Search in sources :

Example 1 with EventSelectionDialog

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

Example 2 with EventSelectionDialog

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

Example 3 with EventSelectionDialog

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

Example 4 with EventSelectionDialog

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

Example 5 with EventSelectionDialog

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

Aggregations

EventObject (org.netxms.client.events.EventObject)5 EventSelectionDialog (org.netxms.ui.eclipse.eventmanager.dialogs.EventSelectionDialog)5 EventTemplate (org.netxms.client.events.EventTemplate)2 EventGroup (org.netxms.client.events.EventGroup)1