代码之家  ›  专栏  ›  技术社区  ›  Imaskar

Eclipse RCP-如何打开启动配置对话框

  •  3
  • Imaskar  · 技术社区  · 17 年前

    如何通过命令在RCP应用程序中打开启动配置对话框(如在项目-运行方式-运行配置上按鼠标右键)?或任何其他方式,但命令优先。

    2 回复  |  直到 17 年前
        1
  •  7
  •   Glorfindel Doug L.    7 年前

    如果你输入' ALT+SHIFT+F1 '在“创建、管理和运行配置”上 plug-in Spy LaunchConfigurationsDialog

    在Eclipse源代码中快速搜索表明它是通过 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];
    

    这应该给你足够的材料开始。


    eclipse.org )

        2
  •  4
  •   C-Otto    13 年前

    config 这就是我的例子 ILaunchConfigurationWorkingCopy 和 mode "run" :

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