1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 07:55:24 +02:00

Bug 312121 - [breakpoints] Show fullpath not working in breakpoints view for other breakpoint type

This commit is contained in:
Patrick Chuong 2011-02-07 19:48:39 +00:00
parent 3806bba6bc
commit 2f04b81343
2 changed files with 28 additions and 0 deletions

View file

@ -44,4 +44,14 @@ public class ICDebugInternalConstants {
* plus this key * plus this key
*/ */
public static final String SHOW_FULL_PATHS_PREF_KEY = "org.eclipse.cdt.debug.ui.cDebug.show_full_paths"; //$NON-NLS-1$ 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 <code>null</code>, 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$
} }

View file

@ -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.internal.ui.CDebugModelPresentation;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchManager; 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.internal.ui.views.launch.LaunchView;
import org.eclipse.debug.ui.IDebugModelPresentation; import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugView; 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); super.selectionChanged(action, selection);
} }
} }