alma::acsplugins::alarmsystem::gui::table::AlarmTable Class Reference

Inheritance diagram for alma::acsplugins::alarmsystem::gui::table::AlarmTable:
Inheritance graph
[legend]
Collaboration diagram for alma::acsplugins::alarmsystem::gui::table::AlarmTable:
Collaboration graph
[legend]

List of all members.

Classes

class  AlarmHeaderMouseAdapter
class  AlarmTableFilter
class  AlarmTableMouseAdapter

Public Member Functions

 AlarmTable (AlarmTableModel model, CernSysPanel panel)
Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int vColIndex)
void actionPerformed (ActionEvent e)
void saveAlarm (Alarm alarm)
void close ()
void showColumns (AlarmTableColumn[] cols)
void addRemoveColumn (AlarmTableColumn col, boolean add)
boolean search (String string, boolean next)
void changeSelection (int rowIndex, int columnIndex, boolean toggle, boolean extend)
void filter (String filterString, boolean not)

Static Public Attributes

static final JLabel reductionRenderer
static final JLabel hasReducedNodesRenderer

Private Member Functions

void initialize ()
void buildPopupMenu ()
void colorizeCell (Component c, AlarmTableEntry alarm)
void showReductionChain (AlarmTableEntry alarm)
String getSelectedAlarmId ()

Private Attributes

final AlarmTableModel model
final CernSysPanel panel
TableRowSorter< AlarmTableModelsorter
DefaultListSelectionModel selectionModel
TableColumn[] columns
AlarmTableMouseAdapter mouseAdapter = new AlarmTableMouseAdapter()
final AlarmTableFilter filter = new AlarmTableFilter()
ClipboardHelper clipboard = new ClipboardHelper()
JPopupMenu popupM = new JPopupMenu("Alarm")
JMenuItem ackMI = new JMenuItem("Acknowledge")
JMenuItem saveMI = new JMenuItem("Save...")
JMenuItem clipMI = new JMenuItem("To clipboard")
JMenuItem showReducedMI = new JMenuItem("Show reduction chain")
JLabel emptyLbl = new JLabel()
ReducedChainDlg reducedDlg = null
final SearchEngine searchEngine
String selectedAlarmId = null

Detailed Description

The table of alarms


Constructor & Destructor Documentation

alma::acsplugins::alarmsystem::gui::table::AlarmTable::AlarmTable ( AlarmTableModel  model,
CernSysPanel  panel 
) [inline]

Constructor

Parameters:
model The model for this table
panel The panel showing this table

References initialize(), and searchEngine.


Member Function Documentation

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::actionPerformed ( ActionEvent  e  )  [inline]
void alma::acsplugins::alarmsystem::gui::table::AlarmTable::addRemoveColumn ( AlarmTableColumn  col,
boolean  add 
) [inline]

Add/remove one column from the table

Parameters:
col The column to add or remove
add If true add the column, otherwise remove the column

References columns.

Referenced by alma::acsplugins::alarmsystem::gui::table::AlarmTable::AlarmHeaderMouseAdapter::actionPerformed(), and alma::acsplugins::alarmsystem::gui::reduced::ReducedChainDlg::initialize().

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::buildPopupMenu (  )  [inline, private]

Build the popup menu

References ackMI, clipMI, popupM, saveMI, and showReducedMI.

Referenced by initialize().

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::changeSelection ( int  rowIndex,
int  columnIndex,
boolean  toggle,
boolean  extend 
) [inline]
void alma::acsplugins::alarmsystem::gui::table::AlarmTable::close (  )  [inline]
void alma::acsplugins::alarmsystem::gui::table::AlarmTable::colorizeCell ( Component  c,
AlarmTableEntry  alarm 
) [inline, private]

Set the background and the foreground of the component depending on the priority and the state of the passed alarm

Parameters:
c The component to color
priority The alarm to set the color

Referenced by prepareRenderer().

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::filter ( String  filterString,
boolean  not 
) [inline]

Filter the table by the passed string

Filtering select all the rows containing the passed string in at least on one (visible) column.

Parameters:
filterString The string used to filter; if null or empty, the table is unfiltered
not If the filter must be applied to discard entries instead of to select

References filter, alma::acsplugins::alarmsystem::gui::table::AlarmTable::AlarmTableFilter::setFilter(), and sorter.

String alma::acsplugins::alarmsystem::gui::table::AlarmTable::getSelectedAlarmId (  )  [inline, private]

Return the id of the selected alarm; the id is null if no alarm is selected;

This method does not ensure that the alarm with the ID returned by this method is still in the table: it might have been removed when the panel discards alarms.

Returns:
The id of the selected alarm or null if no alarm is selected

