Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding Menu Items thru Plugin.xml
Adding Menu Items thru Plugin.xml [message #467582] Tue, 08 May 2007 11:51 Go to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,

Can you please let me know how to add actions to the menubar of our
widget through plugin.xml

Thanks in advance,
Arshia
Re: Adding Menu Items thru Plugin.xml [message #467584 is a reply to message #467582] Tue, 08 May 2007 12:33 Go to previous messageGo to next message
Aravindhan Annamalai is currently offline Aravindhan AnnamalaiFriend
Messages: 89
Registered: July 2009
Location: Chennai
Member
Hi...
Add the org.eclipse.ui.actionsets plug-in under the Extensions
tab....create a new actionset upon that and then create a menu and an
action upon that actionset...don forget to give the menubar path in the
action attributes...
this should work for u....
Re: Adding Menu Items thru Plugin.xml [message #467589 is a reply to message #467584] Tue, 08 May 2007 13:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,

Can u send some snippet of this.. actually I am new to eclipse
Re: Adding Menu Items thru Plugin.xml [message #467610 is a reply to message #467589] Tue, 08 May 2007 23:53 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
In that case, read these:

http://www.eclipse.org/articles/article.php?file=Article-act ion-contribution/index.html

http://eclipse.org/articles/Article-RCP-1/tutorial1.html
http://eclipse.org/articles/Article-RCP-2/tutorial2.html
http://eclipse.org/articles/Article-RCP-3/tutorial3.html

Alex.
Re: Adding Menu Items thru Plugin.xml [message #467612 is a reply to message #467610] Wed, 09 May 2007 04:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,
Thanks for reply..

My view is sampleView and I want to add exit action to this view. I have
written the following in plugin.xml to add my action to the menubar of my
view.


<extension point="org.eclipse.ui.viewActions">
<viewContribution
id="SampleView"
targetID="sample.SmapleView">
<action
id="org.eclipse.ui.articles.action.contribution.view.action1 "
label="Exit"
icon="icons/exit.png"
tooltip="Tooltip for View Action 1"
menubarPath="additions"
class="sample.ExitAction"
enablesFor="*">
</action>
</viewContribution>
</extension>

it didn't add any action to the menu bar.. What exactly to give as
manubarpath in the above code..

Thanks in advance,
Arshia Jamal
Re: Adding Menu Items thru Plugin.xml [message #467621 is a reply to message #467612] Wed, 09 May 2007 08:09 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
When you add XML to EZ, it eats it so you can't see what you've added:

http://www.eclipsezone.com/eclipse/forums/m92145447.html#921 45447

You need to surround XML text with (xml) and (/xml), except using [] instead of ().

Alex.
Re: Adding Menu Items thru Plugin.xml [message #467623 is a reply to message #467621] Wed, 09 May 2007 08:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,


here is the code ,

<xml>

<extension point="org.eclipse.ui.viewActions">
<viewContribution
id="com.sequenom.everest.ui.CustomerView"
targetID="com.sequenom.everest.ui.project.CustomerView">
<action
id="org.eclipse.ui.articles.action.contribution.view.action1 "
label="Exit"
icon="icons/exit.png"
tooltip="Tooltip for View Action 1"
menubarPath="additions"
class="com.sequenom.everest.ui.project.ExitAction"
enablesFor="*">
</action>
</viewContribution>
</extension>

</xml>
Re: Adding Menu Items thru Plugin.xml [message #467625 is a reply to message #467623] Wed, 09 May 2007 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,


here is the code ,

(xml)

<extension point="org.eclipse.ui.viewActions"> <viewContribution
id="com.sequenom.everest.ui.CustomerView"
targetID="com.sequenom.everest.ui.project.CustomerView">
<action
id="org.eclipse.ui.articles.action.contribution.view.action1 "
label="Exit" icon="icons/exit.png"
tooltip="Tooltip for View Action 1"
menubarPath="additions"
class="com.sequenom.everest.ui.project.ExitAction"
enablesFor="*">
</action> </viewContribution> </extension>

(/xml)
Re: Adding Menu Items thru Plugin.xml [message #467638 is a reply to message #467625] Wed, 09 May 2007 12:32 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Sadly, that didn't seem to work. What about translating your &lt; and &gt; to something else like () so that it doesn't get munged? Much more Lisp-like :-)

Alex.
Re: Adding Menu Items thru Plugin.xml [message #467691 is a reply to message #467638] Thu, 10 May 2007 05:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,


What is the wrong with this code in plugin.xml to add actions to the view
menubar,

I have just removed '<' tag from the actual code and pasted here


extension point="org.eclipse.ui.viewActions">

viewContribution
id="com.sequenom.everest.ui.CustomerView"
targetID="com.sequenom.everest.ui.project.CustomerView">

action
id="org.eclipse.ui.articles.action.contribution.view.action1 "
label="Exit" icon="icons/exit.png"
tooltip="Tooltip for View Action 1"
menubarPath="additions"
class="com.sequenom.everest.ui.project.ExitAction"
enablesFor="*">

/action>

/viewContribution>

/extension>

Thanks in advance,
Arshia
Re: Adding Menu Items thru Plugin.xml [message #467731 is a reply to message #467691] Thu, 10 May 2007 13:29 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Arshia Jamal wrote:
> Hi,
>
>
> What is the wrong with this code in plugin.xml to add actions to the
> view menubar,
> I have just removed '<' tag from the actual code and pasted here
>
>
> extension point="org.eclipse.ui.viewActions">
> viewContribution id="com.sequenom.everest.ui.CustomerView"
> targetID="com.sequenom.everest.ui.project.CustomerView">
> action
>
> id="org.eclipse.ui.articles.action.contribution.view.action1 "
> label="Exit" icon="icons/exit.png"
> tooltip="Tooltip for View Action 1"
> menubarPath="additions"
> class="com.sequenom.everest.ui.project.ExitAction"
> enablesFor="*">
>
> /action>
> /viewContribution>
> /extension>
>

This should, in theory, add the action to your view dropdown menu (the
little triangle in the top right corner of your view title).

Is that not where it went? Or is it you want to add the action to the
main menu bar (like File, Edit, Help, etc).

Later,
PW


Re: Adding Menu Items thru Plugin.xml [message #467818 is a reply to message #467731] Fri, 11 May 2007 04:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arshia.yahoo.co.in

Hi,

Thanks for the reply.. I want to add the action to the menubar,toolbar
of my view not to the main menubar and main toolbar...

<extension point="org.eclipse.ui.viewActions">
<viewContribution id="com.sequenom.everest.ui.CustomerView"
targetID="sample.CustomerView">
<action
id="org.eclipse.ui.articles.action.contribution.view.action1 "
label="Exit" icon="icons/exit.png"
tooltip="Tooltip for View Action 1"
menubarPath="additions"
class="sample.ExitAction"
enablesFor="*">

</action>
</viewContribution>
</extension>


How to add the action to my view dropdown menu (the little triangle in the
top right corner of your view title). Please help me... Just few dyas back
I stared exploring all these..

Thanks,
Arshia Jamal
Re: Adding Menu Items thru Plugin.xml [message #712674 is a reply to message #467731] Sun, 07 August 2011 15:37 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 13
Registered: December 2010
Location: swden
Junior Member
Hi,
I have the same problem in plugins.But anyhow did you check the targetID attribute value.Check your xml file that your targetID is correct or not.If it is correct then there is something wrong in your java code.Please if you correct it by this way then inform me also.
/Regards
arifihsan50@yahoo.com
Re: Adding Menu Items thru Plugin.xml [message #712676 is a reply to message #467818] Sun, 07 August 2011 15:41 Go to previous message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 13
Registered: December 2010
Location: swden
Junior Member
Hi Again!
If you want to add your actions to menu bar or toolbar then you have to use the extension point org.eclipse.ui.actionSets.
/ihsan
Previous Topic:Update RCP without UpdateManager
Next Topic:Dynamic menu contribution doesn't show up in a toolbar
Goto Forum:
  


Current Time: Fri Mar 29 00:24:02 GMT 2024

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

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

Back to the top