Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] Re: Getting selected proect from popup menu in 3M8

Rk,

Thanks for the info, I've got a day or two before I can work on this again
but I'll have a go with this approach.

Lukas

Hi,,

your problem can be solved if you use IAdaptable. check if the object is of
type IAdaptable and then convert the object to iadaptable object, then using
getAdapter(class) method you can get the correpsonding object , on which you
can check the correpondingly on your requirements. Also make sure inplugin
descriptor file , you gave the attribute , <adaptable = "true"> or not,, 

all the best...
Rk



Hello,

I've built a templating utility that I want to integrate into eclipse as a
plugin using the IncrementalBuilder mechanism. I understand how the builders
work, and how they are called to do builds and so on and that looks like
just what I want. 

What I'm trying to work out is how to get my builder registered for a
particular project. My current approach has been to use one of the sample
popup menu plugin wizards, and match it to an IProject. This works great,
and the popup only show when you right click on a project in the navigator
window. Using the "selectionChanged()" method from the IObjectActionDelegate
interface lets me see the project that has been selected, and if I iterate
thru the (one) selected item I can see that it's a
org.eclipse.core.internal.resource.Project (from memory) class, so that
seems to work. 

But I can't seem to do anything with the object, if I cast it to a IProject,
or Project I get NoClassDefFound exceptions. I figured this was to do with
dependencies, so I added the org.eclipse.core.resources plugin as a
dependency, and also the org.eclipse.osgi.services as well, but it doesn't
seem to make any difference.

If anyone has any help it would MOST appreciated :) I've been bangin my head
against this wall for a while now but I'm sure theres a real simple
solution.

Thanks in advance.

Lukas Hazlehurst
Colts Ltd



Back to the top