Skip to content

Commit 8349b0e

Browse files
committed
Enhance 'Find' context shown in Expressions View
- Show only when there are active Expressions - Add an Icon
1 parent b0bbf45 commit 8349b0e

File tree

5 files changed

+171
-5
lines changed

5 files changed

+171
-5
lines changed

debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true
5-
Bundle-Version: 3.19.100.qualifier
5+
Bundle-Version: 3.20.0.qualifier
66
Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin
Lines changed: 152 additions & 0 deletions
Loading

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private static void declareImages() {
6666
declareRegistryImage(IDebugUIConstants.IMG_ACT_RUN, CTOOL + "run_exc.svg"); //$NON-NLS-1$
6767
declareRegistryImage(IDebugUIConstants.IMG_ACT_SYNCED, ELCL + "synced.svg"); //$NON-NLS-1$
6868
declareRegistryImage(IDebugUIConstants.IMG_SKIP_BREAKPOINTS, ELCL + "skip_brkp.svg"); //$NON-NLS-1$
69+
declareRegistryImage(IDebugUIConstants.IMG_FIND_ACTION, ELCL + "find.svg"); //$NON-NLS-1$
6970

7071
//menus
7172
declareRegistryImage(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE,

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java

Lines changed: 9 additions & 3 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
@@ -23,6 +23,7 @@
2323
import org.eclipse.debug.core.ILaunch;
2424
import org.eclipse.debug.core.model.IDebugElement;
2525
import org.eclipse.debug.core.model.IWatchExpression;
26+
import org.eclipse.debug.internal.ui.DebugPluginImages;
2627
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
2728
import org.eclipse.debug.internal.ui.actions.expressions.EditWatchExpressinInPlaceAction;
2829
import org.eclipse.debug.internal.ui.actions.expressions.PasteWatchExpressionsAction;
@@ -80,13 +81,18 @@ protected void configureToolBar(IToolBarManager tbm) {
8081
protected void fillContextMenu(IMenuManager menu) {
8182
menu.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP));
8283
menu.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP));
83-
menu.add(getAction(FIND_ACTION));
84+
IAction action;
85+
if (DebugPlugin.getDefault().getExpressionManager().getExpressions().length > 0) {
86+
action = getAction(FIND_ACTION);
87+
action.setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_FIND_ACTION));
88+
menu.add(action);
89+
}
8490
ChangeVariableValueAction changeValueAction = (ChangeVariableValueAction)getAction("ChangeVariableValue"); //$NON-NLS-1$
8591
if (changeValueAction.isApplicable()) {
8692
menu.add(changeValueAction);
8793
}
8894
menu.add(new Separator());
89-
IAction action = new AvailableLogicalStructuresAction(this);
95+
action = new AvailableLogicalStructuresAction(this);
9096
if (action.isEnabled()) {
9197
menu.add(action);
9298
}

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2019 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
@@ -1357,4 +1357,11 @@ public interface IDebugUIConstants {
13571357
*/
13581358
String COLUMN_ID_VARIABLE_VALUE_TYPE = COLUMN_PRESENTATION_ID_VARIABLE + ".COL_VALUE_TYPE"; //$NON-NLS-1$
13591359

1360+
/**
1361+
* "Find" action image identifier
1362+
*
1363+
* @since 3.20
1364+
*/
1365+
String IMG_FIND_ACTION = "FIND_ACTION_ICON"; //$NON-NLS-1$
1366+
13601367
}

0 commit comments

Comments
 (0)