use of org.netxms.client.events.EventGroup in project netxms by netxms.
the class EventObjectList method modifyEventObject.
/**
* Modify event object in server
*
* @param obj to modify
*/
protected void modifyEventObject(final EventObject obj, final boolean updateParent) {
new ConsoleJob(Messages.get().EventConfigurator_UpdateJob_Title, null, Activator.PLUGIN_ID, JOB_FAMILY) {
@Override
protected String getErrorMessage() {
return Messages.get().EventConfigurator_UpdateJob_Error;
}
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.modifyEventObject(obj);
if (updateParent) {
runInUIThread(new Runnable() {
/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
@Override
public void run() {
ITreeSelection selection = (ITreeSelection) viewer.getSelection();
if (selection.size() == 1 && selection.getFirstElement() instanceof EventGroup) {
((EventGroup) selection.getFirstElement()).addChild(obj.getCode());
modifyEventObject((EventGroup) selection.getFirstElement(), false);
}
}
});
}
}
}.start();
}
use of org.netxms.client.events.EventGroup 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();
}
}
Aggregations