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

public abstract class TagTreeAction extends AbstractAction implements TreeSelectionListener
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 Details

  • Constructor Details

  • Method Details

    • getTagManager

      protected ClientTagManager getTagManager()
    • setTree

      public void setTree(JTree tree)
    • getSelectedTagPaths

      protected List<TagPath> getSelectedTagPaths()
    • getEligibleSelectedTagPaths

      protected List<TagPath> getEligibleSelectedTagPaths()
      Returns the selected paths, but pared down to just the nodes that are considered eligible for edit.
    • valueChanged

      public void valueChanged(TreeSelectionEvent e)
      Specified by:
      valueChanged in interface TreeSelectionListener
    • shouldBeEnabled

      protected boolean shouldBeEnabled(BrowseTreeNode[] nodes)
    • isNodeEligible

      protected boolean isNodeEligible(BrowseTreeNode node)
    • shouldBeEnabled

      protected abstract boolean shouldBeEnabled(BrowseTreeNode node)
      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

      protected BrowseTreeNode getNode()
      Returns:
      the first selected node, or null if no node is selected
    • getNodes

      protected List<BrowseTreeNode> getNodes()
    • findProvider

      protected EditableProviderNode findProvider(BrowseTreeNode node)