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

Bug 327226

Summary: When preferences are changed, explorer does not update
Product: [Technology] Tigerstripe Reporter: Richard Craddock <rcraddoc>
Component: UIAssignee: Daniel Johnson <danijoh2>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nmehrega
Version: unspecified   
Target Milestone: 0.5M0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch_327226.txt none

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!