Class AbstractTagEditingCategory

  • All Implemented Interfaces:
    com.jidesoft.dialog.Laziness, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.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:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List<AbstractTagPropEditor> allFields  
      protected TagEditController editTarget  
      • Fields inherited from class com.jidesoft.dialog.AbstractDialogPage

        _buttonEvent, _description, _icon, _pageEnabled, _parentPage, _title, DESCRIPTION_PROPERTY, ICON_PROPERTY, PROPERTY_PAGE_ENABLED, TITLE_PROPERTY
      • Fields inherited from class com.jidesoft.dialog.AbstractPage

        _pageEvent, INVOKE_ON_ALL, INVOKE_ON_NONE, INVOKE_ON_PAINT, INVOKE_ON_REPAINT, INVOKE_ON_UPDATE, INVOKE_ON_VALIDATE
      • Fields inherited from class javax.swing.JComponent

        listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int commit()
      Loops through the fields in the category and calls commit(), after calling isModified() to check for changes.
      boolean dryRunCommit()
      Performs a dry run commit.
      protected TagEditController getCurrentTarget()  
      protected boolean hasTarget()
      Returns whether there is currently an edit target
      void init​(TagEditController tag)
      Sets the selection to the given tag.
      boolean isChanged()  
      protected boolean isDataset​(TagEditController tag)  
      abstract boolean isRelevantFor​(TagEditController tag)
      Returns true if this category is relevant for the given tag.
      protected void registerEditor​(AbstractTagPropEditor editor)  
      • Methods inherited from class com.jidesoft.dialog.AbstractDialogPage

        addButtonListener, fireButtonEvent, fireButtonEvent, fireButtonEvent, focusDefaultFocusComponent, getButtonListeners, getDefaultFocusComponent, getDescription, getFullTitle, getIcon, getParentPage, getTitle, isPageEnabled, removeButtonListener, setDefaultFocusComponent, setDescription, setIcon, setPageEnabled, setParentPage, setTitle
      • Methods inherited from class com.jidesoft.dialog.AbstractPage

        addPageListener, allowClosing, firePageEvent, firePageEvent, getInvokeCondition, getPageListeners, initialize, invalidate, paint, paintAll, paintComponents, removePageListener, repaint, repaint, repaint, repaint, reset, revalidate, setAllowClosing, setInvokeCondition, update
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractTagEditingCategory

        protected AbstractTagEditingCategory()
      • AbstractTagEditingCategory

        public AbstractTagEditingCategory​(java.lang.String titleKey,
                                          javax.swing.Icon icon)
    • Method Detail

      • hasTarget

        protected boolean hasTarget()
        Returns whether there is currently an edit target
        Returns:
        false if editTarget is null
      • 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.
      • commit

        public int commit()
                   throws java.lang.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:
        java.lang.Exception
      • init

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