Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Is there an example of pulldown behaviour of a command
Is there an example of pulldown behaviour of a command [message #665337] Thu, 14 April 2011 11:24 Go to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
I would like a command to have a pulldown menu.
The command can have a finite number of states, and the command in the toolbar should reflect the icon of the current state.
When I click on it, a pull down menu with the icons of all possible states should be shown, and the current one should be checked.

I think this is possible, as I've seen
UIElement#setDropDownId()

but I haven't seen any example or explanation in any place, including here:
http://blog.eclipse-tips.com/search?q=commands+part

I've already seen example of RadioState, without the pulldown menu.

Thanks in advance

David
Re: Is there an example of pulldown behaviour of a command [message #665364 is a reply to message #665337] Thu, 14 April 2011 12:44 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You would put a command in the toolbar and then use a menuContribution
to fill in the menu dropdown part.

See https://github.com/paulweb515/commandsEclipseCon2011 the
org.eclipse.example.commands project. It has examples of both dropdown
toolitems, dynamic menus, and radio buttons.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Is there an example of pulldown behaviour of a command [message #665618 is a reply to message #665364] Fri, 15 April 2011 09:38 Go to previous message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Thanks a lot once again, Paul. Smile

Paul Webster wrote on Thu, 14 April 2011 08:44
You would put a command in the toolbar and then use a menuContribution
to fill in the menu dropdown part.

See https://github.com/paulweb515/commandsEclipseCon2011 the
org.eclipse.example.commands project. It has examples of both dropdown
toolitems, dynamic menus, and radio buttons.

PW

Previous Topic:get file location using IFile and IProject
Next Topic:Phantom sticky shells
Goto Forum:
  


Current Time: Tue Apr 23 16:08:11 GMT 2024

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

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

Back to the top