|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.qfs.apps.qflog.logview.LogLevelTreeModel
TreeModel for the display of log levels for the Loggers used in an application.
Inner Class Summary | |
static class |
LogLevelTreeModel.UnitTest
Test cases for the LogLevelTreeModel class. |
Constructor Summary | |
LogLevelTreeModel()
Create a new LogLevelTreeModel. |
Method Summary | |
void |
addTreeModelListener(javax.swing.event.TreeModelListener listener)
Add a TreeModelListener to the LogLevelTreeModel. |
void |
classAdded(de.qfs.lib.log.LogLevelEvent event)
Notify the listener that a Logger for a formerly unknown class has requested its log level, adding the class to the log level tree. |
void |
cleanup()
Try to remove everything that might prevent garbage collection. |
void |
finalize()
Finalize the LogLevelTreeModel. |
void |
fireNodesChanged(java.lang.Object[] path)
Tell the TreeModelListeners that a node was modified. |
void |
fireNodesInserted(java.lang.Object[] path,
int index)
Tell the TreeModelListeners that a node was inserted. |
void |
fireNodeStructureChanged(java.lang.Object[] path)
Tell the TreeModelListeners that the structure changed. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Get a child of a node from the tree. |
int |
getChildCount(java.lang.Object parent)
Get number of children of a node. |
java.lang.String |
getClazz(java.lang.Object node)
Get the class/package of a node. |
java.lang.String |
getConfigurableName()
Get the Configurable's name. |
java.util.Properties |
getConfigurableState()
Get the Configurable's state. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
Get the index of node's child. |
java.lang.Integer |
getLevel(java.lang.Object node)
Get the level of a node. |
de.qfs.lib.option.OptionSet |
getOptions()
Get the options of the LogLevelTreeModel. |
java.lang.Object[] |
getPath(java.lang.String clazz)
Get the path for a node representing a package or class. |
java.lang.Object |
getRoot()
Get the root node of the tree. |
java.lang.String |
getRootName()
Get the name for the root node. |
boolean |
isLeaf(java.lang.Object node)
Determine, whether a node is a leaf. |
void |
levelChanged(de.qfs.lib.log.LogLevelEvent event)
Notify the listener that a log level has been changed. |
void |
levelChangedImpl(java.lang.String name,
int level)
Notify the listener that a log level has been changed. |
void |
levelRemoved(de.qfs.lib.log.LogLevelEvent event)
Notify the listener that a log level has been unset. |
void |
levelRemovedImpl(java.lang.String name)
Notify the listener that a log level has been unset. |
void |
registrationChanged(de.qfs.lib.config.Configuration config,
java.lang.String name,
boolean registered,
boolean valuesKept)
This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes. |
void |
removeLogLevel(javax.swing.tree.TreePath path,
boolean recurse)
Remove the log level for a node in the tree. |
void |
removeTreeModelListener(javax.swing.event.TreeModelListener listener)
Remove a TreeModelListener from the LogLevelTreeModel. |
void |
setConfigurableName(java.lang.String name)
Set the Configurable's name. |
void |
setConfigurableState(java.util.Properties state)
Set the Configurable's state. |
void |
setLoggingEnabled(boolean enable)
Enable or disable logging output caused directly or indirectly by LogLevelTreeModel methods. |
void |
setLogLevel(javax.swing.tree.TreePath path,
int level)
Set the log level for a node in the tree. |
void |
setLogLevelCallback(de.qfs.lib.log.LogLevelCallback callback)
Sets the LogLevelCallback for the LogLevelListener. |
void |
setRootName(java.lang.String name)
Set the name for the root node. |
void |
update(java.util.Observable obj,
java.lang.Object arg)
Notify the LogLevelTreeModel that one of its Observables has changed. |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
Update a node. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public LogLevelTreeModel()
Method Detail |
public void cleanup()
public void finalize()
public final java.lang.String getRootName()
public final void setRootName(java.lang.String name)
name
- The root node's new name.public final void setLoggingEnabled(boolean enable)
de.qfs.lib.log.Log.excludeThread
.
This is necessary, if the LogFilterTreeModel is used inside the
application whose logs it is supposed to filter. The default value is false.
enable
- True to enable logging, false to disable it.public java.lang.Object[] getPath(java.lang.String clazz)
clazz
- The package/class name.public final de.qfs.lib.option.OptionSet getOptions()
public void setLogLevel(javax.swing.tree.TreePath path, int level)
This method is not thread safe and must be called from the AWT event loop. The update of the LogLevelCallback is delegated to a background task and will not block the event loop.
path
- The TreePath defining the node.level
- The new log level to set.public void removeLogLevel(javax.swing.tree.TreePath path, boolean recurse)
This method is not thread safe and must be called from the AWT event loop. The update of the LogLevelCallback is delegated to a background task and will not block the event loop.
path
- The TreePath defining the node.recurse
- Whether to remove the level on all subnodes.public void classAdded(de.qfs.lib.log.LogLevelEvent event)
event
- The LogLevelEvent holding the details.public void levelChanged(de.qfs.lib.log.LogLevelEvent event)
event
- The LogLevelEvent holding the details.public void levelChangedImpl(java.lang.String name, int level)
name
- The name of the affected class or package.level
- The new log level.public void levelRemoved(de.qfs.lib.log.LogLevelEvent event)
event
- The LogLevelEvent holding the details.public void levelRemovedImpl(java.lang.String name)
name
- The name of the affected class or package.public void setLogLevelCallback(de.qfs.lib.log.LogLevelCallback callback)
callback
- The LogLevelCallback to use to change the
log levels.public java.lang.String getConfigurableName()
public void setConfigurableName(java.lang.String name)
name
- The name to set.public java.util.Properties getConfigurableState()
public void setConfigurableState(java.util.Properties state)
state
- The state to set.public void registrationChanged(de.qfs.lib.config.Configuration config, java.lang.String name, boolean registered, boolean valuesKept)
config
- The affected Configuration.name
- The registration name of the Configurable which may
be different from the Configurable's name.registered
- True if the Configurable was just registered,
false if it was unregistered.valuesKept
- Whether the Configurable's values were kept, if
it was just unregistered.public void addTreeModelListener(javax.swing.event.TreeModelListener listener)
listener
- The listener to add.public void removeTreeModelListener(javax.swing.event.TreeModelListener listener)
listener
- The listener to remove.public java.lang.Object getChild(java.lang.Object parent, int index)
parent
- The parent node.index
- The index of the child in the parent.public int getChildCount(java.lang.Object parent)
parent
- The parent node.public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
parent
- The parent node.child
- The child node.public java.lang.Object getRoot()
public boolean isLeaf(java.lang.Object node)
node
- The Node to check.public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
path
- The path of the changed node.newValue
- The new value of the node.public void fireNodesInserted(java.lang.Object[] path, int index)
path
- The path of the parent node.index
- The index of the new child.public void fireNodesChanged(java.lang.Object[] path)
path
- The path of the modified node.public void fireNodeStructureChanged(java.lang.Object[] path)
path
- The path to the root of the structure change.public java.lang.String getClazz(java.lang.Object node)
node
- The node to query.public java.lang.Integer getLevel(java.lang.Object node)
node
- The node to query.public void update(java.util.Observable obj, java.lang.Object arg)
obj
- The Observable that changed.arg
- Details about the change.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |