org.apache.log4j.chainsaw.messages
Class MessageCenter

java.lang.Object
  extended by org.apache.log4j.chainsaw.messages.MessageCenter

public class MessageCenter
extends java.lang.Object

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

Author:
Paul Smith

Method Summary
 void addMessage(java.lang.String message)
           
 javax.swing.JComponent getGUIComponent()
           
static MessageCenter getInstance()
           
 org.apache.log4j.Layout getLayout()
           
 org.apache.log4j.Logger getLogger()
          Returns the logger that can be used to log messages to display within the Message Center.
 javax.swing.ListModel getModel()
           
 void setLayout(org.apache.log4j.Layout layout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGUIComponent

public final javax.swing.JComponent getGUIComponent()

getModel

public javax.swing.ListModel getModel()

getInstance

public static MessageCenter getInstance()

addMessage

public void addMessage(java.lang.String message)

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


Copyright © 2007 Apache Software Foundation. All Rights Reserved.