References selectedAlarmId.

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::initialize (  )  [inline, private]

Init the GUI

References buildPopupMenu(), columns, model, mouseAdapter, selectionModel, and sorter.

Referenced by AlarmTable().

Component alma::acsplugins::alarmsystem::gui::table::AlarmTable::prepareRenderer ( TableCellRenderer  renderer,
int  rowIndex,
int  vColIndex 
) [inline]
void alma::acsplugins::alarmsystem::gui::table::AlarmTable::saveAlarm ( Alarm  alarm  )  [inline]

Save the alarm in a file

Parameters:
The alarm to save in a plain text file

Referenced by actionPerformed().

boolean alma::acsplugins::alarmsystem::gui::table::AlarmTable::search ( String  string,
boolean  next 
) [inline]

Search for a string in the table

Parameters:
string The string to search in the table
next If true search for the next entry
Returns:
true if an entry has been found
See also:
SearchEngine

References changeSelection(), panel, alma::acsplugins::alarmsystem::gui::table::SearchEngine::search(), searchEngine, and alma::acsplugins::alarmsystem::gui::CernSysPanel::showMessage().

Referenced by alma::acsplugins::alarmsystem::gui::toolbar::Toolbar::actionPerformed().

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::showColumns ( AlarmTableColumn[]  cols  )  [inline]

Set the visible columns in the table. The columns are displayed following their order in the array.

Parameters:
cols The visible columns in the table; it can't be null and at least one column must be in the array.

References columns.

void alma::acsplugins::alarmsystem::gui::table::AlarmTable::showReductionChain ( AlarmTableEntry  alarm  )  [inline, private]

Show the dialog with all the nodes reduced by the passed alarm

Parameters:
alarm The alarm whose children must be shown in a dialog

References alma::acsplugins::alarmsystem::gui::table::AlarmTableModel::getCategoryClient(), model, panel, reducedDlg, and alma::acsplugins::alarmsystem::gui::reduced::ReducedChainDlg::setRootAlarm().

Referenced by actionPerformed().


Member Data Documentation

JMenuItem alma::acsplugins::alarmsystem::gui::table::AlarmTable::ackMI = new JMenuItem("Acknowledge") [private]

The clipboard

Referenced by actionPerformed().

The menu item to svae the selected alarm into the clipboard

Referenced by actionPerformed(), and buildPopupMenu().

The cols of the table

Referenced by addRemoveColumn(), initialize(), and showColumns().

The label returned as renderer when no flag is shown in the first column of the table

Referenced by prepareRenderer().

The filter of the table activate from the toolbar

This filter is added or removed from the tale filters depending if the user select or unselect the toolbar button

Referenced by alma::acsplugins::alarmsystem::gui::toolbar::Toolbar::actionPerformed(), and filter().

Initial value:
 new JLabel(
                        new ImageIcon(AlarmGUIType.class.getResource(AlarmGUIType.iconFolder+"add.png")),
                        JLabel.CENTER)

The renderer for a node that hides children because of a reduction rule is in place

The alarm adapter that recives events from the mouse

Referenced by actionPerformed(), and initialize().

The panel showing this table

Referenced by changeSelection(), search(), and showReductionChain().

JPopupMenu alma::acsplugins::alarmsystem::gui::table::AlarmTable::popupM = new JPopupMenu("Alarm") [private]

The popup menu shown when the user presses the right mouse button over a row

Referenced by buildPopupMenu(), and alma::acsplugins::alarmsystem::gui::table::AlarmTable::AlarmTableMouseAdapter::showPopup().

The dialog showing the table with the alarms involved in a reduction chain

Referenced by close(), and showReductionChain().

Initial value:
 new JLabel(
                        new ImageIcon(AlarmGUIType.class.getResource(AlarmGUIType.iconFolder+"arrow_in.png")),
                        JLabel.CENTER)

The renderer for the reduced alarm entries i.e. the entries normally hidden

JMenuItem alma::acsplugins::alarmsystem::gui::table::AlarmTable::saveMI = new JMenuItem("Save...") [private]

The menu item to save

Referenced by actionPerformed(), and buildPopupMenu().

The engine to search alarm entries in the table

Referenced by AlarmTable(), and search().

The ID of the last selected alarm for painting in bold

Referenced by changeSelection(), getSelectedAlarmId(), and prepareRenderer().

The table selection model

Referenced by initialize().

JMenuItem alma::acsplugins::alarmsystem::gui::table::AlarmTable::showReducedMI = new JMenuItem("Show reduction chain") [private]

The sorter for sorting the rows of the table

Referenced by changeSelection(), filter(), initialize(), and prepareRenderer().


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

Generated by  doxygen 1.6.2