use of org.netxms.client.snmp.SnmpTrapParameterMapping in project netxms by netxms.
the class TrapConfigurationDialog method editParameter.
/**
* Edit currently selected parameter mapping
*/
private void editParameter() {
IStructuredSelection selection = (IStructuredSelection) paramList.getSelection();
if (selection.size() != 1)
return;
SnmpTrapParameterMapping pm = (SnmpTrapParameterMapping) selection.getFirstElement();
ParamMappingEditDialog dlg = new ParamMappingEditDialog(getShell(), pm);
if (dlg.open() == Window.OK) {
paramList.update(pm, null);
}
}
use of org.netxms.client.snmp.SnmpTrapParameterMapping in project netxms by netxms.
the class TrapConfigurationDialog method deleteParameters.
/**
* Delete selected parameters
*/
@SuppressWarnings("unchecked")
private void deleteParameters() {
IStructuredSelection selection = (IStructuredSelection) paramList.getSelection();
if (selection.isEmpty())
return;
Iterator<SnmpTrapParameterMapping> it = selection.iterator();
while (it.hasNext()) pmap.remove(it.next());
paramList.setInput(pmap.toArray());
}
use of org.netxms.client.snmp.SnmpTrapParameterMapping in project netxms by netxms.
the class TrapConfigurationDialog method addParameter.
/**
* Add new parameter mapping
*/
private void addParameter() {
SnmpTrapParameterMapping pm = new SnmpTrapParameterMapping(new SnmpObjectId());
ParamMappingEditDialog dlg = new ParamMappingEditDialog(getShell(), pm);
if (dlg.open() == Window.OK) {
pmap.add(pm);
paramList.setInput(pmap.toArray());
paramList.setSelection(new StructuredSelection(pm));
}
}
use of org.netxms.client.snmp.SnmpTrapParameterMapping in project netxms by netxms.
the class TrapConfigurationDialog method setupParameterList.
/**
* Setup parameter mapping list
*/
private void setupParameterList() {
Table table = paramList.getTable();
table.setHeaderVisible(true);
TableColumn tc = new TableColumn(table, SWT.LEFT);
tc.setText(Messages.get().TrapConfigurationDialog_Number);
tc.setWidth(90);
tc = new TableColumn(table, SWT.LEFT);
tc.setText(Messages.get().TrapConfigurationDialog_Parameter);
tc.setWidth(200);
pmap = new ArrayList<SnmpTrapParameterMapping>(trap.getParameterMapping());
paramList.setContentProvider(new ArrayContentProvider());
paramList.setLabelProvider(new ParamMappingLabelProvider(pmap));
paramList.setInput(pmap.toArray());
WidgetHelper.restoreColumnSettings(table, Activator.getDefault().getDialogSettings(), PARAMLIST_TABLE_SETTINGS);
paramList.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
editParameter();
}
});
}
Aggregations