Package org.apache.log4j.chainsaw
Class LoggerNameTreePanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.apache.log4j.chainsaw.LoggerNameTreePanel
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
DOCUMENT ME!private class
private final class
private final class
(package private) class
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JDialog
private final JEditorPane
private org.apache.log4j.rule.Rule
private final JLabel
private final Action
private final Action
private final Action
private final Action
private final JButton
private final Action
private final JButton
private final RuleColorizer
private org.apache.log4j.rule.Rule
private String
private final Action
private final Action
private final JButton
private final Action
private final JButton
private boolean
private final Action
private final Action
private final SmallToggleButton
private final Set
private final Action
private final Action
private final JDialog
private final JDialog
private final JEditorPane
private org.apache.log4j.rule.Rule
private final JLabel
private final JList
private final JScrollPane
private final SmallToggleButton
private final JLabel
private final EventListenerList
private final org.apache.log4j.Logger
private final LogPanel
private final JTree
private final LogPanelLoggerTreeModel
private final PopupListener
private final LoggerNameTreePanel.LoggerTreePopupMenu
private final LogPanelPreferenceModel
private final JScrollPane
private final Action
private final JToolBar
private final Action
private final Action
private final LoggerNameTreePanel.VisibilityRuleDelegate
private static final int
Fields inherited from class javax.swing.JComponent
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
-
Constructor Summary
ConstructorsConstructorDescriptionLoggerNameTreePanel
(LogPanelLoggerTreeModel logTreeModel, LogPanelPreferenceModel preferenceModel, LogPanel logPanel, RuleColorizer colorizer, FilterModel filterModel) Creates a new LoggerNameTreePanel object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a change Listener to this LoggerNameTreePanel to be notfied when the State of the Focus or Hidden details have changed.private void
private void
private void
Given the currently selected nodes collapses all the children of those nodes.private void
configures all the components that are used in the mini-toolbar of this componentprivate Action
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 Action
DOCUMENT ME!private Action
private Action
An action that closes (hides) this panelprivate Action
DOCUMENT ME!private Action
private Action
private Action
Creates an action that is used to expand the selected node and all childrenprivate Action
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 Action
DOCUMENT ME!private Action
DOCUMENT ME!private Action
DOCUMENT ME!private Action
private Action
private Action
private void
private void
Expands the currently selected node (if any) including all the children.private void
private void
(package private) String
Returns the full name of the Logger that is represented by the currently selected Logger node in the tree.org.apache.log4j.rule.Rule
(package private) String
getLoggerName
(TreePath path) Returns the fullorg.apache.log4j.rule.Rule
(package private) void
ignore
(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
Returns true if the FocusOn element has been selectedprivate boolean
isHiddenLogger
(String loggerName) void
loggerNameAdded
(String loggerName) Called by LoggerNameModel instances when a new unique Logger name string has been introduced into the modelprivate void
void
DOCUMENT ME!void
reset()
Logger names were reset (used to clear the tree model)void
setAlwaysDisplayExpression
(String alwaysDisplayExpression) void
setFocusOn
(String newLogger) Ensures the Focus is set to a specific logger name(package private) void
setFocusOnSelected
(boolean selected) void
setHiddenExpression
(String hiddenExpression) private void
private void
Configures varoius listeners etc for the components within this Class.private void
protected void
toggleHiddenLogger
(String logger) DOCUMENT ME!private boolean
updateAlwaysDisplayExpression
(String alwaysDisplayText) private void
private void
private void
private void
private boolean
updateIgnoreExpression
(String ignoreText) private void
private void
private void
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
-
Field Details
-
WARN_DEPTH
private static final int WARN_DEPTH- See Also:
-
cellRenderer
-
clearIgnoreListAction
-
closeAction
-
closeButton
-
collapseAction
-
collapseButton
-
editLoggerAction
-
editLoggerButton
-
expandAction
-
findAction
-
clearFindNextAction
-
defineColorRuleForLoggerAction
-
setRefineFocusAction
-
updateRefineFocusAction
-
updateFindAction
-
expandButton
-
focusOnAction
-
clearRefineFocusAction
-
focusOnLoggerButton
-
hideAction
-
hideSubLoggersAction
-
preferenceModel
-
ignoreList
-
ignoreExpressionEntryField
-
alwaysDisplayExpressionEntryField
-
ignoreListScroll
-
ignoreDialog
-
ignoreExpressionDialog
-
alwaysDisplayExpressionDialog
-
ignoreSummary
-
ignoreExpressionSummary
-
alwaysDisplayExpressionSummary
-
ignoreLoggerButton
-
listenerList
-
logTree
-
logger
private final org.apache.log4j.Logger logger -
logTreeModel
-
popupListener
-
popupMenu
-
visibilityRuleDelegate
-
colorRuleDelegate
private org.apache.log4j.rule.Rule colorRuleDelegate -
scrollTree
-
toolbar
-
logPanel
-
colorizer
-
ignoreExpressionRule
private org.apache.log4j.rule.Rule ignoreExpressionRule -
alwaysDisplayExpressionRule
private org.apache.log4j.rule.Rule alwaysDisplayExpressionRule -
expandRootLatch
private boolean expandRootLatch -
currentlySelectedLoggerName
-
-
Constructor Details
-
LoggerNameTreePanel
LoggerNameTreePanel(LogPanelLoggerTreeModel logTreeModel, LogPanelPreferenceModel preferenceModel, LogPanel logPanel, RuleColorizer colorizer, FilterModel filterModel) Creates a new LoggerNameTreePanel object.- Parameters:
logTreeModel
-
-
-
Method Details
-
updateIgnoreExpression
-
updateAlwaysDisplayExpression
-
addChangeListener
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
DOCUMENT ME!- Parameters:
l
- DOCUMENT ME!
-
setFocusOn
Ensures the Focus is set to a specific logger name -
isHiddenLogger
-
toggleHiddenLogger
DOCUMENT ME!- Parameters:
logger
-
-
getCurrentlySelectedLoggerName
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
Returns the full- Parameters:
path
- DOCUMENT ME!- Returns:
-
ignore
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
DOCUMENT ME!- Returns:
-
createCloseAction
An action that closes (hides) this panel- Returns:
-
createCollapseAction
DOCUMENT ME!- Returns:
-
createEditLoggerAction
-
createExpandAction
Creates an action that is used to expand the selected node and all children- Returns:
- an 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
-
createUpdateRefineFocusAction
-
createUpdateFindAction
-
updateFindUsingCurrentlySelectedNode
private void updateFindUsingCurrentlySelectedNode() -
updateRefineFocusUsingCurrentlySelectedNode
private void updateRefineFocusUsingCurrentlySelectedNode() -
setRefineFocusUsingCurrentlySelectedNode
private void setRefineFocusUsingCurrentlySelectedNode() -
createDefineColorRuleForLoggerAction
-
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
-
createFocusOnAction
DOCUMENT ME!- Returns:
-
createIgnoreAllAction
DOCUMENT ME!- Returns:
-
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
-
getHiddenExpression
-
setHiddenExpression
-
getAlwaysDisplayExpression
-
setAlwaysDisplayExpression
-
loggerNameAdded
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 interfaceLoggerNameListener
- Parameters:
loggerName
- the new, unique loggerName
-
reset
public void reset()Description copied from interface:LoggerNameListener
Logger names were reset (used to clear the tree model)- Specified by:
reset
in interfaceLoggerNameListener
-