Interface CompositeCommand
- All Superinterfaces:
Command
A
Command that aggregates multiple commands and executes them as a single unit.
A composite command allows grouping of multiple operations so they can be executed, undone, or canceled together.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a command to the end of this composite.voidAdds a command at the specified position.voidApplies the given action to each contained command.Returns the list of contained commands.voidInserts a command according to implementation-defined ordering.booleanisEmpty()Returns whether this composite contains no commands.voidRemoves a command from this composite.Methods inherited from interface com.dassault_systemes.modeler.foundation.editing.Command
cancel, count, execute, getElementOfThisCommand, getName, setName, setWasExecuted, undo, wasExecuted
-
Method Details
-
add
Adds a command to the end of this composite.- Parameters:
command- command to add
-
add
Adds a command at the specified position.- Parameters:
command- command to addindex- position to insert at
-
remove
Removes a command from this composite.- Parameters:
command- command to remove
-
forEach
Applies the given action to each contained command.- Parameters:
consumer- action to apply
-
isEmpty
boolean isEmpty()Returns whether this composite contains no commands.- Returns:
trueif empty, otherwisefalse
-
insert
Inserts a command according to implementation-defined ordering.- Parameters:
command- command to insert
-
getCommands
Returns the list of contained commands.- Returns:
- list of commands
-