public class SwingSetTokensEdit<T> extends SwingTokenEdit<T>
AlignmentModel
.SwingUndoAlignmentModel
beginIndex, sequenceID, tokens
Constructor and Description |
---|
SwingSetTokensEdit(SwingUndoAlignmentModel<T> model,
java.lang.String sequenceID,
int beginIndex,
java.util.Collection<? extends T> tokens)
Creates a new instance of this class.
|
SwingSetTokensEdit(SwingUndoAlignmentModel<T> provider,
java.lang.String sequenceID,
int index,
T token)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<T> |
getOldTokens()
Returns a list of the tokens that are replaced when this edit is executed.
|
protected java.lang.String |
getOperationName() |
void |
redo() |
void |
undo() |
getBeginIndex, getPresentationName, getSequenceID, getTokens
getModel, registerDocumentChange
addEdit, canRedo, canUndo, die, getIsSubedit, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, setIsSubedit
public SwingSetTokensEdit(SwingUndoAlignmentModel<T> model, java.lang.String sequenceID, int beginIndex, java.util.Collection<? extends T> tokens)
model
- 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, java.lang.String sequenceID, int index, T token)
provider
- the alignment model 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 javax.swing.undo.CannotRedoException
redo
in interface javax.swing.undo.UndoableEdit
redo
in class AbstractDocumentEdit
javax.swing.undo.CannotRedoException
public void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
undo
in class AbstractDocumentEdit
javax.swing.undo.CannotUndoException
public java.util.Collection<T> getOldTokens()
protected java.lang.String getOperationName()
getOperationName
in class SwingTokenEdit<T>