com.vaadin.client.ui
Class VOverlay

java.lang.Object
  extended by PopupPanel
      extended by com.vaadin.client.ui.VOverlay
All Implemented Interfaces:
com.google.gwt.event.logical.shared.CloseHandler<PopupPanel>, com.google.gwt.event.shared.EventHandler
Direct Known Subclasses:
VContextMenu, VDebugWindow, VDebugWindow.Menu, VFilterSelect.SuggestionPopup, VNotification, VPopupView.CustomPopup, VWindowOverlay

public class VOverlay
extends PopupPanel
implements com.google.gwt.event.logical.shared.CloseHandler<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
           
 
Field Summary
protected  ApplicationConnection ac
           
static java.lang.String CLASSNAME_CONTAINER
          Style name for the overlay container element (see getOverlayContainer()
static java.lang.String CLASSNAME_SHADOW
          Shadow element style.
protected static VOverlay current
           
static int Z_INDEX
           
 
Constructor Summary
VOverlay()
           
VOverlay(boolean autoHide)
           
VOverlay(boolean autoHide, boolean modal)
           
VOverlay(boolean autoHide, boolean modal, boolean showShadow)
           
 
Method Summary
 void center()
           
protected  ApplicationConnection getApplicationConnection()
          Get the ApplicationConnection that this overlay belongs to.
 com.google.gwt.user.client.Element getOverlayContainer()
          Gets the 'overlay container' element.
static com.google.gwt.user.client.Element getOverlayContainer(ApplicationConnection ac)
          Gets the 'overlay container' element pertaining to the given ApplicationConnection.
 Widget getOwner()
          Get owner (Widget that made this VOverlay, not the layout parent) of VOverlay
protected  boolean isShadowEnabled()
           
protected  boolean isShimElementEnabled()
           
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<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 setHeight(java.lang.String height)
           
static void setOverlayContainerLabel(ApplicationConnection applicationConnection, java.lang.String overlayContainerLabel)
          Set the label of the container element, where tooltip, notification and dialgs are added to.
 void setOwner(Widget owner)
          Set owner (Widget that made this VOverlay, not the layout parent) of VOverlay
 void setPopupPosition(int left, int top)
           
protected  void setShadowEnabled(boolean enabled)
          Method to controle whether DOM elements for shadow are added.
protected  void setShadowStyle(java.lang.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(java.lang.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.logical.shared.CloseHandler
onClose
 

Field Detail

Z_INDEX

public static int Z_INDEX

CLASSNAME_SHADOW

public static final java.lang.String CLASSNAME_SHADOW
Shadow element style. If an extending class wishes to use a different style of shadow, it can use setShadowStyle(String) to give the shadow element a new style name.

See Also:
Constant Field Values

CLASSNAME_CONTAINER

public static final java.lang.String CLASSNAME_CONTAINER
Style name for the overlay container element (see getOverlayContainer()

See Also:
Constant Field Values

ac

protected ApplicationConnection ac

current

protected static VOverlay current
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()

isShimElementEnabled

protected boolean isShimElementEnabled()

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)

show

public void show()

onDetach

protected void onDetach()

setVisible

public void setVisible(boolean visible)

setWidth

public void setWidth(java.lang.String width)

setHeight

public void setHeight(java.lang.String height)

setShadowStyle

protected void setShadowStyle(java.lang.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'.

positionOrSizeUpdated

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


updateShadowSizeAndPosition

@Deprecated
protected void updateShadowSizeAndPosition()
Deprecated. Call positionOrSizeUpdated() instead.


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<PopupPanel> event)

sinkEvents

public void sinkEvents(int eventBitsToAdd)

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

getOwner

public Widget getOwner()
Get owner (Widget that made this VOverlay, not the layout parent) of VOverlay

Returns:
Owner (creator) or null if not defined

setOwner

public void setOwner(Widget owner)
Set owner (Widget that made this VOverlay, not the layout parent) of VOverlay

Parameters:
owner - Owner (creator) of VOverlay

getApplicationConnection

protected ApplicationConnection getApplicationConnection()
Get the ApplicationConnection that this overlay belongs to. If it's not set, getOwner() is used to figure it out.

Returns:

getOverlayContainer

public com.google.gwt.user.client.Element getOverlayContainer()
Gets the 'overlay container' element. Tries to find the current ApplicationConnection using getApplicationConnection().

Returns:
the overlay container element for the current ApplicationConnection or another element if the current ApplicationConnection cannot be determined.

getOverlayContainer

public static com.google.gwt.user.client.Element getOverlayContainer(ApplicationConnection ac)
Gets the 'overlay container' element pertaining to the given ApplicationConnection. Each overlay should be created in a overlay container element, so that the correct theme and styles can be applied.

Parameters:
ac - A reference to ApplicationConnection
Returns:
The overlay container

setOverlayContainerLabel

public static void setOverlayContainerLabel(ApplicationConnection applicationConnection,
                                            java.lang.String overlayContainerLabel)
Set the label of the container element, where tooltip, notification and dialgs are added to.

Parameters:
applicationConnection - the application connection for which to change the label
overlayContainerLabel - label for the container

center

public void center()


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.