Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding the CommonNavigator PopupMenu to my View
Adding the CommonNavigator PopupMenu to my View [message #329704] Tue, 01 July 2008 13:36 Go to next message
Eclipse UserFriend
Originally posted by: kevin.oberg.baesystems.com

Here is my trouble:

I have a view that generates lists of files based on a query I run for my
Clearcase version control system. My TreeViewer holds a list of commands
run and beneath each of these are all the output generated by them, which
is always a list of files and directories that were found to match the
query that was run.

What I want/need to do is make the popup menu for this viewer be the same
one that is accessible from the Project/Package explorer and Navigator
viewers. Long story short, I have spent way too much time trying to
figure this out to no avail, though I am certain that this is a very
simple if not trivial task.

Any suggestions are appreciated, as well as any obvious solutions that I
have overlooked!

Kevin
Re: Adding the CommonNavigator PopupMenu to my View [message #329724 is a reply to message #329704] Wed, 02 July 2008 02:19 Go to previous messageGo to next message
Shawn Spiars is currently offline Shawn SpiarsFriend
Messages: 16
Registered: July 2009
Junior Member
Kevin,

Within the plugin.xml file where you define your CommonNavigator
configuration you need a viewer action binding that will inherit those
actions - something like this:

<viewerActionBinding
viewerId="com.mycompany.ui.views.navigator">
<includes>
<actionExtension
pattern="org.eclipse.ui.navigator.resources.PortingActions"/ >
<actionExtension
pattern="org.eclipse.ui.navigator.resources.ResourceMgmtActions "/>
</includes>
</viewerActionBinding>


Shawn

Kevin Oberg wrote:
> Here is my trouble:
>
> I have a view that generates lists of files based on a query I run for
> my Clearcase version control system. My TreeViewer holds a list of
> commands run and beneath each of these are all the output generated by
> them, which is always a list of files and directories that were found to
> match the query that was run.
>
> What I want/need to do is make the popup menu for this viewer be the
> same one that is accessible from the Project/Package explorer and
> Navigator viewers. Long story short, I have spent way too much time
> trying to figure this out to no avail, though I am certain that this is
> a very simple if not trivial task.
>
> Any suggestions are appreciated, as well as any obvious solutions that I
> have overlooked!
>
> Kevin
>
Re: Adding the CommonNavigator PopupMenu to my View [message #329779 is a reply to message #329724] Thu, 03 July 2008 15:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kevin.oberg.baesystems.com

Shawn,

The trouble with that is that that requires for my viewer to be some form
of a CommonNavigator, but it is not and in fact it has no underlying link
to any resources. My viewer currently holds the query exactly as it is
sent to be exec'ed, and then the output is the absolute path of each file
or directory that resulted from said command and is not actually linked to
any resource. I suppose that brings up the issue that I need to make my
domain objects within my viewer actual resources, so I guess that is my
next question:

How do you link each domain object in a (Tree)viewer to a resource in the
file system (if you already know its absolute path)?

Kevin
Re: Adding the CommonNavigator PopupMenu to my View [message #329830 is a reply to message #329779] Mon, 07 July 2008 15:26 Go to previous messageGo to next message
Shawn Spiars is currently offline Shawn SpiarsFriend
Messages: 16
Registered: July 2009
Junior Member
Kevin,


If all of the files in your TreeViewer are part of an Eclipse workspace
you can use the IAdaptable interface for adapting your model objects
into IResource objects which are understood by the Eclipse Resources API.

For example, when you open a model object for editing in your tree
viewer Eclipse will ask if the model implements the IAdaptable
interface. If it does, then the getAdapter(Class key) method
will return a handle to an IResource (Project, Folder, or File) which
the platform understands.

There is an article at this link that discusses this in more detail -

http://www-128.ibm.com/developerworks/opensource/library/os- ecllink/

Shawn


Kevin Oberg wrote:
> Shawn,
>
> The trouble with that is that that requires for my viewer to be some
> form of a CommonNavigator, but it is not and in fact it has no
> underlying link to any resources. My viewer currently holds the query
> exactly as it is sent to be exec'ed, and then the output is the absolute
> path of each file or directory that resulted from said command and is
> not actually linked to any resource. I suppose that brings up the issue
> that I need to make my domain objects within my viewer actual resources,
> so I guess that is my next question:
>
> How do you link each domain object in a (Tree)viewer to a resource in
> the file system (if you already know its absolute path)?
>
> Kevin
>
Re: Adding the CommonNavigator PopupMenu to my View [message #329862 is a reply to message #329830] Tue, 08 July 2008 17:37 Go to previous message
Eclipse UserFriend
Originally posted by: kevin.oberg.baesystems.com

Thanks, that is exactly what I needed!
Previous Topic:No more handles [gtk_init_check() failed]
Next Topic:PDE build under Linux
Goto Forum:
  


Current Time: Fri Aug 16 11:22:00 GMT 2024

Powered by FUDForum. Page generated in 0.04373 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top