Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CNF Content Provider IFiles
CNF Content Provider IFiles [message #898354] Thu, 26 July 2012 05:17 Go to next message
Mat Mathiew is currently offline Mat Mathiew
Messages: 29
Registered: July 2012
Junior Member
Hi,

I have my own Content Navigator with custom Content and Label Provider.
I have declare classes to represent the different items of the custom project e.g.

CustomProject
CustomProjectFolder1
CustomProjectFolder1.2
CustomProjectFolder2

My problem is that I want also except of this folder structure to dynamically add files (IFiles) to the folders.I created a new wizard to do that but these IFiles dont appear in the folders. The files are created ok since i can see them in eclipse standard navigator.
I added as trigger Points and possibleChildren the IFile
following the eclipse help page
(http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_navigator_navigatorContent.html)

but the ContentNavigator never gets called for an IFile.


   <navigatorContent
         activeByDefault="true"
         contentProvider="navigator.ContentProvider"
         id="myplugin.ui.navigatorContent"
         labelProvider="navigator.LabelProvider"
         name="Custom Navigator Content"
         priority="highest">
      <triggerPoints>
         <or>
            <instanceof
                  value="org.eclipse.core.resources.IWorkspaceRoot">
            </instanceof>
              <instanceof
                  value="org.eclipse.core.resources.IFile">
            </instanceof>
         </or>
      </triggerPoints>   
      <possibleChildren>
           <or>         
              <instanceof 
                    value="org.eclipse.core.resources.IWorkspaceRoot" /> 
              <instanceof 
                     value="myCustomProjectElement" /> 
              <instanceof 
                     value="org.eclipse.core.resources.IFile" /> 
         </or>
       </possibleChildren>
   </navigatorContent>


Is this the correct way to declare the IFile Element in the content provider?
Any suggestions of what is the problem..?

I tried also adding a new content extension to the content of type:
    <contentExtension pattern="org.eclipse.ui.navigator.resourceContent" />	

and although i can see that the navigator has as content Resources and the Custom Navigator Content still the IFiles dont appear...


Another idea is to create a new CustomElement and IFile will be just a property of that element but i am not sure how to dynamically add a new CustomElement as a child in the ContentProvider.

[Updated on: Thu, 26 July 2012 06:59]

Report message to a moderator

Re: CNF Content Provider IFiles [message #899085 is a reply to message #898354] Mon, 30 July 2012 10:05 Go to previous message
Joseph Carroll is currently offline Joseph Carroll
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Mat-

Were you able to solve your problem? I have not worked much with CNF but would be happy to help if you are still in need of assistance.

What comes to mind is if (presumably) the JFace tree-viewer is receiving an update.
    treeViewer.refresh();

Which is assuming that your content provider is able to realize the changes.

I could be way off base, but let me know and I would be happy to collaborate.

JD
Previous Topic:action provider keystrokes not working
Next Topic:3.x RCP application running under 4.2 problem with medialib
Goto Forum:
  


Current Time: Tue Jul 29 21:02:36 EDT 2014

Powered by FUDForum. Page generated in 0.01521 seconds