Search in sources :

Example 1 with DataSourceEditDlg

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

the class TemplateDataSources method addItem.

/**
 * Add new item
 */
private void addItem() {
    ChartDciConfig dci = new ChartDciConfig();
    DataSourceEditDlg dlg = new DataSourceEditDlg(getShell(), dci, true);
    if (dlg.open() == Window.OK) {
        List<ChartDciConfig> select = new ArrayList<ChartDciConfig>();
        select.add(dci);
        select.add(dci);
        dciList.add(dci);
        viewer.setInput(dciList.toArray());
        viewer.setSelection(new StructuredSelection(select));
    }
}
Also used : DataSourceEditDlg(org.netxms.ui.eclipse.datacollection.dialogs.DataSourceEditDlg) ChartDciConfig(org.netxms.client.datacollection.ChartDciConfig) ArrayList(java.util.ArrayList) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 2 with DataSourceEditDlg

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

the class TemplateDataSources method editItem.

/**
 * Edit selected item
 */
private void editItem() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    ChartDciConfig dci = (ChartDciConfig) selection.getFirstElement();
    if (dci == null)
        return;
    DataSourceEditDlg dlg = new DataSourceEditDlg(getShell(), dci, true);
    if (dlg.open() == Window.OK) {
        viewer.update(dci, null);
    }
}
Also used : DataSourceEditDlg(org.netxms.ui.eclipse.datacollection.dialogs.DataSourceEditDlg) ChartDciConfig(org.netxms.client.datacollection.ChartDciConfig) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 3 with DataSourceEditDlg

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

the class DataSources method editItem.

/**
 * Edit selected item
 */
private void editItem() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    ChartDciConfig dci = (ChartDciConfig) selection.getFirstElement();
    if (dci == null)
        return;
    DataSourceEditDlg dlg = new DataSourceEditDlg(getShell(), dci, false);
    if (dlg.open() == Window.OK) {
        viewer.update(dci, null);
    }
}
Also used : DataSourceEditDlg(org.netxms.ui.eclipse.datacollection.dialogs.DataSourceEditDlg) ChartDciConfig(org.netxms.client.datacollection.ChartDciConfig) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 4 with DataSourceEditDlg

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

the class DataSources method editItem.

/**
 * Edit selected item
 */
private void editItem() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    ChartDciConfig dci = (ChartDciConfig) selection.getFirstElement();
    if (dci == null)
        return;
    DataSourceEditDlg dlg = new DataSourceEditDlg(getShell(), dci, graphIsTemplate);
    if (dlg.open() == Window.OK) {
        viewer.update(dci, null);
    }
}
Also used : DataSourceEditDlg(org.netxms.ui.eclipse.datacollection.dialogs.DataSourceEditDlg) ChartDciConfig(org.netxms.client.datacollection.ChartDciConfig) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 ChartDciConfig (org.netxms.client.datacollection.ChartDciConfig)4 DataSourceEditDlg (org.netxms.ui.eclipse.datacollection.dialogs.DataSourceEditDlg)4 ArrayList (java.util.ArrayList)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1