Class SelectionItem

  • All Implemented Interfaces:
    ListItem, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener, javax.swing.Action

    @OpenApiAll
    public class SelectionItem
    extends NMStateAction
    implements ListItem
    Simple action which when is performed sets property to its name. This action can be used to represent lists with selected values.
    See Also:
    SelectItemAction, Serialized Form
    • Field Detail

      • propertyName

        private final java.lang.String propertyName
        Property name of event which will be fired when this action will be executed.
      • value

        private final java.lang.Object value
        New value for PropertyChangeEvent which will be fired when action will be executed.
    • Constructor Detail

      • SelectionItem

        public SelectionItem​(java.lang.String id,
                             java.lang.Object value,
                             java.lang.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 Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.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 java.awt.event.ActionListener
        Overrides:
        actionPerformed in class NMStateAction
        Parameters:
        e - event caused execution.
      • getValue

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