use of org.netxms.ui.eclipse.datacollection.dialogs.EditColumnDialog in project netxms by netxms.
the class TableColumns method editColumn.
/**
* Edit selected threshold
*/
private void editColumn() {
final IStructuredSelection selection = (IStructuredSelection) columnList.getSelection();
if (selection.size() == 1) {
final ColumnDefinition column = (ColumnDefinition) selection.getFirstElement();
EditColumnDialog dlg = new EditColumnDialog(getShell(), column);
if (dlg.open() == Window.OK) {
columnList.update(column, null);
}
}
}
use of org.netxms.ui.eclipse.datacollection.dialogs.EditColumnDialog in project netxms by netxms.
the class TableColumns method addColumn.
/**
* Add new threshold
*/
private void addColumn() {
final InputDialog idlg = new InputDialog(getShell(), Messages.get().TableColumns_NewColumn, Messages.get().TableColumns_ColumnName, "", new // $NON-NLS-1$
IInputValidator() {
@Override
public String isValid(String newText) {
if (newText.trim().isEmpty())
return Messages.get().TableColumns_WarningText;
return null;
}
});
if (idlg.open() == Window.OK) {
final ColumnDefinition column = new ColumnDefinition(idlg.getValue(), idlg.getValue());
final EditColumnDialog dlg = new EditColumnDialog(getShell(), column);
if (dlg.open() == Window.OK) {
columns.add(column);
columnList.setInput(columns.toArray());
columnList.setSelection(new StructuredSelection(column));
}
}
}
Aggregations