public class

LogBrokerMonitor

extends Object
java.lang.Object
   ↳ org.apache.log4j.lf5.viewer.LogBrokerMonitor

Class Overview

LogBrokerMonitor .

Summary

Constants
String DETAILED_VIEW
Fields
protected String _NDCTextFilter
protected boolean _callSystemExitOnClose
protected CategoryExplorerTree _categoryExplorerTree
protected List _columns
protected ConfigurationManager _configurationManager
protected String _currentView
protected List _displayedLogBrokerProperties
protected File _fileLocation
protected String _fontName
protected int _fontSize
protected JComboBox _fontSizeCombo
protected boolean _isDisposed
protected Dimension _lastTableViewportSize
protected LogLevel _leastSevereDisplayedLogLevel
protected List _levels
protected boolean _loadSystemFonts
protected Object _lock
protected Map _logLevelMenuItems
protected JFrame _logMonitorFrame
protected int _logMonitorFrameHeight
protected int _logMonitorFrameWidth
protected Map _logTableColumnMenuItems
protected JScrollPane _logTableScrollPane
protected MRUFileManager _mruFileManager
protected String _searchText
protected JLabel _statusLabel
protected LogTable _table
protected boolean _trackTableScrollPane
Public Constructors
LogBrokerMonitor(List logLevels)
Construct a LogBrokerMonitor.
Public Methods
void addDisplayedProperty(Object messageLine)
void addMessage(LogRecord lr)
Add a log record message to be displayed in the LogTable.
void dispose()
Dispose of the frame for the LogBrokerMonitor.
JFrame getBaseFrame()
boolean getCallSystemExitOnClose()
Get the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.
CategoryExplorerTree getCategoryExplorerTree()
DateFormatManager getDateFormatManager()
Get the DateFormatManager for formatting dates.
Map getLogLevelMenuItems()
Map getLogTableColumnMenuItems()
String getNDCTextFilter()
JCheckBoxMenuItem getTableColumnMenuItem(LogTableColumn column)
void hide()
Hide the frame for the LogBrokerMonitor.
void setCallSystemExitOnClose(boolean callSystemExitOnClose)
Set the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.
void setDateFormatManager(DateFormatManager dfm)
Set the date format manager for formatting dates.
void setFontSize(int fontSize)
void setFrameSize(int width, int height)
void setMaxNumberOfLogRecords(int maxNumberOfLogRecords)
void setNDCLogRecordFilter(String textFilter)
void setTitle(String title)
void show(int delay)
Show the frame for the LogBrokerMonitor.
void show()
Protected Methods
void addTableModelProperties()
void centerFrame(JFrame frame)
int changeFontSizeCombo(JComboBox box, int requestedSize)
Changes the font selection in the combo box and returns the size actually selected.
void clearDetailTextArea()
void closeAfterConfirm()
JMenuItem createAllLogLevelsMenuItem()
JMenuItem createAllLogTableColumnsMenuItem()
JMenuItem createCloseMI()
JMenuItem createConfigureMaxRecords()
JMenu createConfigureMenu()
JMenuItem createConfigureReset()
JMenuItem createConfigureSave()
JTextArea createDetailTextArea()
JMenuItem createEditFindMI()
JMenuItem createEditFindNextMI()
JMenu createEditMenu()
JMenuItem createEditRestoreAllNDCMI()
JMenuItem createEditSortNDCMI()
JMenuItem createExitMI()
JMenu createFileMenu()
JMenu createHelpMenu()
JMenuItem createHelpProperties()
JMenu createLogLevelColorMenu()
JComboBox createLogLevelCombo()
JMenu createLogLevelMenu()
LogRecordFilter createLogRecordFilter()
JCheckBoxMenuItem createLogTableColumnMenuItem(LogTableColumn column)
void createMRUFileListMI(JMenu menu)
Creates a Most Recently Used file list to be displayed in the File menu
JMenuBar createMenuBar()
JCheckBoxMenuItem createMenuItem(LogLevel level)
LogRecordFilter createNDCLogRecordFilter(String text)
JMenuItem createNoLogLevelsMenuItem()
JMenuItem createNoLogTableColumnsMenuItem()
JMenuItem createOpenMI()
Menu item added to allow log files to be opened with the LF5 GUI.
JMenuItem createOpenURLMI()
Menu item added to allow log files loaded from a URL to be opened by the LF5 GUI.
JMenuItem createResetLogLevelColorMenuItem()
JPanel createStatusArea()
JMenuItem createSubMenuItem(LogLevel level)
JToolBar createToolBar()
JMenu createViewMenu()
int findRecord(int startRow, String searchText, List records)
void findSearchText()
int getFirstSelectedRow()
Iterator getLogLevels()
JCheckBoxMenuItem getLogTableColumnMenuItem(LogTableColumn column)
Iterator getLogTableColumns()
JCheckBoxMenuItem getMenuItem(LogLevel level)
String getRecordsDisplayedMessage()
String getStatusText(int displayedRows, int totalRows)
void initComponents()
boolean loadLogFile(URL url)
Loads a parses a log file running on a server.
boolean loadLogFile(File file)
Loads and parses a log file.
void makeLogTableListenToCategoryExplorer()
boolean matches(LogRecord record, String text)
Check to see if the any records contain the search string.
void pause(int millis)
void refresh(JTextArea textArea)
When the fontsize of a JTextArea is changed, the word-wrapped lines may become garbled.
void refreshDetailTextArea()
void requestClose()
void requestExit()
void requestOpen()
Uses a JFileChooser to select a file to opened with the LF5 GUI.
void requestOpenMRU(ActionEvent e)
Opens a file in the MRU list.
void requestOpenURL()
Uses a Dialog box to accept a URL to a file to be opened with the LF5 GUI.
void resetConfiguration()
void saveConfiguration()
void selectAllLogLevels(boolean selected)
void selectAllLogTableColumns(boolean selected)
void selectRow(int foundRow)
void setFontSize(Component component, int fontSize)
void setFontSizeSilently(int fontSize)
Does not update gui or cause any events to be fired.
void setLeastSevereDisplayedLogLevel(LogLevel level)
void setMaxRecordConfiguration()
void setNDCTextFilter(String text)
void setSearchText(String text)
void setView(String viewString, LogTable table)
void showLogLevelColorChangeDialog(JMenuItem result, LogLevel level)
void showPropertiesDialog(String title)
void sortByNDC()
void trackTableScrollPane()
This method is deprecated. tracking is now done automatically.
void updateFrameSize()
void updateMRUList()
Removes old file list and creates a new file list with the updated MRU list.
void updateStatusLabel()
List updateView()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String DETAILED_VIEW

