From 891eaa7729940ef49cb3383a34a3491d8a15e639 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Thu, 29 Mar 2007 15:02:34 +0000 Subject: [PATCH] Added overlay images for breakpoints with actions attached. --- .../breakpointactions/BreakpointActionManager.java | 9 +++++++++ .../icons/ovr16/actions_ovr.gif | Bin 0 -> 59 bytes .../icons/ovr16/actions_ovr_disabled.gif | Bin 0 -> 59 bytes .../cdt/debug/internal/ui/CDebugImages.java | 4 ++++ .../debug/internal/ui/CDebugModelPresentation.java | 4 ++++ 5 files changed, 17 insertions(+) create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/ovr16/actions_ovr.gif create mode 100644 debug/org.eclipse.cdt.debug.ui/icons/ovr16/actions_ovr_disabled.gif diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java index b2a93c9d6fd..2f861a718e8 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/breakpointactions/BreakpointActionManager.java @@ -85,6 +85,15 @@ public class BreakpointActionManager { getBreakpointActions().remove(action); } + public boolean breakpointHasActions(IBreakpoint breakpoint) { + if (breakpoint != null) { + IMarker marker = breakpoint.getMarker(); + String actionNames = marker.getAttribute(BREAKPOINT_ACTION_ATTRIBUTE, ""); //$NON-NLS-1$ + return actionNames.length() > 0; + } + return false; + } + public void executeActions(IBreakpoint breakpoint, IAdaptable context) { if (breakpoint != null) { diff --git a/debug/org.eclipse.cdt.debug.ui/icons/ovr16/actions_ovr.gif b/debug/org.eclipse.cdt.debug.ui/icons/ovr16/actions_ovr.gif new file mode 100644 index 0000000000000000000000000000000000000000..f460fd8ec31160b5559e52246d2b8adc2f6f91d1 GIT binary patch literal 59 zcmZ?wbhEHbWM|-Dn8*ME|Ns9N3=;y9ia%Kx85o!ubU>mYc?Kq)IsKVRCyysh&NmI= HX0QeT)msms literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/icons/ovr16/actions_ovr_disabled.gif b/debug/org.eclipse.cdt.debug.ui/icons/ovr16/actions_ovr_disabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..63fae76d503ff90ade332d48423d40b82eb5faf3 GIT binary patch literal 59 zcmZ?wbhEHbWM|-Dn8*ME|NsAQXlMYEia%Kx85o!ubU>mYc?Kq)IsKVRCyysh&NmI= HX0QeT{cRAZ literal 0 HcmV?d00001 diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java index 8f824d9a473..fc9f6343daf 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImages.java @@ -56,6 +56,8 @@ public class CDebugImages { public static final String IMG_OVRS_BREAKPOINT_INSTALLED_DISABLED = NAME_PREFIX + "installed_ovr_disabled.gif"; //$NON-NLS-1$ public static final String IMG_OVRS_BREAKPOINT_CONDITIONAL = NAME_PREFIX + "conditional_ovr.gif"; //$NON-NLS-1$ public static final String IMG_OVRS_BREAKPOINT_CONDITIONAL_DISABLED = NAME_PREFIX + "conditional_ovr_disabled.gif"; //$NON-NLS-1$ + public static final String IMG_OVRS_BREAKPOINT_WITH_ACTIONS = NAME_PREFIX + "actions_ovr.gif"; //$NON-NLS-1$ + public static final String IMG_OVRS_BREAKPOINT_WITH_ACTIONS_DISABLED = NAME_PREFIX + "actions_ovr_disabled.gif"; //$NON-NLS-1$ public static final String IMG_OVRS_ADDRESS_BREAKPOINT = NAME_PREFIX + "address_ovr.gif"; //$NON-NLS-1$ public static final String IMG_OVRS_ADDRESS_BREAKPOINT_DISABLED = NAME_PREFIX + "address_ovr_disabled.gif"; //$NON-NLS-1$ public static final String IMG_OVRS_FUNCTION_BREAKPOINT = NAME_PREFIX + "function_ovr.gif"; //$NON-NLS-1$ @@ -140,6 +142,8 @@ public class CDebugImages { public static final ImageDescriptor DESC_OVRS_BREAKPOINT_INSTALLED_DISABLED = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_INSTALLED_DISABLED ); public static final ImageDescriptor DESC_OVRS_BREAKPOINT_CONDITIONAL = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_CONDITIONAL ); public static final ImageDescriptor DESC_OVRS_BREAKPOINT_CONDITIONAL_DISABLED = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_CONDITIONAL_DISABLED ); + public static final ImageDescriptor DESC_OVRS_BREAKPOINT_WITH_ACTIONS = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_WITH_ACTIONS ); + public static final ImageDescriptor DESC_OVRS_BREAKPOINT_WITH_ACTIONS_DISABLED = createManaged( T_OVR, IMG_OVRS_BREAKPOINT_WITH_ACTIONS_DISABLED ); public static final ImageDescriptor DESC_OVRS_ADDRESS_BREAKPOINT = createManaged( T_OVR, IMG_OVRS_ADDRESS_BREAKPOINT ); public static final ImageDescriptor DESC_OVRS_ADDRESS_BREAKPOINT_DISABLED = createManaged( T_OVR, IMG_OVRS_ADDRESS_BREAKPOINT_DISABLED ); public static final ImageDescriptor DESC_OVRS_FUNCTION_BREAKPOINT = createManaged( T_OVR, IMG_OVRS_FUNCTION_BREAKPOINT ); diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java index ce7d3ee8e34..0f7defcb913 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java @@ -17,6 +17,7 @@ import java.util.HashMap; import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.resources.FileStorage; +import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; import org.eclipse.cdt.debug.core.cdi.ICDIExitInfo; @@ -474,6 +475,9 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode private ImageDescriptor[] computeBreakpointOverlays( ICBreakpoint breakpoint ) { ImageDescriptor[] overlays = new ImageDescriptor[]{ null, null, null, null }; try { + if ( CDebugCorePlugin.getDefault().getBreakpointActionManager().breakpointHasActions(breakpoint) ) { + overlays[OverlayImageDescriptor.BOTTOM_RIGHT] = (breakpoint.isEnabled()) ? CDebugImages.DESC_OVRS_BREAKPOINT_WITH_ACTIONS : CDebugImages.DESC_OVRS_BREAKPOINT_WITH_ACTIONS_DISABLED; + } if ( breakpoint.isConditional() ) { overlays[OverlayImageDescriptor.TOP_LEFT] = (breakpoint.isEnabled()) ? CDebugImages.DESC_OVRS_BREAKPOINT_CONDITIONAL : CDebugImages.DESC_OVRS_BREAKPOINT_CONDITIONAL_DISABLED; }