Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Combo Box
Combo Box [message #244566] Fri, 25 July 2008 12:36 Go to next message
Michael Swearingen is currently offline Michael Swearingen
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 09:27 Go to previous messageGo to next message
Eclipse User
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 11:00 Go to previous message
Michael Swearingen is currently offline Michael Swearingen
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: Wed Aug 20 20:26:37 EDT 2014

Powered by FUDForum. Page generated in 0.02997 seconds