|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.Container
com.gwtext.client.widgets.Panel
com.gwtext.client.widgets.Window
public class Window
A specialized panel intended for use as an application window. Windows are floated and draggable by default, and also provide specific behavior like the ability to maximize and restore (with an event for * minimizing, since the minimize behavior is application-specific). Windows can also be linked to a WindowGroup or managed by the WindowManager to provide grouping, activation, to front/back and other application-specific behavior.
Nested Class Summary | |
---|---|
static class |
Window.CloseAction
|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
static Window.CloseAction |
CLOSE
|
static Window.CloseAction |
HIDE
|
Fields inherited from class com.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Window()
Create a new Window. |
|
Window(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
Window(java.lang.String title)
Create a new Window. |
|
Window(java.lang.String title,
boolean modal,
boolean resizable)
Create a new Window. |
|
Window(java.lang.String title,
int width,
int height)
Create a new Window. |
|
Window(java.lang.String title,
int width,
int height,
boolean modal,
boolean resizable)
Create a new Window. |
Method Summary | |
---|---|
void |
addListener(WindowListener listener)
|
void |
alignTo(com.google.gwt.user.client.Element element,
java.lang.String position,
int[] offsetXY)
Aligns the window to the specified element. |
void |
anchorTo(com.google.gwt.user.client.Element element,
java.lang.String position,
int[] offsetXY)
Anchors this window to another element and realigns it when the window is resized or scrolled. |
void |
center()
Centers this window in the viewport |
void |
close()
Closes the window, removes it from the DOM and destroys the window object. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
void |
focus()
Focuses the window. |
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
int |
getExpandOnShow()
True to always expand the window when it is displayed, false to keep it in its current state (which may be collapsed) when displayed. |
WindowGroup |
getManager()
|
int |
getMinHeight()
The minimum height in pixels allowed for this window. |
int |
getMinWidth()
The minimum width in pixels allowed for this window. |
java.lang.String |
getResizeHandles()
The Resizable handles config string. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
void |
hide()
Hides the window, setting it to invisible and applying negative offsets. |
boolean |
isConstrain()
True to constrain the window to the viewport, false to allow it to fall outside of the viewport. |
boolean |
isConstrainHeader()
True to constrain the window header to the viewport, allowing the window body to fall outside of the viewport, false to allow the header to fall outside the viewport. |
boolean |
isDraggable()
True to allow the window to be dragged by the header bar, false to disable dragging. |
boolean |
isMaximizable()
True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button and disallow maximizing the window. |
boolean |
isMaximized()
|
boolean |
isModal()
True to make the window modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements. |
boolean |
isPlain()
True to render the window body with a transparent background so that it will blend into the framing elements, false to add a lighter background color to visually highlight the body element and separate it more distinctly from the surrounding frame. |
boolean |
isResizable()
True to allow user resizing at each edge and corner of the window, false to disable resizing. |
void |
maximize()
Fits the window within its current container and automatically replaces the 'maximize' tool button with the 'restore' tool button. |
void |
minimize()
Placeholder method for minimizing the window. |
void |
restore()
Restores a maximized window back to its original size and position prior to being maximized and also replaces the 'restore' tool button with the 'maximize' tool button. |
void |
setActive()
Makes this the active window by showing its shadow. |
void |
setActive(boolean active)
Makes this the active window by showing its shadow, or deactivates it by hiding its shadow. |
void |
setAnimateTarget(com.google.gwt.user.client.Element animateTarget)
Element from which the window should animate while opening. |
void |
setAnimateTarget(java.lang.String animateTarget)
Id from which the window should animate while opening. |
void |
setBaseCls(java.lang.String baseCls)
The base CSS class to apply to this panel's element. |
void |
setClosable(boolean closable)
True to display the 'close' tool button and allow the user to close the window, false to hide the button and disallow closing the window. |
void |
setCloseAction(Window.CloseAction closeAction)
The action to take when the close button is clicked. |
void |
setConstrain(boolean constrain)
True to constrain the window to the viewport, false to allow it to fall outside of the viewport. |
void |
setConstrainHeader(boolean constrainHeader)
True to constrain the window header to the viewport, allowing the window body to fall outside of the viewport, false to allow the header to fall outside the viewport. |
void |
setDefaultButton(com.google.gwt.user.client.Element defaultButton)
The button that should focus when the window receives focus. |
void |
setDefaultButton(int buttonIndex)
The button that should focus when the window receives focus. |
void |
setDefaultButton(java.lang.String defaultButton)
The button that should focus when the window receives focus. |
void |
setDraggable(boolean draggable)
True to allow the window to be dragged by the header bar, false to disable dragging. |
void |
setExpandOnShow(boolean expandOnShow)
True to always expand the window when it is displayed, false to keep it in its current state (which may be collapsed) when displayed |
void |
setManager(WindowGroup manager)
A reference to the WindowGroup that should manage this window (defaults to WindowMgr ). |
void |
setMaximizable(boolean maximizable)
True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button and disallow maximizing the window. |
void |
setMinHeight(int minHeight)
The minimum height in pixels allowed for this window. |
void |
setMinimizable(boolean minimizable)
True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button and disallow minimizing the window. |
void |
setMinWidth(int minWidth)
The minimum width in pixels allowed for this window. |
void |
setModal(boolean modal)
True to make the window modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements. |
void |
setPlain(boolean plain)
True to render the window body with a transparent background so that it will blend into the framing elements, false to add a lighter background color to visually highlight the body element and separate it more distinctly from the surrounding frame. |
void |
setResizable(boolean resizable)
True to allow user resizing at each edge and corner of the window, false to disable resizing. |
void |
setResizeHandles(java.lang.String resizeHandles)
A valid Resizable handles config string. |
void |
show()
Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden |
void |
show(com.google.gwt.user.client.Element animationTarget)
Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden |
void |
show(java.lang.String animationTargetID)
Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden |
void |
toBack()
Sends this window to the back of (lower z-index than) any other visible windows |
void |
toFront()
Brings this window to the front of any other visible windows |
void |
toggleMaximize()
A shortcut method for toggling between maximize and restore based on the current maximized state of the window. |
Methods inherited from class com.gwtext.client.widgets.Container |
---|
add, add, add, add, addListener, bubble, cascade, clear, doLayout, doLayout, findBy, findByID, findByType, getActiveItem, getActiveItemID, getAutoDestroy, getBufferResize, getComponent, getComponent, getComponents, getHideBorders, getItems, getLayout, getMonitorResize, insert, iterator, remove, remove, remove, remove, removeAll, removeAll, setActiveItem, setActiveItemID, setAutoDestroy, setBufferResize, setDefaults, setHideBorders, setLayout, setMonitorResize |
Methods inherited from class com.gwtext.client.widgets.BoxComponent |
---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Window.CloseAction CLOSE
public static Window.CloseAction HIDE
Constructor Detail |
---|
public Window()
public Window(java.lang.String title)
title
- the titlepublic Window(java.lang.String title, int width, int height)
title
- the titlewidth
- the widthheight
- the heightpublic Window(java.lang.String title, boolean modal, boolean resizable)
title
- the titlemodal
- true for modalresizable
- true for resizablepublic Window(java.lang.String title, int width, int height, boolean modal, boolean resizable)
title
- the titlewidth
- the widthheight
- the heightmodal
- true for modalresizable
- true for resizablepublic Window(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class Panel
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class Panel
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class Panel
public void alignTo(com.google.gwt.user.client.Element element, java.lang.String position, int[] offsetXY)
element
- the element to align toposition
- the position to align tooffsetXY
- offset the positioning by [x, y]public void anchorTo(com.google.gwt.user.client.Element element, java.lang.String position, int[] offsetXY)
element
- the element to anchor toposition
- the position to anchor tooffsetXY
- offset the positioning by [x, y]public void center()
public void close()
public void focus()
setDefaultButton(Element)
, it will receive focus,
otherwise the window itself will receive focus.
focus
in class Component
public void hide()
hide
in class Component
public void maximize()
public void minimize()
public void restore()
public void setActive()
public void setActive(boolean active)
active
- true to activate the window, false to deactivate it (defaults to false)public void show()
show
in class Component
public void show(java.lang.String animationTargetID)
animationTargetID
- The target element id from which the window should animate while openingpublic void show(com.google.gwt.user.client.Element animationTarget)
animationTarget
- The target element from which the window should animate while openingpublic void toBack()
public void toFront()
public void toggleMaximize()
public void addListener(WindowListener listener)
public void setAnimateTarget(java.lang.String animateTarget) throws java.lang.IllegalStateException
animateTarget
- By default the id is set to null and there is no animation
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setAnimateTarget(com.google.gwt.user.client.Element animateTarget) throws java.lang.IllegalStateException
animateTarget
- By default the element is set to null and there is no animation.
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setBaseCls(java.lang.String baseCls) throws java.lang.IllegalStateException
setBaseCls
in class Panel
baseCls
- Defaults to 'x-window'
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setClosable(boolean closable) throws java.lang.IllegalStateException
setClosable
in class Panel
closable
- true for closable
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setCloseAction(Window.CloseAction closeAction)
CLOSE
which will actually
remove the window from the DOM and destroy it. The other valid option is HIDE
which will simply hide
the window by setting visibility to hidden and applying negative offsets, keeping the window available
to be redisplayed via the show method.
closeAction
- Defaults to CLOSEpublic void setConstrain(boolean constrain) throws java.lang.IllegalStateException
setConstrainHeader(boolean)
.
constrain
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isConstrain()
setConstrainHeader(boolean)
.
public void setConstrainHeader(boolean constrainHeader) throws java.lang.IllegalStateException
constrainHeader
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isConstrainHeader()
public void setDefaultButton(int buttonIndex) throws java.lang.IllegalStateException
buttonIndex
- the button index
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDefaultButton(java.lang.String defaultButton) throws java.lang.IllegalStateException
defaultButton
- the default button
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDefaultButton(com.google.gwt.user.client.Element defaultButton) throws java.lang.IllegalStateException
defaultButton
- the default button
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setDraggable(boolean draggable) throws java.lang.IllegalStateException
setDraggable
in class Panel
draggable
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isDraggable()
public void setExpandOnShow(boolean expandOnShow) throws java.lang.IllegalStateException
expandOnShow
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getExpandOnShow()
public void setManager(WindowGroup manager)
WindowMgr
).
manager
- the window managerpublic WindowGroup getManager()
public boolean isMaximized()
public void setMaximizable(boolean maximizable) throws java.lang.IllegalStateException
maximizable
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isMaximizable()
public void setMinHeight(int minHeight) throws java.lang.IllegalStateException
minHeight
- Defaults to 100 pixels
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getMinHeight()
public void setMinWidth(int minWidth) throws java.lang.IllegalStateException
minWidth
- Defaults to 200 pixels
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getMinWidth()
public void setMinimizable(boolean minimizable) throws java.lang.IllegalStateException
minimizable
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setModal(boolean modal) throws java.lang.IllegalStateException
modal
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isModal()
public void setPlain(boolean plain) throws java.lang.IllegalStateException
plain
- Defaults to false
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isPlain()
public void setResizable(boolean resizable) throws java.lang.IllegalStateException
resizable
- Defaults to true
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean isResizable()
public void setResizeHandles(java.lang.String resizeHandles) throws java.lang.IllegalStateException
Resizable
handles config string. Only applies when resizable = true.
resizeHandles
- Defaults to Resizable.ALL
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getResizeHandles()
Resizable
handles config string. Only applies when resizable = true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |