Package com.vaadin.client.ui
Class VWindow
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.PopupPanel
-
- com.vaadin.client.widgets.Overlay
-
- com.vaadin.client.ui.VOverlay
-
- com.vaadin.client.ui.VWindow
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.BlurHandler,com.google.gwt.event.dom.client.FocusHandler,com.google.gwt.event.dom.client.KeyDownHandler,com.google.gwt.event.dom.client.ScrollHandler,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>,com.google.gwt.event.shared.EventHandler,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.EventPreview,com.google.gwt.user.client.ui.AcceptsOneWidget,com.google.gwt.user.client.ui.HasAnimation,com.google.gwt.user.client.ui.HasOneWidget,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.SourcesPopupEvents,Focusable,ShortcutActionHandler.ShortcutActionHandlerOwner,Iterable<com.google.gwt.user.client.ui.Widget>
public class VWindow extends VOverlay implements ShortcutActionHandler.ShortcutActionHandlerOwner, com.google.gwt.event.dom.client.ScrollHandler, com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.FocusHandler, com.google.gwt.event.dom.client.BlurHandler, Focusable
"Sub window" component.- Author:
- Vaadin Ltd
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.client.widgets.Overlay
Overlay.PositionAndSize, Overlay.ResizeAnimation
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
-
-
Field Summary
Fields Modifier and Type Field Description intbringToFrontSequenceFor internal use only.booleancenteredIf centered (via UIDL), the window should stay in the centered -mode until a position is received from the server, or the user moves or resizes the window.static StringCLASSNAMEThe default classname for this widget.ApplicationConnectionclientFor internal use only.com.google.gwt.dom.client.ElementcloseBoxFor internal use only.WindowConnectorconnectorFor internal use only.FocusableScrollPanelcontentPanelFor internal use only.com.google.gwt.dom.client.ElementcontentsFor internal use only.com.google.gwt.dom.client.ElementfooterFor internal use only.com.google.gwt.dom.client.ElementheaderFor internal use only.StringidFor internal use only.com.google.gwt.dom.client.ElementmaximizeRestoreBoxFor internal use only.booleanresizableFor internal use only.booleanresizeLazyFor internal use only.ShortcutActionHandlershortcutHandlerFor internal use only.booleanvaadinModalityFor internal use only.booleanvisibilityChangesDisabledFor internal use only.static intZ_INDEXThe default z-index value from where all windows start up from.-
Fields inherited from class com.vaadin.client.widgets.Overlay
ADDITIONAL_CLASSNAME_ANIMATE_IN, ADDITIONAL_CLASSNAME_ANIMATE_OUT, CLASSNAME_CONTAINER, CLASSNAME_SHADOW, current
-
-
Constructor Summary
Constructors Constructor Description VWindow()Constructs a widget for a sub-window.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistrationaddMoveHandler(WindowMoveHandler handler)Adds a Handler for when user moves the window.voidaddStyleDependentName(String styleSuffix)static com.google.gwt.event.shared.HandlerRegistrationaddWindowOrderHandler(WindowOrderHandler handler)Adds a Handler for window order change event.voidbringToFront()Rearranges the window order to place this one on the top.protected voidconstructDOM()Constructs the DOM structure for this widget.static voiddeferOrdering()Calling this method will defer ordering algorithm, to order windows based on servers bringToFront and modality instructions.voidfocus()Sets focus to this widget.List<Connector>getAssistiveDescription()Gets the connectors that are used as assistive description.StringgetAssistivePostfix()Getter for the text for assistive devices the window caption is postfixed with.StringgetAssistivePrefix()Getter for the text for assistive devices the window caption is prefixed with.protected com.google.gwt.user.client.ElementgetContainerElement()protected com.google.gwt.user.client.ElementgetModalityCurtain()Returns the modality curtain element.ShortcutActionHandlergetShortcutActionHandler()Returns the ShortCutActionHandler currently used or null if there is currently no shortcutactionhandler.StringgetTabStopBottomAssistiveText()Gets the message that is provided to users of assistive devices when the user reaches the bottom of the window when leaving a window with the tab key is prevented.StringgetTabStopTopAssistiveText()Gets the message that is provided to users of assistive devices when the user reaches the top of the window when leaving a window with the tab key is prevented.intgetWindowOrder()Returns window position in list of opened and shown windows.voidhide()protected booleanisClosable()Returns the closable state of the sub window.static booleanisModalWindowOpen()Checks if a modal window is currently open.protected voidonAttach()voidonBlur(com.google.gwt.event.dom.client.BlurEvent event)voidonBrowserEvent(com.google.gwt.user.client.Event event)protected voidonDetach()booleanonEventPreview(com.google.gwt.user.client.Event event)voidonFocus(com.google.gwt.event.dom.client.FocusEvent event)voidonKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)voidonScroll(com.google.gwt.event.dom.client.ScrollEvent event)voidsetAssistiveDescription(Connector[] connectors)Allows to specify which connectors contain the description for the window.voidsetAssistivePostfix(String assistivePostfix)Setter for the text for assistive devices the window caption is postfixed with.voidsetAssistivePrefix(String assistivePrefix)Setter for the text for assistive devices the window caption is prefixed with.voidsetCaption(String c)Sets the caption for this window.voidsetCaption(String c, String iconURL)Sets the caption and the caption icon for this window.voidsetCaption(String c, String iconURL, boolean asHtml)Sets the caption and the caption icon for this window, and determines whether the caption should be displayed as HTML or as plain text.voidsetClosable(boolean closable)Sets the closable state of the window.voidsetDraggable(boolean draggable)For internal use only.voidsetHeight(String height)voidsetPopupPosition(int left, int top)voidsetPopupPositionNoUpdate(int left, int top)Sets the popup's position relative to the browser's client area.voidsetResizable(boolean resizability)For internal use only.voidsetTabStopBottomAssistiveText(String bottomMessage)Sets the message that is provided to users of assistive devices when the user reaches the bottom of the window when leaving a window with the tab key is prevented.voidsetTabStopEnabled(boolean doTabStop)Registers the handlers that prevent to leave the window using the Tab-key.voidsetTabStopTopAssistiveText(String topMessage)Sets the message that is provided to users of assistive devices when the user reaches the top of the window when leaving a window with the tab key is prevented.voidsetVaadinModality(boolean modality)For internal use only.voidsetVisible(boolean visible)voidsetWaiAriaRole(WindowRole role)Sets the WAI-ARIA role the window.voidsetWidth(String width)voidsetWindowOrderAndPosition()For internal use only.protected voidsetZIndex(int zIndex)Set the z-index (visual stack position) for this overlay.voidshow()voidupdateContentsSize()Relayouts this window and its contents.voidupdateMaximizeRestoreClassName(boolean visible, WindowMode windowMode)Updates the visibility and styles for the element that doubles up as the maximize and the restore button depending on the mode.-
Methods inherited from class com.vaadin.client.ui.VOverlay
getApplicationConnection, getOverlayContainer, getOverlayContainer, setApplicationConnection, setOverlayContainerLabel
-
Methods inherited from class com.vaadin.client.widgets.Overlay
center, getOwner, hide, hide, isFitInWindow, isShimElementEnabled, needsShimElement, positionOrSizeUpdated, setFitInWindow, setOwner, updateShadowSizeAndPosition
-
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, getAnimationType, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setWidget, showRelativeTo
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getWidget, iterator, remove, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.gwt.user.client.ui.HasWidgets
add, clear, iterator, remove
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CLASSNAME
public static final String CLASSNAME
The default classname for this widget.- See Also:
- Constant Field Values
-
Z_INDEX
public static final int Z_INDEX
The default z-index value from where all windows start up from.- See Also:
- Constant Field Values
-
contents
public com.google.gwt.dom.client.Element contents
For internal use only. May be removed or replaced in the future.
-
header
public com.google.gwt.dom.client.Element header
For internal use only. May be removed or replaced in the future.
-
footer
public com.google.gwt.dom.client.Element footer
For internal use only. May be removed or replaced in the future.
-
contentPanel
public final FocusableScrollPanel contentPanel
For internal use only. May be removed or replaced in the future.
-
closeBox
public com.google.gwt.dom.client.Element closeBox
For internal use only. May be removed or replaced in the future.
-
maximizeRestoreBox
public com.google.gwt.dom.client.Element maximizeRestoreBox
For internal use only. May be removed or replaced in the future.
-
client
public ApplicationConnection client
For internal use only. May be removed or replaced in the future.
-
connector
public WindowConnector connector
For internal use only. May be removed or replaced in the future.
-
id
public String id
For internal use only. May be removed or replaced in the future.
-
shortcutHandler
public ShortcutActionHandler shortcutHandler
For internal use only. May be removed or replaced in the future.
-
vaadinModality
public boolean vaadinModality
For internal use only. May be removed or replaced in the future.
-
resizable
public boolean resizable
For internal use only. May be removed or replaced in the future.
-
resizeLazy
public boolean resizeLazy
For internal use only. May be removed or replaced in the future.
-
centered
public boolean centered
If centered (via UIDL), the window should stay in the centered -mode until a position is received from the server, or the user moves or resizes the window.For internal use only. May be removed or replaced in the future.
-
visibilityChangesDisabled
public boolean visibilityChangesDisabled
For internal use only. May be removed or replaced in the future.
-
bringToFrontSequence
public int bringToFrontSequence
For internal use only. May be removed or replaced in the future.
-
-
Method Detail
-
bringToFront
public void bringToFront()
Rearranges the window order to place this one on the top.
-
setWindowOrderAndPosition
public void setWindowOrderAndPosition()
For internal use only. May be removed or replaced in the future.
-
getWindowOrder
public final int getWindowOrder()
Returns window position in list of opened and shown windows. The highest index indicates the window that is on top.- Returns:
- the position index
- Since:
- 8.0
-
setZIndex
protected void setZIndex(int zIndex)
Description copied from class:OverlaySet the z-index (visual stack position) for this overlay.
-
getModalityCurtain
protected com.google.gwt.user.client.Element getModalityCurtain()
Returns the modality curtain element. If one doesn't exist before this method is called, the element is created.- Returns:
- the modality curtain element
-
constructDOM
protected void constructDOM()
Constructs the DOM structure for this widget.
-
setTabStopTopAssistiveText
public void setTabStopTopAssistiveText(String topMessage)
Sets the message that is provided to users of assistive devices when the user reaches the top of the window when leaving a window with the tab key is prevented.This message is not visible on the screen.
- Parameters:
topMessage- String provided when the user navigates with Shift-Tab keys to the top of the window
-
setTabStopBottomAssistiveText
public void setTabStopBottomAssistiveText(String bottomMessage)
Sets the message that is provided to users of assistive devices when the user reaches the bottom of the window when leaving a window with the tab key is prevented.This message is not visible on the screen.
- Parameters:
bottomMessage- String provided when the user navigates with the Tab key to the bottom of the window
-
getTabStopTopAssistiveText
public String getTabStopTopAssistiveText()
Gets the message that is provided to users of assistive devices when the user reaches the top of the window when leaving a window with the tab key is prevented.- Returns:
- the top message
-
getTabStopBottomAssistiveText
public String getTabStopBottomAssistiveText()
Gets the message that is provided to users of assistive devices when the user reaches the bottom of the window when leaving a window with the tab key is prevented.- Returns:
- the bottom message
-
deferOrdering
public static void deferOrdering()
Calling this method will defer ordering algorithm, to order windows based on servers bringToFront and modality instructions. Non changed windows will be left intact.For internal use only. May be removed or replaced in the future.
-
setVisible
public void setVisible(boolean visible)
- Specified by:
setVisiblein interfacecom.google.gwt.user.client.ui.HasVisibility- Overrides:
setVisiblein classOverlay
-
setDraggable
public void setDraggable(boolean draggable)
For internal use only. May be removed or replaced in the future.- Parameters:
draggable-trueif this window should be draggable,falseotherwise
-
setClosable
public void setClosable(boolean closable)
Sets the closable state of the window. Additionally hides/shows the close button according to the new state.- Parameters:
closable- true if the window can be closed by the user
-
isClosable
protected boolean isClosable()
Returns the closable state of the sub window. If the sub window is closable a decoration (typically an X) is shown to the user. By clicking on the X the user can close the window.- Returns:
- true if the sub window is closable
-
setVaadinModality
public void setVaadinModality(boolean modality)
For internal use only. May be removed or replaced in the future.- Parameters:
modality-trueif this window should be modal,falseotherwise
-
setResizable
public void setResizable(boolean resizability)
For internal use only. May be removed or replaced in the future.- Parameters:
resizability-trueif this window should be resizable,falseotherwise
-
updateMaximizeRestoreClassName
public void updateMaximizeRestoreClassName(boolean visible, WindowMode windowMode)Updates the visibility and styles for the element that doubles up as the maximize and the restore button depending on the mode.- Parameters:
visible-trueif the button should be visible,falseotherwisewindowMode- current mode for this window
-
setPopupPositionNoUpdate
public void setPopupPositionNoUpdate(int left, int top)Sets the popup's position relative to the browser's client area. TODO this will eventually be removed, currently used to avoid updating to server side.- Parameters:
left- the left position, in pixelstop- the top position, in pixels
-
setPopupPosition
public void setPopupPosition(int left, int top)- Overrides:
setPopupPositionin classOverlay
-
setCaption
public void setCaption(String c)
Sets the caption for this window.- Parameters:
c- the caption to set
-
setCaption
public void setCaption(String c, String iconURL)
Sets the caption and the caption icon for this window.- Parameters:
c- the caption to seticonURL- the URL for the icon to set
-
setCaption
public void setCaption(String c, String iconURL, boolean asHtml)
Sets the caption and the caption icon for this window, and determines whether the caption should be displayed as HTML or as plain text.- Parameters:
c- the caption to seticonURL- the URL for the icon to setasHtml-trueif displayed as HTML,falseif displayed as plain text
-
setAssistivePrefix
public void setAssistivePrefix(String assistivePrefix)
Setter for the text for assistive devices the window caption is prefixed with.- Parameters:
assistivePrefix- the assistivePrefix to set
-
getAssistivePrefix
public String getAssistivePrefix()
Getter for the text for assistive devices the window caption is prefixed with.- Returns:
- the assistivePrefix
-
setAssistivePostfix
public void setAssistivePostfix(String assistivePostfix)
Setter for the text for assistive devices the window caption is postfixed with.- Parameters:
assistivePostfix- the assistivePostfix to set
-
getAssistivePostfix
public String getAssistivePostfix()
Getter for the text for assistive devices the window caption is postfixed with.- Returns:
- the assistivePostfix
-
getContainerElement
protected com.google.gwt.user.client.Element getContainerElement()
- Overrides:
getContainerElementin classcom.google.gwt.user.client.ui.PopupPanel
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget
-
updateContentsSize
public void updateContentsSize()
Relayouts this window and its contents.
-
onEventPreview
public boolean onEventPreview(com.google.gwt.user.client.Event event)
- Specified by:
onEventPreviewin interfacecom.google.gwt.user.client.EventPreview- Overrides:
onEventPreviewin classcom.google.gwt.user.client.ui.PopupPanel
-
addStyleDependentName
public void addStyleDependentName(String styleSuffix)
- Overrides:
addStyleDependentNamein classcom.google.gwt.user.client.ui.UIObject
-
getShortcutActionHandler
public ShortcutActionHandler getShortcutActionHandler()
Description copied from interface:ShortcutActionHandler.ShortcutActionHandlerOwnerReturns the ShortCutActionHandler currently used or null if there is currently no shortcutactionhandler.- Specified by:
getShortcutActionHandlerin interfaceShortcutActionHandler.ShortcutActionHandlerOwner
-
onScroll
public void onScroll(com.google.gwt.event.dom.client.ScrollEvent event)
- Specified by:
onScrollin interfacecom.google.gwt.event.dom.client.ScrollHandler
-
onKeyDown
public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
- Specified by:
onKeyDownin interfacecom.google.gwt.event.dom.client.KeyDownHandler
-
onBlur
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
- Specified by:
onBlurin interfacecom.google.gwt.event.dom.client.BlurHandler
-
onFocus
public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
- Specified by:
onFocusin interfacecom.google.gwt.event.dom.client.FocusHandler
-
focus
public void focus()
Description copied from interface:FocusableSets focus to this widget.
-
setAssistiveDescription
public void setAssistiveDescription(Connector[] connectors)
Allows to specify which connectors contain the description for the window. Text contained in the widgets of the connectors will be read by assistive devices when it is opened.When the provided array is empty, an existing description is removed.
- Parameters:
connectors- with the connectors of the widgets to use as description
-
getAssistiveDescription
public List<Connector> getAssistiveDescription()
Gets the connectors that are used as assistive description. Text contained in these connectors will be read by assistive devices when the window is opened.- Returns:
- list of previously set connectors
-
setWaiAriaRole
public void setWaiAriaRole(WindowRole role)
Sets the WAI-ARIA role the window. This role defines how an assistive device handles a window. Available roles are alertdialog and dialog (@see Roles Model). The default role is dialog.- Parameters:
role- WAI-ARIA role to set for the window
-
setTabStopEnabled
public void setTabStopEnabled(boolean doTabStop)
Registers the handlers that prevent to leave the window using the Tab-key.The value of the parameter doTabStop is stored and used for non-modal windows. For modal windows, the handlers are always registered, while preserving the stored value.
- Parameters:
doTabStop- true to prevent leaving the window, false to allow leaving the window for non modal windows
-
addMoveHandler
public com.google.gwt.event.shared.HandlerRegistration addMoveHandler(WindowMoveHandler handler)
Adds a Handler for when user moves the window.- Parameters:
handler- the handler to add- Returns:
- registration object that can be used to deregister the handler
- Since:
- 7.1.9
-
addWindowOrderHandler
public static com.google.gwt.event.shared.HandlerRegistration addWindowOrderHandler(WindowOrderHandler handler)
Adds a Handler for window order change event.- Parameters:
handler- the handler to add- Returns:
- registration object that can be used to deregister the handler
- Since:
- 8.0
-
isModalWindowOpen
public static boolean isModalWindowOpen()
Checks if a modal window is currently open.- Returns:
trueif a modal window is open,falseotherwise.
-
-