Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorAlena Laskavaia2009-04-01 11:18:42 -0400
committerAlena Laskavaia2009-04-01 11:18:42 -0400
commit2c7e70fd476b5826532b9434830bc28f842ec630 (patch)
tree244b226fdf20de9aa44ed97f894aea417a271cb3 /launch
parentba9a7cbcfd9efa25ff92cc8ebce98cc960757767 (diff)
downloadorg.eclipse.cdt-2c7e70fd476b5826532b9434830bc28f842ec630.tar.gz
org.eclipse.cdt-2c7e70fd476b5826532b9434830bc28f842ec630.tar.xz
org.eclipse.cdt-2c7e70fd476b5826532b9434830bc28f842ec630.zip
[270671] - refactor to move ui parts to ui package and some small protection for inf loop
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/plugin.xml2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java42
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties1
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java (renamed from launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationSelectionDialog.java)4
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java (renamed from launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationTabGroup.java)4
5 files changed, 33 insertions, 20 deletions
diff --git a/launch/org.eclipse.cdt.launch/plugin.xml b/launch/org.eclipse.cdt.launch/plugin.xml
index e526f4c90a..1dba6283d1 100644
--- a/launch/org.eclipse.cdt.launch/plugin.xml
+++ b/launch/org.eclipse.cdt.launch/plugin.xml
@@ -215,7 +215,7 @@
<extension
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
- class="org.eclipse.cdt.launch.internal.MultiLaunchConfigurationTabGroup"
+ class="org.eclipse.cdt.launch.internal.ui.MultiLaunchConfigurationTabGroup"
id="org.eclipse.cdt.launch.launchGroup.tabgroup"
type="org.eclipse.cdt.launch.launchGroup">
</launchConfigurationTabGroup>
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
index 625641ccd4..e48ca6a10b 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
@@ -30,20 +30,20 @@ import org.eclipse.ui.PlatformUI;
* Group Launch delegate. Launches each configuration in the user selected mode
*/
public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegate implements ILaunchConfigurationDelegate {
- static final String DEFAULT_MODE = "default"; //$NON-NLS-1$
+ public static final String DEFAULT_MODE = "default"; //$NON-NLS-1$
private static final String NAME_PROP = "name"; //$NON-NLS-1$
private static final String ENABLED_PROP = "enabled"; //$NON-NLS-1$
private static final String MODE_PROP = "mode"; //$NON-NLS-1$
private static final String ACTION_PROP = "action"; //$NON-NLS-1$
public static String MULTI_LAUNCH_CONSTANTS_PREFIX = "org.eclipse.cdt.launch.launchGroup"; //$NON-NLS-1$
- static class LaunchElement {
- int index;
- boolean enabled;
- String mode;
- String action;
- String name;
- ILaunchConfiguration data;
+ public static class LaunchElement {
+ public int index;
+ public boolean enabled;
+ public String mode;
+ public String action;
+ public String name;
+ public ILaunchConfiguration data;
}
public MultiLaunchConfigurationDelegate() {
@@ -85,19 +85,31 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
continue;
}
- ILaunch launch2 = DebugUIPlugin.buildAndLaunch(conf, localMode,
- new SubProgressMonitor(monitor, 1000 / input.size()));
- IProcess[] processes = launch2.getProcesses();
- for (int i = 0; i < processes.length; i++) {
- IProcess process = processes[i];
- launch.addProcess(process);
-
+ try {
+ if (configuration.getName().equals(conf.getName())) throw new StackOverflowError();
+ ILaunch launch2 = DebugUIPlugin.buildAndLaunch(conf, localMode, new SubProgressMonitor(monitor,
+ 1000 / input.size()));
+ IProcess[] processes = launch2.getProcesses();
+ for (int i = 0; i < processes.length; i++) {
+ IProcess process = processes[i];
+ launch.addProcess(process);
+ }
+ } catch (StackOverflowError e) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ LaunchMessages.getString("LaunchUIPlugin.Error"), //$NON-NLS-1$
+ LaunchMessages.getFormattedString("MultiLaunchConfigurationDelegate.Loop", //$NON-NLS-1$
+ conf.toString()));
+ }
+ });
}
}
if (!launch.hasChildren()) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.removeLaunch(launch);
}
+
} finally {
DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, dstore);
monitor.done();
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
index e2c07e3679..e6fdd81141 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.properties
@@ -149,6 +149,7 @@ LocalCDILaunchDelegate.9=Eclipse runtime does not support working directory.
LocalCDILaunchDelegate.10=Failed to set program arguments, environment or working directory.
MultiLaunchConfigurationDelegate.0=Launching
MultiLaunchConfigurationDelegate.Cannot=Cannot launch ''{0}'' in the ''{1}'' mode
+MultiLaunchConfigurationDelegate.Loop=Infinite loop detected for ''{0}'' configuration
MultiLaunchConfigurationSelectionDialog.0=Launch Configuration Selector
MultiLaunchConfigurationSelectionDialog.1=Select a Launch Configuration and a Launch Mode
MultiLaunchConfigurationSelectionDialog.4=Launch Mode:
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationSelectionDialog.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java
index 7c7009fbfc..330f516951 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationSelectionDialog.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java
@@ -1,9 +1,9 @@
-package org.eclipse.cdt.launch.internal;
+package org.eclipse.cdt.launch.internal.ui;
import java.util.HashMap;
import java.util.Iterator;
-import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
+import org.eclipse.cdt.launch.internal.MultiLaunchConfigurationDelegate;
import org.eclipse.cdt.launch.ui.ComboControlledStackComposite;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java
index 7d7123f3f8..b76382a60e 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationTabGroup.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java
@@ -1,9 +1,9 @@
-package org.eclipse.cdt.launch.internal;
+package org.eclipse.cdt.launch.internal.ui;
import java.util.ArrayList;
import java.util.Iterator;
-import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
+import org.eclipse.cdt.launch.internal.MultiLaunchConfigurationDelegate;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;

Back to the top