|
Re: EMF code to add copied package into another package. [message #1408463 is a reply to message #1408459] |
Fri, 15 August 2014 05:26 |
Ed Merks Messages: 33139 Registered: July 2009 |
Senior Member |
|
|
Rajendra,
Given this is a question specifically about UML2's API, its better to
ask on the UML2 forum.
On 15/08/2014 7:11 AM, Rajendra Kashi wrote:
> Hi,
>
> I am trying to copy UML package and paste the same package under the
> parent of the copied package. i am trying to promote the service so
> the next promoted package should not miss the previous version detail.
> I have gathered detail up to copy the package. but I am struggling to
> paste that package under the parent package. Please help.
>
> My code:
>
> private List<EObject> selectedElements;
> private EObject selectedElement;
>
> selectedElements = UMLModeler.getUMLUIHelper().getSelectedElements();
> selectedElement = selectedElements.get(0);
>
> Package selectedElementCopy = (Package)EcoreUtil.copy(selectedElement);
> Package selectedElementParent = (Package)selectedElement.getOwner();
>
> selectedElementCopy.setName("New Package Name");
>
> // How to add the selectedElementCopy to selectedElementParent is
> troubling me.
> ....
>
>
> If anyone has done before, please pass me java code.
>
> Thanking you,
> Raj
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03222 seconds