|CommonNavigator with resources + own navigatorContent [message #661873]
||Mon, 28 March 2011 11:32
Registered: June 2010
I have a problem with the Common Navigator Framework: the input to my view is changed to the workspace root the first time I open it after starting Eclipse, even though I have overridden the getInitialInput method in my extension of CommonNavigator to show something else (and it works well the following times). I read mails & bug reports concerning similar problems for RCP, but I am doing a plugin and running the platform, and I couldn't find any mention of this problem in this case...
My use case is the following: I use CommonNavigator to show resources, files & folders, but not on the whole workspace. In fact we have a notion of project with a main file with a specific nature, and once the project is "opened" (that is the main editor of my plugin is opened on this main file), data is loaded in different views, and one of the views should show the content of a subdirectory inside this project (the other views are ViewParts and do not use CNF). So my plugin.xml references for the viewerContentBinding org.eclipse.ui.navigator.resourceContent, resources.filters, etc, in addition to my own navigationContent (Because I want to inherit from "normal" behavior / icons / etc for some files).
So I tried to correct this problem of the view showing the whole workspace, and finally found a solution (more a workaround, in fact): I subclass CommonViewer and override inputChanged, in order to do nothing in case the input is an IWorkspaceRoot (and otherwise call super.inputChanged). Apparently it works, but I suspect I have done something wrong somewhere and this solution is not optimal...could you tell me if you know of a better way to solve this problem, or what it is caused by?
Powered by FUDForum
. Page generated in 0.01547 seconds