diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java index 4e736f482ac..331d18dd0f7 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/ICDebugInternalConstants.java @@ -44,4 +44,14 @@ public class ICDebugInternalConstants { * plus this key */ public static final String SHOW_FULL_PATHS_PREF_KEY = "org.eclipse.cdt.debug.ui.cDebug.show_full_paths"; //$NON-NLS-1$ + + /** + * An attribute set by a non-ICBreakpoint to support fullpath capability in the Breakpoints view. + * If this attribute exists, not null, in the breakpoint marker or the breakpoint is an + * ICBreakpoint type, then the show fullpath action in the Breakpoints view is enabled, otherwise + * disabled. The show fullpath action does not toggle the value of this breakpoint attribute, it is + * the breakpoint's responsibility to monitor the SHOW_FULL_PATHS_PREF_KEY value change and update + * the breakpoint presentation in the Breakpoints view. + */ + public static final String ATTR_CAPABLE_OF_SHOW_FULL_PATHS = "org.eclipse.cdt.debug.ui.cDebug.capable_of_show_full_paths"; //$NON-NLS-1$ } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java index 642ad191b6a..5f8a8d328ed 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java @@ -16,8 +16,11 @@ import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants; import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.IBreakpointManager; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.debug.core.model.IBreakpoint; +import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView; import org.eclipse.debug.internal.ui.views.launch.LaunchView; import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugView; @@ -100,6 +103,21 @@ public class ShowFullPathsAction extends ViewFilterAction { } } } + + // Breakpoints view + else if (view instanceof BreakpointsView) { + IBreakpointManager bkptmgr = DebugPlugin.getDefault().getBreakpointManager(); + IBreakpoint[] bkpts = bkptmgr.getBreakpoints(); + for (IBreakpoint bkpt : bkpts) { + try { + Object attr = bkpt.getMarker().getAttribute(ICDebugInternalConstants.ATTR_CAPABLE_OF_SHOW_FULL_PATHS); + if (attr != null) { + setEnabled(true); + return; + } + } catch (Exception e) {/* ignore */} + } + } super.selectionChanged(action, selection); } }