use of org.netxms.ui.eclipse.serverconfig.dialogs.SelectSnmpTrapDialog in project netxms by netxms.
the class ExportFileBuilder method addTraps.
/**
* Add traps to list
*/
private void addTraps() {
SelectSnmpTrapDialog dlg = new SelectSnmpTrapDialog(getSite().getShell(), snmpTrapCache);
if (dlg.open() == Window.OK) {
final Set<Long> eventCodes = new HashSet<Long>();
for (SnmpTrap t : dlg.getSelection()) {
traps.put(t.getId(), t);
if (t.getEventCode() >= 100000) {
eventCodes.add((long) t.getEventCode());
}
}
trapViewer.setInput(traps.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