Skip to content

Commit 661c9f5

Browse files
SougandhSiloveeclipse
authored andcommitted
Add checkbox to toggle display of shortcut numbers in breakpoint
grouping types Introduced a new checkbox to control the visibility of shortcut numbers in the selection list for breakpoint grouping types. By default, shortcut numbers are shown, and users can disable them using the checkbox if desired.
1 parent e4ebf10 commit 661c9f5

File tree

6 files changed

+44
-13
lines changed

6 files changed

+44
-13
lines changed

debug/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2021 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
@@ -379,6 +379,13 @@ public class DebugPlugin extends Plugin {
379379
*/
380380
public static final String ATTR_PATH = PI_DEBUG_CORE + ".ATTR_PATH"; //$NON-NLS-1$
381381

382+
/**
383+
* Attribute key for breakpoint grouping types accelerators
384+
*
385+
* @since 3.23
386+
*/
387+
public static final String PREF_SHOW_BREAKPOINT_GROUPBY_TYPE_SHORTCUTS = PI_DEBUG_CORE + ".PREF_FOR_BP_GROUP_TYPE_ACCELERATOR"; //$NON-NLS-1$
388+
382389
/**
383390
* Launch configuration attribute that designates whether or not the
384391
* descendants of the {@link IProcess} associated to a launch of this

debug/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public void initializeDefaultPreferences() {
3131
Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, false);
3232
Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, true);
3333
Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, true);
34+
Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_SHOW_BREAKPOINT_GROUPBY_TYPE_SHORTCUTS, true);
3435
Preferences.savePreferences(DebugPlugin.getUniqueIdentifier());
3536
}
3637

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2004, 2010 IBM Corporation and others.
2+
* Copyright (c) 2004, 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
@@ -28,6 +28,7 @@ public class BreakpointGroupMessages extends NLS {
2828
public static String GroupBreakpointsByDialog_5;
2929
public static String GroupBreakpointsByDialog_6;
3030
public static String GroupBreakpointsByDialog_7;
31+
public static String GroupBreakpointsByDialog_8;
3132
public static String PasteBreakpointsAction_0;
3233
public static String PasteBreakpointsAction_1;
3334
public static String RemoveFromWorkingSetAction_0;

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2004, 2011 IBM Corporation and others.
2+
# Copyright (c) 2004, 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
@@ -22,6 +22,7 @@ GroupBreakpointsByDialog_4=<- &Remove
2222
GroupBreakpointsByDialog_5=Move &Up
2323
GroupBreakpointsByDialog_6=Move &Down
2424
GroupBreakpointsByDialog_7=Group Breakpoints
25+
GroupBreakpointsByDialog_8=Show group menu item accelerators
2526
PasteBreakpointsAction_0=&Paste
2627
PasteBreakpointsAction_1=Paste Breakpoints
2728
RemoveFromWorkingSetAction_0=Remove from &Working Set

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2004, 2013 IBM Corporation and others.
2+
* Copyright (c) 2004, 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
@@ -18,6 +18,8 @@
1818
import java.util.Iterator;
1919
import java.util.List;
2020

21+
import org.eclipse.core.runtime.Platform;
22+
import org.eclipse.debug.core.DebugPlugin;
2123
import org.eclipse.debug.internal.ui.DebugPluginImages;
2224
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
2325
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointOrganizer;
@@ -132,17 +134,21 @@ public List<IAction> getActions(int accel) {
132134

133135
private void addAccel(int accel, IAction action, String label) {
134136
StringBuilder actionLabel= new StringBuilder();
135-
if (accel != 10) {
136-
if (accel < 10) {
137-
// add the numerical accelerators 1 through 9
138-
actionLabel.append('&');
137+
boolean showAcc = Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(),
138+
DebugPlugin.PREF_SHOW_BREAKPOINT_GROUPBY_TYPE_SHORTCUTS, true, null);
139+
if (showAcc) {
140+
if (accel != 10) {
141+
if (accel < 10) {
142+
// add the numerical accelerators 1 through 9
143+
actionLabel.append('&');
144+
}
145+
actionLabel.append(accel);
146+
} else {
147+
actionLabel.append("1&0"); //$NON-NLS-1$
139148
}
140-
actionLabel.append(accel);
141-
} else {
142-
actionLabel.append("1&0"); //$NON-NLS-1$
149+
accel++;
150+
actionLabel.append(' ');
143151
}
144-
accel++;
145-
actionLabel.append(' ');
146152
actionLabel.append(label);
147153
action.setText(actionLabel.toString());
148154
}

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
import java.util.Iterator;
2020
import java.util.List;
2121

22+
import org.eclipse.core.runtime.Platform;
23+
import org.eclipse.debug.core.DebugPlugin;
24+
import org.eclipse.debug.internal.core.Preferences;
2225
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
2326
import org.eclipse.debug.internal.ui.SWTFactory;
2427
import org.eclipse.debug.internal.ui.breakpoints.provisional.IBreakpointOrganizer;
@@ -73,6 +76,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
7376
private Button fRemoveButton;
7477
private Button fMoveUpButton;
7578
private Button fMoveDownButton;
79+
private Button fBreakpointGroupAccel;
7680

7781
/**
7882
* Selection listener that listens to selection from all buttons in this
@@ -127,6 +131,15 @@ protected Control createDialogArea(Composite parent) {
127131

128132
initializeContent();
129133
updateViewers();
134+
135+
fBreakpointGroupAccel = new Button(composite, SWT.CHECK);
136+
fBreakpointGroupAccel.setText(BreakpointGroupMessages.GroupBreakpointsByDialog_8);
137+
GridData gridDataCheckbox = new GridData();
138+
gridDataCheckbox.horizontalSpan = 3;
139+
fBreakpointGroupAccel.setLayoutData(gridDataCheckbox);
140+
boolean set = Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(),
141+
DebugPlugin.PREF_SHOW_BREAKPOINT_GROUPBY_TYPE_SHORTCUTS, true, null);
142+
fBreakpointGroupAccel.setSelection(set);
130143
Dialog.applyDialogFont(parentComposite);
131144
return parentComposite;
132145
}
@@ -254,6 +267,8 @@ public IBreakpointOrganizer[] getOrganizers() {
254267
*/
255268
@Override
256269
protected void okPressed() {
270+
Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(),
271+
DebugPlugin.PREF_SHOW_BREAKPOINT_GROUPBY_TYPE_SHORTCUTS, fBreakpointGroupAccel.getSelection(), null);
257272
Object[] factories= fSelectedOrganizersProvider.getElements(null);
258273
while (factories.length > 0) {
259274
Object factory= factories[0];

0 commit comments

Comments
 (0)