Class Menu.Item

java.lang.Object
overit.geocall.ui.Menu.Item
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SortableMenu.Item
Enclosing class:
Menu

public static class Menu.Item extends Object implements Serializable
The class implements a menu voice
See Also:
  • Field Details

    • _label

      protected String _label
    • _icon

      protected Icon _icon
    • _event

      protected String _event
    • _id

      protected String _id
    • _param

      protected String _param
    • _msg

      protected String _msg
    • _prompt

      protected String _prompt
    • promptEmpty

      protected boolean promptEmpty
    • _check

      protected Boolean _check
    • _ro

      protected Boolean _ro
    • _cssClass

      protected String _cssClass
  • Constructor Details

    • Item

      public Item()
      Empty constructor
    • Item

      public Item(String title)
      Creates a non-active menu voice with the desired label. This kind of voices will be rendered like titles, so in a different way than the others
      Parameters:
      title - The label of the menu voice
    • Item

      public Item(String label, String icon, String event)
      Creates an active menu voice
      Parameters:
      label - The label that appears on the menu
      icon - The icon that appears on the left of the voice
      event - The event triggered when the user clicks on the voice; if null, the item is a title
    • Item

      public Item(String label, String icon, String event, String cssClass)
      Creates an active menu voice with a specified css class
      Parameters:
      label - The label that appears on the menu
      icon - The icon that appears on the left of the voice
      event - The event triggered when the user clicks on the voice; if null, the item is a title
      cssClass - the css class that will be associatd to this item
  • Method Details

    • setTarget

      public Menu.Item setTarget(String target)
      Sets the target for the event of the item
      Parameters:
      target - The desired id of the object that must be used as target for the event
      Returns:
      The item with the given target
    • setParams

      public Menu.Item setParams(String param, String msg, String prompt)
      Sets the parameters for the event associated to the item
      Parameters:
      param - The parameters passed to the event
      msg - The string that appears as a message whe the user clicks the item
      prompt - The string that appears as a prompt when the user clicks the item
      Returns:
      The item with the given parameters
    • setCheck

      public Menu.Item setCheck(Boolean check)
      Defines if it will appears a boolean icon on the left of the menu voice, and the type of the icon
      Parameters:
      check - true if the menu voice must have a "true" boolean icon, false if the menu voice must have a "false" boolean icon
      Returns:
      The item with the given attribute
    • setRO

      public Menu.Item setRO(Boolean ro)
      Sets the readonly state of the item
      Parameters:
      ro - true if the voice must be in readonly state (not clickable by the user), false otherwise
      Returns:
      The item with the given attribute
    • setPromptEmpty

      public Menu.Item setPromptEmpty(String s)
      Sets if the value returned by the prompt can be an empty string ""
      Parameters:
      s - true if you want to allow to return an empty value by the prompt, false otherwise.
      Returns:
      The button with the given parameters
    • isFull

      protected boolean isFull()
      Checks if the item has both the specific icon and the boolean (see setCheck(java.lang.Boolean)) check icon
      Returns:
      true if the item has both the icons, false otherwise
    • isTitle

      public boolean isTitle()
      Checks if the item is a title
      Returns:
      true if the item has a label and an empty event, false otherwise
    • isEmpty

      public boolean isEmpty()
      Checks if the item is empty
      Returns:
      true if the label is null and the event is null
    • getLabel

      public String getLabel()
      Returns the item label
      Returns:
      The string that corresponds to the label of the menu voice
    • getId

      public String getId()
      Return the id used as target for the event of the item
      Returns:
      The id of the item
    • getParam

      public String getParam()
      Return the param associated to the item's event
      Returns:
      The parameters passed to the event when the user clicks on the menu voice
    • getCssClass

      public String getCssClass()
      Return the css class associated to this menu item
      Returns:
      String containing the css class