Class MenuItem

java.lang.Object
com.motivewave.platform.sdk.common.menu.MenuItem
Direct Known Subclasses:
Menu, MenuSeparator

public class MenuItem extends Object
Encapsulates information for displayed a custom menu item when the user invokes the popup trigger on a study (right click).
  • Constructor Details

    • MenuItem

      public MenuItem(String text)
      Constructor. Creates a menu item with the given text label.
      Parameters:
      text - display text for the menu item
    • MenuItem

      public MenuItem(String text, Runnable action)
      Constructor. Creates a menu item with the given text label.
      Parameters:
      text - display text for the menu item
      action - action to execute when this item is selected (clicked) by the user
    • MenuItem

      public MenuItem(String text, boolean checked, Runnable action)
      Constructor. Creates a menu item with the given text label.
      Parameters:
      text - display text for the menu item
      checked - if true a check mark will appear to the left of the menu item
      action - action to execute when this item is selected (clicked) by the user
  • Method Details

    • getText

      public String getText()
      Gets the display text for the menu item.
      Returns:
      display text
    • setText

      public void setText(String text)
      Sets the display text for the menu item.
      Parameters:
      text - display text
    • isChecked

      public boolean isChecked()
      Gets the checked attribute for the menu item. If this is set to true then a check mark will be displayed to the left of the display text.
      Returns:
      true if a check mark should be displayed to the left of the display text
    • setChecked

      public void setChecked(boolean checked)
      Sets the checked attribute for the menu item. If this is set to true then a check mark will be displayed to the left of the display text.
      Parameters:
      checked - true if a check mark should be displayed to the left of the display text
    • isDisabled

      public boolean isDisabled()
      Indicates if this menu item should be disabled (not clickable to the user).
      Returns:
      true if this item is not clickable to the user
    • setDisabled

      public void setDisabled(boolean disabled)
      Indicates if this menu item should be disabled (not clickable to the user).
      Parameters:
      disabled - true if this item is not clickable to the user
    • getAction

      public Runnable getAction()
      Gets the action to execute when the user selects (clicks) the menu item.
      Returns:
      action to execute when the menu item is clicked
    • setAction

      public void setAction(Runnable action)
      Sets the action to execute when the user selects (clicks) the menu item.
      Parameters:
      action - action to execute when the menu item is clicked