

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 |
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.
| alma::acs::logging::dialogs::error::ErrorLogDialog::ErrorLogDialog | ( | Frame | owner, | |
| String | title, | |||
| boolean | modal | |||
| ) | [inline] |
Constructor
| 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().
| void alma::acs::logging::dialogs::error::ErrorLogDialog::actionPerformed | ( | ActionEvent | e | ) | [inline] |
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
| 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] |
References alma::acs::logging::dialogs::error::ErrorLogFile::close(), and outFile.
Referenced by com::cosylab::logging::LoggingClient::close().
| 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
| 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().
JButton alma::acs::logging::dialogs::error::ErrorLogDialog::cleanAllBtn [private] |
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().
JButton alma::acs::logging::dialogs::error::ErrorLogDialog::closeBtn [private] |
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().
final long alma::acs::logging::dialogs::error::ErrorLogDialog::ERROR_LOG_DEFAULT_SIZE = 50 *1000000 [private] |
/ The default maximum size of the ERROR LOG
Referenced by ErrorLogDialog().
final String alma::acs::logging::dialogs::error::ErrorLogDialog::ERRORLOG_SIZE_PROP_NAME = "jlog.errorlog.size" [private] |
/ The name of the property defining the size of the error log
Referenced by ErrorLogDialog().
JTextArea alma::acs::logging::dialogs::error::ErrorLogDialog::logTA [private] |
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().
ErrorLogFile alma::acs::logging::dialogs::error::ErrorLogDialog::outFile = null [private] |
The file to flush logs
Referenced by appendText(), clearAll(), dispose(), ErrorLogDialog(), and saveAllLog().
JButton alma::acs::logging::dialogs::error::ErrorLogDialog::saveAllBtn [private] |
/ 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().
JToolBar alma::acs::logging::dialogs::error::ErrorLogDialog::toolBar [private] |
The toolbar
Referenced by initGUI().
1.6.2