Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsPrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/907997/#msg_907997
Can anyone post an example how to create a property with this construct I cant resolve type.
regards
Florian]]>Florian Wartenberg2012-09-04T14:20:53-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908170/#msg_908170
> Hi I want to create a new property inside a class which has the type
> Integer. I use this construct: modelClass.createOwnedAttribute(String
> arg0, Type arg1, EClass arg2).
> Can anyone post an example how to create a property with this
> construct I cant resolve type.
>
> regards
>
> Florian
Have you looked at the Getting started with UML2 tutorial?
Regards
Ed Willink]]>Ed Willink2012-09-04T21:33:36-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908239/#msg_908239
Florian Wartenberg2012-09-05T01:59:29-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908283/#msg_908283
Since you're earlier reply was
"Works like a charm thank you so much!!! "
I assumed that you now understood how to call UML Java functions. The
getting started tutorial has an example of createOwnedAttribute so I'm
unclear what your problem is.
Try posting your best attempt.
Regards
Ed Willink
On 05/09/2012 02:59, Florian Wartenberg wrote:
> Of course I did apparently it does not say anything about the Integer
> primitive type. As asked before in another topic I have some
> difficulties in finding out how to resolve some expected arguments as
> Type for example.]]>Ed Willink2012-09-05T04:49:03-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908568/#msg_908568
This creates the property but without a Type I do not now how to resolve it properly as stated before.
regards
Florian]]>Florian Wartenberg2012-09-05T15:20:40-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908574/#msg_908574
Does your modelClass.getPackage() have an "int" type?
If not perhaps you want to "Integer" from the UML Types package.
Regards
Ed Willink
On 05/09/2012 16:20, Florian Wartenberg wrote:
> Property duration = modelClass.createOwnedAttribute("duration",
> modelClass.getPackage().getOwnedType("int"),
> UMLPackage.Literals.PROPERTY);
>
> This creates the property but without a Type I do not now how to
> resolve it properly as stated before.
>
> regards
>
> Florian]]>Ed Willink2012-09-05T15:32:34-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908621/#msg_908621
]]>Florian Wartenberg2012-09-05T17:03:53-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908625/#msg_908625
I cannot help you if you do not provide a problem that is reproducible
or comments that are meaningful.
Regards
Ed Willink
On 05/09/2012 18:03, Florian Wartenberg wrote:
> "Integer" does not change anything still no Type :(]]>Ed Willink2012-09-05T17:07:29-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908642/#msg_908642
regards Florian]]>Florian Wartenberg2012-09-05T18:05:40-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908697/#msg_908697
Precisely. You have a UML file. I have nothing I can reproduce. I wish
you luck with your problem.
Regards
Ed Willink
On 05/09/2012 19:05, Florian Wartenberg wrote:
> Ok I have a .uml file which I load then I do some transformations on
> the model. At some point I have to create a new property inside my
> main class. Therefore I use the line written above. My property is
> created but has no type. I want to have a property which has the type
> "<PrimitveType> Integer" which several other properties of the model
> already have. The second argument of the method is "Type" I do not
> know what Java or EMF is expecting me to resolve it to so I get the
> Integer type. If I for example resolve the second argument to my class
> ("modelClass") then the property is created whith a type and the type
> is <Class> ECU which is the name of my class inside the model.
>
> regards Florian]]>Ed Willink2012-09-05T20:42:49-00:00Re: PrimitiveType
https://www.eclipse.org/forums/index.php/mv/msg/372842/908767/#msg_908767
If you have other classes in your model that have properties that
reference Integer as their type, then where did they get it from?
Probably it is the Integer in the UML Primitive Types library. The URI
for the library resource is
You would see it already loaded in the editor if you open your model in
the UML Editor.
Anyways, given that you already have properties of Integer type, you
should be able to find the library resource (URI as above) loaded in
your resource set. The first element in the resource is a package on
which you can use the getOwnedType(…) method that you mentioned
earlier, to get the Integer type.
HTH,
Christian
On 2012-09-05 18:05:40 +0000, Florian Wartenberg said:
> Ok I have a .uml file which I load then I do some transformations on
> the model. At some point I have to create a new property inside my main
> class. Therefore I use the line written above. My property is created
> but has no type. I want to have a property which has the type
> "<PrimitveType> Integer" which several other properties of the model
> already have. The second argument of the method is "Type" I do not know
> what Java or EMF is expecting me to resolve it to so I get the Integer
> type. If I for example resolve the second argument to my class
> ("modelClass") then the property is created whith a type and the type
> is <Class> ECU which is the name of my class inside the model.
>
> regards Florian]]>Christian Damus2012-09-06T01:01:07-00:00