Class PropertyAction

All Implemented Interfaces:
com.nomagic.magicdraw.actions.ShortcutSchemaAction, ActionListener, PropertyChangeListener, Serializable, Cloneable, Comparable, EventListener, Action

@OpenApiAll public class PropertyAction extends MDAction implements PropertyChangeListener
Action for changing assigned property value.
See Also:
  • Field Details

  • Constructor Details

    • PropertyAction

      public PropertyAction(PropertyManager manager, String propertyID)
      The constructor for action with given property.
      Parameters:
      manager - property manager
      propertyID - id of the property
    • PropertyAction

      public PropertyAction(String actionID, PropertyManager manager, String propertyID)
      The constructor for action with given property.
      Parameters:
      actionID - id of the action
      manager - property manager
      propertyID - id of the property
    • PropertyAction

      public PropertyAction(String actionID, PropertyManager manager, String propertyID, boolean useShortcutSchema)
      The constructor for action with given property.
      Parameters:
      actionID - id of the action
      manager - property manager
      propertyID - id of the property
      useShortcutSchema - use shortcuts schema for this action
  • Method Details

    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
      See Also:
    • setNewValue

      public void setNewValue(Object newValue)
      Sets the new property value.
      Parameters:
      newValue - the new property value.
    • getNewValue

      public Object getNewValue()
      Gets the new property value.
      Returns:
      the new property value
    • getProperty

      public Property getProperty()
      Returns the property.
      Returns:
      returns an assigned property
    • changePropertyValue

      protected void changePropertyValue(Object newValue)
      Change value of a property
      Parameters:
      newValue - new value
    • accept

      public void accept(ActionsVisitor visitor)
      Description copied from class: NMAction
      Accepts ActionsVisitor using Visitor pattern.
      Overrides:
      accept in class NMAction
      Parameters:
      visitor - visitor to accept.
    • getManager

      public PropertyManager getManager()
      Get the manager.
      Returns:
      returns the manager
    • setManager

      public void setManager(PropertyManager manager)
      Set the manager.
      Parameters:
      manager - the new manager
    • fireManagerChanged

      protected void fireManagerChanged(PropertyManager oldManager, PropertyManager newManager)
      Fires the notification about the property manager change
      Parameters:
      oldManager - old manager
      newManager - new manager
    • getPropertyID

      public String getPropertyID()
      Get the property id.
      Returns:
      Returns the id
    • setPropertyId

      protected void setPropertyId(String id)
      Sets property id
      Parameters:
      id - property id
    • addChangeListener

      public void addChangeListener(PropertyChangeListener listener)
      Add the listener which will be notified about the change of underlying property manager of this action
      Parameters:
      listener - for property change notifications
    • addChangeListener

      public void addChangeListener(String property, PropertyChangeListener listener)
      Add the listener which will be notified about the change of underlying property manager of this action
      Parameters:
      property - the listener will be notified only about this property changes
      listener - for property change notifications
      See Also:
    • removeChangeListener

      public void removeChangeListener(PropertyChangeListener listener)
      Remove the listener from this action
      Parameters:
      listener - to be removed
    • removeChangeListener

      public void removeChangeListener(String property, PropertyChangeListener listener)
      Remove the listener from this action
      Parameters:
      property - the name of the property
      listener - to be removed