Eclipse RCP - How to Open Launch Settings Dialog

How to open the "Startup Settings" dialog box (for example, when you click mouse_right on a project - run how it works) in an RCP application using the command? or in any other way, but the command is preferred.

+3
source share
2 answers

If you type “ ALT+SHIFT+F1” in “Create, manage, and run configurations,” the Spy plug-in will let you know.LaunchConfigurationsDialog

A quick search in Eclipse sources indicates that it was created using DebugUITools.openLaunchConfigurationDialogOnGroup()

     final int[] result = new int[1];
         Runnable JavaDoc r = new Runnable JavaDoc() {
             /**
              * @see java.lang.Runnable#run()
              */
             public void run() {
                 LaunchConfigurationsDialog dialog = (LaunchConfigurationsDialog) LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
                 if (dialog != null) {
                     dialog.setInitialSelection(selection);
                     dialog.doInitialTreeSelection();
                     if (status != null) {
                         dialog.handleStatus(status);
                     }
                     result[0] = Window.OK;
                 } else {
                     dialog = new LaunchConfigurationsDialog(shell, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier));
                     dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
                     dialog.setInitialSelection(selection);
                     dialog.setInitialStatus(status);
                     result[0] = dialog.open();
                 }
             }
         };
         BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), r);
         return result[0];

This should give you enough material to get you started.

http://help.eclipse.org/stable/topic/org.eclipse.platform.doc.isv/guide/images/lcd.png

+7

VonC , config ILaunchConfigurationWorkingCopy mode is "run":

DebugUITools.openLaunchConfigurationDialog(
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                config,
                DebugUITools.getLaunchGroup(savedConfig, mode).getIdentifier(),
                null);
+4

Source: https://habr.com/ru/post/1705155/


All Articles