Search in sources :

Example 1 with EditEventGroupDialog

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

the class EventObjectList method createNewEventGroup.

/**
 * Create new Event group
 */
protected void createNewEventGroup() {
    EventGroup group = new EventGroup();
    EditEventGroupDialog dlg = new EditEventGroupDialog(getShell().getShell(), group);
    if (dlg.open() == Window.OK)
        modifyEventObject(group, true);
}
Also used : EditEventGroupDialog(org.netxms.ui.eclipse.eventmanager.dialogs.EditEventGroupDialog) EventGroup(org.netxms.client.events.EventGroup)

Example 2 with EditEventGroupDialog

use of org.netxms.ui.eclipse.eventmanager.dialogs.EditEventGroupDialog 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

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