diff options
author | Michael Rennie | 2007-03-12 21:10:51 +0000 |
---|---|---|
committer | Michael Rennie | 2007-03-12 21:10:51 +0000 |
commit | f3b70b40d2e5fb3c9ddb7b40d3bb1752b289c48c (patch) | |
tree | 1a1280f943f5597fe75fa0942293cccc2901b172 /org.eclipse.debug.ui | |
parent | 8f9781c230df00c0116048ecc9ec9a710e3da7e9 (diff) | |
download | eclipse.platform.debug-f3b70b40d2e5fb3c9ddb7b40d3bb1752b289c48c.tar.gz eclipse.platform.debug-f3b70b40d2e5fb3c9ddb7b40d3bb1752b289c48c.tar.xz eclipse.platform.debug-f3b70b40d2e5fb3c9ddb7b40d3bb1752b289c48c.zip |
Bug 176902
run/debug hover/behavior incorrect on workspace re-start
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextLaunchingResourceManager.java | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextLaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextLaunchingResourceManager.java index 4fa7ed0b6..b5597aadf 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextLaunchingResourceManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextLaunchingResourceManager.java @@ -34,6 +34,7 @@ import org.eclipse.ui.IPartListener; import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.IWindowListener; import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; @@ -195,9 +196,13 @@ public class ContextLaunchingResourceManager implements ISelectionListener, IPar } catch(CoreException ce) {DebugUIPlugin.log(ce);} } + //see if the context is a shared configuration + ILaunchConfiguration config = getLaunchConfigurationManager().isSharedConfig(fCurrentResource); + if(config != null) { + return config.getName(); + } List configs = getLaunchConfigurationManager().getApplicableLaunchConfigurations(resource); int csize = configs.size(); - ILaunchConfiguration config = null; if(csize == 1) { return ((ILaunchConfiguration)configs.get(0)).getName(); } @@ -355,5 +360,29 @@ public class ContextLaunchingResourceManager implements ISelectionListener, IPar /** * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow) */ - public void windowOpened(IWorkbenchWindow window) {} + public void windowOpened(IWorkbenchWindow window) { + IWorkbenchPage page = window.getActivePage(); + if(page != null) { + IWorkbenchPart part = page.getActivePart(); + if(part != null) { + if(part instanceof IEditorPart) { + fCurrentResource = (IResource) ((IEditorPart)part).getEditorInput().getAdapter(IResource.class); + } + else { + ISelection selection = part.getSite().getSelectionProvider().getSelection(); + if(selection instanceof IStructuredSelection) { + IStructuredSelection ss = (IStructuredSelection) selection; + if(!ss.isEmpty()) { + Object o = ss.getFirstElement(); + if(o instanceof IAdaptable) { + fCurrentResource = (IResource) ((IAdaptable)o).getAdapter(IResource.class); + } + } + } + } + computeLabels(); + notifyListeners(); + } + } + } } |