Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » CommonNavigator does not refresh when ViewerFilter is present
CommonNavigator does not refresh when ViewerFilter is present [message #1745564] Wed, 12 October 2016 14:24
Alex Kravets is currently offline Alex KravetsFriend
Messages: 528
Registered: November 2009
Senior Member
In using org.eclipse.ui.navigator.navigatorContent extension point I provide content provider, function of which is for certain folders return folder's child during the calling of getChildren() method

public Object[] getChildren(Object parentElement) {
    if(parentElement instanceof IFolder){
        try {
                List<IResource> children = analyzeFolder((IFolder)parentElement);
                return children.size() == 0 ? ((IContainer)parentElement).members() : children.toArray(new IResource[children.size()]);
        } catch (CoreException e) {
            return EMPTY_ARRAY;
        try {
            return ((IContainer)parentElement).members();
        } catch (CoreException e) {
            return EMPTY_ARRAY;

I also use org.eclipse.ui.navigator.ProjectExplorer as Common Navigator instead of defining my own because I don't need any special functionality to define my own CN implementation. And I think the problem is that CN extender provides its own ContentProvider - NavigatorContentServiceContentProvider that adds folders that I am "hiding" in my own ContentProvider. Because of this, I have to utilize ViewerFilter that hides these folders.

Essentially this is what happens:

  -- folder.myExtension (folder is created)
     -- file.myExtension (file is created under folder)

  -- file (content proovider returns file.myExtension instead of folder.myExtension)

What I found is that if I remove ViewerFilter, then the tree gets refreshed, however then I get folders that I was trying to hide that NavigatorContentServiceContentProvider "injects".

Is there a better way to achieve this folder hiding that I am doing, a virtual folder is you will? Can somehow de-register NavigatorContentServiceContentProvider? Or should define my own CN implementation as ProjectExplorer does so that I can myself control all the content?
Previous Topic:Custom Templates
Next Topic:Different Splash Progress Bar on Product Build vs Self-Hosted Launch
Goto Forum:

Current Time: Wed Nov 14 03:11:52 GMT 2018

Powered by FUDForum. Page generated in 0.02295 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top