Search in sources :

Example 1 with RuleSelectionDialog

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());
        }
        ;
    }
}
Also used : EventProcessingPolicyRule(org.netxms.client.events.EventProcessingPolicyRule) RuleSelectionDialog(org.netxms.ui.eclipse.epp.dialogs.RuleSelectionDialog) EventObject(org.netxms.client.events.EventObject) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 EventObject (org.netxms.client.events.EventObject)1 EventProcessingPolicyRule (org.netxms.client.events.EventProcessingPolicyRule)1 RuleSelectionDialog (org.netxms.ui.eclipse.epp.dialogs.RuleSelectionDialog)1