use of alma.acsplugins.alarmsystem.gui.viewcoordination.ViewCoordinator.AlarmSelectionListener in project ACS by ACS-Community.
the class AlarmTable method changeSelection.
/**
* Override {@link JTable#changeSelection(int, int, boolean, boolean)} to show
* the selected alarm in the detail panel.
*/
@Override
public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
super.changeSelection(rowIndex, columnIndex, toggle, extend);
int idx = sorter.convertRowIndexToModel(rowIndex);
AlarmTableEntry alarmEntry = model.getAlarmAt(idx);
panel.showAlarmDetails(alarmEntry);
selectedAlarmId = alarmEntry.getAlarmId();
// to avoid concurrency issues
AlarmSelectionListener listenerCopy = listener;
if (listenerCopy != null) {
Alarm alarm = alarmEntry.getEncapsulatedAlarm();
if (alarm != null) {
listenerCopy.notifyAlarmSelected(alarm);
}
}
}
Aggregations