|
Re: Combo Box [message #244580 is a reply to message #244566] |
Sat, 26 July 2008 13:27 |
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;
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.04646 seconds