Class TagTreeAction
java.lang.Object
javax.swing.AbstractAction
com.inductiveautomation.ignition.designer.tags.tree.action.TagTreeAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,TreeSelectionListener
- Direct Known Subclasses:
BrowseOpcAction
,CopyPathAction
,CopyTagJsonAction
,CopyTagXmlAction
,ExportTagAction
,ImportTagAction
,RenameAction
,TagGroupEditAction
Base for a tag action on the tag browser panel. It watches the tree for selection and modifies the enabled state as
appropriate. When triggered, it has the selected BrowseTreeNodes available for use.
By default, it does not allow selection between providers. To allow that, override allowMixedProviders().
- See Also:
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionTagTreeAction
(DesignerContext context, String name) TagTreeAction
(DesignerContext context, String name, Icon icon) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns whether this action will be enabled when tags from multiple providers are selected.protected EditableProviderNode
findProvider
(BrowseTreeNode node) Returns the selected paths, but pared down to just the nodes that are considered eligible for edit.protected BrowseTreeNode
getNode()
protected List<BrowseTreeNode>
getNodes()
protected ClientTagManager
protected boolean
isNodeEligible
(BrowseTreeNode node) protected abstract int
void
protected abstract boolean
Called for each selected node that isn't a meta node.protected boolean
shouldBeEnabled
(BrowseTreeNode[] nodes) void
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
-
Field Details
-
context
-
tree
-
-
Constructor Details
-
TagTreeAction
-
TagTreeAction
-
-
Method Details
-
getTagManager
-
setTree
-
getSelectedTagPaths
-
getEligibleSelectedTagPaths
Returns the selected paths, but pared down to just the nodes that are considered eligible for edit. -
valueChanged
- Specified by:
valueChanged
in interfaceTreeSelectionListener
-
shouldBeEnabled
-
isNodeEligible
-
shouldBeEnabled
Called for each selected node that isn't a meta node. The action will become enabled only if all selected nodes are not meta nodes and this function returns true for each node. -
maxSelectionCount
protected abstract int maxSelectionCount()- Returns:
- the maximum selection that could cause this action to be enabled
-
allowMixedProviders
protected boolean allowMixedProviders()Returns whether this action will be enabled when tags from multiple providers are selected. -
getNode
- Returns:
- the first selected node, or null if no node is selected
-
getNodes
-
findProvider
-