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:
parent
ba9a7cbcfd
commit
2c7e70fd47
5 changed files with 33 additions and 20 deletions
|
@ -215,7 +215,7 @@
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
|
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
|
||||||
<launchConfigurationTabGroup
|
<launchConfigurationTabGroup
|
||||||
class="org.eclipse.cdt.launch.internal.MultiLaunchConfigurationTabGroup"
|
class="org.eclipse.cdt.launch.internal.ui.MultiLaunchConfigurationTabGroup"
|
||||||
id="org.eclipse.cdt.launch.launchGroup.tabgroup"
|
id="org.eclipse.cdt.launch.launchGroup.tabgroup"
|
||||||
type="org.eclipse.cdt.launch.launchGroup">
|
type="org.eclipse.cdt.launch.launchGroup">
|
||||||
</launchConfigurationTabGroup>
|
</launchConfigurationTabGroup>
|
||||||
|
|
|
@ -30,20 +30,20 @@ import org.eclipse.ui.PlatformUI;
|
||||||
* Group Launch delegate. Launches each configuration in the user selected mode
|
* Group Launch delegate. Launches each configuration in the user selected mode
|
||||||
*/
|
*/
|
||||||
public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegate implements ILaunchConfigurationDelegate {
|
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 NAME_PROP = "name"; //$NON-NLS-1$
|
||||||
private static final String ENABLED_PROP = "enabled"; //$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 MODE_PROP = "mode"; //$NON-NLS-1$
|
||||||
private static final String ACTION_PROP = "action"; //$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$
|
public static String MULTI_LAUNCH_CONSTANTS_PREFIX = "org.eclipse.cdt.launch.launchGroup"; //$NON-NLS-1$
|
||||||
|
|
||||||
static class LaunchElement {
|
public static class LaunchElement {
|
||||||
int index;
|
public int index;
|
||||||
boolean enabled;
|
public boolean enabled;
|
||||||
String mode;
|
public String mode;
|
||||||
String action;
|
public String action;
|
||||||
String name;
|
public String name;
|
||||||
ILaunchConfiguration data;
|
public ILaunchConfiguration data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiLaunchConfigurationDelegate() {
|
public MultiLaunchConfigurationDelegate() {
|
||||||
|
@ -85,19 +85,31 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ILaunch launch2 = DebugUIPlugin.buildAndLaunch(conf, localMode,
|
try {
|
||||||
new SubProgressMonitor(monitor, 1000 / input.size()));
|
if (configuration.getName().equals(conf.getName())) throw new StackOverflowError();
|
||||||
IProcess[] processes = launch2.getProcesses();
|
ILaunch launch2 = DebugUIPlugin.buildAndLaunch(conf, localMode, new SubProgressMonitor(monitor,
|
||||||
for (int i = 0; i < processes.length; i++) {
|
1000 / input.size()));
|
||||||
IProcess process = processes[i];
|
IProcess[] processes = launch2.getProcesses();
|
||||||
launch.addProcess(process);
|
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()) {
|
if (!launch.hasChildren()) {
|
||||||
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
|
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
|
||||||
launchManager.removeLaunch(launch);
|
launchManager.removeLaunch(launch);
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, dstore);
|
DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, dstore);
|
||||||
monitor.done();
|
monitor.done();
|
||||||
|
|
|
@ -149,6 +149,7 @@ LocalCDILaunchDelegate.9=Eclipse runtime does not support working directory.
|
||||||
LocalCDILaunchDelegate.10=Failed to set program arguments, environment or working directory.
|
LocalCDILaunchDelegate.10=Failed to set program arguments, environment or working directory.
|
||||||
MultiLaunchConfigurationDelegate.0=Launching
|
MultiLaunchConfigurationDelegate.0=Launching
|
||||||
MultiLaunchConfigurationDelegate.Cannot=Cannot launch ''{0}'' in the ''{1}'' mode
|
MultiLaunchConfigurationDelegate.Cannot=Cannot launch ''{0}'' in the ''{1}'' mode
|
||||||
|
MultiLaunchConfigurationDelegate.Loop=Infinite loop detected for ''{0}'' configuration
|
||||||
MultiLaunchConfigurationSelectionDialog.0=Launch Configuration Selector
|
MultiLaunchConfigurationSelectionDialog.0=Launch Configuration Selector
|
||||||
MultiLaunchConfigurationSelectionDialog.1=Select a Launch Configuration and a Launch Mode
|
MultiLaunchConfigurationSelectionDialog.1=Select a Launch Configuration and a Launch Mode
|
||||||
MultiLaunchConfigurationSelectionDialog.4=Launch Mode:
|
MultiLaunchConfigurationSelectionDialog.4=Launch Mode:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.eclipse.cdt.launch.internal;
|
package org.eclipse.cdt.launch.internal.ui;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
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.cdt.launch.ui.ComboControlledStackComposite;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
|
@ -1,9 +1,9 @@
|
||||||
package org.eclipse.cdt.launch.internal;
|
package org.eclipse.cdt.launch.internal.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
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.core.runtime.CoreException;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
Loading…
Add table
Reference in a new issue