alma::acs::logging::dialogs::error::ErrorLogDialog Class Reference

Inheritance diagram for alma::acs::logging::dialogs::error::ErrorLogDialog:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::dialogs::error::ErrorLogDialog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ErrorLogDialog (Frame owner, String title, boolean modal)
synchronized void appendText (String str)
synchronized void clearAll ()
void actionPerformed (ActionEvent e)
void dispose ()
void setVisible (boolean visible, Component c)

Private Member Functions

void initGUI ()
void saveAllLog ()
void rationalizeButtons ()

Private Attributes

JTextArea logTA
PlainDocument document = new PlainDocument()
JButton closeBtn
JButton cleanAllBtn
JButton saveAllBtn
JToolBar toolBar
long maxLength
final String ERRORLOG_SIZE_PROP_NAME = "jlog.errorlog.size"
final long ERROR_LOG_DEFAULT_SIZE = 50 *1000000
ErrorLogFile outFile = null

Detailed Description

The dialog to show the errors.

The dialog stores errors till maxLength chars is reached. If the log exceeds that number, they are automatically flushed in a file in ACS_TMP.

The dimension defaults to ERROR_LOG_DEFAULT_SIZE and can be changed setting the ERRORLOG_SIZE_PROP_NAME property.

The content of the dialog can be saved and cleared.

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::logging::dialogs::error::ErrorLogDialog::ErrorLogDialog ( Frame  owner,
String  title,
boolean  modal 
) [inline]

Constructor

Parameters:
owner The owner of the dialog
title The title
modal Modal type

References ERROR_LOG_DEFAULT_SIZE, ERRORLOG_SIZE_PROP_NAME, initGUI(), maxLength, outFile, and setVisible().


Member Function Documentation

void alma::acs::logging::dialogs::error::ErrorLogDialog::actionPerformed ( ActionEvent  e  )  [inline]
See also:
java.awt.event.ActionListener
java.awt.event.ActionEvent

References cleanAllBtn, clearAll(), closeBtn, saveAllBtn, saveAllLog(), and setVisible().

synchronized void alma::acs::logging::dialogs::error::ErrorLogDialog::appendText ( String  str  )  [inline]

Add a String to the error log and show/hide the dialog if it is the first time an error is added

Parameters:
str The string to append in the TextArea
show Show/hide the dialog

References alma::acs::logging::dialogs::error::ErrorLogFile::append(), document, logTA, maxLength, outFile, and rationalizeButtons().

Referenced by com::cosylab::logging::LoggingClient::errorReceived().

synchronized void alma::acs::logging::dialogs::error::ErrorLogDialog::clearAll (  )  [inline]

Clear the log in the windows and the log in the file

References alma::acs::logging::dialogs::error::ErrorLogFile::clear(), document, logTA, outFile, and rationalizeButtons().

Referenced by actionPerformed().

void alma::acs::logging::dialogs::error::ErrorLogDialog::dispose (  )  [inline]
void alma::acs::logging::dialogs::error::ErrorLogDialog::initGUI (  )  [inline, private]

Builds the content of the GUI

References cleanAllBtn, closeBtn, document, logTA, rationalizeButtons(), saveAllBtn, and toolBar.

Referenced by ErrorLogDialog().

void alma::acs::logging::dialogs::error::ErrorLogDialog::rationalizeButtons (  )  [inline, private]

Enable/Disable the buttons in the toolbar depending on the content of the text area and the existence of the temporary file

References cleanAllBtn, document, and saveAllBtn.

Referenced by appendText(), clearAll(), and initGUI().

void alma::acs::logging::dialogs::error::ErrorLogDialog::saveAllLog (  )  [inline, private]

Save the content of the temporary file and the content of the text area into a file

References alma::acs::logging::dialogs::error::ErrorLogFile::copy(), logTA, and outFile.

Referenced by actionPerformed().

void alma::acs::logging::dialogs::error::ErrorLogDialog::setVisible ( boolean  visible,
Component  c 
) [inline]

Make the dialog visible and position it over the passed component

Parameters:
visible If true show the component
c The component to show this dialog over

Referenced by com::cosylab::logging::LoggingClient::EventHandler::actionPerformed(), actionPerformed(), com::cosylab::logging::LoggingClient::close(), ErrorLogDialog(), and com::cosylab::logging::LoggingClient::getStatusLinePnl().


Member Data Documentation

The button to erase all the logs (i.e. the logs shown in the window and those flushed on the temporary file)

Referenced by actionPerformed(), initGUI(), and rationalizeButtons().

The button to close (hide) the dialog

Referenced by actionPerformed(), and initGUI().

PlainDocument alma::acs::logging::dialogs::error::ErrorLogDialog::document = new PlainDocument() [private]

The document of the TextArea

Referenced by appendText(), clearAll(), initGUI(), and rationalizeButtons().

/ The default maximum size of the ERROR LOG

Referenced by ErrorLogDialog().

/ The name of the property defining the size of the error log

Referenced by ErrorLogDialog().

The log text appears into a JtextArea

Referenced by appendText(), clearAll(), initGUI(), and saveAllLog().

The maximum dimension of the log to keep in memory.

Its value is read from a property. If the value is 0, the error log is unlimited

Referenced by appendText(), and ErrorLogDialog().

The file to flush logs

Referenced by appendText(), clearAll(), dispose(), ErrorLogDialog(), and saveAllLog().

/ The button to save all the logs in a file (it saves the content of the temporary log file on disk and the content of the text area)

The button is enabled only if some log has been flushed on disk

Referenced by actionPerformed(), initGUI(), and rationalizeButtons().

The toolbar

Referenced by initGUI().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2