Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » how to deal with EDataType
how to deal with EDataType [message #909662] Fri, 07 September 2012 14:22 Go to next message
Junior Lekane Nimpa is currently offline Junior Lekane NimpaFriend
Messages: 23
Registered: September 2012
Junior Member
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
Re: how to deal with EDataType [message #909932 is a reply to message #909662] Sat, 08 September 2012 05:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Comments below.

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 Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Greate Job! and I have some questions
Next Topic:ChopBoxAnchor vs. BoxRelativeAnchor
Goto Forum:
  


Current Time: Thu Mar 28 22:31:24 GMT 2024

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

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

Back to the top