Search in sources :

Example 6 with ConditionDciInfo

use of org.netxms.client.datacollection.ConditionDciInfo in project netxms by netxms.

the class ConditionData method moveUp.

/**
 * Move selected item up
 */
private void moveUp() {
    final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() == 1) {
        ConditionDciInfo element = (ConditionDciInfo) selection.getFirstElement();
        int index = dciList.indexOf(element);
        if (index > 0) {
            Collections.swap(dciList, index - 1, index);
            viewer.setInput(dciList.toArray());
            viewer.setSelection(new StructuredSelection(element));
            isModified = true;
        }
    }
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ConditionDciInfo(org.netxms.client.datacollection.ConditionDciInfo) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 7 with ConditionDciInfo

use of org.netxms.client.datacollection.ConditionDciInfo in project netxms by netxms.

the class ConditionData method editItem.

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

Example 8 with ConditionDciInfo

use of org.netxms.client.datacollection.ConditionDciInfo in project netxms by netxms.

the class ConditionData method moveDown.

/**
 * Move selected item down
 */
private void moveDown() {
    final IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() == 1) {
        ConditionDciInfo element = (ConditionDciInfo) selection.getFirstElement();
        int index = dciList.indexOf(element);
        if ((index < dciList.size() - 1) && (index >= 0)) {
            Collections.swap(dciList, index + 1, index);
            viewer.setInput(dciList.toArray());
            viewer.setSelection(new StructuredSelection(element));
        }
    }
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ConditionDciInfo(org.netxms.client.datacollection.ConditionDciInfo) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Aggregations

ConditionDciInfo (org.netxms.client.datacollection.ConditionDciInfo)8 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)5 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)3 AccessPoint (org.netxms.client.objects.AccessPoint)2 ConnectionPoint (org.netxms.client.topology.ConnectionPoint)2 ArrayList (java.util.ArrayList)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 RowData (org.eclipse.swt.layout.RowData)1 RowLayout (org.eclipse.swt.layout.RowLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1