Skip to content

PreferenceDialog: render filter as native search field#3925

Open
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
vogella:fix/preference-search-style-bits
Open

PreferenceDialog: render filter as native search field#3925
vogella wants to merge 1 commit intoeclipse-platform:masterfrom
vogella:fix/preference-search-style-bits

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented Apr 22, 2026

Summary

  • Use SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL for the filter field in FilteredPreferenceDialog's PreferenceFilteredTree, so it is rendered as a native search field with magnifier and cancel icons.
  • Override setInitialText to expose the filter hint via Text#setMessage only, rather than inserting it as real field content. The dialog auto-focuses the filter field on open, which made the old initial-text fallback behave poorly: users saw the hint as actual text and had to delete it before typing.

Test plan

  • Open Window > Preferences and confirm the filter field renders with a magnifier icon and a cancel (x) icon once text is typed.
  • Verify the "type filter text" hint is shown as a placeholder and disappears when focus/typing begins, without needing to be deleted.
  • Filter by typing; verify the cancel icon clears the filter and restores the full tree.

Give the preference dialog's filter field the full set of search-related
style bits (SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL) so it is
rendered as a native search field with a magnifier and cancel icon.

Also override setInitialText to expose the hint via Text#setMessage
only, instead of stuffing it into the field's content. The dialog
auto-focuses the filter field on open, so the old initial-text fallback
was never actually shown as a placeholder and forced users to delete
the hint before typing.
@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented Apr 22, 2026

Old in Light theme

image

New in Dark theme

image

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   852 files  ±0     852 suites  ±0   53m 14s ⏱️ - 1m 13s
 7 913 tests ±0   7 670 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 241 runs  ±0  19 586 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit 19ee7f3. ± Comparison against base commit fc4799a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant