2009-03-22 11 views
3

Öffnen des Konfigurationsdialogs starten (z. B. Mausklick rechts auf Projekt - Ausführen als - Ausführen von Konfigurationen) in der RCP-App über Befehl? oder auf andere Weise, aber Befehl bevorzugt.Eclipse RCP - Öffnen des Startkonfigurations-Dialogfelds

+0

Ich meine, wie diese http nennen: //help.eclipse .org/stable/index.jsp? topic =/org.eclipse.platform.doc.isv/guide/debug_launch_ui.htm Dialog? – Imaskar

Antwort

7

Wenn Sie geben ‚ALT+SHIFT+F1‘ auf eine ‚erstellen, verwalten und ausführen Konfigurationen‘, die plug-in Spy wird Ihnen sagen, es ist ein in den Eclipse-Quellen LaunchConfigurationsDialog

Eine schnelle Suche ist, zeigt es durch eine DebugUITools.openLaunchConfigurationDialogOnGroup()

erstellt
 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]; 

Das sollte Ihnen genug Material geben, um loszulegen.

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

+0

Danke, es hat geholfen. Ich habe LaunchConfigurationsDialog und sogar OpenLaunchConfigurationsDialogOnGroup gefunden, konnte aber seine Parameter nicht verstehen. Quellcode machte es klar. Verdammt, ich war so nah ... – Imaskar

+0

Froh, dass es am Ende klappte :) – VonC

4

Basierend auf VonC Antwort habe ich die folgenden, wo config nur meine Instanz ILaunchConfigurationWorkingCopy und mode ist "run":

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