Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Source folder in Context Menu of JavaEditor
Source folder in Context Menu of JavaEditor [message #158408] Wed, 12 May 2004 09:19 Go to next message
Eclipse UserFriend
Hi Eclipse Gurus
I want to add my own actions under the "Source" subfolder of the Java
Editor's context menu, however I don't see any obvious way to do that...
Any suggestions will be greatly appreciated

Thank you !
Re: Source folder in Context Menu of JavaEditor [message #158549 is a reply to message #158408] Thu, 13 May 2004 06:26 Go to previous messageGo to next message
Eclipse UserFriend
This will work with the most recent integration builds:

<!-- define the foo command -->
<!-- the command can then be referenced by various UI elements (actions,
keybindings, toolbar etc.) -->

<extension
point="org.eclipse.ui.commands">
<command
name="FooCommand"
description="Executes Foo"
category="org.eclipse.jdt.ui.category.source"
id="com.example.commands.foo">
</command>
</extension>

<!-- register an action for foo in the source menu -->
<!-- note that this will only add an entry to the context menu, not the
main menu -->

<extension
point="org.eclipse.ui.popupMenus">
<viewerContribution
targetID="#CompilationUnitEditorContext">
<action
definitionId="com.example.commands.foo"
label="Foo"
menubarPath="org.eclipse.jdt.ui.source.menu/additions"
class="com.example.actions.source.FooAction"
id="com.example.actions.source.foo">
</action>
</viewerContribution>
</extension>


-tom

Leho Nigul wrote:
> Hi Eclipse Gurus
> I want to add my own actions under the "Source" subfolder of the Java
> Editor's context menu, however I don't see any obvious way to do that...
> Any suggestions will be greatly appreciated
>
> Thank you !
>
>
Re: Source folder in Context Menu of JavaEditor [message #158606 is a reply to message #158549] Thu, 13 May 2004 12:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi Tom
Thank you for your suggestion.
I tried it, but still got
"Invalid Menu Extension (Path is invalid): com.example.actions.source.foo"
Any other suggestions that I try?

Thank you !

"Tom Eicher" <eclipse@tom.eicher.name> wrote in message
news:c7vi38$94s$1@eclipse.org...
> This will work with the most recent integration builds:
>
> <!-- define the foo command -->
> <!-- the command can then be referenced by various UI elements (actions,
> keybindings, toolbar etc.) -->
>
> <extension
> point="org.eclipse.ui.commands">
> <command
> name="FooCommand"
> description="Executes Foo"
> category="org.eclipse.jdt.ui.category.source"
> id="com.example.commands.foo">
> </command>
> </extension>
>
> <!-- register an action for foo in the source menu -->
> <!-- note that this will only add an entry to the context menu, not the
> main menu -->
>
> <extension
> point="org.eclipse.ui.popupMenus">
> <viewerContribution
> targetID="#CompilationUnitEditorContext">
> <action
> definitionId="com.example.commands.foo"
> label="Foo"
> menubarPath="org.eclipse.jdt.ui.source.menu/additions"
> class="com.example.actions.source.FooAction"
> id="com.example.actions.source.foo">
> </action>
> </viewerContribution>
> </extension>
>
>
> -tom
>
> Leho Nigul wrote:
> > Hi Eclipse Gurus
> > I want to add my own actions under the "Source" subfolder of the Java
> > Editor's context menu, however I don't see any obvious way to do that...
> > Any suggestions will be greatly appreciated
> >
> > Thank you !
> >
> >
Re: Source folder in Context Menu of JavaEditor [message #158622 is a reply to message #158606] Thu, 13 May 2004 12:47 Go to previous messageGo to next message
Eclipse UserFriend
For this to work, you need I20040513_0800 - are you sure you have that?

-tom

Leho Nigul wrote:
> Hi Tom
> Thank you for your suggestion.
> I tried it, but still got
> "Invalid Menu Extension (Path is invalid): com.example.actions.source.foo"
> Any other suggestions that I try?
>
> Thank you !
>
> "Tom Eicher" <eclipse@tom.eicher.name> wrote in message
> news:c7vi38$94s$1@eclipse.org...
>
>>This will work with the most recent integration builds:
>>
>><!-- define the foo command -->
>><!-- the command can then be referenced by various UI elements (actions,
>>keybindings, toolbar etc.) -->
>>
>><extension
>> point="org.eclipse.ui.commands">
>> <command
>> name="FooCommand"
>> description="Executes Foo"
>> category="org.eclipse.jdt.ui.category.source"
>> id="com.example.commands.foo">
>> </command>
>></extension>
>>
>><!-- register an action for foo in the source menu -->
>><!-- note that this will only add an entry to the context menu, not the
>>main menu -->
>>
>><extension
>> point="org.eclipse.ui.popupMenus">
>> <viewerContribution
>> targetID="#CompilationUnitEditorContext">
>> <action
>> definitionId="com.example.commands.foo"
>> label="Foo"
>> menubarPath="org.eclipse.jdt.ui.source.menu/additions"
>> class="com.example.actions.source.FooAction"
>> id="com.example.actions.source.foo">
>> </action>
>> </viewerContribution>
>></extension>
>>
>>
>>-tom
>>
>>Leho Nigul wrote:
>>
>>> Hi Eclipse Gurus
>>>I want to add my own actions under the "Source" subfolder of the Java
>>>Editor's context menu, however I don't see any obvious way to do that...
>>> Any suggestions will be greatly appreciated
>>>
>>>Thank you !
>>>
>>>
>
>
>
Re: Source folder in Context Menu of JavaEditor [message #159346 is a reply to message #158622] Tue, 18 May 2004 16:55 Go to previous message
Eclipse UserFriend
Hi Tom
You were right, I was on the older driver. It works on the latest one.
Thank you!

"Tom Eicher" <eclipse@tom.eicher.name> wrote in message
news:c808d6$6sj$1@eclipse.org...
> For this to work, you need I20040513_0800 - are you sure you have that?
>
> -tom
>
> Leho Nigul wrote:
> > Hi Tom
> > Thank you for your suggestion.
> > I tried it, but still got
> > "Invalid Menu Extension (Path is invalid):
com.example.actions.source.foo"
> > Any other suggestions that I try?
> >
> > Thank you !
> >
> > "Tom Eicher" <eclipse@tom.eicher.name> wrote in message
> > news:c7vi38$94s$1@eclipse.org...
> >
> >>This will work with the most recent integration builds:
> >>
> >><!-- define the foo command -->
> >><!-- the command can then be referenced by various UI elements (actions,
> >>keybindings, toolbar etc.) -->
> >>
> >><extension
> >> point="org.eclipse.ui.commands">
> >> <command
> >> name="FooCommand"
> >> description="Executes Foo"
> >> category="org.eclipse.jdt.ui.category.source"
> >> id="com.example.commands.foo">
> >> </command>
> >></extension>
> >>
> >><!-- register an action for foo in the source menu -->
> >><!-- note that this will only add an entry to the context menu, not the
> >>main menu -->
> >>
> >><extension
> >> point="org.eclipse.ui.popupMenus">
> >> <viewerContribution
> >> targetID="#CompilationUnitEditorContext">
> >> <action
> >> definitionId="com.example.commands.foo"
> >> label="Foo"
> >> menubarPath="org.eclipse.jdt.ui.source.menu/additions"
> >> class="com.example.actions.source.FooAction"
> >> id="com.example.actions.source.foo">
> >> </action>
> >> </viewerContribution>
> >></extension>
> >>
> >>
> >>-tom
> >>
> >>Leho Nigul wrote:
> >>
> >>> Hi Eclipse Gurus
> >>>I want to add my own actions under the "Source" subfolder of the Java
> >>>Editor's context menu, however I don't see any obvious way to do
that...
> >>> Any suggestions will be greatly appreciated
> >>>
> >>>Thank you !
> >>>
> >>>
> >
> >
> >
Previous Topic:File Menu: resource history
Next Topic:New Formatter - Assignment statments
Goto Forum:
  


Current Time: Thu May 01 14:53:37 EDT 2025

Powered by FUDForum. Page generated in 0.02617 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top