Constant Value: "Detailed"

Fields

protected String _NDCTextFilter

protected boolean _callSystemExitOnClose

protected CategoryExplorerTree _categoryExplorerTree

protected List _columns

protected ConfigurationManager _configurationManager

protected String _currentView

protected List _displayedLogBrokerProperties

protected File _fileLocation

protected String _fontName

protected int _fontSize

protected JComboBox _fontSizeCombo

protected boolean _isDisposed

protected Dimension _lastTableViewportSize

protected LogLevel _leastSevereDisplayedLogLevel

protected List _levels

protected boolean _loadSystemFonts

protected Object _lock

protected Map _logLevelMenuItems

protected JFrame _logMonitorFrame

protected int _logMonitorFrameHeight

protected int _logMonitorFrameWidth

protected Map _logTableColumnMenuItems

protected JScrollPane _logTableScrollPane

protected MRUFileManager _mruFileManager

protected String _searchText

protected JLabel _statusLabel

protected LogTable _table

protected boolean _trackTableScrollPane

Public Constructors

public LogBrokerMonitor (List logLevels)

Construct a LogBrokerMonitor.

Public Methods

public void addDisplayedProperty (Object messageLine)

public void addMessage (LogRecord lr)

Add a log record message to be displayed in the LogTable. This method is thread-safe as it posts requests to the SwingThread rather than processing directly.

public void dispose ()

Dispose of the frame for the LogBrokerMonitor.

public JFrame getBaseFrame ()

public boolean getCallSystemExitOnClose ()

Get the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.

public CategoryExplorerTree getCategoryExplorerTree ()

public DateFormatManager getDateFormatManager ()

Get the DateFormatManager for formatting dates.

public Map getLogLevelMenuItems ()

public Map getLogTableColumnMenuItems ()

public String getNDCTextFilter ()

public JCheckBoxMenuItem getTableColumnMenuItem (LogTableColumn column)

public void hide ()

Hide the frame for the LogBrokerMonitor.

public void setCallSystemExitOnClose (boolean callSystemExitOnClose)

Set the value of whether or not System.exit() will be called when the LogBrokerMonitor is closed.

public void setDateFormatManager (DateFormatManager dfm)

Set the date format manager for formatting dates.

public void setFontSize (int fontSize)

public void setFrameSize (int width, int height)

public void setMaxNumberOfLogRecords (int maxNumberOfLogRecords)

public void setNDCLogRecordFilter (String textFilter)

public void setTitle (String title)

public void show (int delay)

Show the frame for the LogBrokerMonitor. Dispatched to the swing thread.

public void show ()

Protected Methods

protected void addTableModelProperties ()

protected void centerFrame (JFrame frame)

protected int changeFontSizeCombo (JComboBox box, int requestedSize)

Changes the font selection in the combo box and returns the size actually selected.

Returns
  • -1 if unable to select an appropriate font

protected void clearDetailTextArea ()

protected void closeAfterConfirm ()

