public class CodeAreaUndoHandler
extends java.lang.Object
implements org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
Constructor and Description |
---|
CodeAreaUndoHandler(org.exbin.deltahex.swing.CodeArea codeArea)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(org.exbin.deltahex.operation.BinaryDataCommand command) |
void |
addUndoUpdateListener(org.exbin.deltahex.operation.undo.BinaryDataUndoUpdateListener listener) |
boolean |
canRedo() |
boolean |
canUndo() |
void |
clear() |
void |
doSync()
Performs revert to sync point.
|
void |
execute(org.exbin.deltahex.operation.BinaryDataCommand command)
Adds new step into revert list.
|
java.util.List<org.exbin.deltahex.operation.BinaryDataCommand> |
getCommandList() |
long |
getCommandPosition() |
long |
getMaximumUndo() |
long |
getSyncPoint() |
long |
getUndoMaximumSize() |
long |
getUsedSize() |
void |
performRedo()
Performs single redo step.
|
void |
performRedo(int count)
Performs multiple redo step.
|
void |
performUndo()
Performs single undo step.
|
void |
performUndo(int count)
Performs multiple undo step.
|
void |
removeUndoUpdateListener(org.exbin.deltahex.operation.undo.BinaryDataUndoUpdateListener listener) |
void |
setCommandPosition(long targetPosition)
Performs undo or redo operation to reach given position.
|
void |
setSyncPoint() |
void |
setSyncPoint(long syncPoint) |
void |
setUndoMaxCount(long maxUndo) |
void |
setUndoMaximumSize(long maxSize) |
public CodeAreaUndoHandler(org.exbin.deltahex.swing.CodeArea codeArea)
codeArea
- hexadecimal componentpublic void execute(org.exbin.deltahex.operation.BinaryDataCommand command) throws org.exbin.deltahex.operation.BinaryDataOperationException
execute
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
command
- commandorg.exbin.deltahex.operation.BinaryDataOperationException
- if commands throws itpublic void addCommand(org.exbin.deltahex.operation.BinaryDataCommand command)
addCommand
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void performUndo() throws org.exbin.deltahex.operation.BinaryDataOperationException
performUndo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
org.exbin.deltahex.operation.BinaryDataOperationException
- if commands throws itpublic void performRedo() throws org.exbin.deltahex.operation.BinaryDataOperationException
performRedo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
org.exbin.deltahex.operation.BinaryDataOperationException
- if commands throws itpublic void performUndo(int count) throws org.exbin.deltahex.operation.BinaryDataOperationException
performUndo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
count
- count of stepsorg.exbin.deltahex.operation.BinaryDataOperationException
- if commands throws itpublic void performRedo(int count) throws org.exbin.deltahex.operation.BinaryDataOperationException
performRedo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
count
- count of stepsorg.exbin.deltahex.operation.BinaryDataOperationException
- if commands throws itpublic void clear()
clear
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public boolean canUndo()
canUndo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public boolean canRedo()
canRedo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public long getMaximumUndo()
getMaximumUndo
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public long getCommandPosition()
getCommandPosition
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void doSync() throws org.exbin.deltahex.operation.BinaryDataOperationException
doSync
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
org.exbin.deltahex.operation.BinaryDataOperationException
- for operation handling issuespublic void setUndoMaxCount(long maxUndo)
public long getUndoMaximumSize()
getUndoMaximumSize
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void setUndoMaximumSize(long maxSize)
public long getUsedSize()
getUsedSize
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public long getSyncPoint()
getSyncPoint
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void setSyncPoint(long syncPoint)
setSyncPoint
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void setSyncPoint()
setSyncPoint
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public java.util.List<org.exbin.deltahex.operation.BinaryDataCommand> getCommandList()
getCommandList
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void setCommandPosition(long targetPosition) throws org.exbin.deltahex.operation.BinaryDataOperationException
setCommandPosition
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
targetPosition
- desired positionorg.exbin.deltahex.operation.BinaryDataOperationException
- for operation handling issuespublic void addUndoUpdateListener(org.exbin.deltahex.operation.undo.BinaryDataUndoUpdateListener listener)
addUndoUpdateListener
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler
public void removeUndoUpdateListener(org.exbin.deltahex.operation.undo.BinaryDataUndoUpdateListener listener)
removeUndoUpdateListener
in interface org.exbin.deltahex.operation.undo.BinaryDataUndoHandler