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.BinaryDataUndoHandlerUndo 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 voidaddCommand(org.exbin.bined.operation.BinaryDataCommand command)voidaddUndoUpdateListener(org.exbin.bined.operation.undo.BinaryDataUndoUpdateListener listener)booleancanRedo()booleancanUndo()voidclear()voiddoSync()Performs revert to sync point.voidexecute(org.exbin.bined.operation.BinaryDataCommand command)Adds new step into revert list.java.util.List<org.exbin.bined.operation.BinaryDataCommand>getCommandList()longgetCommandPosition()longgetMaximumUndo()longgetSyncPoint()longgetUndoMaximumSize()longgetUsedSize()voidperformRedo()Performs single redo step.voidperformRedo(int count)Performs multiple redo step.voidperformUndo()Performs single undo step.voidperformUndo(int count)Performs multiple undo step.voidremoveUndoUpdateListener(org.exbin.bined.operation.undo.BinaryDataUndoUpdateListener listener)voidsetCommandPosition(long targetPosition)Performs undo or redo operation to reach given position.voidsetSyncPoint()voidsetSyncPoint(long syncPoint)voidsetUndoMaxCount(long maxUndo)voidsetUndoMaximumSize(long maxSize)
-
-
-
Method Detail
-
execute
public void execute(org.exbin.bined.operation.BinaryDataCommand command) throws org.exbin.bined.operation.BinaryDataOperationExceptionAdds new step into revert list.- Specified by:
executein 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:
addCommandin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
performUndo
public void performUndo() throws org.exbin.bined.operation.BinaryDataOperationExceptionPerforms single undo step.- Specified by:
performUndoin 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.BinaryDataOperationExceptionPerforms single redo step.- Specified by:
performRedoin 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.BinaryDataOperationExceptionPerforms multiple undo step.- Specified by:
performUndoin 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.BinaryDataOperationExceptionPerforms multiple redo step.- Specified by:
performRedoin 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:
clearin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
canUndo
public boolean canUndo()
- Specified by:
canUndoin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
canRedo
public boolean canRedo()
- Specified by:
canRedoin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getMaximumUndo
public long getMaximumUndo()
- Specified by:
getMaximumUndoin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getCommandPosition
public long getCommandPosition()
- Specified by:
getCommandPositionin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
doSync
public void doSync() throws org.exbin.bined.operation.BinaryDataOperationExceptionPerforms revert to sync point.- Specified by:
doSyncin 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:
getUndoMaximumSizein interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setUndoMaximumSize
public void setUndoMaximumSize(long maxSize)
-
getUsedSize
public long getUsedSize()
- Specified by:
getUsedSizein interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getSyncPoint
public long getSyncPoint()
- Specified by:
getSyncPointin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setSyncPoint
public void setSyncPoint(long syncPoint)
- Specified by:
setSyncPointin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setSyncPoint
public void setSyncPoint()
- Specified by:
setSyncPointin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
getCommandList
@Nonnull public java.util.List<org.exbin.bined.operation.BinaryDataCommand> getCommandList()
- Specified by:
getCommandListin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
setCommandPosition
public void setCommandPosition(long targetPosition) throws org.exbin.bined.operation.BinaryDataOperationExceptionPerforms undo or redo operation to reach given position.- Specified by:
setCommandPositionin 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:
addUndoUpdateListenerin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
removeUndoUpdateListener
public void removeUndoUpdateListener(org.exbin.bined.operation.undo.BinaryDataUndoUpdateListener listener)
- Specified by:
removeUndoUpdateListenerin interfaceorg.exbin.bined.operation.undo.BinaryDataUndoHandler
-
-