Adding the CommonNavigator PopupMenu to my View [message #329704] |
Tue, 01 July 2008 13:36 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #329779 is a reply to message #329724] |
Thu, 03 July 2008 15:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Shawn Spiars![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=sspiars%40abac.com) 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
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04045 seconds