Why is a .java file not an IFile? [message #514167] |
Fri, 12 February 2010 16:50 |
sheamus Messages: 14 Registered: September 2009 |
Junior Member |
|
|
I want to create a context menu action for Java source files in eclipses.
In my plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
id="dds_gen.contribution1"
objectClass="org.eclipse.core.runtime.IAdaptable"
nameFilter="*.java">
<menu
label="My Menu"
path="additions"
id="my_gen.menu1">
<separator
name="group1">
</separator>
</menu>
<action
label="My Generator"
class="my_gen.popup.actions.MyGeneratorAction"
menubarPath="my_gen.menu1/group1"
enablesFor="1"
id="my_gen.newAction">
</action>
</objectContribution>
</extension>
</plugin>
If I change org.eclipse.core.runtime.IAdaptable to org.eclipse.core.resources.IFile or org.eclipse.core.resources.IResource I do not see my action in menu. But if it is an IAdaptable I do. All the docs and tutorials say I should be using IFile.
I am on eclipse 3.4.
Thanks,
~S
[Updated on: Fri, 12 February 2010 16:51] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05211 seconds