Fix empty page tree in pre-filtered preference dialog#4044
Conversation
The native search field rework (PR eclipse-platform#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 eclipse-platform#4041
|
@wahlbrink FYI, I also tested your example and it works fine. |
There was a problem hiding this comment.
With this change, the filterered trees in preference dialogs don't have any hint on the filter field at all anymore. Is that intended?
For the filtered preference dialog one might argue that it's okay because the filter text was only presented as ordinary filter text input when opening the dialog, so it might be somehow okay to remove that:

But the ordinary preferences dialog now looks like this:

While it used to contain a proper hint:

Edit: just saw that there is the search symbol in front of the text now. Still I thought that there is a possibility to show a hint in such a search box, isn't it? I would rather expect that to be shown (like it was in the preferences dialog before). Otherwise it becomes less obvious that this is filter field rather than a search field.
| getViewer().addFilter(filter); | ||
|
|
||
| if (filterText != null) { | ||
| setFilterText(WorkbenchMessages.FilteredTree_FilterMessage); |
There was a problem hiding this comment.
Doesn't this removal make other places using that NLS obsolete or maybe kind of incompatible, such as ... ?
Forward fix for #4041 on master (the 4.40 maintenance branch gets the plain revert in #4043).
The native search field rework in #3925 stopped maintaining the inherited initialText sentinel, so the hint that addFilter() wrote into the field was applied as a real filter pattern and hid every preference page. This keeps the sentinel in sync and no longer writes the hint into the field, so a pre-filtered dialog (for example Preferences from a Java editor context menu) shows its pages again. The native search field is preserved, and the now-redundant "type filter text" placeholder is dropped since the search icon already indicates the field purpose.