protected JMenuItem createAllLogLevelsMenuItem ()

protected JMenuItem createAllLogTableColumnsMenuItem ()

protected JMenuItem createCloseMI ()

protected JMenuItem createConfigureMaxRecords ()

protected JMenu createConfigureMenu ()

protected JMenuItem createConfigureReset ()

protected JMenuItem createConfigureSave ()

protected JTextArea createDetailTextArea ()

protected JMenuItem createEditFindMI ()

protected JMenuItem createEditFindNextMI ()

protected JMenu createEditMenu ()

protected JMenuItem createEditRestoreAllNDCMI ()

protected JMenuItem createEditSortNDCMI ()

protected JMenuItem createExitMI ()

protected JMenu createFileMenu ()

protected JMenu createHelpMenu ()

protected JMenuItem createHelpProperties ()

protected JMenu createLogLevelColorMenu ()

protected JComboBox createLogLevelCombo ()

protected JMenu createLogLevelMenu ()

protected LogRecordFilter createLogRecordFilter ()

protected JCheckBoxMenuItem createLogTableColumnMenuItem (LogTableColumn column)

protected void createMRUFileListMI (JMenu menu)

Creates a Most Recently Used file list to be displayed in the File menu

protected JMenuBar createMenuBar ()

protected JCheckBoxMenuItem createMenuItem (LogLevel level)

protected LogRecordFilter createNDCLogRecordFilter (String text)

protected JMenuItem createNoLogLevelsMenuItem ()

protected JMenuItem createNoLogTableColumnsMenuItem ()

protected JMenuItem createOpenMI ()

Menu item added to allow log files to be opened with the LF5 GUI.

protected JMenuItem createOpenURLMI ()

Menu item added to allow log files loaded from a URL to be opened by the LF5 GUI.

protected JMenuItem createResetLogLevelColorMenuItem ()

protected JPanel createStatusArea ()

protected JMenuItem createSubMenuItem (LogLevel level)

protected JToolBar createToolBar ()

protected JMenu createViewMenu ()

protected int findRecord (int startRow, String searchText, List records)

protected void findSearchText ()

protected int getFirstSelectedRow ()

protected Iterator getLogLevels ()

protected JCheckBoxMenuItem getLogTableColumnMenuItem (LogTableColumn column)

protected Iterator getLogTableColumns ()

protected JCheckBoxMenuItem getMenuItem (LogLevel level)

protected String getRecordsDisplayedMessage ()

protected String getStatusText (int displayedRows, int totalRows)

protected void initComponents ()

protected boolean loadLogFile (URL url)

Loads a parses a log file running on a server.

protected boolean loadLogFile (File file)

Loads and parses a log file.

protected void makeLogTableListenToCategoryExplorer ()

protected boolean matches (LogRecord record, String text)

Check to see if the any records contain the search string. Searching now supports NDC messages and date.

protected void pause (int millis)

protected void refresh (JTextArea textArea)

When the fontsize of a JTextArea is changed, the word-wrapped lines may become garbled. This method clears and resets the text of the text area.

protected void refreshDetailTextArea ()

protected void requestClose ()

protected void requestExit ()

protected void requestOpen ()

Uses a JFileChooser to select a file to opened with the LF5 GUI.

protected void requestOpenMRU (ActionEvent e)

Opens a file in the MRU list.

protected void requestOpenURL ()

Uses a Dialog box to accept a URL to a file to be opened with the LF5 GUI.

protected void resetConfiguration ()

protected void saveConfiguration ()

protected void selectAllLogLevels (boolean selected)

protected void selectAllLogTableColumns (boolean selected)

protected void selectRow (int foundRow)

protected void setFontSize (Component component, int fontSize)

protected void setFontSizeSilently (int fontSize)

Does not update gui or cause any events to be fired.

protected void setLeastSevereDisplayedLogLevel (LogLevel level)

protected void setMaxRecordConfiguration ()

protected void setNDCTextFilter (String text)

protected void setSearchText (String text)

protected void setView (String viewString, LogTable table)

protected void showLogLevelColorChangeDialog (JMenuItem result, LogLevel level)

protected void showPropertiesDialog (String title)

protected void sortByNDC ()

protected void trackTableScrollPane ()

This method is deprecated.
tracking is now done automatically.

Ensures that the Table's ScrollPane Viewport will "track" with updates to the Table. When the vertical scroll bar is at its bottom anchor and tracking is enabled then viewport will stay at the bottom most point of the component. The purpose of this feature is to allow a developer to watch the table as messages arrive and not have to scroll after each new message arrives. When the vertical scroll bar is at any other location, then no tracking will happen.

protected void updateFrameSize ()

protected void updateMRUList ()

Removes old file list and creates a new file list with the updated MRU list.

protected void updateStatusLabel ()

protected List updateView ()