Skip to content

Commit c8751e8

Browse files
committed
Add support for custom labels on breakpoints
This commit introduces the ability for users to set custom labels on breakpoints, making it easier to identify and differentiate them. Additionally, breakpoints with custom labels are visually highlighted, improving workflow and debugging efficiency.
1 parent 8c2aa0f commit c8751e8

File tree

11 files changed

+449
-6
lines changed

11 files changed

+449
-6
lines changed

debug/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2016 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -45,7 +45,6 @@
4545

4646
public abstract class Breakpoint extends PlatformObject implements IBreakpoint, ITriggerPoint {
4747

48-
4948
/**
5049
* Creates a breakpoint.
5150
*
@@ -61,6 +60,13 @@ public Breakpoint() {
6160
*/
6261
private volatile IMarker fMarker;
6362

63+
/**
64+
* Attribute for custom labeling in breakpoints
65+
*
66+
* @since 3.23
67+
*/
68+
private final String LABEL = "breakpointLabel"; //$NON-NLS-1$
69+
6470
/**
6571
* @see IBreakpoint#setMarker(IMarker)
6672
*/
@@ -384,4 +390,24 @@ public String toString() {
384390
return builder.toString();
385391
}
386392

393+
/**
394+
* Returns the label associated with this breakpoint, or <code>null</code>
395+
* if no specific label was defined.
396+
*
397+
* @since 3.23
398+
*/
399+
public String getBreakpointLabel() {
400+
return getMarker().getAttribute(LABEL, null);
401+
}
402+
403+
/**
404+
* Sets a new label for the breakpoint.
405+
*
406+
* @param labelValue provide by the user
407+
* @since 3.23
408+
*/
409+
public void setBreakpointLabel(String labelValue) throws CoreException {
410+
setAttribute(LABEL, labelValue);
411+
}
412+
387413
}
Loading
Lines changed: 219 additions & 0 deletions
Loading
Loading

debug/org.eclipse.debug.ui/plugin.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,5 @@ debug.core.component.label = Platform Debug Core
418418
GroupLaunch.description=Launch several other configurations sequentially
419419

420420
prototype.decorator.label = Prototype Decorator
421+
breakpointLabel.label=Label
422+
breakpointLabel.tooltip=Provide a custom label to quickly identify breakpoint

debug/org.eclipse.debug.ui/plugin.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,15 @@
14821482
enablesFor="+"
14831483
id="org.eclipse.debug.ui.breakpointsView.toolbar.remove">
14841484
</action>
1485+
<action
1486+
label="%breakpointLabel.label"
1487+
icon="$nl$/icons/full/elcl16/bp_label.svg"
1488+
tooltip="%breakpointLabel.tooltip"
1489+
class="org.eclipse.debug.internal.ui.actions.breakpoints.BreakpointLabelAction"
1490+
menubarPath="breakpointGroup"
1491+
enablesFor="1"
1492+
id="org.eclipse.debug.ui.breakpointsView.breakpointLabel">
1493+
</action>
14851494
<action
14861495
label="%DisableAllBreakpointsAction.label"
14871496
icon="$nl$/icons/full/elcl16/disabled_co.svg"

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2020 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -252,4 +252,6 @@ public class ActionMessages extends NLS {
252252
public static String EnableAllBreakpointsAction_0;
253253
public static String EnableAllBreakpointsAction_1;
254254
public static String EnableAllBreakpointsAction_3;
255+
public static String BreakpointLabelDialog;
256+
255257
}

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2000, 2020 IBM Corporation and others.
2+
# Copyright (c) 2000, 2025 IBM Corporation and others.
33
#
44
# This program and the accompanying materials
55
# are made available under the terms of the Eclipse Public License 2.0
@@ -235,4 +235,5 @@ VirtualFindAction_0=Error
235235
VirtualFindAction_1=Unable to locate {0} in viewer
236236

237237
ToggleBreakpointsTargetManager_defaultToggleTarget_name = Default
238-
ToggleBreakpointsTargetManager_defaultToggleTarget_description = Default
238+
ToggleBreakpointsTargetManager_defaultToggleTarget_description = Default
239+
BreakpointLabelDialog=Provide a custom label, or blank for the default label

0 commit comments

Comments
 (0)