public class Overlay
extends com.google.gwt.user.client.ui.PopupPanel
implements com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>
Note: This class should always be constructed with
GWT.create(Class)
.
The separate shadow element underneath the main overlay element is
deprecated, and should not be used for new overlay
components. CSS box-shadow should be used instead of a separate shadow
element. Remember to include any vendor-prefixed versions to support all
browsers that you need to. To cover all possible browsers that Vaadin 7
supports, add -webkit-box-shadow
and the standard
box-shadow
properties.
For IE8, which doesn't support CSS box-shadow, you can use the proprietary DropShadow filter. It doesn't provide the exact same features as box-shadow, but it is suitable for graceful degradation. Other options are to use a border or a pseudo-element underneath the overlay which mimics a shadow, or any combination of these.
Read more about the DropShadow filter from Microsoft Developer Network
Modifier and Type | Class and Description |
---|---|
static class |
Overlay.PositionAndSize |
protected class |
Overlay.ResizeAnimation |
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 |
static int |
Z_INDEX |
Constructor and Description |
---|
Overlay() |
Overlay(boolean autoHide) |
Overlay(boolean autoHide,
boolean modal) |
Overlay(boolean autoHide,
boolean modal,
boolean showShadow)
Deprecated.
See main JavaDoc for Overlay. Use the other constructors
without the
showShadow parameter. |
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 |
isShadowEnabled()
Deprecated.
See main JavaDoc for Overlay
|
protected boolean |
isShimElementEnabled() |
protected boolean |
isSinkShadowEvents()
Deprecated.
See main JavaDoc for Overlay
|
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() |
void |
onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event) |
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) |
protected void |
setShadowEnabled(boolean enabled)
Deprecated.
See main JavaDoc for Overlay
|
protected void |
setShadowStyle(String style)
Deprecated.
See main JavaDoc for Overlay
|
protected void |
setSinkShadowEvents(boolean sinkShadowEvents)
Deprecated.
See main JavaDoc for Overlay
|
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() |
void |
sinkEvents(int eventBitsToAdd) |
protected void |
updateShadowSizeAndPosition()
Deprecated.
Call
positionOrSizeUpdated() instead. |
protected boolean |
useShadowDiv()
Deprecated.
See main JavaDoc for Overlay
|
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, showRelativeTo
add, getWidget, iterator, remove, setWidget
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, removeFromParent, setLayoutData, unsinkEvents
addStyleDependentName, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public 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()
public Overlay(boolean autoHide)
public Overlay(boolean autoHide, boolean modal)
@Deprecated public Overlay(boolean autoHide, boolean modal, boolean showShadow)
showShadow
parameter.protected void onAttach()
onAttach
in class com.google.gwt.user.client.ui.Widget
@Deprecated protected boolean useShadowDiv()
@Deprecated protected void setShadowEnabled(boolean enabled)
enabled
- true if shadow should be displayed@Deprecated protected boolean isShadowEnabled()
protected boolean isShimElementEnabled()
protected void setZIndex(int zIndex)
zIndex
- The new z-indexpublic void setPopupPosition(int left, int top)
setPopupPosition
in class com.google.gwt.user.client.ui.PopupPanel
public void show()
show
in class com.google.gwt.user.client.ui.PopupPanel
protected void onDetach()
onDetach
in class com.google.gwt.user.client.ui.Widget
public void setVisible(boolean visible)
setVisible
in interface com.google.gwt.user.client.ui.HasVisibility
setVisible
in class com.google.gwt.user.client.ui.PopupPanel
public void setWidth(String width)
setWidth
in class com.google.gwt.user.client.ui.PopupPanel
public void setHeight(String height)
setHeight
in class com.google.gwt.user.client.ui.PopupPanel
@Deprecated protected void setShadowStyle(String style)
style
- The new style name for the shadow element. Will be prefixed by
CLASSNAME_SHADOW, e.g. style=='foobar' -> actual style
name=='v-shadow-foobar'.public void positionOrSizeUpdated()
@Deprecated protected void updateShadowSizeAndPosition()
positionOrSizeUpdated()
instead.protected boolean needsShimElement()
public void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)
onClose
in interface com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>
public void sinkEvents(int eventBitsToAdd)
sinkEvents
in class com.google.gwt.user.client.ui.Widget
@Deprecated protected void setSinkShadowEvents(boolean sinkShadowEvents)
sinkShadowEvents
- @Deprecated protected boolean isSinkShadowEvents()
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.PopupPanel
public void hide()
hide
in class com.google.gwt.user.client.ui.PopupPanel
public void hide(boolean autoClosed)
hide
in class com.google.gwt.user.client.ui.PopupPanel
public 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 © 2019 Vaadin Ltd. All rights reserved.