From 8349b0e812f0ab3282880699bf8d26941cea52b8 Mon Sep 17 00:00:00 2001 From: sougandhs Date: Fri, 14 Nov 2025 11:22:44 +0530 Subject: [PATCH] Enhance 'Find' context shown in Expressions View - Show only when there are active Expressions - Add an Icon --- .../org.eclipse.debug.ui/META-INF/MANIFEST.MF | 2 +- .../icons/full/elcl16/find.svg | 152 ++++++++++++++++++ .../debug/internal/ui/DebugPluginImages.java | 1 + .../ui/views/expression/ExpressionView.java | 12 +- .../eclipse/debug/ui/IDebugUIConstants.java | 9 +- 5 files changed, 171 insertions(+), 5 deletions(-) create mode 100644 debug/org.eclipse.debug.ui/icons/full/elcl16/find.svg diff --git a/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF index 860867d420f..f574f83f49f 100644 --- a/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF +++ b/debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true -Bundle-Version: 3.19.100.qualifier +Bundle-Version: 3.20.0.qualifier Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/debug/org.eclipse.debug.ui/icons/full/elcl16/find.svg b/debug/org.eclipse.debug.ui/icons/full/elcl16/find.svg new file mode 100644 index 00000000000..6f216b1ecf5 --- /dev/null +++ b/debug/org.eclipse.debug.ui/icons/full/elcl16/find.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java index 93c3f68c8d3..a9f1e913a60 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java @@ -66,6 +66,7 @@ private static void declareImages() { declareRegistryImage(IDebugUIConstants.IMG_ACT_RUN, CTOOL + "run_exc.svg"); //$NON-NLS-1$ declareRegistryImage(IDebugUIConstants.IMG_ACT_SYNCED, ELCL + "synced.svg"); //$NON-NLS-1$ declareRegistryImage(IDebugUIConstants.IMG_SKIP_BREAKPOINTS, ELCL + "skip_brkp.svg"); //$NON-NLS-1$ + declareRegistryImage(IDebugUIConstants.IMG_FIND_ACTION, ELCL + "find.svg"); //$NON-NLS-1$ //menus declareRegistryImage(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE, diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java index 70cadd9ad59..341c5809e52 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2020 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -23,6 +23,7 @@ import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.model.IDebugElement; import org.eclipse.debug.core.model.IWatchExpression; +import org.eclipse.debug.internal.ui.DebugPluginImages; import org.eclipse.debug.internal.ui.IDebugHelpContextIds; import org.eclipse.debug.internal.ui.actions.expressions.EditWatchExpressinInPlaceAction; import org.eclipse.debug.internal.ui.actions.expressions.PasteWatchExpressionsAction; @@ -80,13 +81,18 @@ protected void configureToolBar(IToolBarManager tbm) { protected void fillContextMenu(IMenuManager menu) { menu.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP)); menu.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP)); - menu.add(getAction(FIND_ACTION)); + IAction action; + if (DebugPlugin.getDefault().getExpressionManager().getExpressions().length > 0) { + action = getAction(FIND_ACTION); + action.setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_FIND_ACTION)); + menu.add(action); + } ChangeVariableValueAction changeValueAction = (ChangeVariableValueAction)getAction("ChangeVariableValue"); //$NON-NLS-1$ if (changeValueAction.isApplicable()) { menu.add(changeValueAction); } menu.add(new Separator()); - IAction action = new AvailableLogicalStructuresAction(this); + action = new AvailableLogicalStructuresAction(this); if (action.isEnabled()) { menu.add(action); } diff --git a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java index e3dcdb1c200..c52ff715bca 100644 --- a/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java +++ b/debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -1357,4 +1357,11 @@ public interface IDebugUIConstants { */ String COLUMN_ID_VARIABLE_VALUE_TYPE = COLUMN_PRESENTATION_ID_VARIABLE + ".COL_VALUE_TYPE"; //$NON-NLS-1$ + /** + * "Find" action image identifier + * + * @since 3.20 + */ + String IMG_FIND_ACTION = "FIND_ACTION_ICON"; //$NON-NLS-1$ + }