Search in sources :

Example 1 with EditTableThresholdDialog

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

the class TableThresholds method editThreshold.

/**
 * Edit selected threshold
 */
private void editThreshold() {
    final IStructuredSelection selection = (IStructuredSelection) thresholdList.getSelection();
    if (selection.size() == 1) {
        final TableThreshold t = (TableThreshold) selection.getFirstElement();
        EditTableThresholdDialog dlg = new EditTableThresholdDialog(getShell(), t, editor.getCallback());
        if (dlg.open() == Window.OK) {
            thresholdList.update(t, null);
        }
    }
}
Also used : EditTableThresholdDialog(org.netxms.ui.eclipse.datacollection.dialogs.EditTableThresholdDialog) TableThreshold(org.netxms.client.datacollection.TableThreshold) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 2 with EditTableThresholdDialog

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

the class TableThresholds method addThreshold.

/**
 * Add new threshold
 */
private void addThreshold() {
    final TableThreshold t = new TableThreshold();
    final EditTableThresholdDialog dlg = new EditTableThresholdDialog(getShell(), t, editor.getCallback());
    if (dlg.open() == Window.OK) {
        thresholds.add(t);
        thresholdList.setInput(thresholds.toArray());
        thresholdList.setSelection(new StructuredSelection(t));
    }
}
Also used : EditTableThresholdDialog(org.netxms.ui.eclipse.datacollection.dialogs.EditTableThresholdDialog) TableThreshold(org.netxms.client.datacollection.TableThreshold) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 TableThreshold (org.netxms.client.datacollection.TableThreshold)2 EditTableThresholdDialog (org.netxms.ui.eclipse.datacollection.dialogs.EditTableThresholdDialog)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1