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

Bug 160400

Summary: [Dialogs] increase visibility of FilteredTree members
Product: [Eclipse Project] Platform Reporter: Damian Biollo <damian_biollo>
Component: UIAssignee: Susan McCourt <susan>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: bokowski
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Damian Biollo CLA 2006-10-10 18:37:59 EDT
I'm using the FilteredTree to add filtering to a docking view.
I need to override the class to provide a few customizations, such as a subclassed TreeViewer.

This is almost totally possible, with the exception that 2 members are declared private instead of protected: 
    private PatternFilter patternFilter;
    private Job refreshJob;

For example, if I want to override createTreeControl (which is declared protected), the following code becomes very problemic because of the scope of refreshJob -- basically it means that I can't safely override createTreeControl:
        treeViewer.getControl().addDisposeListener(new DisposeListener(){
        	public void widgetDisposed(DisposeEvent e) {
        		refreshJob.cancel();
        	}
        });


A protected accessor function for refreshJob and patternFilter would also suffice to solve this.
Comment 1 Susan McCourt CLA 2006-10-12 12:40:09 EDT
cc'ing Boris.  Boris, it looks like there are some loose ends related to bug #152170 that still prevent successful reuse of FilteredTree.  Do you have any problems with the suggestion to make these fields protected?  seems worth doing since we've already taken a step in that direction.
Comment 2 Boris Bokowski CLA 2006-10-12 13:50:58 EDT
(In reply to comment #0)
> For example, if I want to override createTreeControl (which is declared
> protected), the following code becomes very problemic because of the scope of
> refreshJob -- basically it means that I can't safely override
> createTreeControl:

As per the Javadoc comment on createTreeControl(), you are supposed to override doCreateTreeViewer() instead.  Does this not work?
Comment 3 Damian Biollo CLA 2006-10-12 15:57:35 EDT
It sounds like the code in Eclipse 3.3 with the doCreateTreeViewer will work. Thanks for the info and the link to 152170.

I'm on 3.2 right now and can wait for the next released version.

Thanks
Comment 4 Susan McCourt CLA 2006-10-12 16:29:16 EDT
I'll close this as a duplicate.

minor nit...the bugzilla bug had 3.3 as the version on which the bug was reported, so I assumed you were running on the latest...

*** This bug has been marked as a duplicate of 152170 ***