Search in sources :

Example 11 with PropertyDialog

use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.

the class ReportExecutionForm method addSchedule.

/**
 * Add schedule
 */
protected void addSchedule() {
    final Map<String, String> execParameters = new HashMap<String, String>();
    if (parameters != null) {
        for (int i = 0; i < parameters.size(); i++) execParameters.put(parameters.get(i).getName(), fields.get(i).getValue());
    }
    final ReportingJob job = new ReportingJob(report);
    final PropertyDialog dialog = PropertyDialog.createDialogOn(workbenchPart.getSite().getShell(), General.ID, job);
    dialog.getShell().setText("Report Execution Schedule");
    if (dialog.open() != Window.OK)
        return;
    new ConsoleJob("Adding report schedule", workbenchPart, Activator.PLUGIN_ID, null) {

        @Override
        protected void runInternal(IProgressMonitor monitor) throws Exception {
            session.scheduleReport(job, execParameters);
        }

        @Override
        protected String getErrorMessage() {
            return String.format("Cannot schedule report %s", report.getName());
        }
    }.start();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) HashMap(java.util.HashMap) ConsoleJob(org.netxms.ui.eclipse.jobs.ConsoleJob) ReportingJob(org.netxms.client.reporting.ReportingJob) CoreException(org.eclipse.core.runtime.CoreException)

Example 12 with PropertyDialog

use of org.eclipse.ui.internal.dialogs.PropertyDialog in project eclipse-integration-commons by spring-projects.

the class SpringUIUtils method openPreferenceNode.

private static boolean openPreferenceNode(final String propertyPageId, final IPreferenceNode targetNode, final String title, Object element, Map<String, Object> data) {
    PreferenceManager manager = new PreferenceManager();
    manager.addToRoot(targetNode);
    final PropertyDialog dialog = new PropertyDialog(UiPlugin.getActiveWorkbenchShell(), manager, new StructuredSelection(element));
    if (propertyPageId != null) {
        dialog.setSelectedNode(propertyPageId);
    }
    if (data != null) {
        dialog.setPageData(data);
    }
    final boolean[] result = new boolean[] { false };
    BusyIndicator.showWhile(getStandardDisplay(), new Runnable() {

        public void run() {
            dialog.create();
            dialog.setMessage(targetNode.getLabelText());
            dialog.getShell().setText(title);
            result[0] = (dialog.open() == Window.OK);
        }
    });
    return result[0];
}
Also used : PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) PreferenceManager(org.eclipse.jface.preference.PreferenceManager)

Example 13 with PropertyDialog

use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.

the class DashboardControl method addElement.

/**
 * @param element
 */
private void addElement(DashboardElement element) {
    DashboardElementConfig config = (DashboardElementConfig) AdapterManager.getDefault().getAdapter(element, DashboardElementConfig.class);
    if (config != null) {
        try {
            config.setLayout(DashboardElementLayout.createFromXml(element.getLayout()));
            PropertyDialog dlg = PropertyDialog.createDialogOn(getShell(), null, config);
            if (dlg.open() == Window.CANCEL)
                // element creation cancelled
                return;
            element.setData(config.createXml());
            element.setLayout(config.getLayout().createXml());
            elements.add(element);
            createElementWidget(element);
            redoLayout();
            setModified();
        } catch (Exception e) {
            MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorPrefix + e.getMessage());
        }
    } else {
        MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorText2);
    }
}
Also used : PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) DashboardElementConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardElementConfig)

Example 14 with PropertyDialog

use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.

the class DashboardControl method editElement.

/**
 * Edit element
 *
 * @param element
 */
void editElement(DashboardElement element) {
    DashboardElementConfig config = (DashboardElementConfig) AdapterManager.getDefault().getAdapter(element, DashboardElementConfig.class);
    if (config != null) {
        try {
            config.setLayout(DashboardElementLayout.createFromXml(element.getLayout()));
            PropertyDialog dlg = PropertyDialog.createDialogOn(getShell(), null, config);
            if (dlg.open() == Window.CANCEL)
                // element creation cancelled
                return;
            element.setData(config.createXml());
            element.setLayout(config.getLayout().createXml());
            recreateElement(element);
            redoLayout();
            setModified();
        } catch (Exception e) {
            MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorPrefix + e.getMessage());
        }
    } else {
        MessageDialogHelper.openError(getShell(), Messages.get().DashboardControl_InternalError, Messages.get().DashboardControl_InternalErrorText1);
    }
}
Also used : PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) DashboardElementConfig(org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardElementConfig)

Example 15 with PropertyDialog

use of org.eclipse.ui.internal.dialogs.PropertyDialog in project netxms by netxms.

the class AlarmCategoryList method createCategory.

/**
 * Create new category
 */
public void createCategory() {
    AlarmCategoryEditor editor = new AlarmCategoryEditor(new AlarmCategory());
    PropertyDialog dlg = PropertyDialog.createDialogOn(getShell(), null, editor);
    dlg.open();
}
Also used : AlarmCategoryEditor(org.netxms.ui.eclipse.alarmviewer.editors.AlarmCategoryEditor) PropertyDialog(org.eclipse.ui.internal.dialogs.PropertyDialog) AlarmCategory(org.netxms.client.events.AlarmCategory)

Aggregations

PropertyDialog (org.eclipse.ui.internal.dialogs.PropertyDialog)24 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)10 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)5 ConsoleJob (org.netxms.ui.eclipse.jobs.ConsoleJob)5 PartInitException (org.eclipse.ui.PartInitException)4 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)3 DashboardElementConfig (org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardElementConfig)3 DciSummaryTable (org.netxms.client.datacollection.DciSummaryTable)2 DciSummaryTableDescriptor (org.netxms.client.datacollection.DciSummaryTableDescriptor)2 GraphSettings (org.netxms.client.datacollection.GraphSettings)2 NetworkMapDCIContainer (org.netxms.client.maps.elements.NetworkMapDCIContainer)2 NetworkMapDCIImage (org.netxms.client.maps.elements.NetworkMapDCIImage)2 NetworkMapTextBox (org.netxms.client.maps.elements.NetworkMapTextBox)2 AlarmCategoryEditor (org.netxms.ui.eclipse.alarmviewer.editors.AlarmCategoryEditor)2 PropertyEditor (com.centurylink.mdw.plugin.designer.properties.editor.PropertyEditor)1 ValueChangeListener (com.centurylink.mdw.plugin.designer.properties.editor.ValueChangeListener)1 ExtensionModulesUpdater (com.centurylink.mdw.plugin.project.assembly.ExtensionModulesUpdater)1 ProjectUpdater (com.centurylink.mdw.plugin.project.assembly.ProjectUpdater)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 HashMap (java.util.HashMap)1