Bug 569108 - The ShowViewsDialog shows disabled views
Summary: The ShowViewsDialog shows disabled views
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.16   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.20 M1   Edit
Assignee: Hannes Niederhausen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-24 04:34 EST by Hannes Niederhausen CLA
Modified: 2021-08-17 04:42 EDT (History)
4 users (show)

See Also:


Attachments
Fix in the ViewContentProvider. (969 bytes, patch)
2020-11-24 07:10 EST, Hannes Niederhausen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Niederhausen CLA 2020-11-24 04:34:34 EST
Hi,

I deactivated some views using activity patterns. Although I can't open them the ShowViewsDialog lists the disabled views.

I found the problem in the ContentProvider of the TreeViewer.

ViewContentProvider#isFilteredByActivity checks whether the given view id is filtered. However, it uses  viewRegistry.getViews() to find the view for the given id. getViews() is already filtering out disabled views, therefore the content provider can't find the view with the id to check and defaults to "unfiltered".

I see two solutions:
Either extend isFilteredByActivity so it also returns true if the view wasn't found or use the viewRegistry in the methods determineTopLevelElements and determineViewsInCategory instead of application.getDescriptors().
Comment 1 Lars Vogel CLA 2020-11-24 04:55:37 EST
Can you push a Gerrit for your suggestion? See https://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#clone-the-selected-eclipse-git-repository
Comment 2 Hannes Niederhausen CLA 2020-11-24 07:08:20 EST
I'd like to, but it seems I am not allowed to push to the repository.
Comment 3 Hannes Niederhausen CLA 2020-11-24 07:10:05 EST
Created attachment 284869 [details]
Fix in the ViewContentProvider.
Comment 4 Eclipse Genie CLA 2020-11-25 02:01:38 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/172795
Comment 6 Mickael Istria CLA 2021-03-30 03:05:11 EDT
Thanks Hannes!
Comment 7 Eclipse Genie CLA 2021-08-17 02:48:20 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/183775
Comment 9 Vikas Chandra CLA 2021-08-17 03:05:19 EDT
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=575329#c9