[CNF] Enablement with resources [message #335771] |
Tue, 28 April 2009 16:59  |
Eclipse User |
|
|
|
I am trying to use CNF to allow navigation amongst resources (project,
folder, file) and within files (i.e. expand a file to see the contents
of the model in the file).
I created a navgigatorContent extension (NCE), which references my
content and label provider. It seems that the only way to get it to
work is specify activateByDefault as true, and then add an empty enable
or triggerPoint child element to the NCE.
If I specify activateByDefault as false, it will not work, even if I
specify what I think are correct conditions in enablement or
triggerPoint (e.g. instanceof element with type IResource).
|
|
|
Re: [CNF] Enablement with resources [message #335772 is a reply to message #335771] |
Tue, 28 April 2009 19:41   |
Eclipse User |
|
|
|
Originally posted by: ali.akar.geensys.com
Hi Jon,
Did you contribute your own viewer via the extension
point="org.eclipse.ui.navigator.viewer" ???
if yes, you can insclude as navigatorcontentbinding the
"org.eclipse.ui.navigator.resourceContent", then you don't have to care
about the navigation amongst resources (IProject, IFolder & IFile). your
navigatorcontent must be enabled on your files only to navigate within,
so for the trigger point you can use property testes (like file
extension or content type) and for the possible children you can use an
instanceof your root model object. see below :
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="false"
contentProvider="com.lgt.myContentProvider"
id="com.lgt.mynavigator"
labelProvider="com.lgt.myLabelProvider"
name="LGT Content"
priority="normal">
<triggerPoints>
<and>
<instanceof
value="org.eclipse.core.resources.IFile">
</instanceof>
<test
property="org.eclipse.core.resources.extension"
value="lgt">
</test>
</and>
</triggerPoints>
<possibleChildren>
<instanceof
value="org.lgt.emf.MyRootModelObject">
</instanceof>
</possibleChildren>
And don't forget to incluse your own content to the viewer.
Jon Barrilleaux a écrit :
> I am trying to use CNF to allow navigation amongst resources (project,
> folder, file) and within files (i.e. expand a file to see the contents
> of the model in the file).
>
> I created a navgigatorContent extension (NCE), which references my
> content and label provider. It seems that the only way to get it to
> work is specify activateByDefault as true, and then add an empty enable
> or triggerPoint child element to the NCE.
>
> If I specify activateByDefault as false, it will not work, even if I
> specify what I think are correct conditions in enablement or
> triggerPoint (e.g. instanceof element with type IResource).
|
|
|
|
|
Re: [CNF] Enablement with resources [message #335812 is a reply to message #335788] |
Thu, 30 April 2009 15:51  |
Eclipse User |
|
|
|
Mystery solved (I think)....
It seems that if activateByDefault is false, the content extension is
essentially disabled, regardless of the enablement/triggerpoint
conditions. As such, activateByDefault must be set to true (or the user
must check it in the viewer's content selection dialog) otherwise the
content extension is ignored.
Is this consistent with other developer's experience?
--jon
|
|
|
Powered by
FUDForum. Page generated in 0.06509 seconds