use of org.netxms.client.objecttools.InputField in project netxms by netxms.
the class InputFields method addField.
/**
* Add new field
*/
private void addField() {
// $NON-NLS-1$
InputField f = new InputField("Field" + Integer.toString(fields.size() + 1));
EditInputFieldDialog dlg = new EditInputFieldDialog(getShell(), true, f);
if (dlg.open() == Window.OK) {
if (nameIsUnique(f.getName())) {
f.setSequence(fields.size());
fields.add(f);
viewer.setInput(fields.toArray());
viewer.setSelection(new StructuredSelection(f));
}
}
}
use of org.netxms.client.objecttools.InputField in project netxms by netxms.
the class InputFields method removeField.
/**
* Remove selected column(s)
*/
@SuppressWarnings("unchecked")
private void removeField() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
Iterator<InputField> it = selection.iterator();
while (it.hasNext()) {
fields.remove(it.next());
}
viewer.setInput(fields.toArray());
}
Aggregations