Skip to main content



      Home
Home » Eclipse Projects » GEF » ComboBoxPropertyDescriptor
ComboBoxPropertyDescriptor [message #80977] Tue, 27 May 2003 04:05 Go to next message
Eclipse UserFriend
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 #81022 is a reply to message #80977] Tue, 27 May 2003 07:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.rummler.tu-ilmenau.de

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
Re: ComboBoxPropertyDescriptor [message #81078 is a reply to message #80977] Tue, 27 May 2003 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Which code were you looking at in the logic example? Try looking at the
LogicDiagram code. It has a ComboBoxPropertyDescriptor for its connection
router, which uses Integers.

Eric


Stefan Junsved wrote:

> 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 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:Deleting
Next Topic:[Draw2D] Setting Label size
Goto Forum:
  


Current Time: Tue Jul 22 08:35:17 EDT 2025

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

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

Back to the top