Search in sources :

Example 6 with SelectDciDialog

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);
            labelProvider.addCacheEntry(dci.nodeId, dci.dciId, dci.name);
            select.add(dci);
            dciList.add(dci);
        }
        viewer.setInput(dciList.toArray());
        viewer.setSelection(new StructuredSelection(select));
    }
}
Also used : ChartDciConfig(org.netxms.client.datacollection.ChartDciConfig) DciValue(org.netxms.client.datacollection.DciValue) ArrayList(java.util.ArrayList) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) SelectDciDialog(org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog)

Example 7 with SelectDciDialog

use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.

the class TemplateDataSources method importItem.

/**
 * Import new item
 */
private void importItem() {
    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);
            dciList.add(dci);
        }
        viewer.setInput(dciList.toArray());
        viewer.setSelection(new StructuredSelection(select));
    }
}
Also used : ChartDciConfig(org.netxms.client.datacollection.ChartDciConfig) DciValue(org.netxms.client.datacollection.DciValue) ArrayList(java.util.ArrayList) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) SelectDciDialog(org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog)

Example 8 with SelectDciDialog

use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.

the class LinkDataSources 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));
    }
}
Also used : DciValue(org.netxms.client.datacollection.DciValue) ArrayList(java.util.ArrayList) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) SelectDciDialog(org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog) SingleDciConfig(org.netxms.client.maps.configs.SingleDciConfig)

Example 9 with SelectDciDialog

use of org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog in project netxms by netxms.

the class SummaryTableGeneral method selectDci.

private void selectDci() {
    SelectDciDialog dlg = new SelectDciDialog(getShell(), 0);
    dlg.setDcObjectType(2);
    dlg.setSingleSelection(true);
    if (dlg.open() == Window.OK) {
        table.setTableDciName(dlg.getSelection().get(0).getName());
        dciName.setText(table.getTableDciName());
    }
}
Also used : SelectDciDialog(org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog)

Aggregations

SelectDciDialog (org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog)9 DciValue (org.netxms.client.datacollection.DciValue)8 ArrayList (java.util.ArrayList)7 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)7 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)7 ChartDciConfig (org.netxms.client.datacollection.ChartDciConfig)3 SingleDciConfig (org.netxms.client.maps.configs.SingleDciConfig)2 ConditionDciInfo (org.netxms.client.datacollection.ConditionDciInfo)1 DciSummaryTableColumn (org.netxms.client.datacollection.DciSummaryTableColumn)1