how to deal with EDataTypehttps://www.eclipse.org/forums/index.php/mv/msg/373919/909662/#msg_909662
Hello everybody,

i am new to graphiti and actually i try to implement my first editor for the ecore meta model.I want to implement direct editing feature for EAttribute but i am facing some problems.I hope that someone could help me.
I use shape with text to represent EAttributes. You can see here the format that i use to store the informations as text :
attributeName : attributeType [= initialValue]

My questions are the following.
1 -how can i check if attributeType is a well EDataType?
(as represented above attributeType is a String)

2- Assuming that attributeType is an EDataType (e.g EString)
how can create the corresponding dataType from this string?

3- How can i check that initialValue is a value from the data type represented by
attributeType ?

Thanks,
Junior]]>Junior Lekane Nimpa2012-09-07T14:22:07-00:00Re: how to deal with EDataTypehttps://www.eclipse.org/forums/index.php/mv/msg/373919/909932/#msg_909932
On 07/09/2012 4:22 PM, Junior Lekane Nimpa wrote:
> Hello everybody,
>
> i am new to graphiti and actually i try to implement my first editor
> for the ecore meta model.I want to implement direct editing feature
> for EAttribute but i am facing some problems.I hope that someone could
> help me.
> I use shape with text to represent EAttributes. You can see here the
> format that i use to store the informations as text :
> attributeName : attributeType [= initialValue]
>
> My questions are the following.
> 1 -how can i check if attributeType is a well EDataType?
> (as represented above attributeType is a String)
Using instanceof EDataType?
>
> 2- Assuming that attributeType is an EDataType (e.g EString) how can
> create the corresponding dataType from this string?
EcoreUtil.createFromString/convertToString.
>
> 3- How can i check that initialValue is a value from the data type
> represented by attributeType ?
Assuming you're specifying a literal, calling
EcoreUtil.createFromString; note that if these are new data types you're
developing, you can't generally use them as if the logic for converting
instances to and from strings has already been hand written and
available for use.
>
> Thanks,
> Junior]]>Ed Merks2012-09-08T05:08:57-00:00