Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Click a menu button to display the drop down list
Click a menu button to display the drop down list [message #778106] Wed, 11 January 2012 12:18 Go to next message
Leung Wang Hei is currently offline Leung Wang HeiFriend
Messages: 64
Registered: July 2010
Member
I have a button at the main toolbar with drop-down style. A few
children actions are attached.

How could I show the drop-down list (showing those sub-actions) when
clicking at the top button?

Thanks,
Leung Wang Hei
Re: Click a menu button to display the drop down list [message #778634 is a reply to message #778106] Fri, 13 January 2012 15:23 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
For an example of how this works at the swt level see
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet67.java
..

Hopefully this is what you're looking for, if not then please follow up
here and someone else may have a higher-level answer for you.

Grant


On 1/11/2012 7:18 AM, Leung Wang Hei wrote:
> I have a button at the main toolbar with drop-down style. A few children
> actions are attached.
>
> How could I show the drop-down list (showing those sub-actions) when
> clicking at the top button?
>
> Thanks,
> Leung Wang Hei
Re: Click a menu button to display the drop down list [message #779567 is a reply to message #778634] Mon, 16 January 2012 04:03 Go to previous messageGo to next message
Leung Wang Hei is currently offline Leung Wang HeiFriend
Messages: 64
Registered: July 2010
Member
Thanks Grant, that's the effect I am looking for but the main menu in my
app is added via plugin.xml.

Could you please give me some hint that how I could do the same trick then?


On 1/13/2012 11:23 PM, Grant Gayed wrote:
> For an example of how this works at the swt level see
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet67.java
> .
>
> Hopefully this is what you're looking for, if not then please follow up
> here and someone else may have a higher-level answer for you.
>
> Grant
>
>
> On 1/11/2012 7:18 AM, Leung Wang Hei wrote:
>> I have a button at the main toolbar with drop-down style. A few children
>> actions are attached.
>>
>> How could I show the drop-down list (showing those sub-actions) when
>> clicking at the top button?
>>
>> Thanks,
>> Leung Wang Hei
>
Re: Click a menu button to display the drop down list [message #779838 is a reply to message #779567] Mon, 16 January 2012 16:39 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It matters how it is added in the plugin.xml. If you use org.eclipse.ui.menus, you can provide a separate entry to manage the menu dropped down from the tool item.

See http://wiki.eclipse.org/Platform_Command_Framework and http://wiki.eclipse.org/Menu_Contributions for more info.

PW


Previous Topic:Problems with command expressions and enableWhen, activeWhen
Next Topic:Drag-n-Drop - can it NOT display the insertion bar in the target?
Goto Forum:
  


Current Time: Mon Nov 30 08:51:34 GMT 2020

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

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

Back to the top