Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327226 - When preferences are changed, explorer does not update
Summary: When preferences are changed, explorer does not update
Status: RESOLVED FIXED
Alias: None
Product: Tigerstripe
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.5M0   Edit
Assignee: Daniel Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 09:03 EDT by Richard Craddock CLA
Modified: 2010-11-18 12:44 EST (History)
1 user (show)

See Also:


Attachments
patch_327226.txt (25.19 KB, patch)
2010-11-05 18:58 EDT, Daniel Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Craddock CLA 2010-10-07 09:03:43 EDT
If I change the preference values for display of Stereotypes in the explorer ( eg enable the option for Attrbutes), The explorer doe not update to reflect that change until some other event prompts it.

The Explorer should be listening for Preference Change Events
Comment 1 Daniel Johnson CLA 2010-11-05 18:58:13 EDT
Created attachment 182543 [details]
patch_327226.txt

Technically this patch fixes the issue, but I am not convinced it is the best possible solution for one reason.
In TigerstripeContentProvider in the init method I do this:
CommonViewer viewer = ((CommonViewer) ((NavigatorContentService) contentService)
                    .getViewer());
...
annFilter.setHide(hide);
viewer.addFilter(annFilter);

It seems like there should be the ability to get to the viewer maybe in a different class that wouldn't force casting two objects. I thought maybe TigerstripeViewProvider, but that didn't seem to offer a good way to get straight to the viewer either.

Anyway, if someone can review this an acceptable solution. 

I stole all the logic from TigerstripeExplorerPart which seems to not be in use any longer.
Changes TigerstripeContentProvider:
Line 83: added annFilter variable
Line 99-115: Try-catch block initializing annFilter and adding it to the tigerstripe explorer viewer
Line  383-405: Added If block using logic from TigerstripeExplorerPart
Comment 2 Navid Mehregani CLA 2010-11-18 12:44:10 EST
Submitted patch.  Thanks Dan!