Package org.exbin.bined.operation.swing
Class CodeAreaUndoHandler
- java.lang.Object
-
- org.exbin.bined.operation.swing.CodeAreaUndoHandler
-
- All Implemented Interfaces:
org.exbin.bined.operation.undo.BinaryDataUndoHandler
@ParametersAreNonnullByDefault public class CodeAreaUndoHandler extends java.lang.Object implements org.exbin.bined.operation.undo.BinaryDataUndoHandler
Undo handler for binary editor.
-
-
Constructor Summary
Constructors Constructor Description CodeAreaUndoHandler(org.exbin.bined.swing.CodeAreaCore codeArea)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommand(org.exbin.bined.operation.BinaryDataCommand command)
void
addUndoUpdateListener(org.exbin.bined.operation.undo.BinaryDataUndoUpdateListener listener)
boolean
canRedo()
boolean
canUndo()
void
clear()
void
doSync()
Performs revert to sync point.void
execute(org.exbin.bined.operation.BinaryDataCommand command)
Adds new step into revert list.java.util.List<org.exbin.bined.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.bined.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)
-
-
-
Method Detail
-
execute
public void execute(org.exbin.bined.operation.BinaryDataCommand command) throws org.exbin.bined.operation.BinaryDataOperationException
Adds new step into revert list.- Specified by:
execute
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Parameters:
command
- command- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- if commands throws it
-
addCommand
public void addCommand(org.exbin.bined.operation.BinaryDataCommand command)
- Specified by:
addCommand
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
performUndo
public void performUndo() throws org.exbin.bined.operation.BinaryDataOperationException
Performs single undo step.- Specified by:
performUndo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- if commands throws it
-
performRedo
public void performRedo() throws org.exbin.bined.operation.BinaryDataOperationException
Performs single redo step.- Specified by:
performRedo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- if commands throws it
-
performUndo
public void performUndo(int count) throws org.exbin.bined.operation.BinaryDataOperationException
Performs multiple undo step.- Specified by:
performUndo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Parameters:
count
- count of steps- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- if commands throws it
-
performRedo
public void performRedo(int count) throws org.exbin.bined.operation.BinaryDataOperationException
Performs multiple redo step.- Specified by:
performRedo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Parameters:
count
- count of steps- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- if commands throws it
-
clear
public void clear()
- Specified by:
clear
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
canUndo
public boolean canUndo()
- Specified by:
canUndo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
canRedo
public boolean canRedo()
- Specified by:
canRedo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getMaximumUndo
public long getMaximumUndo()
- Specified by:
getMaximumUndo
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getCommandPosition
public long getCommandPosition()
- Specified by:
getCommandPosition
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
doSync
public void doSync() throws org.exbin.bined.operation.BinaryDataOperationException
Performs revert to sync point.- Specified by:
doSync
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- for operation handling issues
-
setUndoMaxCount
public void setUndoMaxCount(long maxUndo)
-
getUndoMaximumSize
public long getUndoMaximumSize()
- Specified by:
getUndoMaximumSize
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setUndoMaximumSize
public void setUndoMaximumSize(long maxSize)
-
getUsedSize
public long getUsedSize()
- Specified by:
getUsedSize
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getSyncPoint
public long getSyncPoint()
- Specified by:
getSyncPoint
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setSyncPoint
public void setSyncPoint(long syncPoint)
- Specified by:
setSyncPoint
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setSyncPoint
public void setSyncPoint()
- Specified by:
setSyncPoint
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getCommandList
@Nonnull public java.util.List<org.exbin.bined.operation.BinaryDataCommand> getCommandList()
- Specified by:
getCommandList
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setCommandPosition
public void setCommandPosition(long targetPosition) throws org.exbin.bined.operation.BinaryDataOperationException
Performs undo or redo operation to reach given position.- Specified by:
setCommandPosition
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
- Parameters:
targetPosition
- desired position- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- for operation handling issues
-
addUndoUpdateListener
public void addUndoUpdateListener(org.exbin.bined.operation.undo.BinaryDataUndoUpdateListener listener)
- Specified by:
addUndoUpdateListener
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
removeUndoUpdateListener
public void removeUndoUpdateListener(org.exbin.bined.operation.undo.BinaryDataUndoUpdateListener listener)
- Specified by:
removeUndoUpdateListener
in interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
-