Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2005-11-23 18:11:24 +0000
committerDarin Wright2005-11-23 18:11:24 +0000
commit66c6d750a53def4f0025912b1c500379b0370837 (patch)
tree723dd1f5ca750dcee3cb6a44788f7eeb03abac11 /org.eclipse.debug.ui/ui/org/eclipse/debug
parentbbaac91025985428cfc2ea8e822fc6c95ccdfc23 (diff)
downloadeclipse.platform.debug-66c6d750a53def4f0025912b1c500379b0370837.tar.gz
eclipse.platform.debug-66c6d750a53def4f0025912b1c500379b0370837.tar.xz
eclipse.platform.debug-66c6d750a53def4f0025912b1c500379b0370837.zip
Bug 117491 - Debug event handlers no more
Bug 117089 - [flex-hierarchy] the "Lookup Source" action does not work
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextListener.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextManager.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextProvider.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISourceDisplayAdapter.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISourceDisplayAdapter.java)5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISuspendTrigger.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISuspendTriggerListener.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java)2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/CommonSourceNotFoundEditor.java226
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java170
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java2
26 files changed, 161 insertions, 475 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java
index 9281ed046..440d41869 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/AbstractDebugContextActionDelegate.java
@@ -22,8 +22,8 @@ import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
+import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
index f3ac0b4f9..20d64e946 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
@@ -13,9 +13,6 @@ package org.eclipse.debug.internal.ui.contexts;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index 57175af45..719fd3d49 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -19,8 +19,6 @@ import org.eclipse.core.commands.util.ListenerList;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IWorkbenchPage;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextListener.java
index 42240d61b..a59ac304f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextListener.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextManager.java
index 1fff05031..caf0c018b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextManager.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextProvider.java
index 1052a4e4d..cfb53e240 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java
index 146f262e3..052b919f6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/IDebugContextService.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.contexts;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.jface.viewers.ISelection;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISourceDisplayAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISourceDisplayAdapter.java
index 938e49278..9a02a7ddd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISourceDisplayAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISourceDisplayAdapter.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.ui.IWorkbenchPage;
@@ -25,7 +25,8 @@ public interface ISourceDisplayAdapter {
*
* @param context debug context to display source for
* @param page the page in which to display source
+ * @param forceSourceLookup whether source lookup should be performed
*/
- public void displaySource(Object context, IWorkbenchPage page);
+ public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISuspendTrigger.java
index a5ce7e0bb..bede82a97 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISuspendTrigger.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts;
/**
* Adapter retrieved from an <code>ILaunch</code> that notifies
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISuspendTriggerListener.java
index 5daafe5e7..82f7a77fd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/ISuspendTriggerListener.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-package org.eclipse.debug.ui.contexts;
+package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.debug.core.ILaunch;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
index e90457839..9b5515b28 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
@@ -22,8 +22,6 @@ import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.contexts.ISuspendTrigger;
-import org.eclipse.debug.ui.contexts.ISuspendTriggerListener;
/**
* @since 3.2
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
index 056b7c418..99c3e4a96 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
@@ -12,7 +12,6 @@ package org.eclipse.debug.internal.ui.contexts;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.ui.contexts.ISuspendTrigger;
/**
* @since 3.2
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
index 08024e5ab..be9e46319 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
@@ -22,10 +22,10 @@ import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.internal.ui.InstructionPointerManager;
+import org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupResult;
import org.eclipse.debug.internal.ui.views.launch.DecorationManager;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.ISourceDisplayAdapter;
import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.progress.UIJob;
@@ -130,11 +130,11 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplayAdapter {
}
/* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage)
+ * @see org.eclipse.debug.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
*/
- public synchronized void displaySource(Object context, IWorkbenchPage page) {
+ public synchronized void displaySource(Object context, IWorkbenchPage page, boolean force) {
IStackFrame frame = (IStackFrame)context;
- if (frame.equals(fPrevFrame)) {
+ if (!force && frame.equals(fPrevFrame)) {
fPrevResult.updateArtifact(context);
(new SourceDisplayJob(fPrevResult, page)).schedule();
} else {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 34c6f5eac..a488957b5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -35,10 +35,10 @@ import org.eclipse.debug.core.ILaunchListener;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.contexts.ISuspendTrigger;
+import org.eclipse.debug.internal.ui.contexts.ISuspendTriggerListener;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.ISuspendTrigger;
-import org.eclipse.debug.ui.contexts.ISuspendTriggerListener;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.swt.widgets.Display;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/CommonSourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/CommonSourceNotFoundEditor.java
index cb9f1388d..2308d5dcb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/CommonSourceNotFoundEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/CommonSourceNotFoundEditor.java
@@ -14,30 +14,18 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.views.launch.LaunchView;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.sourcelookup.SourceLookupDialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -51,14 +39,11 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
/**
* Editor for when source is not found. Shows the source name and has
@@ -73,7 +58,7 @@ import org.eclipse.ui.texteditor.ITextEditor;
* @see CommonSourceNotFoundEditorInput
* @since 3.0
*/
-public class CommonSourceNotFoundEditor extends EditorPart implements IReusableEditor, IDebugEventSetListener {
+public class CommonSourceNotFoundEditor extends EditorPart implements IReusableEditor, ILaunchesListener2 {
/**
* Text widgets used for this editor
@@ -108,7 +93,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
setSite(site);
setInput(input);
- DebugPlugin.getDefault().addDebugEventListener(this);
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
}
/**
@@ -193,84 +178,11 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
int result = dialog.open();
if(result == Window.OK) {
- resetEditor();
+ IWorkbenchPage page = getEditorSite().getPage();
+ SourceLookupManager.getDefault().displaySource(fObject, page, true);
+ closeEditor();
}
}
- /**
- * Clears the (source not found) editor inputs associated with the stack and
- * opening the editor again, if the item is not a stackframe. A marker will be added
- * and the editor will be told to scroll to the marker.
- *
- * If it is a stackframe, the launch view will pick up the change event and open a new
- * editor automatically.
- *
- */
- public void resetEditor()
- {
- fireChangeEventsOnStack();
-
- if(fObject instanceof IStackFrame) {
- return; //launch view will pick up from here
- }
-
- // close this editor and open a new editor
- final int lineNumber = getLineNumber();
- Runnable open = new Runnable() {
- public void run() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow != null) {
- IWorkbenchPage page= dwindow.getActivePage();
- if (page != null) {
- IDebugModelPresentation modelPres = DebugUITools.newDebugModelPresentation();
- IEditorInput input = modelPres.getEditorInput(fObject);
- if (input != null) {
- String id = modelPres.getEditorId(input, fObject);
- if (id != null) {
- try {
- IEditorPart editorPart = page.openEditor(input, id);
- if (editorPart instanceof ITextEditor && lineNumber >= 0) {
- // position to line number
- ITextEditor textEditor = (ITextEditor) editorPart;
- IRegion region= getLineInformation(textEditor, lineNumber);
- if (region != null) {
- textEditor.selectAndReveal(region.getOffset(), 0);
- }
- }
- } catch (PartInitException e1) {
- }
- }
- }
- modelPres.dispose();
- }
- }
- }
- };
- closeEditor();
- // get new editor input
- DebugUIPlugin.getStandardDisplay().asyncExec(open);
- }
-
- /**
- * Returns the line information for the given line in the given editor
- */
- private IRegion getLineInformation(ITextEditor editor, int lineNumber) {
- IDocumentProvider provider= editor.getDocumentProvider();
- IEditorInput input= editor.getEditorInput();
- try {
- provider.connect(input);
- } catch (CoreException e) {
- return null;
- }
- try {
- IDocument document= provider.getDocument(input);
- if (document != null)
- return document.getLineInformation(lineNumber);
- } catch (BadLocationException e) {
- } finally {
- provider.disconnect(input);
- }
- return null;
- }
/**
* Returns the line number associated with the breakpoint (marker).
@@ -308,95 +220,6 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
fText.setText(input.getToolTipText()+"\n"); //$NON-NLS-1$
}
}
-
- /**
- * Fires change event(s) to clear the source file history of the items in the stack.
- */
- protected void fireChangeEventsOnStack(){
- if(fObject instanceof IStackFrame) {
- fireChangeEvent(DebugEvent.CONTENT, (IStackFrame)fObject);
- } else if(fObject instanceof IDebugElement) { //loop through all threads and clear the cached source files
- try{
- IThread[] threads =((IDebugElement)fObject).getDebugTarget().getThreads();
- for(int i=0; i< threads.length; i++)
- {
- fireChangeEvent(DebugEvent.CONTENT, threads[i].getTopStackFrame());
- }
- } catch(DebugException e){}
- }
- }
-
- /**
- * Fire a debug change event with detail
- * @param detail @see DebugEvent
- */
- public void fireChangeEvent(int detail, IDebugElement source) {
- fireEvent(new DebugEvent(source, DebugEvent.CHANGE, detail));
- }
-
-
- /**
- * Fire a debug event
- */
- private void fireEvent(DebugEvent event) {
- if(DebugPlugin.getDefault() != null)
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event});
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- Object source= event.getSource();
- switch (event.getKind()) {
- case DebugEvent.TERMINATE :
- if(checkIfEditorShouldClose(source))
- closeEditor();
- break;
-
- case DebugEvent.CHANGE :
- if(!source.equals(fObject))
- return;
- // Trigger a selectionChange event
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- IWorkbenchPage p= window.getActivePage();
- if (p == null) {
- return;
- }
- IViewPart fLaunchView= p.findView(IDebugUIConstants.ID_DEBUG_VIEW);
- if (fLaunchView instanceof ISelectionChangedListener) {
- ISelection fSelection = ((LaunchView)fLaunchView).getViewer().getSelection();
- // To clear the stackframe stored in the launchView
- ((LaunchView)fLaunchView).clearSourceSelection(((IStackFrame)source).getThread());
- ((LaunchView)fLaunchView).getViewer().setSelection(fSelection, true);
- }
- break;
- }
- }
- }
-
-
- /**
- * Checks if the source of the terminate event is associated with this editor
- * object.
- * @param source the source of the event
- * @return true if the <code>source</code> is related to this editor, false otherwise
- */
- protected boolean checkIfEditorShouldClose(Object source) {
- //Make sure terminate event is for me
- if (fObject instanceof IDebugElement && source instanceof IDebugElement) {
- IDebugElement element = (IDebugElement)fObject;
- IDebugElement sourceElement = (IDebugElement)source;
- return sourceElement.equals(element.getDebugTarget());
- }
- return false;
- }
/**
* Closes this editor.
@@ -423,9 +246,44 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
super.dispose();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesTerminated(ILaunch[] launches) {
+ if (fObject instanceof IDebugElement) {
+ IDebugElement element = (IDebugElement)fObject;
+ for (int i = 0; i < launches.length; i++) {
+ ILaunch launch = launches[i];
+ if (launch.equals(element.getLaunch())) {
+ closeEditor();
+ return;
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesRemoved(ILaunch[] launches) {
+ launchesTerminated(launches);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesAdded(ILaunch[] launches) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesChanged(ILaunch[] launches) {
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
index 2d57596cf..641b01435 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
@@ -19,9 +19,11 @@ import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.views.launch.LaunchView;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.sourcelookup.SourceLookupDialog;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
@@ -71,7 +73,14 @@ public class EditSourceLookupPathAction extends SelectionListenerAction {
Shell shell = DebugUIPlugin.getShell();
SourceLookupDialog dialog = new SourceLookupDialog(shell, director);
if (dialog.open() == Window.OK) {
- fView.redoSourceLookup();
+ ISelection selection = fView.getViewer().getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() == 1) {
+ IWorkbenchPage page = fView.getSite().getPage();
+ SourceLookupManager.getDefault().displaySource(ss.getFirstElement(), page, true);
+ }
+ }
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
index 992e6cae6..8d13d4e49 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
@@ -15,7 +15,9 @@ import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.views.launch.LaunchView;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
@@ -60,7 +62,13 @@ public class LookupSourceAction extends SelectionListenerAction {
* @see org.eclipse.jface.action.IAction#run()
*/
public void run() {
- director.clearSourceElements(frame);
- fView.redoSourceLookup();
+ ISelection selection = fView.getViewer().getSelection();
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() == 1) {
+ IWorkbenchPage page = fView.getSite().getPage();
+ SourceLookupManager.getDefault().displaySource(ss.getFirstElement(), page, true);
+ }
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
index 952350436..50dc8a3d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
@@ -15,6 +15,7 @@ import java.util.Map;
import org.eclipse.ui.IWindowListener;
import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -83,4 +84,15 @@ public class SourceLookupManager implements IWindowListener {
SourceLookupService service = new SourceLookupService(window);
fServices.put(window, service);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
+ */
+ public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
+ IWorkbenchWindow window = page.getWorkbenchWindow();
+ SourceLookupService service = (SourceLookupService) fServices.get(window);
+ if (service != null) {
+ service.displaySource(context, page, forceSourceLookup);
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
index 13d9303b9..ef7ef5b17 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
@@ -12,8 +12,8 @@ package org.eclipse.debug.internal.ui.sourcelookup;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.ISourceDisplayAdapter;
+import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
+import org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchPage;
@@ -25,7 +25,7 @@ import org.eclipse.ui.IWorkbenchWindow;
*
* @since 3.2
*/
-public class SourceLookupService implements IDebugContextListener {
+public class SourceLookupService implements IDebugContextListener, ISourceDisplayAdapter {
private IWorkbenchWindow fWindow;
@@ -47,19 +47,13 @@ public class SourceLookupService implements IDebugContextListener {
IStructuredSelection structuredSelection = (IStructuredSelection)selection;
if (structuredSelection.size() == 1) {
Object context = (structuredSelection).getFirstElement();
- if (context instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) context;
- ISourceDisplayAdapter adapter = (ISourceDisplayAdapter) adaptable.getAdapter(ISourceDisplayAdapter.class);
- if (adapter != null) {
- IWorkbenchPage page = null;
- if (part == null) {
- page = fWindow.getActivePage();
- } else {
- page = part.getSite().getPage();
- }
- adapter.displaySource(context, page);
- }
- }
+ IWorkbenchPage page = null;
+ if (part == null) {
+ page = fWindow.getActivePage();
+ } else {
+ page = part.getSite().getPage();
+ }
+ displaySource(context, page, false);
}
}
}
@@ -68,5 +62,18 @@ public class SourceLookupService implements IDebugContextListener {
* @see org.eclipse.debug.ui.contexts.IDebugContextListener#contextChanged(org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
public void contextChanged(ISelection selection, IWorkbenchPart part) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
+ */
+ public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
+ if (context instanceof IAdaptable) {
+ IAdaptable adaptable = (IAdaptable) context;
+ ISourceDisplayAdapter adapter = (ISourceDisplayAdapter) adaptable.getAdapter(ISourceDisplayAdapter.class);
+ if (adapter != null) {
+ adapter.displaySource(context, page, forceSourceLookup);
+ }
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
index be37402c3..4c468d67c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
@@ -14,7 +14,7 @@ import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IWatchExpression;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
+import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchPart;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
index a6caeba01..cd44301c0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
@@ -10,13 +10,9 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.console;
-import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchesListener;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
@@ -29,24 +25,9 @@ import org.eclipse.ui.texteditor.IUpdate;
/**
* ConsoleRemoveAllTerminatedAction
*/
-public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate, IDebugEventSetListener, ILaunchesListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- Object source = event.getSource();
- if (event.getKind() == DebugEvent.TERMINATE && (source instanceof IDebugTarget || source instanceof IProcess)) {
- update();
- }
- }
-
- }
+public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate, ILaunchesListener2 {
public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
}
@@ -81,7 +62,6 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE_ALL));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_ALL));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE_ALL));
- DebugPlugin.getDefault().addDebugEventListener(this);
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
update();
}
@@ -105,5 +85,12 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
public void launchesChanged(ILaunch[] launches) {
- }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesTerminated(ILaunch[] launches) {
+ update();
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
index 3cc7a9a98..558269649 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
@@ -10,15 +10,11 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.console;
-import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.ui.IDebugUIConstants;
@@ -27,25 +23,19 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.IConsoleListener;
-import org.eclipse.ui.console.IConsoleView;
/**
* ConsoleRemoveTerminatedAction
*/
-public class ConsoleRemoveLaunchAction extends Action implements IDebugEventSetListener, IViewActionDelegate, IConsoleListener {
+public class ConsoleRemoveLaunchAction extends Action implements IViewActionDelegate, IConsoleListener, ILaunchesListener2 {
private ILaunch fLaunch;
- private IConsoleView fConsoleView;
-
- public ConsoleRemoveLaunchAction() {
+ public ConsoleRemoveLaunchAction(ILaunch launch) {
super(ConsoleMessages.ConsoleRemoveTerminatedAction_0);
setToolTipText(ConsoleMessages.ConsoleRemoveTerminatedAction_1);
@@ -53,46 +43,19 @@ public class ConsoleRemoveLaunchAction extends Action implements IDebugEventSetL
setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE));
- DebugPlugin.getDefault().addDebugEventListener(this);
+ DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this);
+ fLaunch = launch;
update();
}
public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
}
public synchronized void update() {
- if (fConsoleView == null) {
- IWorkbenchWindow activeWorkbenchWindow = DebugUIPlugin.getActiveWorkbenchWindow();
- if (activeWorkbenchWindow != null) {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if (activePage != null) {
- fConsoleView = (IConsoleView) activePage.findView(IConsoleConstants.ID_CONSOLE_VIEW);
- }
- }
- }
-
- if (fConsoleView != null) {
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- IConsole console = fConsoleView.getConsole();
- if (console instanceof ProcessConsole) {
- ProcessConsole processConsole = (ProcessConsole) console;
- IProcess process = processConsole.getProcess();
- ILaunch launch = process.getLaunch();
- if (launch.isTerminated()) {
- setEnabled(true);
- fLaunch = launch;
- return;
- }
- }
- }
- });
- }
- fLaunch = null;
- setEnabled(false);
+ setEnabled(fLaunch.isTerminated());
}
public synchronized void run() {
@@ -100,18 +63,7 @@ public class ConsoleRemoveLaunchAction extends Action implements IDebugEventSetL
launchManager.removeLaunch(fLaunch);
}
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- Object source = event.getSource();
- if (event.getKind() == DebugEvent.TERMINATE && (source instanceof IDebugTarget || source instanceof IProcess)) {
- update();
- }
- }
- }
-
public void init(IViewPart view) {
- fConsoleView = (IConsoleView) view;
}
public void run(IAction action) {
@@ -127,4 +79,29 @@ public class ConsoleRemoveLaunchAction extends Action implements IDebugEventSetL
public void consolesRemoved(IConsole[] consoles) {
update();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesTerminated(ILaunch[] launches) {
+ update();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesRemoved(ILaunch[] launches) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesAdded(ILaunch[] launches) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
+ */
+ public void launchesChanged(ILaunch[] launches) {
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
index dda224bbf..63148d2cc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
@@ -96,7 +96,7 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
fPage = page;
fConsole = (ProcessConsole) console;
- fRemoveTerminated = new ConsoleRemoveLaunchAction();
+ fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getProcess().getLaunch());
fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction();
fTerminate = new ConsoleTerminateAction(fConsole);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
index f0bf6f2ee..e43953adb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
@@ -22,6 +22,7 @@ import org.eclipse.debug.core.model.IRegisterGroup;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.model.IVariable;
+import org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter;
import org.eclipse.debug.internal.ui.elements.adapters.AsynchronousDebugLabelAdapter;
import org.eclipse.debug.internal.ui.elements.adapters.DebugTargetTreeContentAdapter;
import org.eclipse.debug.internal.ui.elements.adapters.ExpressionManagerTreeContentAdapter;
@@ -41,7 +42,6 @@ import org.eclipse.debug.internal.ui.viewers.IModelProxyFactory;
import org.eclipse.debug.internal.ui.viewers.IModelSelectionPolicy;
import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory;
import org.eclipse.debug.internal.ui.viewers.update.DefaultSelectionPolicy;
-import org.eclipse.debug.ui.contexts.ISourceDisplayAdapter;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.model.IWorkbenchAdapter2;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index 88fcd82c9..fe0d7c2dd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -14,15 +14,8 @@ package org.eclipse.debug.internal.ui.views.launch;
import java.util.Iterator;
import org.eclipse.core.commands.util.ListenerList;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
@@ -45,10 +38,11 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.InstructionPointerManager;
import org.eclipse.debug.internal.ui.actions.AddToFavoritesAction;
import org.eclipse.debug.internal.ui.actions.EditLaunchConfigurationAction;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
+import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
+import org.eclipse.debug.internal.ui.contexts.IDebugContextProvider;
import org.eclipse.debug.internal.ui.sourcelookup.EditSourceLookupPathAction;
import org.eclipse.debug.internal.ui.sourcelookup.LookupSourceAction;
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
@@ -60,8 +54,6 @@ import org.eclipse.debug.ui.AbstractDebugView;
import org.eclipse.debug.ui.IDebugEditorPresentation;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
@@ -101,16 +93,10 @@ import org.eclipse.ui.part.IShowInTarget;
import org.eclipse.ui.part.IShowInTargetList;
import org.eclipse.ui.part.ShowInContext;
-public class LaunchView extends AbstractDebugView implements ISelectionChangedListener, IPerspectiveListener2, IPageListener, IPropertyChangeListener, IResourceChangeListener, IShowInTarget, IShowInSource, IShowInTargetList, IPartListener2 {
+public class LaunchView extends AbstractDebugView implements ISelectionChangedListener, IPerspectiveListener2, IPageListener, IPropertyChangeListener, IShowInTarget, IShowInSource, IShowInTargetList, IPartListener2 {
public static final String ID_CONTEXT_ACTIVITY_BINDINGS = "contextActivityBindings"; //$NON-NLS-1$
- /**s
- * Cache of the stack frame that source was displayed
- * for.
- */
- private IStackFrame fStackFrame = null;
-
/**
* Whether this view is in the active page of a perspective.
*/
@@ -228,7 +214,6 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
*/
public LaunchView() {
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
}
/* (non-Javadoc)
@@ -502,19 +487,9 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
window.removePerspectiveListener(this);
window.removePageListener(this);
- cleanup();
-
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
super.dispose();
}
-
- /**
- * Disposes of cached information
- */
- protected void cleanup() {
- setStackFrame(null);
- }
/**
* The selection has changed in the viewer. Show the
@@ -538,36 +513,6 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
fProvider.possibleContextChange(element);
}
- /**
- * Lookup source element for current stack frame again.
- */
- public void redoSourceLookup() {
- setStackFrame(null);
- selectionChanged(null);
- }
-
- /**
- * Notifies this view to clean up for the given launches (they've been terminated,
- * removed, etc.). Remove all context submissions associated with these launches.
- * Clear the cache of the last stack frame that source was displayed for
- * if that launch is terminated.
- *
- * @param launches the terminated launches
- */
- protected void cleanupLaunches(ILaunch[] launches) {
- fContextListener.launchesTerminated(launches);
- IStackFrame frame = getStackFrame();
- if (frame != null) {
- ILaunch frameLaunch= frame.getLaunch();
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- if (launch.equals(frameLaunch)) {
- setStackFrame(null);
- }
- }
- }
- }
-
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
*/
@@ -647,24 +592,6 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
public IDebugModelPresentation getPresentation(String id) {
return ((DelegatingModelPresentation)fEditorPresentation).getPresentation(id);
}
-
- /**
- * Deselects any source decorations associated with the given thread or
- * debug target.
- *
- * @param source thread or debug target
- */
- public void clearSourceSelection(Object source) {
- if (source instanceof IThread) {
- IThread thread = (IThread)source;
- DecorationManager.removeDecorations(thread);
- InstructionPointerManager.getDefault().removeAnnotations(thread);
- } else if (source instanceof IDebugTarget) {
- IDebugTarget target = (IDebugTarget)source;
- DecorationManager.removeDecorations(target);
- InstructionPointerManager.getDefault().removeAnnotations(target);
- }
- }
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
@@ -743,29 +670,6 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
}
}
}
-
- /**
- * Returns the last stack frame that source was retrieved
- * for. Used to avoid source lookups for the same stack
- * frame when stepping.
- *
- * @return stack frame, or <code>null</code>
- */
- protected IStackFrame getStackFrame() {
- return fStackFrame;
- }
-
- /**
- * Sets the last stack frame that source was retrieved
- * for. Used to avoid source lookups for the same stack
- * frame when stepping. Setting the stack frame to <code>null</code>
- * effectively forces a source lookup.
- *
- * @param frame The stack frame or <code>null</code>
- */
- protected void setStackFrame(IStackFrame frame) {
- fStackFrame= frame;
- }
/**
* Sets whether this view is in the active page of a
@@ -806,74 +710,6 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
fContextListener.loadTrackViews();
}
}
-
- /**
- * Visitor for handling resource deltas. When a project is closed, we must clear
- * the cache of editor input/stack frame, etc., as the elements can become invalid.
- */
- class LaunchViewVisitor implements IResourceDeltaVisitor {
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) {
- if (delta == null) {
- return false;
- }
- IResource resource = delta.getResource();
- if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
- if (resource instanceof IProject) {
- IProject project = (IProject)resource;
- if (!project.isOpen()) {
- // clear
- cleanup();
- }
- }
- return false;
- }
- return resource instanceof IWorkspaceRoot;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent event) {
- IResourceDelta delta= event.getDelta();
- if (delta != null) {
- try {
- delta.accept(getVisitor());
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
-
- /**
- * Returns the resource delta visitor for this view,
- * creating if required.
- *
- * @return resource delta visitor
- */
- protected IResourceDeltaVisitor getVisitor() {
- if (fVisitor == null) {
- fVisitor = new LaunchViewVisitor();
- }
- return fVisitor;
- }
-
- /**
- * When this view becomes visible, selects the last stack frame whose
- * location was revealed.
- *
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
- */
- protected void becomesVisible() {
- super.becomesVisible();
- IStructuredSelection selection= (IStructuredSelection) getViewer().getSelection();
- if (selection.isEmpty() || !selection.getFirstElement().equals(getStackFrame())) {
- initializeSelection();
- }
- }
/* (non-Javadoc)
* @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index 9be1eaa19..c42134f7b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -46,6 +46,7 @@ import org.eclipse.debug.internal.ui.actions.ShowTypesAction;
import org.eclipse.debug.internal.ui.actions.ToggleDetailPaneAction;
import org.eclipse.debug.internal.ui.actions.context.FindVariableAction;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
+import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
import org.eclipse.debug.internal.ui.viewers.PresentationContext;
@@ -55,7 +56,6 @@ import org.eclipse.debug.ui.AbstractDebugView;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;

Back to the top