use of org.netxms.client.datacollection.ConditionDciInfo in project netxms by netxms.
the class ConditionData method moveUp.
/**
* Move selected item up
*/
private void moveUp() {
final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() == 1) {
ConditionDciInfo element = (ConditionDciInfo) selection.getFirstElement();
int index = dciList.indexOf(element);
if (index > 0) {
Collections.swap(dciList, index - 1, index);
viewer.setInput(dciList.toArray());
viewer.setSelection(new StructuredSelection(element));
isModified = true;
}
}
}
use of org.netxms.client.datacollection.ConditionDciInfo in project netxms by netxms.
the class ConditionData method editItem.
/**
* Edit selected item
*/
private void editItem() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
ConditionDciInfo dci = (ConditionDciInfo) selection.getFirstElement();
if (dci == null)
return;
ConditionDciEditDialog dlg = new ConditionDciEditDialog(getShell(), dci, labelProvider.getColumnText(dci, COLUMN_NODE), labelProvider.getColumnText(dci, COLUMN_METRIC));
if (dlg.open() == Window.OK) {
viewer.update(dci, null);
isModified = true;
}
}
use of org.netxms.client.datacollection.ConditionDciInfo in project netxms by netxms.
the class ConditionData method moveDown.
/**
* Move selected item down
*/
private void moveDown() {
final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() == 1) {
ConditionDciInfo element = (ConditionDciInfo) selection.getFirstElement();
int index = dciList.indexOf(element);
if ((index < dciList.size() - 1) && (index >= 0)) {
Collections.swap(dciList, index + 1, index);
viewer.setInput(dciList.toArray());
viewer.setSelection(new StructuredSelection(element));
}
}
}
Aggregations