use of org.netxms.ui.eclipse.tools.ExtendedPropertyDialog in project netxms by netxms.
the class DataCollectionEditor method editSelectedObject.
/**
* Edit selected object
*/
private void editSelectedObject() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
DataCollectionObject dco = (DataCollectionObject) selection.getFirstElement();
DialogData data = null;
if (!hideModificationWarnings && dco.getTemplateId() != 0) {
String message = DataCollectionObjectEditor.createModificationWarningMessage(dco);
if (message != null) {
data = MessageDialogHelper.openWarningWithCheckbox(getSite().getShell(), "Warning", "Don't show this message again", message);
hideModificationWarnings = data.getSaveSelection();
}
}
if ((data == null) || data.isOkPressed()) {
// $NON-NLS-1$
ExtendedPropertyDialog dlg = ExtendedPropertyDialog.createDialogOn(getSite().getShell(), null, dco, "");
dlg.createAllPages();
int result = dlg.open();
if (((DataCollectionObject) selection.getFirstElement()).isNewItem() && result != SWT.OK) {
viewer.remove(selection.getFirstElement());
}
}
}
Aggregations