Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding button to Right Click menu
Adding button to Right Click menu [message #329559] Fri, 27 June 2008 19:44 Go to next message
Eclipse UserFriend
Originally posted by: maxipower_q.yahoo.com

i'm developing a file renamer plugin.

currently, i put a button under 'Edit' menu, on the upper menu of the
Eclipse window. this button opens my GUI. also i use a JFileChooser in my
GUI to take the choosen file's path.

but this is a really bad solution.

i wanna learn;

1. how can i add my plugin's button inside the right click menu in Eclipse?
so user can right click on the file and select it.
(can you tell me what changes should i make in my plugin.xml (shown below))

2. how can i get the choosen file's path to a string? (with which
commands?)






my current plugin.xml file is like that:

<plugin>
<extension point="org.eclipse.ui.actionSets">
<actionSet label="Sample Action Set" visible="true"
id="argela.plugins.rename13.actionSet">
<action label="&Rename13"
class="argela.plugins.rename13.actions.Application"
menubarPath="Edit/Rename13"
id="argela.plugins.rename13.actions.Application">
</action>
</actionSet>
</extension>
</plugin>
Re: Adding button to Right Click menu [message #329573 is a reply to message #329559] Sat, 28 June 2008 11:18 Go to previous messageGo to next message
Rahul Kamdar is currently offline Rahul KamdarFriend
Messages: 63
Registered: July 2009
Member
Hi,

Do you want to override the existing "Rename" action? Or do you want to
contribute your own form of a rename action which would exist along with the
native "Rename"?

For contributing to the right-click menu (context menu/popup menu) for any
selected resource in the Navigator/Project Explorer view, you can refer to
the articles at:
http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-based-viewer.html
(for using the popupMenus extension point) and
http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html
(actionProviders).

You want to convert the file's path to a string? The IPath/Path class has
couple of API methods for converting into a string of your requirement
(refer javadoc - toPortableString/toOsString etc.).

Rahul

"Cumhur Kilic" <maxipower_q@yahoo.com> wrote in message
news:82a9993aa10179af3f10747e908bd4cf$1@www.eclipse.org...
> i'm developing a file renamer plugin.
>
> currently, i put a button under 'Edit' menu, on the upper menu of the
> Eclipse window. this button opens my GUI. also i use a JFileChooser in my
> GUI to take the choosen file's path.
> but this is a really bad solution.
>
> i wanna learn;
> 1. how can i add my plugin's button inside the right click menu in
> Eclipse?
> so user can right click on the file and select it.
> (can you tell me what changes should i make in my plugin.xml (shown
> below))
>
> 2. how can i get the choosen file's path to a string? (with which
> commands?)
>
>
>
>
>
>
> my current plugin.xml file is like that:
>
> <plugin>
> <extension point="org.eclipse.ui.actionSets">
> <actionSet label="Sample Action Set" visible="true"
> id="argela.plugins.rename13.actionSet">
> <action label="&Rename13"
> class="argela.plugins.rename13.actions.Application"
> menubarPath="Edit/Rename13"
> id="argela.plugins.rename13.actions.Application">
> </action>
> </actionSet>
> </extension>
> </plugin>
>
Re: Adding button to Right Click menu [message #329577 is a reply to message #329573] Sat, 28 June 2008 11:21 Go to previous message
Rahul Kamdar is currently offline Rahul KamdarFriend
Messages: 63
Registered: July 2009
Member
Also, I missed this:
http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-based-viewer_18.html
Your case probably might be better suited to use Object Contributions.

Rahul

"Rahul Kamdar" <rtkamdar@kamdars-india.com> wrote in message
news:g456nc$gu7$1@build.eclipse.org...
> Hi,
>
> Do you want to override the existing "Rename" action? Or do you want to
> contribute your own form of a rename action which would exist along with
> the native "Rename"?
>
> For contributing to the right-click menu (context menu/popup menu) for any
> selected resource in the Navigator/Project Explorer view, you can refer to
> the articles at:
> http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-based-viewer.html
> (for using the popupMenus extension point) and
> http://scribbledideas.blogspot.com/2006/06/building-common-n avigator-_115067357450703178.html
> (actionProviders).
>
> You want to convert the file's path to a string? The IPath/Path class has
> couple of API methods for converting into a string of your requirement
> (refer javadoc - toPortableString/toOsString etc.).
>
> Rahul
>
> "Cumhur Kilic" <maxipower_q@yahoo.com> wrote in message
> news:82a9993aa10179af3f10747e908bd4cf$1@www.eclipse.org...
>> i'm developing a file renamer plugin.
>>
>> currently, i put a button under 'Edit' menu, on the upper menu of the
>> Eclipse window. this button opens my GUI. also i use a JFileChooser in my
>> GUI to take the choosen file's path.
>> but this is a really bad solution.
>>
>> i wanna learn;
>> 1. how can i add my plugin's button inside the right click menu in
>> Eclipse?
>> so user can right click on the file and select it.
>> (can you tell me what changes should i make in my plugin.xml (shown
>> below))
>>
>> 2. how can i get the choosen file's path to a string? (with which
>> commands?)
>>
>>
>>
>>
>>
>>
>> my current plugin.xml file is like that:
>>
>> <plugin>
>> <extension point="org.eclipse.ui.actionSets">
>> <actionSet label="Sample Action Set" visible="true"
>> id="argela.plugins.rename13.actionSet">
>> <action label="&Rename13"
>> class="argela.plugins.rename13.actions.Application"
>> menubarPath="Edit/Rename13"
>> id="argela.plugins.rename13.actions.Application">
>> </action>
>> </actionSet>
>> </extension>
>> </plugin>
>>
>
>
Previous Topic:Textfield with auto-completion
Next Topic:Re: Eclipse for Vista 64-bit
Goto Forum:
  


Current Time: Wed Jul 17 14:51:16 GMT 2024

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

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

Back to the top