Class ContextMenuRadioItem

All Implemented Interfaces:
IsEditor<LeafValueEditor<String>>, ClickHandler, ContextMenuHandler, HasAllDragAndDropHandlers, HasAllGestureHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragEndHandlers, HasDragEnterHandlers, HasDragHandlers, HasDragLeaveHandlers, HasDragOverHandlers, HasDragStartHandlers, HasDropHandlers, HasGestureChangeHandlers, HasGestureEndHandlers, HasGestureStartHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasTouchCancelHandlers, HasTouchEndHandlers, HasTouchMoveHandlers, HasTouchStartHandlers, MouseOutHandler, MouseOverHandler, HasAttachHandlers, EventHandler, HasHandlers, HasDirection, HasDirectionEstimator, EventListener, HasAutoHorizontalAlignment, HasDirectionalText, HasEnabled, HasHorizontalAlignment, HasText, HasVisibility, HasWordWrap, IsWidget, SourcesClickEvents, SourcesMouseEvents

public class ContextMenuRadioItem extends ContextMenuItem
Component of the context menu extension to GWT's user interface.

Implements mutually exclusive radio items in a context menu. Selecting one item deselects all other radio items in the same menu or submenu.

CSS Style Rules

Same as for ContextMenuItem plus

.gwt-ContextMenuRadioItem
the radio item element.
.gwt-ContextMenuRadioItem-selected
if the context menu item is selected.
Author:
Christoph Hauert
See Also:
  • Field Details

    • isSelected

      private boolean isSelected
      true if the radio item is selected.
  • Constructor Details

    • ContextMenuRadioItem

      public ContextMenuRadioItem(String text, Scheduler.ScheduledCommand cmd)
      Create a new radio menu item with title text. Initially the menu item is not selected. Clicking the menu item executes cmd.
      Parameters:
      text - title of menu item
      cmd - command to execute when clicked
    • ContextMenuRadioItem

      public ContextMenuRadioItem(String text, boolean isSelected, Scheduler.ScheduledCommand cmd)
      Create a new radio menu item with title text.
      Parameters:
      text - title of menu item
      isSelected - true if initially selected
      cmd - command to execute when clicked
  • Method Details

    • onLoad

      protected void onLoad()
      Overrides:
      onLoad in class ContextMenuItem
    • action

      public void action()
      Description copied from class: ContextMenuItem
      Entry method when context menu item is selected. Nothing happens if the context menu item is disabled. If it controls a submenu then the submenu is opened or closed, respectively. Otherwise, the assigned command is executed and the surrounding menu hierarchy is closed.
      Overrides:
      action in class ContextMenuItem
    • setSelected

      public void setSelected(boolean selected)
      Set selection state of radio item.
      Parameters:
      selected - true to select the item
    • isSelected

      public boolean isSelected()
      Check whether the radio item is selected.
      Returns:
      true if selected