Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-05 12:47:10 +0000
committerTobias Schwarz2014-02-05 12:47:10 +0000
commite8614100fe2783252753d493a5c824f6f0518730 (patch)
tree3b52e1c5e9e87bf3018c07c09a3bda96b24f0c6d /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui
parent1009da7964bac5acc2956da7d7010a4ac462bdc4 (diff)
downloadorg.eclipse.tcf-e8614100fe2783252753d493a5c824f6f0518730.tar.gz
org.eclipse.tcf-e8614100fe2783252753d493a5c824f6f0518730.tar.xz
org.eclipse.tcf-e8614100fe2783252753d493a5c824f6f0518730.zip
SM: switch to configured perspective even if launch is already running
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
index 4a6866a5f..77c67b364 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/internal/services/DebugService.java
@@ -77,7 +77,8 @@ public class DebugService extends AbstractService implements IDebugService {
}
}
- protected void internalAttach(final Object context, final IPropertiesContainer data, final IProgressMonitor monitor, final ICallback callback) {
+ @SuppressWarnings("restriction")
+ protected void internalAttach(final Object context, final IPropertiesContainer data, final IProgressMonitor monitor, final ICallback callback) {
Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(context);
@@ -103,15 +104,17 @@ public class DebugService extends AbstractService implements IDebugService {
ILaunchConfiguration config = launchConfigs != null && launchConfigs.length > 0 ? launchConfigs[0] : null;
boolean skip = false;
+ ILaunch activeLaunch = null;
if (config != null) {
-
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
for (ILaunch launch : launches) {
if (launch.getLaunchConfiguration().getType().getIdentifier().equals(ILaunchTypes.ATTACH) && !launch.isTerminated()) {
IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(launch.getLaunchConfiguration());
if (contexts != null && contexts.length == 1 && contexts[0].equals(context)) {
callback.setProperty("launch", launch); //$NON-NLS-1$
+ activeLaunch = launch;
skip = true;
+ break;
}
}
}
@@ -154,6 +157,7 @@ public class DebugService extends AbstractService implements IDebugService {
}
});
} else {
+ org.eclipse.debug.internal.ui.DebugUIPlugin.getDefault().getPerspectiveManager().launchAdded(activeLaunch);
callback.done(this, Status.OK_STATUS);
}
}

Back to the top