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 classDOCUMENT ME!private classprivate final classprivate final class(package private) classNested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JDialogprivate final JEditorPaneprivate org.apache.log4j.rule.Ruleprivate final JLabelprivate final Actionprivate final Actionprivate final Actionprivate final Actionprivate final JButtonprivate final Actionprivate final JButtonprivate final RuleColorizerprivate org.apache.log4j.rule.Ruleprivate Stringprivate final Actionprivate final Actionprivate final JButtonprivate final Actionprivate final JButtonprivate booleanprivate final Actionprivate final Actionprivate final SmallToggleButtonprivate final Setprivate final Actionprivate final Actionprivate final JDialogprivate final JDialogprivate final JEditorPaneprivate org.apache.log4j.rule.Ruleprivate final JLabelprivate final JListprivate final JScrollPaneprivate final SmallToggleButtonprivate final JLabelprivate final EventListenerListprivate final org.apache.log4j.Loggerprivate final LogPanelprivate final JTreeprivate final LogPanelLoggerTreeModelprivate final PopupListenerprivate final LoggerNameTreePanel.LoggerTreePopupMenuprivate final LogPanelPreferenceModelprivate final JScrollPaneprivate final Actionprivate final JToolBarprivate final Actionprivate final Actionprivate final LoggerNameTreePanel.VisibilityRuleDelegateprivate static final intFields inherited from class JComponent
TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface 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 TypeMethodDescriptionvoidAdds a change Listener to this LoggerNameTreePanel to be notfied when the State of the Focus or Hidden details have changed.private voidprivate voidprivate voidGiven the currently selected nodes collapses all the children of those nodes.private voidconfigures all the components that are used in the mini-toolbar of this componentprivate ActionCreates 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 ActionDOCUMENT ME!private Actionprivate ActionAn action that closes (hides) this panelprivate ActionDOCUMENT ME!private Actionprivate Actionprivate ActionCreates an action that is used to expand the selected node and all childrenprivate ActionCreates 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 ActionDOCUMENT ME!private ActionDOCUMENT ME!private ActionDOCUMENT ME!private Actionprivate Actionprivate Actionprivate voidprivate voidExpands the currently selected node (if any) including all the children.private voidprivate void(package private) StringReturns 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) StringgetLoggerName(TreePath path) Returns the fullorg.apache.log4j.rule.Rule(package private) voidignore(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) booleanReturns true if the FocusOn element has been selectedprivate booleanisHiddenLogger(String loggerName) voidloggerNameAdded(String loggerName) Called by LoggerNameModel instances when a new unique Logger name string has been introduced into the modelprivate voidvoidDOCUMENT ME!voidreset()Logger names were reset (used to clear the tree model)voidsetAlwaysDisplayExpression(String alwaysDisplayExpression) voidsetFocusOn(String newLogger) Ensures the Focus is set to a specific logger name(package private) voidsetFocusOnSelected(boolean selected) voidsetHiddenExpression(String hiddenExpression) private voidprivate voidConfigures varoius listeners etc for the components within this Class.private voidprotected voidtoggleHiddenLogger(String logger) DOCUMENT ME!private booleanupdateAlwaysDisplayExpression(String alwaysDisplayText) private voidprivate voidprivate voidprivate voidprivate booleanupdateIgnoreExpression(String ignoreText) private voidprivate voidprivate voidMethods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class 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, updateMethods inherited from class 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, validateTreeMethods inherited from class 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
-
setFocusOn
Ensures the Focus is set to a specific logger name -
isHiddenLogger
-
toggleHiddenLogger
-
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
-
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
-
createCloseAction
-
createCollapseAction
-
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
-
createIgnoreAllAction
-
createIgnoreAction
-
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:LoggerNameListenerCalled by LoggerNameModel instances when a new unique Logger name string has been introduced into the model- Specified by:
loggerNameAddedin interfaceLoggerNameListener- Parameters:
loggerName- the new, unique loggerName
-
reset
public void reset()Description copied from interface:LoggerNameListenerLogger names were reset (used to clear the tree model)- Specified by:
resetin interfaceLoggerNameListener
-