Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Label text for EDatatType values
Label text for EDatatType values [message #53829] Fri, 22 September 2006 08:48 Go to next message
Eclipse UserFriend
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 10:28 Go to previous message
Eclipse UserFriend
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: Sun Mar 09 23:51:40 EDT 2025

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

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

Back to the top