Fix empty page tree in pre-filtered preference dialog#4044
Conversation
|
@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 ... ?
|
The search icon is the hint. I can add the text back if you prefer. |
5b5ddc5 to
be72249
Compare
|
I restored the text hint |
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 placeholder hint is still shown via setMessage so the field keeps signalling that it filters the pages, but it is never written into the field as an active pattern. Fixes eclipse-platform#4041
be72249 to
e783f80
Compare

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 "type filter text" hint is kept as the placeholder message so the field still signals that it filters the pages.