com.vaadin.client.ui.

Class 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.HasVisibility, 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>

    public class VContextMenu
    extends VOverlay
    implements SubPartAware
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel

        com.google.gwt.user.client.ui.PopupPanel.AnimationType, 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
    • Constructor Summary

      Constructors
      Constructor Description
      VContextMenu()

      This method should be used only by Client object as only one per client should exists.

    • Method Summary

      All Methods
      Modifier and Type Method Description
      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​(int left, int top)

      Shows context menu at given location IF it contain at least one item.

      void showAt​(ActionOwner ao, int left, int top)  
      • Methods inherited from class com.google.gwt.user.client.ui.PopupPanel

        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
      • 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, clear, 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, onBrowserEvent, onLoad, removeFromParent, setLayoutData, unsinkEvents
      • 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, resolvePotentialElement, setElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
      • Methods inherited from interface com.google.gwt.event.logical.shared.CloseHandler

        onClose
      • Methods inherited from interface com.google.gwt.event.shared.HasHandlers

        fireEvent
    • 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​(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 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 -