public class Overlay
extends com.google.gwt.user.client.ui.PopupPanel
Note: This class should always be constructed with
GWT.create(Class).
| Modifier and Type | Class and Description |
|---|---|
static class |
Overlay.PositionAndSize
Data object for storing position and size information.
|
protected class |
Overlay.ResizeAnimation
An
Animation class for overlay resizing needs. |
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback| Modifier and Type | Field and Description |
|---|---|
static String |
ADDITIONAL_CLASSNAME_ANIMATE_IN |
static String |
ADDITIONAL_CLASSNAME_ANIMATE_OUT |
static String |
CLASSNAME_CONTAINER
Style name for the overlay container element (see
getOverlayContainer(). |
static String |
CLASSNAME_SHADOW
Deprecated.
See main JavaDoc for Overlay
|
protected static Overlay |
current
A "thread local" of sorts, set temporarily so that OverlayImpl knows
which Overlay is using it, so that it can be attached to the correct
overlay container.
|
static int |
Z_INDEX
The z-index value from where all overlays live.
|
| Constructor and Description |
|---|
Overlay()
Constructs a floating popup overlay element.
|
Overlay(boolean autoHide)
Constructs a floating popup overlay element.
|
Overlay(boolean autoHide,
boolean modal)
Constructs a floating popup overlay element.
|
| Modifier and Type | Method and Description |
|---|---|
void |
center() |
com.google.gwt.user.client.Element |
getOverlayContainer()
Gets the 'overlay container' element.
|
com.google.gwt.user.client.ui.Widget |
getOwner()
Get owner (Widget that made this Overlay, not the layout parent) of
Overlay.
|
void |
hide() |
void |
hide(boolean autoClosed) |
void |
hide(boolean autoClosed,
boolean animateIn,
boolean animateOut)
Hides the popup and detaches it from the page.
|
boolean |
isFitInWindow()
Checks whether the overlay should be moved or shrunk to fit inside the
window.
|
protected boolean |
isShimElementEnabled()
Is there a shim iframe behind the overlay, allowing PDFs and applets to
be covered by overlays.
|
protected boolean |
needsShimElement()
Returns true if we should add a shim iframe below the overlay to deal
with zindex issues with PDFs and applets.
|
protected void |
onAttach() |
protected void |
onDetach() |
void |
positionOrSizeUpdated()
Extending classes should always call this method after they change the
size of overlay without using normal 'setWidth(String)' and
'setHeight(String)' methods (if not calling super.setWidth/Height).
|
void |
setFitInWindow(boolean fitInWindow)
Sets whether the overlay should be moved or shrunk to fit inside the
window.
|
void |
setHeight(String height) |
void |
setOwner(com.google.gwt.user.client.ui.Widget owner)
Set owner (Widget that made this Overlay, not the layout parent) of
Overlay.
|
void |
setPopupPosition(int left,
int top) |
void |
setVisible(boolean visible) |
void |
setWidth(String width) |
protected void |
setZIndex(int zIndex)
Set the z-index (visual stack position) for this overlay.
|
void |
show() |
protected void |
updateShadowSizeAndPosition()
Deprecated.
Call
positionOrSizeUpdated() instead. |
addAutoHidePartner, addCloseHandler, addPopupListener, getAnimationType, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setWidget, showRelativeToadd, getWidget, iterator, remove, setWidgetadd, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static int Z_INDEX
@Deprecated public static final String CLASSNAME_SHADOW
public static final String CLASSNAME_CONTAINER
getOverlayContainer().public static final String ADDITIONAL_CLASSNAME_ANIMATE_IN
public static final String ADDITIONAL_CLASSNAME_ANIMATE_OUT
protected static Overlay current
public Overlay()
Overlaypublic Overlay(boolean autoHide)
autoHide - true if the overlay should be automatically hidden
when the user clicks outside of it or the history token
changes.Overlaypublic Overlay(boolean autoHide,
boolean modal)
autoHide - true if the overlay should be automatically hidden
when the user clicks outside of it or the history token
changes.modal - true if keyboard or mouse events that do not target
the Overlay or its children should be ignoredOverlayprotected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetprotected boolean isShimElementEnabled()
true if a shim element exists, false otherwiseprotected void setZIndex(int zIndex)
zIndex - The new z-indexpublic void setPopupPosition(int left,
int top)
setPopupPosition in class com.google.gwt.user.client.ui.PopupPanelpublic void show()
show in class com.google.gwt.user.client.ui.PopupPanelprotected void onDetach()
onDetach in class com.google.gwt.user.client.ui.Widgetpublic void setVisible(boolean visible)
setVisible in interface com.google.gwt.user.client.ui.HasVisibilitysetVisible in class com.google.gwt.user.client.ui.PopupPanelpublic void setWidth(String width)
setWidth in class com.google.gwt.user.client.ui.PopupPanelpublic void setHeight(String height)
setHeight in class com.google.gwt.user.client.ui.PopupPanelpublic void positionOrSizeUpdated()
@Deprecated protected void updateShadowSizeAndPosition()
positionOrSizeUpdated() instead.protected boolean needsShimElement()
public com.google.gwt.user.client.ui.Widget getOwner()
public void setOwner(com.google.gwt.user.client.ui.Widget owner)
owner - Owner (creator) of Overlaypublic com.google.gwt.user.client.Element getOverlayContainer()
public void center()
center in class com.google.gwt.user.client.ui.PopupPanelpublic void hide()
hide in class com.google.gwt.user.client.ui.PopupPanelpublic void hide(boolean autoClosed)
hide in class com.google.gwt.user.client.ui.PopupPanelpublic void hide(boolean autoClosed,
boolean animateIn,
boolean animateOut)
autoClosed - the value that will be passed to
CloseHandler.onClose(CloseEvent) when the popup is
closedanimateIn - enable/disable animate-in animationanimateOut - enable/disable animate-out animationPopupPanel.hide(boolean)public void setFitInWindow(boolean fitInWindow)
When this is false, the default PopupPanel behavior
is used, which tries to position the popup primarly below and to the
right of a reference UIObject and, if there is not enough space, above or
to the left.
When this is true, the popup will be moved up/left in case
it does not fit on either side. If the popup is larger than the window,
it will be shrunk to fit and assume that scrolling e.g. using
overflow:auto, is taken care of by the overlay user.
fitInWindow - true to ensure that no part of the popup is
outside the visible view, false to use the
default PopupPanel behaviorpublic boolean isFitInWindow()
true if the popup will be moved and/or shrunk to fit
inside the window, false otherwisesetFitInWindow(boolean)Copyright © 2023 Vaadin Ltd. All rights reserved.