com.vaadin.terminal.gwt.client.ui.


Class VOverlay

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.terminal.gwt.client.ui.VOverlay

All Implemented Interfaces:

com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>, 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.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, com.google.gwt.user.client.ui.SourcesPopupEvents, Iterable<com.google.gwt.user.client.ui.Widget>

Direct Known Subclasses:

VContextMenu, VDebugConsole, VFilterSelect.SuggestionPopup, VNotification, VPopupView.CustomPopup, VTooltip, VWindow

public class VOverlay
extends com.google.gwt.user.client.ui.PopupPanel
implements com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>

In Vaadin UI this Overlay should always be used for all elements that temporary float over other components like context menus etc. This is to deal stacking order correctly with VWindow objects.

Nested Class Summary
static class VOverlay.PositionAndSize
           
protected  class VOverlay.ResizeAnimation
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.PositionCallback
 
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
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
static String CLASSNAME_SHADOW
           
protected static int Z_INDEX
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
VOverlay()
           
VOverlay(boolean autoHide)
           
VOverlay(boolean autoHide, boolean modal)
           
VOverlay(boolean autoHide, boolean modal, boolean showShadow)
           
 
Method Summary
 void hide(boolean autoClosed)
           
protected  boolean isShadowEnabled()
           
protected  boolean isSinkShadowEvents()
           
protected  boolean needsShimElement()
          Returns true if we should add a shim iframe below the overlay to deal with zindex issues with PDFs and applets.
 void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)
           
protected  void onDetach()
           
protected  void positionOrSizeUpdated()
           
 void setHeight(String height)
           
 void setPopupPosition(int left, int top)
           
protected  void setShadowEnabled(boolean enabled)
          Method to controle whether DOM elements for shadow are added.
protected  void setShadowStyle(String style)
          Sets the shadow style for this overlay.
protected  void setSinkShadowEvents(boolean sinkShadowEvents)
          Enables or disables sinking the events of the shadow to the same onBrowserEvent as events to the actual overlay goes.
 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.
 
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addCloseHandler, addPopupListener, center, getContainerElement, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, hide, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onPreviewNativeEvent, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, 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, adopt, clear, disown, 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, onAttach, onBrowserEvent, onLoad, removeFromParent, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Field Detail

Z_INDEX

protected static int Z_INDEX

CLASSNAME_SHADOW

public static final String CLASSNAME_SHADOW

See Also:

Constant Field Values

Constructor Detail

VOverlay

public VOverlay()

VOverlay

public VOverlay(boolean autoHide)

VOverlay

public VOverlay(boolean autoHide,
                boolean modal)

VOverlay

public VOverlay(boolean autoHide,
                boolean modal,
                boolean showShadow)
Method Detail

setShadowEnabled

protected void setShadowEnabled(boolean enabled)

Method to controle whether DOM elements for shadow are added. With this method subclasses can control displaying of shadow also after the constructor.

Parameters:
enabled - true if shadow should be displayed

isShadowEnabled

protected boolean isShadowEnabled()

setZIndex

protected void setZIndex(int zIndex)

Set the z-index (visual stack position) for this overlay.

Parameters:
zIndex - The new z-index

setPopupPosition

public void setPopupPosition(int left,
                             int top)

Overrides:
setPopupPosition in class com.google.gwt.user.client.ui.PopupPanel

show

public void show()

Overrides:
show in class com.google.gwt.user.client.ui.PopupPanel

hide

public void hide(boolean autoClosed)

Overrides:
hide in class com.google.gwt.user.client.ui.PopupPanel

onDetach

protected void onDetach()

Overrides:
onDetach in class com.google.gwt.user.client.ui.Widget

setVisible

public void setVisible(boolean visible)

Overrides:
setVisible in class com.google.gwt.user.client.ui.PopupPanel

setWidth

public void setWidth(String width)

Overrides:
setWidth in class com.google.gwt.user.client.ui.PopupPanel

setHeight

public void setHeight(String height)

Overrides:
setHeight in class com.google.gwt.user.client.ui.PopupPanel

setShadowStyle

protected void setShadowStyle(String style)

Sets the shadow style for this overlay. Will override any previous style for the shadow. The default style name is defined by CLASSNAME_SHADOW. The given style will be prefixed with CLASSNAME_SHADOW.

Parameters:
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'.

updateShadowSizeAndPosition

@Deprecated
protected void updateShadowSizeAndPosition()

Deprecated. Call positionOrSizeUpdated() instead.

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).

positionOrSizeUpdated

protected void positionOrSizeUpdated()

needsShimElement

protected boolean needsShimElement()

Returns true if we should add a shim iframe below the overlay to deal with zindex issues with PDFs and applets. Can be overriden to disable shim iframes if they are not needed.

Returns:
true if a shim iframe should be added, false otherwise

onClose

public void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)

Specified by:
onClose in interface com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>

sinkEvents

public void sinkEvents(int eventBitsToAdd)

Overrides:
sinkEvents in class com.google.gwt.user.client.ui.Widget

setSinkShadowEvents

protected void setSinkShadowEvents(boolean sinkShadowEvents)

Enables or disables sinking the events of the shadow to the same onBrowserEvent as events to the actual overlay goes. Please note, that if you enable this, you can't assume that e.g. event.getEventTarget returns an element inside the DOM structure of the overlay

Parameters:
sinkShadowEvents -

isSinkShadowEvents

protected boolean isSinkShadowEvents()