use of org.netxms.ui.eclipse.epp.dialogs.RuleSelectionDialog in project netxms by netxms.
the class ExportFileBuilder method addRules.
/**
* Add rules to list
*/
private void addRules() {
RuleSelectionDialog dlg = new RuleSelectionDialog(getSite().getShell(), rulesCache);
if (dlg.open() == Window.OK) {
final Set<Long> eventCodes = new HashSet<Long>();
for (EventProcessingPolicyRule r : dlg.getSelectedRules()) {
rules.put(r.getRuleNumber(), r);
for (Long e : r.getEvents()) {
if (e >= 100000) {
eventCodes.add(e);
}
}
}
ruleViewer.setInput(rules.values().toArray());
setModified();
if (eventCodes.size() > 0) {
for (EventObject o : session.findMultipleEventObjects(eventCodes.toArray(new Long[eventCodes.size()]))) {
events.put(o.getCode(), o);
}
eventViewer.setInput(events.values().toArray());
}
;
}
}
Aggregations