Search in sources :

Example 1 with DialogData

use of org.netxms.ui.eclipse.tools.DialogData 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());
        }
    }
}
Also used : DataCollectionObject(org.netxms.client.datacollection.DataCollectionObject) ExtendedPropertyDialog(org.netxms.ui.eclipse.tools.ExtendedPropertyDialog) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) DialogData(org.netxms.ui.eclipse.tools.DialogData)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 DataCollectionObject (org.netxms.client.datacollection.DataCollectionObject)1 DialogData (org.netxms.ui.eclipse.tools.DialogData)1 ExtendedPropertyDialog (org.netxms.ui.eclipse.tools.ExtendedPropertyDialog)1