From 01c5b676196b84ed721cfa43267079374abf4498 Mon Sep 17 00:00:00 2001 From: Mickael Istria Date: Mon, 21 Aug 2023 08:25:51 +0200 Subject: [PATCH] Disable "Select All" button for empty input Just like other buttons on this dialog. Fixes https://github.com/eclipse-platform/eclipse.platform.ui/issues/1046 --- .../src/org/eclipse/ui/texteditor/FindReplaceDialog.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java index 525f5c7dfe9..fae3682279a 100644 --- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java +++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java @@ -1693,6 +1693,7 @@ private void updateButtonState(boolean disableReplace) { fWholeWordCheckBox.setEnabled(isWord(str) && !isRegExSearchAvailableAndChecked()); fFindNextButton.setEnabled(enable && findString); + fSelectAllButton.setEnabled(enable && findString && fTarget instanceof IFindReplaceTargetExtension4); fReplaceSelectionButton.setEnabled(!disableReplace && enable && isEditable() && selection && (!fNeedsInitialFindBeforeReplace || !isRegExSearchAvailableAndChecked())); fReplaceFindButton.setEnabled(!disableReplace && enable && isEditable() && findString && selection && (!fNeedsInitialFindBeforeReplace || !isRegExSearchAvailableAndChecked())); fReplaceAllButton.setEnabled(enable && isEditable() && findString); @@ -1834,12 +1835,8 @@ public void updateTarget(IFindReplaceTarget target, boolean isTargetEditable, bo fGiveFocusToFindField= true; } initIncrementalBaseLocation(); - updateButtonState(); - } - - if (okToUse(fSelectAllButton)) { - fSelectAllButton.setEnabled(fTarget instanceof IFindReplaceTargetExtension4); } + updateButtonState(); setContentAssistsEnablement(isRegExSearchAvailableAndChecked()); }