Adding a PopupMenu item to Java source folders [message #685593] |
Fri, 17 June 2011 20:23 |
Mat DeLong Messages: 3 Registered: June 2011 |
Junior Member |
|
|
First off... sorry if I am posting this in the incorrect area. I looked around and this seemed correct.
Also, I've researched this and can't find any articles, tutorials, threads, etc which explain how to do this... so if I'm posting a common question, I did my best to prevent that.
What I want to do is create a plugin which adds an action in the context menu of source folders of java projects. Furthermore, I want this item to only be visible if the project is of a specific nature (I know the nature ID.)
I've tried creating a new plugin project and using the wizard made a new popupMenu plugin. From this base I was able to add a popup menu to all IFile (files) in all projects. I couldn't find the ObjectClass for source folders. I was also not sure how to show or hide the context menu item (I could only enable/disable it) but I didn't spend too much time yet looking into that, since I couldn't even get the menu item on the correct node.
I tried IFolder, thinking I might be able to write code to maybe check the classpath or something to see if the folder being passed in was a source folder... but it seems that source folders don't get triggered from IFolder. A regular folder triggered my extension (menu item showed up), but a source folder did not.
Also, out of desperation I tried IProject. When testing in the secondary IDE that you can launch from the manifest it seemed to work.. .but then when deploying the plugin into my development IDE, the menu item only showed up for closed projects... not any open projects. Weird.
Any help is greatly appreciated. I know what I am trying to do is probably dead simple, but the solution is escaping me.
Thanks,
Mat
|
|
|
|
|
|
Re: Adding a PopupMenu item to Java source folders [message #777234 is a reply to message #686417] |
Tue, 10 January 2012 05:07 |
shreyas k Messages: 7 Registered: January 2012 |
Junior Member |
|
|
guys m a newbee to eclipse..
the problem m facing is...(and is with respect to PLUGINS(popupmenu template))
i have created a popupmenu-item (in the project explorer view) which is visible for all files except for C-files. i think there's a problem with the 'objectClass' of the objectContribution-attribute under 'org.eclipse.ui.popupMenus'-Extension.
please will anyone help me out with this...??
Thanks,
shreyas
[Updated on: Tue, 10 January 2012 07:47] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04055 seconds