Add action to external editors [message #555905] |
Mon, 30 August 2010 03:39  |
Eclipse User |
|
|
|
Hi,
I am working on an application in which I need to add an action to
context menu of editor. However, this action should be visible only for
external editors (i.e. for editing files which are external to the
workspace).
In my plugin, plugin.xml file if I use,
objectClass="org.eclipse.core.resources.IResource", this action is
visible and enabled in context menu of internal editors only.
If objectClass="org.eclipse.ui.IEditorInput" is used, the action is
visible and enabled in context menu of both internal and external editors.
Following is the code snipppet of plugin.xml for my plug-in.
<objectContribution
adaptable="true"
id="my.plugin.objectContributionAction1"
objectClass="org.eclipse.core.runtime.IResource">
<action
class="my.plugin.internal.Action1"
enablesFor="1"
icon="icons/obj/image.png"
id="my.plugin.Action1"
label="Action Label"
tooltip="Action Tooltip">
</action>
</objectContribution>
I am not able to find any hints on how to show the action in context
menu of external editors only.
Any suggestions would be of great help.
Thanks,
Sneha
|
|
|
Re: Add action to external editors [message #555950 is a reply to message #555905] |
Mon, 30 August 2010 06:58   |
Eclipse User |
|
|
|
Hi,
Please let me know if there are any pointers for this.
Thanks in advance,
Sneha
sneha wrote:
> Hi,
>
> I am working on an application in which I need to add an action to
> context menu of editor. However, this action should be visible only for
> external editors (i.e. for editing files which are external to the
> workspace).
> In my plugin, plugin.xml file if I use,
> objectClass="org.eclipse.core.resources.IResource", this action is
> visible and enabled in context menu of internal editors only.
> If objectClass="org.eclipse.ui.IEditorInput" is used, the action is
> visible and enabled in context menu of both internal and external editors.
> Following is the code snipppet of plugin.xml for my plug-in.
>
> <objectContribution
> adaptable="true"
> id="my.plugin.objectContributionAction1"
> objectClass="org.eclipse.core.runtime.IResource">
> <action
> class="my.plugin.internal.Action1"
> enablesFor="1"
> icon="icons/obj/image.png"
> id="my.plugin.Action1"
> label="Action Label"
> tooltip="Action Tooltip">
> </action>
> </objectContribution>
>
> I am not able to find any hints on how to show the action in context
> menu of external editors only.
>
> Any suggestions would be of great help.
>
> Thanks,
> Sneha
|
|
|
|
Powered by
FUDForum. Page generated in 0.03681 seconds