public class SwingSetTokensEdit<T> extends SwingTokenEdit<T>
AlignmentModel
.SwingUndoAlignmentModel
beginIndex, sequenceID, tokens
Constructor and Description |
---|
SwingSetTokensEdit(SwingUndoAlignmentModel<T> provider,
String sequenceID,
int beginIndex,
Collection<? extends T> tokens)
Creates a new instance of this class.
|
SwingSetTokensEdit(SwingUndoAlignmentModel<T> provider,
String sequenceID,
int index,
T token)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
Collection<T> |
getOldTokens()
Returns a list of the tokens that are replaced when this edit is executed.
|
protected String |
getOperationName() |
void |
redo() |
void |
undo() |
getBeginIndex, getPresentationName, getSequenceID, getTokens
getProvider, registerDocumentChange
addEdit, canRedo, canUndo, die, getIsSubedit, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, setIsSubedit
public SwingSetTokensEdit(SwingUndoAlignmentModel<T> provider, String sequenceID, int beginIndex, Collection<? extends T> tokens)
provider
- the data provider creating this instancesequenceID
- the identifier the sequence where the token is containedbeginIndex
- the index of the first element to be replaced
(The first element in the sequence has the index 0.)tokens
- the new tokens for the specified positionpublic SwingSetTokensEdit(SwingUndoAlignmentModel<T> provider, String sequenceID, int index, T token)
provider
- the data provider creating this instancesequenceID
- the identifier the sequence where the token is containedindex
- the index of the element to be replaced
(The first element in the sequence has the index 0.)token
- the new token for the specified positionpublic void redo() throws CannotRedoException
redo
in interface UndoableEdit
redo
in class AbstractDocumentEdit
CannotRedoException
public void undo() throws CannotUndoException
undo
in interface UndoableEdit
undo
in class AbstractDocumentEdit
CannotUndoException
public Collection<T> getOldTokens()
protected String getOperationName()
getOperationName
in class SwingTokenEdit<T>