@OpenApiAll
public static class Refactoring.Moving
extends java.lang.Object
// Decide what elements needs to be moved and put them in a collection CollectionelementsToMove = ...; // Define new owner to move elements (and relations) into Element newOwner = ...; // Element moving should be wrapped with session create/close calls. SessionManager sessionManager = SessionManager.getInstance(); sessionManager.createSession("Move elements"); // Move elements Refactoring.Moving.moveElementsWithRelations(elementsToMove, newOwner); // Close the session. sessionManager.closeSession();
Constructor and Description |
---|
Moving() |
Modifier and Type | Method and Description |
---|---|
static void |
moveElements(java.util.Collection<Element> elementsToMove,
Element newOwner)
Moves all elements to the new owner.
|
static void |
moveElementsWithRelations(java.util.Collection<Element> elementsToMove,
Element newOwner)
Moves all elements to the new owner.
|
public static void moveElements(java.util.Collection<Element> elementsToMove, Element newOwner) throws ReadOnlyElementException
elementsToMove
- elements to movenewOwner
- new owner to move elements intoReadOnlyElementException
- if newOwner cannot add children or any of moved elements is not editablejava.lang.IllegalArgumentException
- if any of moved elements cannot be added into new ownerpublic static void moveElementsWithRelations(java.util.Collection<Element> elementsToMove, Element newOwner) throws ReadOnlyElementException
elementsToMove
- elements to movenewOwner
- new owner to move elements intoReadOnlyElementException
- if newOwner cannot add children or any of moved elements is not editablejava.lang.IllegalArgumentException
- if any of moved elements cannot be added into new owner