Search in sources :

Example 11 with EventTemplate

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);
        }
    }
}
Also used : EventTemplate(org.netxms.client.events.EventTemplate) EventObject(org.netxms.client.events.EventObject) EventSelectionDialog(org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog)

Aggregations

EventTemplate (org.netxms.client.events.EventTemplate)11 GridLayout (org.eclipse.swt.layout.GridLayout)4 Composite (org.eclipse.swt.widgets.Composite)4 EventObject (org.netxms.client.events.EventObject)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 GridData (org.eclipse.swt.layout.GridData)3 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)2 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)2 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2 TableViewer (org.eclipse.jface.viewers.TableViewer)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2 RowData (org.eclipse.swt.layout.RowData)2 RowLayout (org.eclipse.swt.layout.RowLayout)2 Button (org.eclipse.swt.widgets.Button)2 Label (org.eclipse.swt.widgets.Label)2 Threshold (org.netxms.client.datacollection.Threshold)2 EditEventTemplateDialog (org.netxms.ui.eclipse.eventmanager.dialogs.EditEventTemplateDialog)2 EventSelectionDialog (org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog)2