Common Navigator view contents... [message #327896] |
Wed, 07 May 2008 17:50 |
Eclipse User |
|
|
|
Originally posted by: sursubra.cisco.com
Hi
I am using common Navigator to create a view. In that view , I am trying
show my project type content in a dirfferent way than the prject shown in
the package explorer view. For instance my project type have 2 directories,
one for model files and for storing other files in the project. My models
are stored as files with certain extension. What i want to do is when i add
my project in common Navigator based view i don't want to show the actual
file as children of the model folder instead i want to show the model
elements directly.I am able see the model elements as children of model
folder. But it also shows the file. I guess this is because i am using
<contentExtension pattern="org.eclipse.ui.navigator.resourceContent"/>
if i remove the above contentExtension pattern the projects are not
appearing in the view. Is there a way to suppress only the model files
appearing as children to model folder. following is my plugin.xml fragment.
<extension
point="org.eclipse.ui.views">
<category
id="my.viewers.category"
name="My Viewers Category"/>
<view allowMultiple="false"
class="org.eclipse.ui.navigator.CommonNavigator"
id="my.model.explorer"
name="My Model Explorer"/>
</extension>
<!-- Declare the viewer configuration, and the default content/action
bindings -->
<extension
point="org.eclipse.ui.navigator.viewer">
<viewer viewerId="my.model.explorer">
<popupMenu
allowsPlatformContributions="true"
</viewer>
<viewerContentBinding viewerId="my.model.explorer">
<includes>
<contentExtension pattern="my.model.explorer.myContent"/>
<contentExtension pattern="org.eclipse.ui.navigator.resourceContent"/>
<contentExtension pattern="org.eclipse.ui.navigator.resources.filters.*"/>
</includes>
</viewerContentBinding>
</extension>
------------------------------------------------------------ --------------------------------
<extension point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="true"
contentProvider="my.model.MyTypeContentProvider"
id="my.model.explorer.myContent"
labelProvider="my.mode.MyTypeLabelProvider"
name="My Model Type Content"
priority="high">
<triggerPoints>
<or>
<adapt type="org.eclipse.core.resources.IProject" >
<test property="org.eclipse.core.resources.projectNature"
value="my.project.nature"/>
</adapt>
<instanceof value= "org.eclipse.core.resources.IResource" />
</or>
</triggerPoints>
<possibleChildren>
<or>
<instanceof value="org.eclipse.emf.ecore.EObject"/>
</or>
</possibleChildren>
</navigatorContent>
</extension>
Regards,
Suresh Subramanian
|
|
|
Powered by
FUDForum. Page generated in 0.02545 seconds