com.vaadin.client.ui
Class VContextMenu

java.lang.Object
  extended by PopupPanel
      extended by com.vaadin.client.widgets.Overlay
          extended by com.vaadin.client.ui.VOverlay
              extended by com.vaadin.client.ui.VContextMenu
All Implemented Interfaces:
com.google.gwt.event.logical.shared.CloseHandler<PopupPanel>, com.google.gwt.event.shared.EventHandler, SubPartAware

public class VContextMenu
extends VOverlay
implements SubPartAware


Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.client.widgets.Overlay
Overlay.PositionAndSize, Overlay.ResizeAnimation
 
Field Summary
 
Fields inherited from class com.vaadin.client.ui.VOverlay
ac, current
 
Fields inherited from class com.vaadin.client.widgets.Overlay
ADDITIONAL_CLASSNAME_ANIMATE_IN, ADDITIONAL_CLASSNAME_ANIMATE_OUT, CLASSNAME_CONTAINER, CLASSNAME_SHADOW, Z_INDEX
 
Constructor Summary
VContextMenu()
          This method should be used only by Client object as only one per client should exists.
 
Method Summary
 void ensureHidden(ActionOwner actionOwner)
          Hides context menu if it is currently shown by given action owner.
 com.google.gwt.user.client.Element getSubPartElement(java.lang.String subPart)
          Locates an element inside a component using the identifier provided in subPart.
 java.lang.String getSubPartName(com.google.gwt.user.client.Element subElement)
          Provides an identifier that identifies the element within the component.
protected  void imagesLoaded()
           
 void setActionOwner(ActionOwner ao)
          Sets the element from which to build menu
 void showAt(ActionOwner ao, int left, int top)
           
 void showAt(int left, int top)
          Shows context menu at given location IF it contain at least one item.
 
Methods inherited from class com.vaadin.client.ui.VOverlay
getApplicationConnection, getOverlayContainer, getOverlayContainer, setOverlayContainerLabel
 
Methods inherited from class com.vaadin.client.widgets.Overlay
center, getOwner, hide, hide, hide, isShadowEnabled, isShimElementEnabled, isSinkShadowEvents, needsShimElement, onAttach, onClose, onDetach, positionOrSizeUpdated, setHeight, setOwner, setPopupPosition, setShadowEnabled, setShadowStyle, setSinkShadowEvents, setVisible, setWidth, setZIndex, show, sinkEvents, updateShadowSizeAndPosition, useShadowDiv
 
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
 

Constructor Detail

VContextMenu

public VContextMenu()
This method should be used only by Client object as only one per client should exists. Request an instance via client.getContextMenu();

Parameters:
cli - to be set as an owner of menu
Method Detail

imagesLoaded

protected void imagesLoaded()

setActionOwner

public void setActionOwner(ActionOwner ao)
Sets the element from which to build menu

Parameters:
ao -

showAt

public void showAt(int left,
                   int top)
Shows context menu at given location IF it contain at least one item.

Parameters:
left -
top -

showAt

public void showAt(ActionOwner ao,
                   int left,
                   int top)

getSubPartElement

public com.google.gwt.user.client.Element getSubPartElement(java.lang.String subPart)
Description copied from interface: SubPartAware
Locates an element inside a component using the identifier provided in subPart. The subPart identifier is component specific and may be any string of characters, numbers, space characters and brackets.

Specified by:
getSubPartElement in interface SubPartAware
Parameters:
subPart - The identifier for the element inside the component
Returns:
The element identified by subPart or null if the element could not be found.

getSubPartName

public java.lang.String getSubPartName(com.google.gwt.user.client.Element subElement)
Description copied from interface: SubPartAware
Provides an identifier that identifies the element within the component. The subElement is a part of the component and must never be null.

Note! getSubPartElement(getSubPartName(element)) == element is not always true. A component can choose to provide a more generic identifier for any given element if the results of all interactions with subElement are the same as interactions with the element identified by the return value. For example a button can return an identifier for the root element even though a DIV inside the button was passed as subElement because interactions with the DIV and the root button element produce the same result.

Specified by:
getSubPartName in interface SubPartAware
Parameters:
subElement - The element the identifier string should uniquely identify
Returns:
An identifier that uniquely identifies subElement or null if no identifier could be provided.

ensureHidden

public void ensureHidden(ActionOwner actionOwner)
Hides context menu if it is currently shown by given action owner.

Parameters:
actionOwner -


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