Search in sources :

Example 1 with EditEventTemplateDialog

use of org.netxms.ui.eclipse.eventmanager.dialogs.EditEventTemplateDialog in project netxms by netxms.

the class EventObjectList method createNewEventTemplate.

/**
 * Create new event template
 */
protected void createNewEventTemplate() {
    final EventTemplate etmpl = new EventTemplate(0);
    EditEventTemplateDialog dlg = new EditEventTemplateDialog(getShell().getShell(), etmpl, false);
    if (dlg.open() == Window.OK)
        modifyEventObject(etmpl, true);
}
Also used : EventTemplate(org.netxms.client.events.EventTemplate) EditEventTemplateDialog(org.netxms.ui.eclipse.eventmanager.dialogs.EditEventTemplateDialog)

Example 2 with EditEventTemplateDialog

use of org.netxms.ui.eclipse.eventmanager.dialogs.EditEventTemplateDialog in project netxms by netxms.

the class EventObjectList method editEventTemplate.

/**
 * Edit currently selected event template
 */
protected void editEventTemplate() {
    final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() != 1)
        return;
    if (selection.getFirstElement() instanceof EventGroup) {
        final EventGroup group = new EventGroup((EventGroup) selection.getFirstElement());
        EditEventGroupDialog dlg = new EditEventGroupDialog(getShell().getShell(), group);
        if (dlg.open() == Window.OK)
            modifyEventObject(group, false);
        else
            return;
    }
    final EventTemplate etmpl = new EventTemplate((EventTemplate) selection.getFirstElement());
    EditEventTemplateDialog dlg = new EditEventTemplateDialog(getShell().getShell(), etmpl, false);
    if (dlg.open() == Window.OK)
        modifyEventObject(etmpl, false);
}
Also used : EventTemplate(org.netxms.client.events.EventTemplate) EditEventTemplateDialog(org.netxms.ui.eclipse.eventmanager.dialogs.EditEventTemplateDialog) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditEventGroupDialog(org.netxms.ui.eclipse.eventmanager.dialogs.EditEventGroupDialog) EventGroup(org.netxms.client.events.EventGroup)

Aggregations

EventTemplate (org.netxms.client.events.EventTemplate)2 EditEventTemplateDialog (org.netxms.ui.eclipse.eventmanager.dialogs.EditEventTemplateDialog)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 EventGroup (org.netxms.client.events.EventGroup)1 EditEventGroupDialog (org.netxms.ui.eclipse.eventmanager.dialogs.EditEventGroupDialog)1