Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Label text for EDatatType values
Label text for EDatatType values [message #53829] Fri, 22 September 2006 12:48 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
I've a diagram with lots of labels, and many of the labels are objects
that are defined in the model as EDataTypes. In the corresponding
factory implementation I have defined convertXXXToString and
createXXXFromString for handling string conversion, and this is
automatically used by the property sheet, when presenting and editing
values. The label editors do not use these, however. Instead they use
MessageFormat and toString, for EDataType values.

To fix this, I redefined the getValidValue (and getValidNewValue), so
that it converts the value using the appropriate factory method
(i.e. in getValidValue insert value =
type.getEPackage().getEFactoryInstance().convertToString((ED ataType)type,
value); and in getValidNewValue insert
value =
type.getEPackage().getEFactoryInstance().createFromString((E DataType)type,
(String)value);)
giving the same behavior as the property sheet. I can understand that
this is not always the desired behavior, but I suggest that this is a
reasonable default behavior that should be standard for GMF.

Have I missed something? Comments?

Hallvard
Re: Label text for EDatatType values [message #53961 is a reply to message #53829] Fri, 22 September 2006 14:28 Go to previous message
Artem Tikhomirov is currently offline Artem TikhomirovFriend
Messages: 222
Registered: July 2009
Senior Member
Guess, it's an overlook and would be great if you file a bugzilla.

Thanks

Artem

"Hallvard Tr?tteberg" <hal@idi.ntnu.no> wrote in message
news:bcm7h2lqdedu6k0g4rrajdvpq9oie7btug@4ax.com...
> I've a diagram with lots of labels, and many of the labels are objects
> that are defined in the model as EDataTypes. In the corresponding
> factory implementation I have defined convertXXXToString and
> createXXXFromString for handling string conversion, and this is
> automatically used by the property sheet, when presenting and editing
> values. The label editors do not use these, however. Instead they use
> MessageFormat and toString, for EDataType values.
>
> To fix this, I redefined the getValidValue (and getValidNewValue), so
> that it converts the value using the appropriate factory method
> (i.e. in getValidValue insert value =
> type.getEPackage().getEFactoryInstance().convertToString((ED ataType)type,
> value); and in getValidNewValue insert
> value =
> type.getEPackage().getEFactoryInstance().createFromString((E DataType)type,
> (String)value);)
> giving the same behavior as the property sheet. I can understand that
> this is not always the desired behavior, but I suggest that this is a
> reasonable default behavior that should be standard for GMF.
>
> Have I missed something? Comments?
>
> Hallvard
>
Previous Topic:Can't get XSD to work
Next Topic:Keeping synchronized the Layout Constraints in case of ConstrainedToolbarLayout
Goto Forum:
  


Current Time: Sat Jul 06 10:30:38 GMT 2024

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

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

Back to the top