Search in sources :

Example 1 with EditThresholdDialog

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

the class Thresholds method addThreshold.

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

Example 2 with EditThresholdDialog

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

the class Thresholds method editThreshold.

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

Aggregations

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