Package com.nomagic.magicdraw.actions
Class PropertyAction
java.lang.Object
javax.swing.AbstractAction
com.nomagic.actions.NMAction
com.nomagic.magicdraw.actions.MDAction
com.nomagic.magicdraw.actions.PropertyAction
- All Implemented Interfaces:
com.nomagic.magicdraw.actions.ShortcutSchemaAction
,ActionListener
,PropertyChangeListener
,Serializable
,Cloneable
,Comparable
,EventListener
,Action
Action for changing assigned property value.
- See Also:
-
Field Summary
Fields inherited from class com.nomagic.actions.NMAction
ACTION_SHORTCUTS, BELONGS_TO_SEPARATE_GROUP_IN_UI, DO_NO_SHOW_ACTION_NAME_IN_UI, DO_NOT_REGISTER_ACTION_TO_COMPONENTS, GENERATED_ID_PREFIX, GROUP, ID, LARGE_ICON, MENU_SHORTCUT_MASK, TINY_ICON
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
ConstructorDescriptionPropertyAction
(PropertyManager manager, String propertyID) The constructor for action with given property.PropertyAction
(String actionID, PropertyManager manager, String propertyID) The constructor for action with given property.PropertyAction
(String actionID, PropertyManager manager, String propertyID, boolean useShortcutSchema) The constructor for action with given property. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ActionsVisitor visitor) Accepts ActionsVisitor using Visitor pattern.void
addChangeListener
(PropertyChangeListener listener) Add the listener which will be notified about the change of underlying property manager of this actionvoid
addChangeListener
(String property, PropertyChangeListener listener) Add the listener which will be notified about the change of underlying property manager of this actionprotected void
changePropertyValue
(Object newValue) Change value of a propertyprotected void
fireManagerChanged
(PropertyManager oldManager, PropertyManager newManager) Fires the notification about the property manager changeGet the manager.Gets the new property value.Returns the property.Get the property id.void
void
removeChangeListener
(PropertyChangeListener listener) Remove the listener from this actionvoid
removeChangeListener
(String property, PropertyChangeListener listener) Remove the listener from this actionvoid
setManager
(PropertyManager manager) Set the manager.void
setNewValue
(Object newValue) Sets the new property value.protected void
setPropertyId
(String id) Sets property idMethods inherited from class com.nomagic.magicdraw.actions.MDAction
actionPerformed, isUseShortcutSchema, updateState
Methods inherited from class com.nomagic.actions.NMAction
addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, forEach, forEachIncludingSelf, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removeAction, removeIf, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setActions, setDescription, setGroup, setIcon, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, setTinyIcon, shallowClone, toString
Methods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled
-
Field Details
-
MANAGER_CHANGED
- See Also:
-
-
Constructor Details
-
PropertyAction
The constructor for action with given property.- Parameters:
manager
- property managerpropertyID
- id of the property
-
PropertyAction
The constructor for action with given property.- Parameters:
actionID
- id of the actionmanager
- property managerpropertyID
- 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 actionmanager
- property managerpropertyID
- id of the propertyuseShortcutSchema
- use shortcuts schema for this action
-
-
Method Details
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
- See Also:
-
setNewValue
Sets the new property value.- Parameters:
newValue
- the new property value.
-
getNewValue
Gets the new property value.- Returns:
- the new property value
-
getProperty
Returns the property.- Returns:
- returns an assigned property
-
changePropertyValue
Change value of a property- Parameters:
newValue
- new value
-
accept
Description copied from class:NMAction
Accepts ActionsVisitor using Visitor pattern. -
getManager
Get the manager.- Returns:
- returns the manager
-
setManager
Set the manager.- Parameters:
manager
- the new manager
-
fireManagerChanged
Fires the notification about the property manager change- Parameters:
oldManager
- old managernewManager
- new manager
-
getPropertyID
Get the property id.- Returns:
- Returns the id
-
setPropertyId
Sets property id- Parameters:
id
- property id
-
addChangeListener
Add the listener which will be notified about the change of underlying property manager of this action- Parameters:
listener
- for property change notifications
-
addChangeListener
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 changeslistener
- for property change notifications- See Also:
-
removeChangeListener
Remove the listener from this action- Parameters:
listener
- to be removed
-
removeChangeListener
Remove the listener from this action- Parameters:
property
- the name of the propertylistener
- to be removed
-