Class MessageCenter
java.lang.Object
org.apache.log4j.chainsaw.messages.MessageCenter
The MessageCenter is central place for all elements within Chainsaw to
notify the user of important information.
This class uses log4j itself quite significantly. All user message are sent to this classes log4j Logger (org.apache.log4j.chainsaw.message.MessageCenter).
To register a message with the user, you can use the addMessage(String) style methods on this class, or just as easily, get a handle to this class' logger, and log it as you would normally do.
All events to this logger are trapped within a Custom appender (additivity will be switched OFF), which stores the events in a ListModel.
You can invoke the setVisible() method to display all the messages
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classThis class simply renders an event by delegating the effort to a Log4j layout instance. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ListModelAppenderprivate Actionprivate final JPanelprivate static final MessageCenterprivate org.apache.log4j.Layoutprivate ListCellRendererprivate final org.apache.log4j.Loggerprivate final JList<org.apache.log4j.spi.LoggingEvent> private JScrollPaneprivate PopupListenerprivate JPopupMenuprivate PropertyChangeSupportprivate final JToolBar -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(String message) final JComponentstatic MessageCenterfinal org.apache.log4j.Layoutfinal org.apache.log4j.LoggerReturns the logger that can be used to log messages to display within the Message Center.ListModel<org.apache.log4j.spi.LoggingEvent> getModel()final voidsetLayout(org.apache.log4j.Layout layout) private voidprivate voidprivate voidprivate voidprivate voidprivate voidprivate void
-
Field Details
-
instance
-
logger
private final org.apache.log4j.Logger logger -
layout
private org.apache.log4j.Layout layout -
messageList
-
appender
-
listCellRenderer
-
propertySupport
-
pane
-
toolbar
-
popupMenu
-
popupListener
-
clearAction
-
componentPanel
-
-
Constructor Details
-
MessageCenter
private MessageCenter()
-
-
Method Details
-
setupPopMenu
private void setupPopMenu() -
setupToolbar
private void setupToolbar() -
setupActions
private void setupActions() -
setupListeners
private void setupListeners() -
updateActions
private void updateActions() -
setupLogger
private void setupLogger() -
setupComponentPanel
private void setupComponentPanel() -
getGUIComponent
-
getModel
-
getInstance
-
addMessage
-
getLayout
public final org.apache.log4j.Layout getLayout()- Returns:
- Returns the layout used by the MessageCenter.
-
setLayout
public final void setLayout(org.apache.log4j.Layout layout) - Parameters:
layout- Sets the layout to be used by the MessageCenter .
-
getLogger
public final org.apache.log4j.Logger getLogger()Returns the logger that can be used to log messages to display within the Message Center.- Returns:
- logger
-