use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.
the class SummaryTableColumns method importColumns.
/**
* Import Columns from node
*/
private void importColumns() {
final SelectDciDialog dialog = new SelectDciDialog(getShell(), 0);
dialog.setAllowTemplateItems(true);
dialog.setEnableEmptySelection(false);
if (dialog.open() == Dialog.OK) {
final List<DciValue> selection = dialog.getSelection();
List<DciSummaryTableColumn> select = new ArrayList<DciSummaryTableColumn>();
for (DciValue item : selection) {
DciSummaryTableColumn column = new DciSummaryTableColumn(item.getDescription(), item.getName(), 0, ";");
select.add(column);
columns.add(column);
}
viewer.setInput(columns.toArray());
viewer.setSelection(new StructuredSelection(select));
}
}
use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.
the class DataSources method addItem.
/**
* Add new item
*/
private void addItem() {
SelectDciDialog dlg = new SelectDciDialog(getShell(), 0);
if (dlg.open() == Window.OK) {
List<DciValue> selection = dlg.getSelection();
List<ChartDciConfig> select = new ArrayList<ChartDciConfig>();
for (DciValue item : selection) {
ChartDciConfig dci = new ChartDciConfig(item);
select.add(dci);
labelProvider.addCacheEntry(dci.nodeId, dci.dciId, dci.name);
dciList.add(dci);
}
viewer.setInput(dciList.toArray());
viewer.setSelection(new StructuredSelection(select));
}
}
use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.
the class DciSelector method selectionButtonHandler.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.widgets.AbstractSelector#selectionButtonHandler()
*/
@Override
protected void selectionButtonHandler() {
SelectDciDialog dlg = new SelectDciDialog(getShell(), fixedNode ? nodeId : 0);
dlg.setEnableEmptySelection(true);
dlg.setDcObjectType(dcObjectType);
dlg.setSingleSelection(true);
dlg.setAllowNoValueObjects(allowNoValueObjects);
if (dlg.open() == Window.OK) {
List<DciValue> dci = dlg.getSelection();
if (dci != null && dci.size() == 1) {
setDciId(dci.get(0).getNodeId(), dci.get(0).getId());
dciName = dci.get(0).getName();
dciObjectType = dci.get(0).getDcObjectType();
} else {
setDciId(fixedNode ? nodeId : 0, 0);
dciName = null;
}
}
}
use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.
the class DCIContainerDataSources method addItem.
/**
* Add new item
*/
private void addItem() {
SelectDciDialog dlg = new SelectDciDialog(getShell(), 0);
if (dlg.open() == Window.OK) {
List<DciValue> selection = dlg.getSelection();
List<SingleDciConfig> select = new ArrayList<SingleDciConfig>();
for (DciValue item : selection) {
SingleDciConfig dci = new SingleDciConfig(item);
select.add(dci);
labelProvider.addCacheEntry(dci.getNodeId(), dci.dciId, dci.name);
dciList.add(dci);
}
viewer.setInput(dciList.toArray());
viewer.setSelection(new StructuredSelection(select));
}
}
use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.
the class ConditionData method addItem.
/**
* Add new item
*/
private void addItem() {
SelectDciDialog dlg = new SelectDciDialog(getShell(), 0);
if (dlg.open() == Window.OK) {
List<DciValue> selection = dlg.getSelection();
List<ConditionDciInfo> select = new ArrayList<ConditionDciInfo>();
for (DciValue item : selection) {
ConditionDciInfo dci = new ConditionDciInfo(item.getNodeId(), item.getId(), item.getDcObjectType(), Threshold.F_LAST, 1);
labelProvider.addCacheEntry(dci.getNodeId(), dci.getDciId(), item.getDescription());
dciList.add(dci);
select.add(dci);
viewer.setInput(dciList.toArray());
isModified = true;
viewer.setSelection(new StructuredSelection(dci));
editItem();
}
viewer.setSelection(new StructuredSelection(select));
}
}
Aggregations