Class LogUI

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, ChainsawViewer, SettingsListener

public class LogUI extends JFrame implements ChainsawViewer, SettingsListener
The main entry point for Chainsaw, this class represents the first frame that is used to display a Welcome panel, and any other panels that are generated because Logging Events are streamed via a Receiver, or other mechanism.

NOTE: Some of Chainsaw's application initialization should be performed prior to activating receivers and the logging framework used to perform self-logging.

DELAY as much as possible the logging framework initialization process, currently initialized by the creation of a ChainsawAppenderHandler.

Author:
Scott Deboy <sdeboy@apache.org>, Paul Smith <psmith@apache.org>
See Also:
  • Constructor Details

    • LogUI

      public LogUI()
      Constructor which builds up all the visual elements of the frame including the Menu bar
  • Method Details

    • addShutdownListener

      public void addShutdownListener(ShutdownListener l)
      Registers a ShutdownListener with this calss so that it can be notified when the user has requested that Chainsaw exit.
      Parameters:
      l -
    • removeShutdownListener

      public void removeShutdownListener(ShutdownListener l)
      Removes the registered ShutdownListener so that the listener will not be notified on a shutdown.
      Parameters:
      l -
    • main

      public static void main(String[] args)
      Starts Chainsaw by attaching a new instance to the Log4J main root Logger via a ChainsawAppender, and activates itself
      Parameters:
      args -
    • createChainsawGUI

      public static void createChainsawGUI(ApplicationPreferenceModel model, Action newShutdownAction)
      Creates, activates, and then shows the Chainsaw GUI, optionally showing the splash screen, and using the passed shutdown action when the user requests to exit the application (if null, then Chainsaw will exit the vm)
      Parameters:
      model -
      newShutdownAction - DOCUMENT ME!
    • activateViewer

      public void activateViewer(ChainsawAppender appender)
      Allow Chainsaw v2 to be ran in-process (configured as a ChainsawAppender) NOTE: Closing Chainsaw will NOT stop the application generating the events.
      Specified by:
      activateViewer in interface ChainsawViewer
      Parameters:
      appender -
    • loadSettings

      public void loadSettings(LoadSettingsEvent event)
      Given the load event, configures the size/location of the main window etc etc.
      Specified by:
      loadSettings in interface SettingsListener
      Parameters:
      event - DOCUMENT ME!
    • saveSettings

      public void saveSettings(SaveSettingsEvent event)
      Ensures the location/size of the main window is stored with the settings
      Specified by:
      saveSettings in interface SettingsListener
      Parameters:
      event - DOCUMENT ME!
    • activateViewer

      public void activateViewer()
      Activates itself as a viewer by configuring Size, and location of itself, and configures the default Tabbed Pane elements with the correct layout, table columns, and sets itself viewable.
    • exit

      public boolean exit()
      Exits the application, ensuring Settings are saved.
    • showApplicationPreferences

      public void showApplicationPreferences()
    • showReceiverConfiguration

      public void showReceiverConfiguration()
    • showAboutBox

      public void showAboutBox()
    • shutdown

      public boolean shutdown()
      Shutsdown by ensuring the Appender gets a chance to close.
    • setShutdownAction

      public final void setShutdownAction(Action shutdownAction)
      Configures LogUI's with an action to execute when the user requests to exit the application, the default action is to exit the VM. This Action is called AFTER all the ShutdownListeners have been notified
      Parameters:
      shutdownAction -
    • getActiveTabName

      public String getActiveTabName()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • showHelp

      public void showHelp(URL url)
      Causes the Welcome Panel to become visible, and shows the URL specified as it's contents
      Parameters:
      url - for content to show
    • isLogTreePanelVisible

      public boolean isLogTreePanelVisible()
      DOCUMENT ME!
      Returns:
      log tree panel visible flag
    • getPanelMap

      public Map<String, Component> getPanelMap()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getSettingsManager

      public SettingsManager getSettingsManager()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getFilterableColumns

      public List<String> getFilterableColumns()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setToolBarAndMenus

      public void setToolBarAndMenus(org.apache.log4j.chainsaw.ChainsawToolBarAndMenus tbms)
      DOCUMENT ME!
      Parameters:
      tbms - DOCUMENT ME!
    • getToolBarAndMenus

      public org.apache.log4j.chainsaw.ChainsawToolBarAndMenus getToolBarAndMenus()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getTableMap

      public Map getTableMap()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getTableModelMap

      public Map getTableModelMap()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setTabbedPane

      public void setTabbedPane(org.apache.log4j.chainsaw.ChainsawTabbedPane tabbedPane)
      DOCUMENT ME!
      Parameters:
      tabbedPane - DOCUMENT ME!
    • getTabbedPane

      public org.apache.log4j.chainsaw.ChainsawTabbedPane getTabbedPane()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getApplicationPreferenceModel

      public final ApplicationPreferenceModel getApplicationPreferenceModel()
      Returns:
      Returns the applicationPreferenceModel.
    • setupTutorial

      public void setupTutorial()
      DOCUMENT ME!
    • createCustomExpressionLogPanel

      public void createCustomExpressionLogPanel(String ident)