ComboBoxPropertyDescriptor [message #80977] |
Tue, 27 May 2003 04:05  |
Eclipse User |
|
|
|
Hi,
I'm trying to use the ComboBoxPropertyDescriptor in my implementation.
The coding is straight forward:
String[] types = {"XOR", "AND"};
ComboBoxPropertyDescriptor descr = new
ComboBoxPropertyDescriptor("stringvalue", "stringvalue", types);
return...;
When I open the properties tab in my workbench everything is OK. I select an
editpart and the
properties for that part are shown as they should. Now, I click on the
combobox descriptor to
change value from XOR to AND. What happens is that I get an
AssertionFailedException!!??
I have checked the Logic example and the code is almost the same as mine,
but there it works
prefectly well. I have discovered that the method doSetValue(Object value)
is called in the
ComboBoxCellEditor class. In the logic example the value parameter is an
Integer and in my
case it is a String, either "XOR" or "AND". Of course the assertion fails
when the value
parameter is a String. What am I doing wrong??
Thanks
/Stefan
|
|
|
|
|
Re: ComboBoxPropertyDescriptor [message #81151 is a reply to message #81022] |
Tue, 27 May 2003 11:55  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The reason the default uses Integer instead of String is for translation
purposes. Once you translate into Japanese, etc., the String it no longer a
reliable way to set the current choice.
"Andreas Rummler" <andreas.rummler@tu-ilmenau.de> wrote in message
news:bavho3$n8r$1@rogue.oti.com...
> Stefan Junsved schrieb:
>
> > In the logic example the value parameter is an Integer and in my
> > case it is a String, either "XOR" or "AND".
>
> And that's the mistake: you don't have return the String itself, but the
> index of the string!
>
> Regards,
>
> Andreas Rummler
>
>
> --
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++
> + Andreas Rummler +
> + Technical University of Ilmenau, Germany (__) +
> + Department Of Electronic Circuits & Systems (oo) +
> + \/-------\ +
> + MAIL: mailto:arummler@acm.org || | \ +
> + MAIL: mailto:andreas.rummler@tu-ilmenau.de ||----|| * +
> + WEB : http://www.inf-technik.tu-ilmenau.de/~rummler ~~ ~~ +
> + PGP : http://www.inf-technik.tu-ilmenau.de/~rummler/public.pgp +
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++
>
> "Programming today is a race between software engineers striving to
> build bigger and better idiot-proof programs and the universe trying
> to produce bigger and better idiots. So far, the universe is winning."
> Richard Cook
>
|
|
|
Powered by
FUDForum. Page generated in 0.14703 seconds