Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545876

Summary: "user filters" tabs shouldn't leak to CNF views if ResourceNameRegexpFilter is not active
Product: [Eclipse Project] Platform Reporter: Michael Keppler <michael.keppler>
Component: UIAssignee: Mickael Istria <mistria>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: loskutov, mistria, twolf
Version: 4.11   
Target Milestone: 4.12 M1   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=226046
https://git.eclipse.org/r/139824
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f9e923aa1450388a020f88d1070effeefea24bd7
Whiteboard:

Description Michael Keppler CLA 2019-03-28 03:19:49 EDT
Since 2019-03, common navigator views have an additional tab in the filter configuration dialog, so called user filters based on regular expressions. You can see them in the repo views filter menu, when using egit nightly on recent eclipse. Also check https://www.eclipse.org/eclipse/news/4.11/platform.php

Those are somewhat problematic:
* The tab is always there. Other filter dialog tabs can be suppressed via plugin.xml properties, this one cannot.
* It expects/returns the list of filters as bean class, which has only been added to the navigator plugin for 2019-03.

As a consequence, users can start configuring this in the repo view, and it has no effect. We cannot hide it, and we cannot support it with our 4.6 target platform.

* Shall we just ignore the issue?
* Shall we request additional API for common navigator to also suppress this tab, in addition to the others?
* Shall we implement support for the filters (and would that be possible, by having a local copy of the bean class?)
Comment 1 Thomas Wolf CLA 2019-03-28 17:12:32 EDT
Platforms < 4.11 won't have these user filters at all, so no need to support them.

On >= 4.11:

1. The explanatory text seems to be hardcoded? Even in the repositories view it says "create custom resource filters...", which simply makes no sense.

2. Yes, there needs to be a way in plugin.xml to suppress this tab, and we should suppress it in the repositories view. And the way to suppress this tab should be backwards-compatible, i.e., not cause trouble on older Eclipses if the new suppression is in the plugin.xml.
Comment 2 Andrey Loskutov CLA 2019-03-29 12:29:19 EDT
(In reply to Michael Keppler from comment #0)
> Since 2019-03, common navigator views have an additional tab in the filter
> configuration dialog, so called user filters based on regular expressions.
> You can see them in the repo views filter menu, when using egit nightly on
> recent eclipse. Also check
> https://www.eclipse.org/eclipse/news/4.11/platform.php
> 
> Those are somewhat problematic:
> * The tab is always there. Other filter dialog tabs can be suppressed via
> plugin.xml properties, this one cannot.

Bug

> * It expects/returns the list of filters as bean class, which has only been
> added to the navigator plugin for 2019-03.

Possibly a bug, especially because there can be "old" plugins not yet ported to the new API (if there is any).

> As a consequence, users can start configuring this in the repo view, and it
> has no effect. 

Bug

> We cannot hide it

Bug

In overall, for me this is just a regression introduced with fix for bug 226046 => moving to platform UI for a fix.
Comment 3 Andrey Loskutov CLA 2019-03-29 12:38:04 EDT
Mickael, can you please look at this? 
Must have is: existing CNF clients should be able to disable the new tab, and if the proper functionality requires some modern API, it should be optional or explicitly requested by a client. It should not appear for existing code and be non-functional.
Comment 4 Mickael Istria CLA 2019-03-29 12:46:05 EDT
Indeed, the user filter features was initially designed in the scope of resources. The text is hardcoded.

The feature at the moment cannot work on non-IResources. Maybe it could be a possible improvement to implement if there is a use-case for it.

> You can see them in the repo views filter menu, when using egit nightly on recent eclipse

Is this "filter" menu new? I don't see one locally.

About hiding it, it should probably be hidden in case the ResourceContentProvider isn't active on this CNF. I'm not sure how hard to would be to implement, I guess it's mostly a matter of mimicking what's already done in the dialog for "hideExtensionsTab" and have the ResourceContentProvider enablement changing the propertly accordingly.

While I'm available to discuss it and review patches, it's definitely not something I'll be able to work on before weeks.
Comment 5 Thomas Wolf CLA 2019-03-29 13:27:14 EDT
(In reply to Mickael Istria from comment #4)
> Is this "filter" menu new? I don't see one locally.

Yes. Install EGit nightly. It defines normal CNF filters for the Git Repositories view, so that "filter" menu is just the standard CNF "Filters and Customization..." CNF menu.
Comment 6 Eclipse Genie CLA 2019-04-01 03:35:52 EDT
New Gerrit change created: https://git.eclipse.org/r/139824
Comment 7 Mickael Istria CLA 2019-04-01 03:45:56 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/139824

Please give a try to that patch with your local EGit code to verify whether it helps or not.
Comment 8 Michael Keppler CLA 2019-04-01 13:17:29 EDT
Tested. Works well. See gerrit.