DESCRIPTION

Bug 506931 -  [CommonNavigator] A quick filter possibility in Project
Explorer and other CNF viewers

Change-Id: I30ea6878c9ad86f25feae2fef45b3dc0b2d00126
Signed-off-by: Clara Kelly xxx@xxx.xxx

COMMENTS

author: Clara Kelly
date: 2017-03-29 14:40:37.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2017-03-29 14:50:33.000000000

Patch Set 4:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/12320/

-------------------------------------
author: Brenden Conley
date: 2017-03-29 15:39:15.000000000

Patch Set 4: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/12320/ : UNSTABLE

-------------------------------------
author: Clara Kelly
date: 2017-03-29 19:08:34.000000000

Patch Set 4: Code-Review-1

I just realized that the current implementation would not work with the Project Explorer configured to show Working Sets as roots (and not Projects). But before I fix that, I'd like to wait for some feedback from your side...

-------------------------------------
author: Isis Velasquez
date: 2017-04-04 18:40:44.000000000

Patch Set 4:

I really enjoy this feature and the workflow it provides. I didn't look into details so I didn't spot bugs, but it looks great and intuitive to use.
I'm a bit worried about the performance. I've indeed a lot of things in my navigator so filtering takes more than 10 seconds. We should try to improve this.
The progress report eye-candy does the work so I didn't get an impression of bug during filtering. That's IMO clean enough for not making the performance a blocker and to consider merging this great feature whenever it's bug free.

-------------------------------------
author: Isis Velasquez
date: 2017-04-04 18:47:42.000000000

Patch Set 4:

@Stefan: BTW, if you manage to write some automated test (in tests/org.eclipse.ui.tests.navigator ) covering this feature and the bug you've found about working set, that would be very welcome as it would make review and maintenance much simpler!

-------------------------------------
author: Isis Velasquez
date: 2017-04-04 18:52:00.000000000

Patch Set 4:

A few other comments/questions:
* I don't get how workingsets are supposed to change anything on that layer. From the navigator bundle and CNF, the filter you've implemented doesn't seem to care about the nature of what it's filtering.
* I would be great if the action/button to enable filter were a toggle. I don't think it's a blocker, but I believe it would make things look better.

-------------------------------------
author: Clara Kelly
date: 2017-04-05 07:39:11.000000000

Patch Set 4:

Hi Mickael,

first of all, thank you for your feedback. I will try to get the improvements ready this or next weekend.

(In reply to comment #21)
> * I don't get how workingsets are supposed to change anything on that layer.
> From the navigator bundle and CNF, the filter you've implemented doesn't seem to
> care about the nature of what it's filtering.

To speed up the search, I pre-filter (and pune sub-trees) based on the element class. (see org.eclipse.ui.internal.navigator.filters.search.CommonNavigatorSearchFilter.DEFAULT_ALLOWED_CLASSES and its references).
To make it work with working sets as well, I need to add the working set class here as well.

Also one question: Thinking about it, I don't know if the filter fuctionality should be out-out or opt-in.
Currently (as of Patchset 4), it is opt-out; i.e., every CommonNavigator view will have it (but only with the default configuration to filter resource names, not other objects!). To hide it or to change the allowed classes, the implementer of the CommonNavigator-based view needs to set certain properties (see ActionGroupFilter:155 and CommonNavigatorSearchFilter:192).

Maybe it is better that we hide the filter functionality per default (make the feature opt-in) and only enable it for the Project Explorer; so any other CommonNavigator-based view won't have it unless the property descriptor is configured accordingly.

What do you think?

-------------------------------------
author: Isis Velasquez
date: 2017-04-05 07:51:51.000000000

Patch Set 4:

> To speed up the search, I pre-filter (and pune sub-trees) based on the element class. (see org.eclipse.ui.internal.navigator.filters.search.CommonNavigatorSearchFilter.DEFAULT_ALLOWED_CLASSES and its references).
To make it work with working sets as well, I need to add the working set class here as well.

Ok, but keep in mind that the CNF trees can contain any kind of objects, so we should avoid enabling filters only on some classes.
As a result, other instance of the CNF that are not based on resource couldn't Leon Ochoaefit from this quick filter, could they? If they can't I suggest you keep the definition of the action in the generic CNF bundle but move the handler and filter strategy to org.eclipse.ui.navigator.resources if possible.
But even better would be to make the filter run on all nodes, not just on IResource one. The story of finding a resource is already decently covered by Ctrl+Shift+R, I believe from the CNF, we should try to get into a more abstract and generic search from the tree.
FYI, the CommonViewer is used by some other views such as some outline or some tree-based editors. I would love to see the filter work in those case to.

> Also one question: Thinking about it, I don't know if the filter fuctionality should be out-out or opt-in.

If it can work on any navigator, this should be enabled on all navigators IMO. If it cannot, then the filter should be shown only where it works (navigators dealing with resources so far).

> Maybe it is better that we hide the filter functionality per default (make the feature opt-in) and only enable it for the Project Explorer; so any other CommonNavigator-based view won't have it unless the property descriptor is configured accordingly.

+1, in the current state, it seems to be a good increment. But I really hope we'll manage to filter on any CNF tree soon ;)

-------------------------------------
