|
Re: [CNF] Enablement with resources [message #335772 is a reply to message #335771] |
Tue, 28 April 2009 23: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 #335788 is a reply to message #335785] |
Wed, 29 April 2009 20:47 |
Eclipse User |
|
|
|
Originally posted by: ali.akar.geensys.com
Hello,
You didn't declare the viewer :)
I suggest u to take a look at the plugin.xml of the plugin
"org.eclipse.ui.navigator.resources" which declares the ProjectExplorer
view.
Did you contribute your own view part ???
see correction below.
Jon Barrilleaux a écrit :
> thanks for your help. I had tried what you recommended a while back but
> gave up since I couldn't get it to work. I added it back again to give
> it another try. Below are what I believe to be the critical portions of
> my plugin.xml file. I must be missing some
>
> Ali Akar wrote:
>> Hi Jon,
>>
>> Did you contribute your own viewer via the extension
>> point="org.eclipse.ui.navigator.viewer" ???
>
> Here is the pertinent part of my org.eclipse.ui.navigator.viewer
> extension...
>
> <extension
> point="org.eclipse.ui.navigator.viewer">
<viewer
viewerId="org.eclipse.ui.navigator.ProjectExplorer">
</viewer>
> <viewerContentBinding
> viewerId="com.msli.mapp3d.client.WORKSPACE_VIEW">
> <includes>
> <contentExtension
> pattern="org.eclipse.ui.navigator.resourceContent">
> </contentExtension>
> <contentExtension
> pattern="com.msli.jme.GRAPHIC_MODEL">
> </contentExtension>
>
>> 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 :
>>
>> ...
>>
>> And don't forget to incluse your own content to the viewer.
>>
> Here is the pertinent part of my
> org.eclipse.ui.navigator.navigatorContent extension. I kept it simple
> by simply testing for an instance of IFile instead of also including an
> extension test (I'll add that later once I get the basic stuff to work)...
>
> <extension
> point="org.eclipse.ui.navigator.navigatorContent">
> <navigatorContent
> activeByDefault="false"
>
> contentProvider="com.msli.jme.rcp.provider.JmeModelContentProvider "
> id="com.msli.jme.GRAPHIC_MODEL"
> labelProvider="com.msli.jme.rcp.provider.JmeModelLabelProvider "
> name="Graphic Model"
> priority="normal">
> <triggerPoints>
> <instanceof
> value="org.eclipse.core.resources.IFile">
> </instanceof>
> </triggerPoints>
> <possibleChildren>
> <or>
> <instanceof
> value="com.msli.jme.model.JmeModelNode">
> </instanceof>
> <instanceof
> value="com.jme.scene.Node">
> </instanceof>
> </or>
> </possibleChildren>
> </navigatorContent>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03524 seconds