use of org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog in project netxms by netxms.
the class EventSelector method selectionButtonHandler.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.widgets.AbstractSelector#selectionButtonHandler()
*/
@Override
protected void selectionButtonHandler() {
EventSelectionDialog dlg = new EventSelectionDialog(getShell(), false);
dlg.enableMultiSelection(false);
if (dlg.open() == Window.OK) {
long prevEventCode = eventCode;
EventObject[] events = dlg.getSelectedEvents();
if (events.length > 0) {
eventCode = events[0].getCode();
setText(events[0].getName());
if (events[0] instanceof EventTemplate)
setImage(StatusDisplayInfo.getStatusImage(((EventTemplate) events[0]).getSeverity()));
else
setImage(SharedIcons.IMG_CONTAINER);
getTextControl().setToolTipText(generateToolTipText(events[0]));
} else {
eventCode = 0;
setText(Messages.get().EventSelector_None);
setImage(null);
getTextControl().setToolTipText(null);
}
if (prevEventCode != eventCode)
fireModifyListeners();
}
}
use of org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog in project netxms by netxms.
the class EventConditionEditor 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();
objectName.setText(events[0].getName());
objectName.setImage(labelProvider.getImage(events[0]));
} else {
eventCode = 0;
objectName.setText(EMPTY_SELECTION_TEXT);
objectName.setImage(null);
}
}
}
use of org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog in project netxms by netxms.
the class RuleEvents method addEvent.
/**
* Add new event
*/
private void addEvent() {
EventSelectionDialog dlg = new EventSelectionDialog(getShell(), true);
dlg.enableMultiSelection(true);
if (dlg.open() == Window.OK) {
for (EventObject e : dlg.getSelectedEvents()) events.put(e.getCode(), e);
}
viewer.setInput(events.values().toArray());
}
use of org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog in project netxms by netxms.
the class ExportFileBuilder method addEvents.
/**
* Add events to list
*/
private void addEvents() {
EventSelectionDialog dlg = new EventSelectionDialog(getSite().getShell(), true);
dlg.enableMultiSelection(true);
if (dlg.open() == Window.OK) {
for (EventObject t : dlg.getSelectedEvents()) {
if (t instanceof EventGroup)
addEventGroups((EventGroup) t);
else
events.put(t.getCode(), t);
}
eventViewer.setInput(events.values().toArray());
setModified();
}
}
use of org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog 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