Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse RCP - How to open Launch Configuration dialog

How to open Launch Configuration dialog (like when press mouse_right on project - run as - run configurations) in RCP app via command? or any other way, but command preferred.

like image 265
Imaskar Avatar asked Dec 23 '22 12:12

Imaskar


1 Answers

If you type 'ALT+SHIFT+F1' on an 'Create, manage and run configurations', the plug-in Spy will tell you it is a LaunchConfigurationsDialog

A quick search in the Eclipse sources indicates it is created through an 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];

That should give you enough material to get started.


(source: eclipse.org)

like image 143
VonC Avatar answered Dec 28 '22 01:12

VonC