How to add an InstanceSpecification to a Package [message #757279] |
Thu, 17 November 2011 08:02  |
Eclipse User |
|
|
|
Hi,
I feel a bit silly to ask this probably simple UML2 API question but browsing the JavaDoc and asking my collegues did not help, so here it goes:
How can I add an org.eclipse.uml2.uml.InstanceSpecificationto an org.eclipse.uml2.uml.Package? The following code snippet creates a package and an instance specification, but how do I add the instance specification to the package?
Package package = model.createNestedPackage("MyInstancePackage");
InstanceSpecification is = UMLFactory.eINSTANCE.createInstanceSpecification();
// package.someMethod(is) <--- ???
Thanks a lot!
/Andreas
|
|
|
|
Re: How to add an InstanceSpecification to a Package [message #758017 is a reply to message #757279] |
Thu, 17 November 2011 08:35  |
Eclipse User |
|
|
|
Hi Andreas,
simply use
package.getPackagedElements().add(instance);
Greetings
Peter
Am Do 17.11.11 14:02, schrieb Andreas Jakobik:
> Hi,
>
> I feel a bit silly to ask this probably simple UML2 API question but
> browsing the JavaDoc and asking my collegues did not help, so here it goes:
>
> How can I add an org.eclipse.uml2.uml.InstanceSpecificationto an
> org.eclipse.uml2.uml.Package? The following code snippet creates a
> package and an instance specification, but how do I add the instance
> specification to the package?
>
> Package package = model.createNestedPackage("MyInstancePackage");
> InstanceSpecification is =
> UMLFactory.eINSTANCE.createInstanceSpecification();
> // package.someMethod(is) <--- ???
> Thanks a lot!
>
> /Andreas
|
|
|
Powered by
FUDForum. Page generated in 0.07151 seconds