Common Navigator setup question [message #440666] |
Fri, 31 July 2009 04:59  |
Eclipse User |
|
|
|
I am really struggling with the incompatible changes introduced in the CNF
with the Galileo release... still working through issues and trying to
create reproducible test cases, but before spending any more hours in the
debugger I would really appreciate it if someone could help me confirm
that my overall setup is correct.
In the Project Explorer, I want to replace IProjects with a certain nature
and all their descendants with my model nodes M1Project, M1Folder and
M1File.
Furthermore another plugin supports higher level abstractions and needs to
replace certain M1File nodes with M2Files.
To achieve this I have declared two overriding content extensions
(M1Resource is a common base class of all M1 nodes, same for M2):
M1:
contentProvider="cnf_test.M1ContentProvider"
labelProvider="cnf_test.ResourceWrapperLabelProvider"
override:
suppressedExtensionId="org.eclipse.ui.navigator.resourceContent "
triggerPoints: instanceof org.eclipse.core.resources.IWorkspaceRoot
possibleChildren: instanceof cnf_test.M1Resource
M2:
contentProvider="cnf_test.M2ContentProvider"
labelProvider="cnf_test.ResourceWrapperLabelProvider"
override: suppressedExtensionId="CNF_Test.M1"
triggerPoints: instanceof cnf_test.M1Folder
possibleChildren: instanceof cnf_test.M2Resource
M1ContentProvider implements getPipelinedElements and getPipelinedParent
to replace IProjects with M1Projects and conversely,
and implements getChildren and getParent for M1 nodes.
M2ContentProvider does the same for M2 nodes but implements
getPipelinedChildren rather than getPipelinedElements.
Both content providers listen to resource changes and translate resource
deltas into calls to the appropriate viewer.update(<model node>) or
viewer.refresh(model node).
Is this setup basically correct or did I miss anything fundamental? The
issues I am seeing are multiple, often triggered by external resource
changes (e.g. new folder under created M1Project) not being properly
reflected in the project explorer.
Any help would be greatly appreciated, I have stopped counting the time I
have spent debugging this and I am getting really frustrated :(
Thanks!
Franck
|
|
|
|
Re: Common Navigator setup question [message #441259 is a reply to message #440666] |
Fri, 31 July 2009 06:08   |
Eclipse User |
|
|
|
Here is a first specific use case where I am seeing strange CNF behavior.
Based on discussions I saw on bugzilla on label providers being searched
by trigger points I have updated augmented my triggerPoints with the
possibleChildren condition (i.e. M1 trigger points are now [IWorkspaceRoot
or any M1Resource], M2 are [M1Project or M1Folder or any M2Resource]).
If I use File->New->Folder... to create a new folder directly under an
M1Project, my M1 resource listener issues a call to
viewer.refresh(M1Project).
The image for newM1Folder should be provided by the M1LabelProvider.
The refresh call goes down to
NavigatorContentServiceLabelProvider.getImage(newM1Folder)
which in turns looks for possible contributing extensions by calling
findDescriptorsByTriggerPoint(newM1Folder, considerOverrides=false).
That method only considers firstClassDescriptorsSet members as candidate
extensions, which my M1 content extension is not (it overrides resources).
It would also consider getSourceOfContribution(newM1Folder) but that
returns null (more on this below), and in the end the image returned is
null.
Should I declare two navigator content extensions for M1, one overriding
the core resources provider and another not overriding anything (to
account for providing M1 children or M1 containers)??
Regarding contributions sources, I am tracing and seeing very strange
things, in particular M1Folders being marked as contributed by the
M2Provider, due to this line in NavigatorContentServiceContentProvider:
// Update contributor even if not pipelining as this is where it is
recorded by
viewer pipelinedChildren.setContributor((NavigatorContentDescriptor )
theOverridingExtensions[i].getDescriptor());
I don't quite understand the comment, but this code will mark an M1Folder
and all its M1 children as having been contributed my M2, simply because
M2 wanted a chance to maybe replace a few specific M1 children... this
looks wrong?
This trace demonstrates the pb:
rememberContribution: Content[CNF_Test.M2, "M2 model provider"]:
cnf_test.M1Folder@2c073c61
rememberContribution: Content[CNF_Test.M2, "M2 model provider"]:
cnf_test.M1Folder@2c073c71
rememberContribution: Content[CNF_Test.M2, "M2 model provider"]:
cnf_test.M1Folder@2c073c79
rememberContribution: Content[CNF_Test.M2, "M2 model provider"]:
cnf_test.M2Resource@58cfeb49
rememberContribution: Content[CNF_Test.M2, "M2 model provider"]:
cnf_test.M1File@89d4cd29
Should I just disregard those erroneous contribution assignments??
Thanks!
Franck
|
|
|
|
|
Filed bug #285344 [message #446979 is a reply to message #440666] |
Fri, 31 July 2009 19:35  |
Eclipse User |
|
|
|
... please comment and vote. I have identified the change from Ganymede in
NavigatorContentServiceContentProvider.pipelineChildren that is breaking
existing CNF contributors.
Thanks,
Franck
|
|
|
Powered by
FUDForum. Page generated in 0.04542 seconds