Skip to content

Commit 6ef9331

Browse files
committed
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 #4041
1 parent 55391d7 commit 6ef9331

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/FilteredPreferenceDialog.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ protected Text doCreateFilterText(Composite parent) {
126126

127127
@Override
128128
public void setInitialText(String text) {
129-
if (filterText != null && !filterText.isDisposed()) {
130-
filterText.setMessage(text != null ? text : ""); //$NON-NLS-1$
131-
}
129+
// No placeholder hint; the search icon already signals the field's purpose.
130+
// initialText is still tracked for the empty-filter check and accessible name.
131+
initialText = text != null ? text : ""; //$NON-NLS-1$
132132
}
133133

134134
/**
@@ -140,7 +140,8 @@ protected void addFilter(ViewerFilter filter) {
140140
getViewer().addFilter(filter);
141141

142142
if (filterText != null) {
143-
setFilterText(WorkbenchMessages.FilteredTree_FilterMessage);
143+
// Keep the field empty so the viewer filter narrows the pages; the
144+
// hint text would otherwise be applied as a pattern and hide all pages.
144145
textChanged();
145146
}
146147

0 commit comments

Comments
 (0)