|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ccg.swing.LogEditor
public class LogEditor
Provides a graphical user interface component
to a LogModel.
This class provides a graphical interface which the user can
interact with to view/control the log and/or debug verbosity levels
of a LogModel object.
Typically use of this object involves:
system log model or non-system log model.applied immediately, or only when you invoke
the apply method directly.graphical component used to
represent the interface and add it to your own container.automatic
apply, you are done (everything else should be automatic). If you
chose not to enable the "automatic apply", you will then need to
invoke the apply method when you want the user's
current choices to be applied to the associated model (you might do
this if you added the component to a dialog box that has a
"OK/Apply/Cancel/Revert" type of interface.To see a working example of using the LogModel,
DefaultLogModel, SystemLogModel and LogEditor objects in
combination, take a look at LogTest.java.
LogModel,
DefaultLogModel,
SystemLogModel.getInstance()| Constructor Summary | |
|---|---|
LogEditor(LogModel lm)
Construct the object and associate a LogModel object. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener cl)
Add a new listener which is notified if the state of the object is changed by the user. |
void |
apply()
Applies the current values of the graphical
object to the associated LogModel. |
JComponent |
getComponent()
Get the graphical component used to view and
control the state of the associated LogModel. |
LogModel |
getLogModel()
Access the LogModel associated with the editor. |
boolean |
isAutoApplyEnabled()
Are changes to the interface automatically applied as soon as the user chooses them set? |
void |
removeChangeListener(ChangeListener cl)
Remove a change listener (stop it from being notified of change events). |
void |
reset()
Resets the current values of the graphical
object to match the associated LogModel. |
void |
setAutoApplyEnabled(boolean val)
Specify whether changes to the interface automatically applied as soon as the user chooses them. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogEditor(LogModel lm)
LogModel object.
lm - The LogModel to be associated with the graphical component. Must NOT be null.setAutoApplyEnabled(boolean),
getComponent()| Method Detail |
|---|
public LogModel getLogModel()
LogModel associated with the editor.
LogModel which
this editor allows the user to adjust.public JComponent getComponent()
graphical component used to view and
control the state of the associated LogModel.
This method returns the graphical component
which the user will use to view the state of the log/debug levels
and to adjust these states.
The first invocation constructs and returns the graphical component, all subsequent invocations will return the same reference as the first invocation (only one graphical component is ever created by a instance of this object).
LogModel.public void reset()
graphical
object to match the associated LogModel.
public void apply()
graphical
object to the associated LogModel.
public void setAutoApplyEnabled(boolean val)
val - true if you want user choices applied as soon as they are
made, false if not.isAutoApplyEnabled()public boolean isAutoApplyEnabled()
setAutoApplyEnabled(boolean)public void addChangeListener(ChangeListener cl)
Once registered, your change listener will be notified if the user changes EITHER the debug or log level. The source associated with the ChangeEvent will be the LogEditor object associated.
cl - The ChangeListener to register - should not be null.removeChangeListener(javax.swing.event.ChangeListener)public void removeChangeListener(ChangeListener cl)
cl - The ChangeListener to de-register - should not be null.addChangeListener(javax.swing.event.ChangeListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||