Package com.uppaal.model.core2
Class InsertTextCommand
java.lang.Object
com.uppaal.model.core2.AbstractCommand
com.uppaal.model.core2.InsertTextCommand
- All Implemented Interfaces:
Command
public class InsertTextCommand extends AbstractCommand
Inserts text into a property value at specified position
-
Field Summary
-
Constructor Summary
Constructors Constructor Description InsertTextCommand(Property property, String text, int position)Command to insert a text at the specified position of the property value -
Method Summary
Modifier and Type Method Description voidexecute()intgetBeginIndex()intgetEndIndex()ElementgetModifiedElement()booleanmerge(Command next)attempt to merge another insertion into the same commandvoidundo()
-
Field Details
-
Constructor Details
-
InsertTextCommand
Command to insert a text at the specified position of the property value- Parameters:
property- the property value to be modifiedtext- the text to be insertedposition- the position of the insertion.
-
-
Method Details
-
execute
public void execute() -
merge
attempt to merge another insertion into the same command- Specified by:
mergein interfaceCommand- Overrides:
mergein classAbstractCommand- Parameters:
next- the next command to be stored together- Returns:
- true if merge is successful, otherwise the command needs to be stored separately
-
undo
public void undo() -
getModifiedElement
- Returns:
- the modified element or its closest relative (sibling or parent) if the element is not displayed.
-
getBeginIndex
public int getBeginIndex() -
getEndIndex
public int getEndIndex()
-