public class MoveObjectFragment extends com.sodius.mdw.internal.metamodel.doors.io.commands.MoveObjectFragmentImpl implements ShareModuleFragment
When instantiating this command, an InsertLocation
is used to determine the location where object must be moved to (e.g. below another
object).
Note that a table cell cannot be moved to another location and can also not be a reference point to move another object.
This fragment is intended to be combined into an EditModuleCommand
instance.
Below is a snippet illustrating how to use this fragment (see CommandRunner
for a full snippet):
ModuleRef module = ModuleRef.qualifiedName("/MyFolder/MyModule"); EditModuleCommand command = new EditModuleCommand(module, TerminationMode.SAVE_AND_CLOSE); ObjectRef objectToMove = ObjectRef.absoluteNumber(4); ObjectRef newParentObject = ObjectRef.absoluteNumber(8); InsertLocation location = InsertLocation.below(newParentObject); MoveObjectFragment fragment = new MoveObjectFragment(objectToMove, location); command.add(fragment); myCommandRunner.run(command);
CommandRunner
,
EditModuleCommand
Constructor and Description |
---|
MoveObjectFragment(ObjectRef childObject,
InsertLocation insertLocation)
Instantiates a fragment to move the specified object to another location within the same module.
|
public MoveObjectFragment(ObjectRef childObject, InsertLocation insertLocation)
childObject
- the object that is to be moved.insertLocation
- the location where the object needs to be moved to.