From 6ef933159b008d189d3cdade4a3715f15f2585a2 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Mon, 1 Jun 2026 10:45:48 +0200 Subject: [PATCH] Fix empty page tree in pre-filtered preference dialog The native search field rework (PR #3925) overrode setInitialText to only set the placeholder message and stopped maintaining the inherited initialText sentinel. The pre-filter path addFilter() still wrote the hint "type filter text" into the field, which was then applied as a real filter pattern (since it no longer equalled initialText), matching no preference pages and leaving the tree empty. Keep the initialText sentinel in sync in the override and stop writing the hint into the field in addFilter(). The search icon now signals the field's purpose, so the "type filter text" placeholder is dropped; initialText is kept only for the empty-filter check and the field's accessible name. Fixes https://github.com/eclipse-platform/eclipse.platform.ui/issues/4041 --- .../ui/internal/dialogs/FilteredPreferenceDialog.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java index 9c281e7d07d..173065c52dc 100644 --- a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java +++ b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java @@ -126,9 +126,9 @@ protected Text doCreateFilterText(Composite parent) { @Override public void setInitialText(String text) { - if (filterText != null && !filterText.isDisposed()) { - filterText.setMessage(text != null ? text : ""); //$NON-NLS-1$ - } + // No placeholder hint; the search icon already signals the field's purpose. + // initialText is still tracked for the empty-filter check and accessible name. + initialText = text != null ? text : ""; //$NON-NLS-1$ } /** @@ -140,7 +140,8 @@ protected void addFilter(ViewerFilter filter) { getViewer().addFilter(filter); if (filterText != null) { - setFilterText(WorkbenchMessages.FilteredTree_FilterMessage); + // Keep the field empty so the viewer filter narrows the pages; the + // hint text would otherwise be applied as a pattern and hide all pages. textChanged(); }