logahawk.swing
Class JOptionPaneListener
java.lang.Object
logahawk.swing.JOptionPaneListener
- All Implemented Interfaces:
- Listener
public class JOptionPaneListener
- extends Object
- implements Listener
Displays a JOptionPane
message dialog for each log message. It is HIGHLY RECOMMENDED that this be used with
the following classes:
SeverityFilterLogger
, SeverityFilter
, or some other FilterLogger
or
FilterListener
to avoid bombarding the user with an endless parade of log messages.
LengthTruncatingListener
to overloading the user with an extremely wordy message.
LineTruncatingListener
to keep the dialog reasonably sized (if its too long the OK button will go off
screen).
EventDispatchThreadListener
to enforce that this executes only on the EDT.
- See Also:
JOptionPane.showMessageDialog(Component, Object)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parent
protected final JComponent parent
- Used as the "parentComponent" argument of the call to
JOptionPane.showMessageDialog(Component,
Object)
s.
JOptionPaneListener
public JOptionPaneListener(JComponent parent)
log
public void log(LogMeta meta,
String text)
- Description copied from interface:
Listener
- Logs the provided statement.
Normally this method should not throw any exceptions. If exceptions are expected it is recommend to wrap this
Listener with a FailSafeListener.
- Specified by:
log
in interface Listener
getMessageType
protected int getMessageType(Severity severity)
- Returns the following: