Skip to content

Commit 9021299

Browse files
committed
Add grouping for breakpoints by Enablement
This commit adds a new grouping option in the Debug view to organize breakpoints based on whether they are enabled or disabled. Enabled breakpoints are shown at the top, followed by disabled ones. This helps users quickly find and manage breakpoints without excessive scrolling.
1 parent 3f12c83 commit 9021299

File tree

4 files changed

+94
-1
lines changed

4 files changed

+94
-1
lines changed
Lines changed: 15 additions & 0 deletions
Loading

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ BreakpointWorkingSet.name=Breakpoint
356356
BreakpointWorkingSet.description=Breakpoint workingsets contain listings of workspace breakpoints
357357
memoryRenderingsExtensionPointName = Memory Renderings
358358
TableRenderingPrefActionName = &Table Renderings Preferences...
359-
359+
BreakpointActive.label=Enablement
360+
BreakpointActive.name=Breakpoint
360361

361362
NewMemoryViewAction.label=&New Memory View
362363
NewMemoryViewAction.tooltip=New Memory View

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,6 +3044,11 @@ M4 = Platform-specific fourth key
30443044
class="org.eclipse.debug.internal.ui.views.breakpoints.WorkingSetBreakpointOrganizer"
30453045
icon="$nl$/icons/full/obj16/fldr_obj.svg"
30463046
id="org.eclipse.debug.ui.workingSetOrganizer"/>
3047+
<breakpointOrganizer
3048+
label="%BreakpointActive.label"
3049+
class="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointEnablement"
3050+
icon="$nl$/icons/full/obj16/brkp_grp4.svg"
3051+
id="org.eclipse.debug.ui.breakpointEnablement"/>
30473052
<breakpointOrganizer
30483053
othersLabel="%BreakpointType.others"
30493054
label="%BreakpointType.label"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 IBM Corporation and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.debug.internal.ui.views.breakpoints;
15+
16+
import org.eclipse.core.resources.IMarkerDelta;
17+
import org.eclipse.core.runtime.CoreException;
18+
import org.eclipse.core.runtime.IAdaptable;
19+
import org.eclipse.debug.core.DebugPlugin;
20+
import org.eclipse.debug.core.IBreakpointListener;
21+
import org.eclipse.debug.core.model.IBreakpoint;
22+
import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
23+
import org.eclipse.debug.ui.BreakpointTypeCategory;
24+
25+
/**
26+
* Breakpoint organizers for breakpoint types.
27+
*
28+
* @since 3.1
29+
*/
30+
public class BreakpointEnablement extends AbstractBreakpointOrganizerDelegate implements IBreakpointListener {
31+
private final BreakpointTypeCategory ENABLED = new BreakpointTypeCategory("Active"); //$NON-NLS-1$
32+
private final BreakpointTypeCategory DISABLED = new BreakpointTypeCategory("In-Active"); //$NON-NLS-1$
33+
34+
public BreakpointEnablement() {
35+
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
36+
}
37+
38+
@Override
39+
public IAdaptable[] getCategories(IBreakpoint breakpoint) {
40+
try {
41+
IAdaptable[] categories;
42+
if (breakpoint.isEnabled()) {
43+
categories = new IAdaptable[] { ENABLED };
44+
} else {
45+
categories = new IAdaptable[] { DISABLED };
46+
}
47+
return categories;
48+
} catch (CoreException e) {
49+
DebugPlugin.log(e);
50+
}
51+
return null;
52+
}
53+
54+
@Override
55+
public void dispose() {
56+
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
57+
}
58+
59+
60+
@Override
61+
public void breakpointAdded(IBreakpoint breakpoint) {
62+
}
63+
64+
@Override
65+
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
66+
}
67+
68+
@Override
69+
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
70+
fireCategoryChanged(ENABLED);
71+
}
72+
}

0 commit comments

Comments
 (0)