use of org.netxms.client.events.EventTemplate in project netxms by netxms.
the class EventFieldEditor method selectEvent.
/**
* Select event
*/
private void selectEvent() {
EventSelectionDialog dlg = new EventSelectionDialog(getShell(), false);
dlg.enableMultiSelection(false);
if (dlg.open() == Window.OK) {
EventObject[] events = dlg.getSelectedEvents();
if (events.length > 0) {
eventCode = events[0].getCode();
text.setText(events[0].getName());
if (events[0] instanceof EventTemplate)
text.setImage(StatusDisplayInfo.getStatusImage(((EventTemplate) events[0]).getSeverity()));
} else {
eventCode = 0;
text.setText(EMPTY_SELECTION_TEXT);
text.setImage(null);
}
}
}
Aggregations