Search in sources :

Example 1 with EditColumnDialog

use of org.netxms.ui.eclipse.objecttools.dialogs.EditColumnDialog in project netxms by netxms.

the class Columns method addColumn.

/**
 * Add new column
 */
private void addColumn() {
    ObjectToolTableColumn tc = new ObjectToolTableColumn(Messages.get().Columns_DefName + Integer.toString(columns.size() + 1));
    EditColumnDialog dlg = new EditColumnDialog(getShell(), true, objectTool.getToolType() == ObjectTool.TYPE_TABLE_SNMP, tc);
    if (dlg.open() == Window.OK) {
        columns.add(tc);
        viewer.setInput(columns.toArray());
        viewer.setSelection(new StructuredSelection(tc));
    }
}
Also used : ObjectToolTableColumn(org.netxms.client.objecttools.ObjectToolTableColumn) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditColumnDialog(org.netxms.ui.eclipse.objecttools.dialogs.EditColumnDialog)

Example 2 with EditColumnDialog

use of org.netxms.ui.eclipse.objecttools.dialogs.EditColumnDialog in project netxms by netxms.

the class Columns method editColumn.

/**
 * Edit column
 */
private void editColumn() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() != 1)
        return;
    EditColumnDialog dlg = new EditColumnDialog(getShell(), false, objectTool.getToolType() == ObjectTool.TYPE_TABLE_SNMP, (ObjectToolTableColumn) selection.getFirstElement());
    dlg.open();
    viewer.update(selection.getFirstElement(), null);
}
Also used : IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditColumnDialog(org.netxms.ui.eclipse.objecttools.dialogs.EditColumnDialog)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 EditColumnDialog (org.netxms.ui.eclipse.objecttools.dialogs.EditColumnDialog)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ObjectToolTableColumn (org.netxms.client.objecttools.ObjectToolTableColumn)1