diff options
author | Darin Wright | 2004-11-16 14:00:34 +0000 |
---|---|---|
committer | Darin Wright | 2004-11-16 14:00:34 +0000 |
commit | 1b54fc94f13b7bda7faf648af2360403df3e5b07 (patch) | |
tree | eafed38eb81cedba7637954a5361bd993030f2a5 | |
parent | 1690baa245b0c738f281a1cec38c59ee29b4ced5 (diff) | |
download | eclipse.platform.debug-1b54fc94f13b7bda7faf648af2360403df3e5b07.tar.gz eclipse.platform.debug-1b54fc94f13b7bda7faf648af2360403df3e5b07.tar.xz eclipse.platform.debug-1b54fc94f13b7bda7faf648af2360403df3e5b07.zip |
Bug 78710 - Exceptions in log when terminating a session
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java index 76493e0da..1d8833617 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java @@ -21,6 +21,7 @@ import org.eclipse.debug.ui.DebugUITools; import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.widgets.Event; import org.eclipse.ui.IActionDelegate2; @@ -28,6 +29,7 @@ import org.eclipse.ui.IEditorActionDelegate; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.ISelectionListener; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchPartSite; /** * A run to line action that can be contributed to a an editor. The action @@ -104,12 +106,18 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe if (fAction == null) { return; } + boolean enabled = false; if (fPartTarget != null && fTargetElement != null) { - fAction.setEnabled(fTargetElement.isSuspended() && - fPartTarget.canRunToLine(fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement)); - } else { - fAction.setEnabled(false); + IWorkbenchPartSite site = fActivePart.getSite(); + if (site != null) { + ISelectionProvider selectionProvider = site.getSelectionProvider(); + if (selectionProvider != null) { + ISelection selection = selectionProvider.getSelection(); + enabled = fTargetElement.isSuspended() && fPartTarget.canRunToLine(fActivePart, selection, fTargetElement); + } + } } + fAction.setEnabled(enabled); } /* (non-Javadoc) |