Class AbstractTagEditingCategory

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.jidesoft.dialog.AbstractPage
com.jidesoft.dialog.AbstractDialogPage
All Implemented Interfaces:
com.jidesoft.dialog.Laziness, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
AlarmCategory, DerivedTagCategory, ExpressionCategory, GeneralCategory, MetaCategory, NumericCategory, PermissionsCategory, TagEventCategory

public abstract class AbstractTagEditingCategory extends AbstractEditingCategory
This class is the base for a "page" of properties for a tag. The general model for editing tags is to break up settings into these categories. Each category is then initialized with a read-only model when a tag is selected, and committed with a mutable object when the user performs some action. If an edit isn't valid, the commit can be canceled.

The editing fields should all be subclasses of AbstractTagPropEditor. Since that class is a panel, complex components can still be built, but the base class provides support for change detection, error display, multi edit and more.

See Also:
  • Field Details

  • Constructor Details

    • AbstractTagEditingCategory

      protected AbstractTagEditingCategory()
    • AbstractTagEditingCategory

      public AbstractTagEditingCategory(String titleKey, Icon icon)
  • Method Details

    • registerEditor

      protected void registerEditor(AbstractTagPropEditor editor)
    • getCurrentTarget

      protected TagEditController getCurrentTarget()
    • hasTarget

      protected boolean hasTarget()
      Returns whether there is currently an edit target
      Returns:
      false if editTarget is null
    • isDataset

      protected boolean isDataset(TagEditController tag)
    • isRelevantFor

      public abstract boolean isRelevantFor(TagEditController tag)
      Returns true if this category is relevant for the given tag. If the category isn't relevant, it will not be initialized, and will be disabled in the UI.
      Returns:
      true if this editing category applies to the tag
    • dryRunCommit

      public boolean dryRunCommit()
      Performs a dry run commit.
      Returns:
      returning TRUE if the edits are valid, false if an error occurred.
    • isChanged

      public boolean isChanged()
      Overrides:
      isChanged in class AbstractListDialogPage
    • commit

      public int commit() throws Exception
      Loops through the fields in the category and calls commit(), after calling isModified() to check for changes. Returns the number of changes made.
      Throws:
      Exception
    • init

      public void init(TagEditController tag)
      Sets the selection to the given tag.
      Parameters:
      tag - the tag to select