Search in sources :

Example 36 with Dialog

use of org.eclipse.jface.dialogs.Dialog in project webtools.servertools by eclipse.

the class PreferencesTestCase method testPreferencePage.

public void testPreferencePage() {
    Dialog dialog = UITestHelper.getPreferenceDialog("org.eclipse.wst.internet.monitor.preferencePage");
    UITestHelper.assertDialog(dialog);
}
Also used : Dialog(org.eclipse.jface.dialogs.Dialog)

Example 37 with Dialog

use of org.eclipse.jface.dialogs.Dialog in project netxms by netxms.

the class ApplicationActionBarAdvisor method makeActions.

/* (non-Javadoc)
	 * @see org.eclipse.ui.application.ActionBarAdvisor#makeActions(org.eclipse.ui.IWorkbenchWindow)
	 */
@Override
protected void makeActions(final IWorkbenchWindow window) {
    contribItemShowView = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
    contribItemOpenPerspective = ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(window);
    actionExit = ActionFactory.QUIT.create(window);
    register(actionExit);
    actionAbout = new Action(String.format(Messages.get().ApplicationActionBarAdvisor_AboutActionName, BrandingManager.getInstance().getConsoleProductName())) {

        @Override
        public void run() {
            Dialog dlg = BrandingManager.getInstance().getAboutDialog(window.getShell());
            if (dlg != null) {
                dlg.open();
            } else {
                MessageDialogHelper.openInformation(window.getShell(), Messages.get().ApplicationActionBarAdvisor_AboutTitle, String.format(Messages.get().ApplicationActionBarAdvisor_AboutText, NXCommon.VERSION + " (" + BuildNumber.TEXT + ")"));
            }
        }
    };
    actionShowPreferences = ActionFactory.PREFERENCES.create(window);
    register(actionShowPreferences);
    actionCustomizePerspective = ActionFactory.EDIT_ACTION_SETS.create(window);
    register(actionCustomizePerspective);
    actionSavePerspective = ActionFactory.SAVE_PERSPECTIVE.create(window);
    register(actionSavePerspective);
    actionResetPerspective = ActionFactory.RESET_PERSPECTIVE.create(window);
    register(actionResetPerspective);
    actionClosePerspective = ActionFactory.CLOSE_PERSPECTIVE.create(window);
    register(actionClosePerspective);
    actionCloseAllPerspectives = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window);
    register(actionCloseAllPerspectives);
    actionMinimize = ActionFactory.MINIMIZE.create(window);
    register(actionMinimize);
    actionMaximize = ActionFactory.MAXIMIZE.create(window);
    register(actionMaximize);
    actionClose = new CommandAction(window, IWorkbenchCommandConstants.WINDOW_CLOSE_PART);
    register(actionClose);
    actionPrevView = ActionFactory.PREVIOUS_PART.create(window);
    register(actionPrevView);
    actionNextView = ActionFactory.NEXT_PART.create(window);
    register(actionNextView);
    actionShowViewMenu = ActionFactory.SHOW_VIEW_MENU.create(window);
    register(actionShowViewMenu);
    actionOpenProgressView = new Action() {

        @Override
        public void run() {
            IWorkbench wb = PlatformUI.getWorkbench();
            if (wb != null) {
                IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
                if (win != null) {
                    IWorkbenchPage page = win.getActivePage();
                    if (page != null) {
                        try {
                            // $NON-NLS-1$
                            page.showView("org.eclipse.ui.views.ProgressView");
                        } catch (PartInitException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
    };
    actionOpenProgressView.setText(Messages.get().ApplicationActionBarAdvisor_Progress);
    // $NON-NLS-1$
    actionOpenProgressView.setImageDescriptor(Activator.getImageDescriptor("icons/pview.gif"));
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IWorkbenchAction(org.eclipse.ui.actions.ActionFactory.IWorkbenchAction) Action(org.eclipse.jface.action.Action) CommandAction(org.eclipse.ui.internal.actions.CommandAction) Dialog(org.eclipse.jface.dialogs.Dialog) CommandAction(org.eclipse.ui.internal.actions.CommandAction) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) PartInitException(org.eclipse.ui.PartInitException)

Example 38 with Dialog

use of org.eclipse.jface.dialogs.Dialog in project netxms by netxms.

the class General method selectParameter.

/**
 * Select parameter
 */
private void selectParameter() {
    Dialog dlg;
    switch(origin.getSelectionIndex()) {
        case DataCollectionItem.INTERNAL:
            if (sourceNode.getObjectId() != 0)
                dlg = new SelectInternalParamDlg(getShell(), sourceNode.getObjectId());
            else
                dlg = new SelectInternalParamDlg(getShell(), dci.getNodeId());
            break;
        case DataCollectionItem.AGENT:
        case DataCollectionItem.DEVICE_DRIVER:
            if (sourceNode.getObjectId() != 0)
                dlg = new SelectAgentParamDlg(getShell(), sourceNode.getObjectId(), origin.getSelectionIndex(), false);
            else
                dlg = new SelectAgentParamDlg(getShell(), dci.getNodeId(), origin.getSelectionIndex(), false);
            break;
        case DataCollectionItem.SNMP:
        case DataCollectionItem.CHECKPOINT_SNMP:
            SnmpObjectId oid;
            try {
                oid = SnmpObjectId.parseSnmpObjectId(parameter.getText());
            } catch (SnmpObjectIdFormatException e) {
                oid = null;
            }
            if (sourceNode.getObjectId() != 0)
                dlg = new SelectSnmpParamDlg(getShell(), oid, sourceNode.getObjectId());
            else
                dlg = new SelectSnmpParamDlg(getShell(), oid, dci.getNodeId());
            break;
        case DataCollectionItem.WINPERF:
            if (sourceNode.getObjectId() != 0)
                dlg = new WinPerfCounterSelectionDialog(getShell(), sourceNode.getObjectId());
            else
                dlg = new WinPerfCounterSelectionDialog(getShell(), dci.getNodeId());
            break;
        case DataCollectionItem.SCRIPT:
            dlg = new SelectParameterScriptDialog(getShell());
            break;
        default:
            dlg = null;
            break;
    }
    if ((dlg != null) && (dlg.open() == Window.OK)) {
        IParameterSelectionDialog pd = (IParameterSelectionDialog) dlg;
        description.setText(pd.getParameterDescription());
        parameter.setText(pd.getParameterName());
        dataType.select(getDataTypePosition(pd.getParameterDataType()));
        editor.fireOnSelectItemListeners(origin.getSelectionIndex(), pd.getParameterName(), pd.getParameterDescription(), pd.getParameterDataType());
    }
}
Also used : SelectSnmpParamDlg(org.netxms.ui.eclipse.datacollection.dialogs.SelectSnmpParamDlg) SelectParameterScriptDialog(org.netxms.ui.eclipse.datacollection.dialogs.SelectParameterScriptDialog) DCIPropertyPageDialog(org.netxms.ui.eclipse.datacollection.propertypages.helpers.DCIPropertyPageDialog) IParameterSelectionDialog(org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog) WinPerfCounterSelectionDialog(org.netxms.ui.eclipse.datacollection.dialogs.WinPerfCounterSelectionDialog) Dialog(org.eclipse.jface.dialogs.Dialog) SnmpObjectIdFormatException(org.netxms.client.snmp.SnmpObjectIdFormatException) SelectAgentParamDlg(org.netxms.ui.eclipse.datacollection.dialogs.SelectAgentParamDlg) SnmpObjectId(org.netxms.client.snmp.SnmpObjectId) SelectParameterScriptDialog(org.netxms.ui.eclipse.datacollection.dialogs.SelectParameterScriptDialog) IParameterSelectionDialog(org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog) WinPerfCounterSelectionDialog(org.netxms.ui.eclipse.datacollection.dialogs.WinPerfCounterSelectionDialog) SelectInternalParamDlg(org.netxms.ui.eclipse.datacollection.dialogs.SelectInternalParamDlg)

Example 39 with Dialog

use of org.eclipse.jface.dialogs.Dialog in project tdq-studio-se by Talend.

the class About method run.

public void run(IAction action) {
    Dialog dialog = new AboutDlg(_shell);
    dialog.open();
}
Also used : Dialog(org.eclipse.jface.dialogs.Dialog) AboutDlg(net.sourceforge.sqlexplorer.dialogs.AboutDlg)

Example 40 with Dialog

use of org.eclipse.jface.dialogs.Dialog in project abstools by abstools.

the class DebugActionDelegate method run.

@Override
public void run(IAction action) {
    if (action == saveHistory) {
        FileDialog historyDialog = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);
        String pathString = historyDialog.open();
        if (pathString != null) {
            File path = new File(pathString);
            DebugUtils.getSchedulerRef().saveHistory(path);
        }
    } else if (action == executeSingleStep) {
        DebugUtils.getSchedulerRef().doSingleStep();
    } else if (action == executeNSteps) {
        Dialog stepDialog = new StepNumberDialog(Display.getCurrent().getActiveShell());
        stepDialog.open();
    } else if (action == stepOver) {
        DebugUtils.getSchedulerRef().doStepOver();
    } else if (action == runToLine) {
        Dialog lineDialog = new LineNumberDialog(Display.getCurrent().getActiveShell());
        lineDialog.open();
    } else if (action == resume) {
        DebugUtils.getSchedulerRef().resumeAutomaticScheduling();
    } else if (action == terminate) {
        DebugUtils.getDebugger().shutdown();
    }
}
Also used : FileDialog(org.eclipse.swt.widgets.FileDialog) Dialog(org.eclipse.jface.dialogs.Dialog) FileDialog(org.eclipse.swt.widgets.FileDialog) File(java.io.File)

Aggregations

Dialog (org.eclipse.jface.dialogs.Dialog)49 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)15 FileDialog (org.eclipse.swt.widgets.FileDialog)11 Composite (org.eclipse.swt.widgets.Composite)9 ArrayList (java.util.ArrayList)8 WizardDialog (org.eclipse.jface.wizard.WizardDialog)8 Control (org.eclipse.swt.widgets.Control)7 Shell (org.eclipse.swt.widgets.Shell)7 GridData (org.eclipse.swt.layout.GridData)6 Button (org.eclipse.swt.widgets.Button)6 ITextSelection (org.eclipse.jface.text.ITextSelection)5 GridLayout (org.eclipse.swt.layout.GridLayout)5 IStructuredCleanupProcessor (org.eclipse.wst.sse.core.internal.cleanup.IStructuredCleanupProcessor)5 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)5 File (java.io.File)4 Client (name.abuchen.portfolio.model.Client)4 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)4 List (java.util.List)3 SWT (org.eclipse.swt.SWT)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3