Class SelectionStateItem

All Implemented Interfaces:
ListItem, com.nomagic.actions.ShortcutsNotCustomizable, ActionListener, Serializable, Cloneable, Comparable, EventListener, Action

@OpenApiAll public class SelectionStateItem extends NMStateAction implements ListItem, com.nomagic.actions.ShortcutsNotCustomizable
Simple action which on action performed sets property to its name. This action can be used to represent lists with selected values.
See Also:
  • Constructor Details

    • SelectionStateItem

      public SelectionStateItem(@CheckForNull String id, Object value, String propertyName)
      Creates new action.
      Parameters:
      id - action id
      value - action value, action name is created from value.toString method.
      propertyName - Property name of event which will be fired when this action will be executed.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Fires property change event with name this.propertyName and with new value this.value, and null old value.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class NMStateAction
      Parameters:
      e - event caused execution.
    • getValue

      public Object getValue()
      Returns value of this action.
      Specified by:
      getValue in interface ListItem
      Returns:
      value of this action.
    • getPropertyName

      public String getPropertyName()