Package org.exbin.bined.operation.swing
Class CodeAreaOperation
- java.lang.Object
-
- org.exbin.bined.operation.swing.CodeAreaOperation
-
- All Implemented Interfaces:
org.exbin.bined.operation.BinaryDataOperation
- Direct Known Subclasses:
CodeEditDataOperation,CharEditDataOperation,InsertDataOperation,ModifyDataOperation,RemoveDataOperation
@ParametersAreNonnullByDefault public abstract class CodeAreaOperation extends java.lang.Object implements org.exbin.bined.operation.BinaryDataOperationAbstract class for operation on code area component.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCodeAreaOperation.ExecutionType
-
Field Summary
Fields Modifier and Type Field Description protected org.exbin.bined.DefaultCodeAreaCaretPositionbackPositionprotected org.exbin.bined.swing.CodeAreaCorecodeArea
-
Constructor Summary
Constructors Constructor Description CodeAreaOperation(org.exbin.bined.swing.CodeAreaCore codeArea)CodeAreaOperation(org.exbin.bined.swing.CodeAreaCore codeArea, org.exbin.bined.CodeAreaCaretPosition backPosition)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddispose()Performs dispose of the operation.voidexecute()Performs operation on given document.protected CodeAreaOperationexecute(CodeAreaOperation.ExecutionType executionType)Default empty execution method supporting both modes ready for override.CodeAreaOperationexecuteWithUndo()Performs operation on given document and returns undo operation.org.exbin.bined.CodeAreaCaretPositiongetBackPosition()java.lang.StringgetCaption()Returns caption as text.org.exbin.bined.swing.CodeAreaCoregetCodeArea()abstract CodeAreaOperationTypegetType()Returns type of the operation.voidsetBackPosition(org.exbin.bined.CodeAreaCaretPosition backPosition)
-
-
-
Method Detail
-
getType
@Nonnull public abstract CodeAreaOperationType getType()
Returns type of the operation.- Returns:
- operation type
-
getCodeArea
@Nonnull public org.exbin.bined.swing.CodeAreaCore getCodeArea()
-
getCaption
@Nonnull public java.lang.String getCaption()
Returns caption as text.- Specified by:
getCaptionin interfaceorg.exbin.bined.operation.BinaryDataOperation- Returns:
- text caption
-
getBackPosition
@Nonnull public org.exbin.bined.CodeAreaCaretPosition getBackPosition()
-
setBackPosition
public void setBackPosition(org.exbin.bined.CodeAreaCaretPosition backPosition)
-
execute
public void execute() throws org.exbin.bined.operation.BinaryDataOperationExceptionPerforms operation on given document.- Specified by:
executein interfaceorg.exbin.bined.operation.BinaryDataOperation- Throws:
org.exbin.bined.operation.BinaryDataOperationException- for operation handling issues
-
executeWithUndo
@Nullable public CodeAreaOperation executeWithUndo() throws org.exbin.bined.operation.BinaryDataOperationException
Performs operation on given document and returns undo operation.- Specified by:
executeWithUndoin interfaceorg.exbin.bined.operation.BinaryDataOperation- Returns:
- undo operation or null if not available
- Throws:
org.exbin.bined.operation.BinaryDataOperationException- for operation handling issues
-
execute
@Nullable protected CodeAreaOperation execute(CodeAreaOperation.ExecutionType executionType)
Default empty execution method supporting both modes ready for override.- Parameters:
executionType- if undo should be included- Returns:
- undo operation or null if not available
-
dispose
public void dispose() throws org.exbin.bined.operation.BinaryDataOperationExceptionPerforms dispose of the operation. Default dispose is empty.- Specified by:
disposein interfaceorg.exbin.bined.operation.BinaryDataOperation- Throws:
org.exbin.bined.operation.BinaryDataOperationException- for operation handling issues
-
-