Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Use Menu with Combo?(Is it possible to use a Menu widget instead of the usual setItems with the Combo widget?)
Use Menu with Combo? [message #636580] Tue, 02 November 2010 02:24 Go to next message
Jonah Bron is currently offline Jonah BronFriend
Messages: 32
Registered: October 2010
Location: California
Member
Hello, world!

Is it possible to use a Menu widget on a Combo instead of the usual addItems() method? Or otherwise, how can I add separators to the Combo dropdown? Menu would be better because I can associate an Object with each item.

Thanks!


Premature developer

[Updated on: Tue, 02 November 2010 02:27]

Report message to a moderator

Re: Use Menu with Combo? [message #636704 is a reply to message #636580] Tue, 02 November 2010 13:51 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi,

There isn't a way to do this for Combos, I don't know if the native controls
provide support for separators like this.

If this is important then a workaround you can try is to create a ToolBar
with a SWT.DROP_DOWN ToolItem, and provide the menu (which can contain a
separator) when needed. For an example of this see
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet67. java .

Grant


"Jonah Bron" <jonah@nucleussystems.com> wrote in message
news:iansia$95i$1@news.eclipse.org...
> Hello, world!
>
> Is it possible to use a Menu widget on a Combo instead of the usual
> addItems() method? Or otherwise, how can I add separators to the Combo
> dropdown?
>
> Thanks!
> --
> Premature developer
Re: Use Menu with Combo? [message #636773 is a reply to message #636580] Tue, 02 November 2010 17:48 Go to previous messageGo to next message
Jonah Bron is currently offline Jonah BronFriend
Messages: 32
Registered: October 2010
Location: California
Member
Hm, I don't know if that will work for my application. Is there any way to set an item in the Combo as non-selectable?

Premature developer
Re: Use Menu with Combo? [message #636958 is a reply to message #636773] Wed, 03 November 2010 14:12 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
No, there isn't a way to do this. But a menu item can be disabled ;-).

Grant


"Jonah Bron" <jonah@nucleussystems.com> wrote in message
news:iapime$rl7$1@news.eclipse.org...
> Hm, I don't know if that will work for my application. Is there any way
> to set an item in the Combo as non-selectable?
> --
> Premature developer
Previous Topic:Linux GTK hanging in an RCP Application for java 6
Next Topic:Re: Changing fonts without effect
Goto Forum:
  


Current Time: Sun Oct 22 06:36:36 GMT 2017

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

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