com.vaadin.terminal.gwt.client.ui.
Class VContextMenu
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
com.vaadin.terminal.gwt.client.ui.VContextMenu
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, SubPartAware, Iterable<com.google.gwt.user.client.ui.Widget>
- extends VOverlay
- implements SubPartAware
public class VContextMenu
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.terminal.gwt.client.ui.VOverlay |
---|
VOverlay.PositionAndSize, 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 |
---|
Fields inherited from class com.vaadin.terminal.gwt.client.ui.VOverlay |
---|
CLASSNAME_SHADOW, Z_INDEX |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
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(String subPart)
Locates an element inside a component using the identifier provided in subPart . |
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.terminal.gwt.client.ui.VOverlay |
---|
hide, isShadowEnabled, isSinkShadowEvents, needsShimElement, onClose, onDetach, positionOrSizeUpdated, setHeight, setPopupPosition, setShadowEnabled, setShadowStyle, setSinkShadowEvents, setVisible, setWidth, setZIndex, show, sinkEvents, updateShadowSizeAndPosition |
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 |
Constructor Detail |
---|
VContextMenu
public VContextMenu()
- Parameters:
cli
- to be set as an owner of menu
This method should be used only by Client object as only one per client should exists. Request an instance via client.getContextMenu();
Method Detail |
---|
imagesLoaded
protected void imagesLoaded()
setActionOwner
public void setActionOwner(ActionOwner ao)
- Parameters:
ao
-
Sets the element from which to build menu
showAt
public void showAt(int left,
int top)
- Parameters:
left
-top
-
Shows context menu at given location IF it contain at least one item.
showAt
public void showAt(ActionOwner ao,
int left,
int top)
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
- Specified by:
getSubPartElement
in interfaceSubPartAware
- 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.
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.
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
- Specified by:
getSubPartName
in interfaceSubPartAware
- 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.
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.
ensureHidden
public void ensureHidden(ActionOwner actionOwner)
- Parameters:
actionOwner
-
Hides context menu if it is currently shown by given action owner.