Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Combo Box
Combo Box [message #244566] Fri, 25 July 2008 16:36 Go to next message
Michael Swearingen is currently offline Michael SwearingenFriend
Messages: 26
Registered: July 2009
Junior Member
Hello Everyone,

In my project each shape has certain properties that are chosen from a
list. I would like to replace the text box in the properties view with a
combo box. Can anyone point me to a tutorial showing how to add a combo
box to the properties view or some sample code?

Thanks,
MS
Re: Combo Box [message #244580 is a reply to message #244566] Sat, 26 July 2008 13:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lifesting.gmail.com

Michael S. wrote:
> Hello Everyone,
>
> In my project each shape has certain properties that are chosen from a
> list. I would like to replace the text box in the properties view with
> a combo box. Can anyone point me to a tutorial showing how to add a
> combo box to the properties view or some sample code?
>
> Thanks,
> MS
>
replace PropertyDescriptor or TextPropertyDescriptor to
ComboBoxPropertyDescriptor for the model element you want to change.

e.g:

class MyModel implements IPropertySource
{
protected static IPropertyDescriptor[] descriptors = new
IPropertyDescriptor[]{
new new PropertyDescriptor(PROPERTY_ID, PROPERTY_LABEL),
//COMBO you like to select color
new ComboBoxPropertyDescriptor(COLOR_PROPERTY_ID,
COLOLR_PROPERTY_LABEL, new String[]{"WHITE", "BLACK", "PINK"});
}
......
.....
public IPropertyDescriptor[] getPropertyDescriptors(){
return descriptors;
}
}
Re: Combo Box [message #244649 is a reply to message #244580] Mon, 28 July 2008 15:00 Go to previous message
Michael Swearingen is currently offline Michael SwearingenFriend
Messages: 26
Registered: July 2009
Junior Member
I made the change that you suggested David, but it didn't actually create
the combo box. I just have a blank cell in my properties view. What am I
missing?

MS
Previous Topic:non-rectangular bound?
Next Topic:shall I use GEF or just draw2D?
Goto Forum:
  


Current Time: Thu Mar 28 14:41:46 GMT 2024

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

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

Back to the top