Class LoggerNameTreePanel

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, LoggerNameListener

    final class LoggerNameTreePanel
    extends javax.swing.JPanel
    implements LoggerNameListener
    A panel that encapsulates the Logger Name tree, with associated actions and implements the Rule interface so that it can filter in/out events that do not match the users request for refining the view based on Loggers.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChangeListener​(javax.swing.event.ChangeListener l)
      Adds a change Listener to this LoggerNameTreePanel to be notfied when the State of the Focus or Hidden details have changed.
      private void clearFindNext()  
      private void clearRefineFocus()  
      private void collapseCurrentlySelectedNode()
      Given the currently selected nodes collapses all the children of those nodes.
      private void configureToolbarPanel()
      configures all the components that are used in the mini-toolbar of this component
      private javax.swing.Action createClearFindNextAction()
      Creates an action that is used to find the next match of the selected node (similar to default selection behavior except the search field is populated and the next match is selected.
      private javax.swing.Action createClearIgnoreListAction()
      DOCUMENT ME!
      private javax.swing.Action createClearRefineFocusAction()  
      private javax.swing.Action createCloseAction()
      An action that closes (hides) this panel
      private javax.swing.Action createCollapseAction()
      DOCUMENT ME!
      private javax.swing.Action createDefineColorRuleForLoggerAction()  
      private javax.swing.Action createEditLoggerAction()  
      private javax.swing.Action createExpandAction()
      Creates an action that is used to expand the selected node and all children
      private javax.swing.Action createFindNextAction()
      Creates an action that is used to find the next match of the selected node (similar to default selection behavior except the search field is populated and the next match is selected.
      private javax.swing.Action createFocusOnAction()
      DOCUMENT ME!
      private javax.swing.Action createIgnoreAction()
      DOCUMENT ME!
      private javax.swing.Action createIgnoreAllAction()
      DOCUMENT ME!
      private javax.swing.Action createSetRefineFocusAction()  
      private javax.swing.Action createUpdateFindAction()  
      private javax.swing.Action createUpdateRefineFocusAction()  
      private void ensureRootExpanded()  
      private void expandCurrentlySelectedNode()
      Expands the currently selected node (if any) including all the children.
      private void findNextUsingCurrentlySelectedNode()  
      private void fireChangeEvent()  
      java.lang.String getAlwaysDisplayExpression()  
      (package private) java.lang.String getCurrentlySelectedLoggerName()
      Returns the full name of the Logger that is represented by the currently selected Logger node in the tree.
      java.lang.String getHiddenExpression()  
      java.util.Collection getHiddenSet()  
      org.apache.log4j.rule.Rule getLoggerColorRule()  
      (package private) java.lang.String getLoggerName​(javax.swing.tree.TreePath path)
      Returns the full
      org.apache.log4j.rule.Rule getLoggerVisibilityRule()  
      (package private) void ignore​(java.util.Collection fqnLoggersToIgnore)
      adds a Collection of Strings to the ignore List and notifise all listeners of both the "hiddenSet" property and those expecting the Rule to change via the ChangeListener interface
      (package private) boolean isFocusOnSelected()
      Returns true if the FocusOn element has been selected
      private boolean isHiddenLogger​(java.lang.String loggerName)  
      void loggerNameAdded​(java.lang.String loggerName)
      Called by LoggerNameModel instances when a new unique Logger name string has been introduced into the model
      private void reconfigureMenuText()  
      void removeChangeListener​(javax.swing.event.ChangeListener l)
      DOCUMENT ME!
      void reset()
      Logger names were reset (used to clear the tree model)
      void setAlwaysDisplayExpression​(java.lang.String alwaysDisplayExpression)  
      void setFocusOn​(java.lang.String newLogger)
      Ensures the Focus is set to a specific logger name
      (package private) void setFocusOnSelected​(boolean selected)  
      void setHiddenExpression​(java.lang.String hiddenExpression)  
      private void setRefineFocusUsingCurrentlySelectedNode()  
      private void setupListeners()
      Configures varoius listeners etc for the components within this Class.
      private void toggleFocusOnState()  
      protected void toggleHiddenLogger​(java.lang.String logger)
      DOCUMENT ME!
      private boolean updateAlwaysDisplayExpression​(java.lang.String alwaysDisplayText)  
      private void updateAlwaysDisplayExpressionSummary()  
      private void updateDisplay()  
      private void updateFindUsingCurrentlySelectedNode()  
      private void updateHiddenSetModels()  
      private boolean updateIgnoreExpression​(java.lang.String ignoreText)  
      private void updateIgnoreExpressionSummary()  
      private void updateIgnoreSummary()  
      private void updateRefineFocusUsingCurrentlySelectedNode()  
      • 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, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, 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, update
      • 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, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, 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, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, 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
    • Field Detail

      • clearIgnoreListAction

        private final javax.swing.Action clearIgnoreListAction
      • closeAction

        private final javax.swing.Action closeAction
      • closeButton

        private final javax.swing.JButton closeButton
      • collapseAction

        private final javax.swing.Action collapseAction
      • collapseButton

        private final javax.swing.JButton collapseButton
      • editLoggerAction

        private final javax.swing.Action editLoggerAction
      • editLoggerButton

        private final javax.swing.JButton editLoggerButton
      • expandAction

        private final javax.swing.Action expandAction
      • findAction

        private final javax.swing.Action findAction
      • clearFindNextAction

        private final javax.swing.Action clearFindNextAction
      • defineColorRuleForLoggerAction

        private final javax.swing.Action defineColorRuleForLoggerAction
      • setRefineFocusAction

        private final javax.swing.Action setRefineFocusAction
      • updateRefineFocusAction

        private final javax.swing.Action updateRefineFocusAction
      • updateFindAction

        private final javax.swing.Action updateFindAction
      • expandButton

        private final javax.swing.JButton expandButton
      • focusOnAction

        private final javax.swing.Action focusOnAction
      • clearRefineFocusAction

        private final javax.swing.Action clearRefineFocusAction
      • hiddenSet

        private final java.util.Set hiddenSet
      • hideAction

        private final javax.swing.Action hideAction
      • hideSubLoggersAction

        private final javax.swing.Action hideSubLoggersAction
      • ignoreList

        private final javax.swing.JList ignoreList
      • ignoreExpressionEntryField

        private final javax.swing.JEditorPane ignoreExpressionEntryField
      • alwaysDisplayExpressionEntryField

        private final javax.swing.JEditorPane alwaysDisplayExpressionEntryField
      • ignoreListScroll

        private final javax.swing.JScrollPane ignoreListScroll
      • ignoreDialog

        private final javax.swing.JDialog ignoreDialog
      • ignoreExpressionDialog

        private final javax.swing.JDialog ignoreExpressionDialog
      • alwaysDisplayExpressionDialog

        private final javax.swing.JDialog alwaysDisplayExpressionDialog
      • ignoreSummary

        private final javax.swing.JLabel ignoreSummary
      • ignoreExpressionSummary

        private final javax.swing.JLabel ignoreExpressionSummary
      • alwaysDisplayExpressionSummary

        private final javax.swing.JLabel alwaysDisplayExpressionSummary
      • listenerList

        private final javax.swing.event.EventListenerList listenerList
      • logTree

        private final javax.swing.JTree logTree
      • logger

        private final org.apache.log4j.Logger logger
      • colorRuleDelegate

        private org.apache.log4j.rule.Rule colorRuleDelegate
      • scrollTree

        private final javax.swing.JScrollPane scrollTree
      • toolbar

        private final javax.swing.JToolBar toolbar
      • logPanel

        private final LogPanel logPanel
      • ignoreExpressionRule

        private org.apache.log4j.rule.Rule ignoreExpressionRule
      • alwaysDisplayExpressionRule

        private org.apache.log4j.rule.Rule alwaysDisplayExpressionRule
      • expandRootLatch

        private boolean expandRootLatch
      • currentlySelectedLoggerName

        private java.lang.String currentlySelectedLoggerName
    • Method Detail

      • updateIgnoreExpression

        private boolean updateIgnoreExpression​(java.lang.String ignoreText)
      • updateAlwaysDisplayExpression

        private boolean updateAlwaysDisplayExpression​(java.lang.String alwaysDisplayText)
      • addChangeListener

        public void addChangeListener​(javax.swing.event.ChangeListener l)
        Adds a change Listener to this LoggerNameTreePanel to be notfied when the State of the Focus or Hidden details have changed.
        Parameters:
        l -
      • getLoggerColorRule

        public org.apache.log4j.rule.Rule getLoggerColorRule()
      • getLoggerVisibilityRule

        public org.apache.log4j.rule.Rule getLoggerVisibilityRule()
      • removeChangeListener

        public void removeChangeListener​(javax.swing.event.ChangeListener l)
        DOCUMENT ME!
        Parameters:
        l - DOCUMENT ME!
      • setFocusOn

        public void setFocusOn​(java.lang.String newLogger)
        Ensures the Focus is set to a specific logger name
      • isHiddenLogger

        private boolean isHiddenLogger​(java.lang.String loggerName)
      • toggleHiddenLogger

        protected void toggleHiddenLogger​(java.lang.String logger)
        DOCUMENT ME!
        Parameters:
        logger -
      • getCurrentlySelectedLoggerName

        java.lang.String getCurrentlySelectedLoggerName()
        Returns the full name of the Logger that is represented by the currently selected Logger node in the tree.

        This is the dotted name, of the current node including all it's parents.

        If multiple Nodes are selected, the first path is used

        Returns:
        Logger Name or null if nothing selected
      • getLoggerName

        java.lang.String getLoggerName​(javax.swing.tree.TreePath path)
        Returns the full
        Parameters:
        path - DOCUMENT ME!
        Returns:
      • ignore

        void ignore​(java.util.Collection fqnLoggersToIgnore)
        adds a Collection of Strings to the ignore List and notifise all listeners of both the "hiddenSet" property and those expecting the Rule to change via the ChangeListener interface
        Parameters:
        fqnLoggersToIgnore -
      • isFocusOnSelected

        boolean isFocusOnSelected()
        Returns true if the FocusOn element has been selected
        Returns:
        true if the FocusOn action/lement has been selected
      • setFocusOnSelected

        void setFocusOnSelected​(boolean selected)
      • collapseCurrentlySelectedNode

        private void collapseCurrentlySelectedNode()
        Given the currently selected nodes collapses all the children of those nodes.
      • configureToolbarPanel

        private void configureToolbarPanel()
        configures all the components that are used in the mini-toolbar of this component
      • createClearIgnoreListAction

        private javax.swing.Action createClearIgnoreListAction()
        DOCUMENT ME!
        Returns:
      • createCloseAction

        private javax.swing.Action createCloseAction()
        An action that closes (hides) this panel
        Returns:
      • createCollapseAction

        private javax.swing.Action createCollapseAction()
        DOCUMENT ME!
        Returns:
      • createEditLoggerAction

        private javax.swing.Action createEditLoggerAction()
      • createExpandAction

        private javax.swing.Action createExpandAction()
        Creates an action that is used to expand the selected node and all children
        Returns:
        an Action
      • createFindNextAction

        private javax.swing.Action createFindNextAction()
        Creates an action that is used to find the next match of the selected node (similar to default selection behavior except the search field is populated and the next match is selected.
        Returns:
        an Action
      • createSetRefineFocusAction

        private javax.swing.Action createSetRefineFocusAction()
      • createUpdateRefineFocusAction

        private javax.swing.Action createUpdateRefineFocusAction()
      • createUpdateFindAction

        private javax.swing.Action createUpdateFindAction()
      • updateFindUsingCurrentlySelectedNode

        private void updateFindUsingCurrentlySelectedNode()
      • updateRefineFocusUsingCurrentlySelectedNode

        private void updateRefineFocusUsingCurrentlySelectedNode()
      • setRefineFocusUsingCurrentlySelectedNode

        private void setRefineFocusUsingCurrentlySelectedNode()
      • createDefineColorRuleForLoggerAction

        private javax.swing.Action createDefineColorRuleForLoggerAction()
      • createClearFindNextAction

        private javax.swing.Action createClearFindNextAction()
        Creates an action that is used to find the next match of the selected node (similar to default selection behavior except the search field is populated and the next match is selected.
        Returns:
        an Action
      • createClearRefineFocusAction

        private javax.swing.Action createClearRefineFocusAction()
      • createFocusOnAction

        private javax.swing.Action createFocusOnAction()
        DOCUMENT ME!
        Returns:
      • createIgnoreAllAction

        private javax.swing.Action createIgnoreAllAction()
        DOCUMENT ME!
        Returns:
      • createIgnoreAction

        private javax.swing.Action createIgnoreAction()
        DOCUMENT ME!
        Returns:
      • ensureRootExpanded

        private void ensureRootExpanded()
      • findNextUsingCurrentlySelectedNode

        private void findNextUsingCurrentlySelectedNode()
      • clearFindNext

        private void clearFindNext()
      • clearRefineFocus

        private void clearRefineFocus()
      • expandCurrentlySelectedNode

        private void expandCurrentlySelectedNode()
        Expands the currently selected node (if any) including all the children.
      • fireChangeEvent

        private void fireChangeEvent()
      • reconfigureMenuText

        private void reconfigureMenuText()
      • setupListeners

        private void setupListeners()
        Configures varoius listeners etc for the components within this Class.
      • updateDisplay

        private void updateDisplay()
      • updateHiddenSetModels

        private void updateHiddenSetModels()
      • updateIgnoreSummary

        private void updateIgnoreSummary()
      • updateIgnoreExpressionSummary

        private void updateIgnoreExpressionSummary()
      • updateAlwaysDisplayExpressionSummary

        private void updateAlwaysDisplayExpressionSummary()
      • toggleFocusOnState

        private void toggleFocusOnState()
      • getHiddenSet

        public java.util.Collection getHiddenSet()
      • getHiddenExpression

        public java.lang.String getHiddenExpression()
      • setHiddenExpression

        public void setHiddenExpression​(java.lang.String hiddenExpression)
      • getAlwaysDisplayExpression

        public java.lang.String getAlwaysDisplayExpression()
      • setAlwaysDisplayExpression

        public void setAlwaysDisplayExpression​(java.lang.String alwaysDisplayExpression)
      • loggerNameAdded

        public void loggerNameAdded​(java.lang.String loggerName)
        Description copied from interface: LoggerNameListener
        Called by LoggerNameModel instances when a new unique Logger name string has been introduced into the model
        Specified by:
        loggerNameAdded in interface LoggerNameListener
        Parameters:
        loggerName - the new, unique loggerName