1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

[270671] - refactor to move ui parts to ui package and some small protection for inf loop

This commit is contained in:
Alena Laskavaia 2009-04-01 15:18:42 +00:00
parent ba9a7cbcfd
commit 2c7e70fd47
5 changed files with 33 additions and 20 deletions

View file

@ -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>

View file

@ -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();

View file

@ -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:

View file

@ -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;

View file

@ -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;