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.BinaryDataOperation
Abstract class for operation on code area component.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CodeAreaOperation.ExecutionType
-
Field Summary
Fields Modifier and Type Field Description protected org.exbin.bined.DefaultCodeAreaCaretPosition
backPosition
protected org.exbin.bined.swing.CodeAreaCore
codeArea
-
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 void
dispose()
Performs dispose of the operation.void
execute()
Performs operation on given document.protected CodeAreaOperation
execute(CodeAreaOperation.ExecutionType executionType)
Default empty execution method supporting both modes ready for override.CodeAreaOperation
executeWithUndo()
Performs operation on given document and returns undo operation.org.exbin.bined.CodeAreaCaretPosition
getBackPosition()
java.lang.String
getCaption()
Returns caption as text.org.exbin.bined.swing.CodeAreaCore
getCodeArea()
abstract CodeAreaOperationType
getType()
Returns type of the operation.void
setBackPosition(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:
getCaption
in 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.BinaryDataOperationException
Performs operation on given document.- Specified by:
execute
in 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:
executeWithUndo
in 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.BinaryDataOperationException
Performs dispose of the operation. Default dispose is empty.- Specified by:
dispose
in interfaceorg.exbin.bined.operation.BinaryDataOperation
- Throws:
org.exbin.bined.operation.BinaryDataOperationException
- for operation handling issues
-
-