Package org.exbin.bined.swing.basic
Class DefaultCodeAreaCommandHandler
- java.lang.Object
-
- org.exbin.bined.swing.basic.DefaultCodeAreaCommandHandler
-
- All Implemented Interfaces:
CodeAreaCommandHandler
@ParametersAreNonnullByDefault public class DefaultCodeAreaCommandHandler extends java.lang.Object implements CodeAreaCommandHandler
Default binary editor command handler.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.exbin.bined.swing.CodeAreaCommandHandler
CodeAreaCommandHandler.CodeAreaCommandHandlerFactory, CodeAreaCommandHandler.ScrollbarOrientation, CodeAreaCommandHandler.SelectingMode
-
-
Field Summary
Fields Modifier and Type Field Description static int
LAST_CONTROL_CODE
-
Constructor Summary
Constructors Constructor Description DefaultCodeAreaCommandHandler(CodeAreaCore codeArea)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
backSpacePressed()
Backspace key was pressed.boolean
canPaste()
Returns true if paste action is possible.void
clearSelection()
Clears data selection.void
copy()
Copies selection to clipboard.void
copyAsCode()
Copies selection to clipboard as code string.static CodeAreaCommandHandler.CodeAreaCommandHandlerFactory
createDefaultCodeAreaCommandHandlerFactory()
void
cut()
Cuts selection to clipboard.void
delete()
Deletes selection.void
deletePressed()
Delete key was pressed.void
enterPressed()
Enter key was pressed.org.exbin.bined.basic.EnterKeyHandlingMode
getEnterKeyHandlingMode()
byte[]
charToBytes(char value)
boolean
checkEditAllowed()
Checks whether edit is allowed.boolean
isValidChar(char value)
void
keyPressed(java.awt.event.KeyEvent keyEvent)
Keyboard key was pressed.void
keyTyped(java.awt.event.KeyEvent keyEvent)
Keyboard key was typed.void
move(CodeAreaCommandHandler.SelectingMode selectingMode, org.exbin.bined.basic.MovementDirection direction)
void
moveCaret(int positionX, int positionY, CodeAreaCommandHandler.SelectingMode selecting)
Moves caret with mouse event.void
paste()
Pastes content of clipboard to cursor area.void
pasteFromCode()
Pastes content of clipboard to cursor area analyzing string code.void
scroll(org.exbin.bined.basic.ScrollingDirection direction)
void
selectAll()
Expands selection to all data.void
setEnterKeyHandlingMode(org.exbin.bined.basic.EnterKeyHandlingMode enterKeyHandlingMode)
void
undoSequenceBreak()
Notifies command handler about end of sequence of append-able commands.void
updateSelection(CodeAreaCommandHandler.SelectingMode selectingMode, org.exbin.bined.CodeAreaCaretPosition caretPosition)
void
wheelScroll(int scrollSize, CodeAreaCommandHandler.ScrollbarOrientation orientation)
Performs scrolling.
-
-
-
Field Detail
-
LAST_CONTROL_CODE
public static final int LAST_CONTROL_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultCodeAreaCommandHandler
public DefaultCodeAreaCommandHandler(CodeAreaCore codeArea)
-
-
Method Detail
-
createDefaultCodeAreaCommandHandlerFactory
@Nonnull public static CodeAreaCommandHandler.CodeAreaCommandHandlerFactory createDefaultCodeAreaCommandHandlerFactory()
-
undoSequenceBreak
public void undoSequenceBreak()
Description copied from interface:CodeAreaCommandHandler
Notifies command handler about end of sequence of append-able commands.- Specified by:
undoSequenceBreak
in interfaceCodeAreaCommandHandler
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent keyEvent)
Description copied from interface:CodeAreaCommandHandler
Keyboard key was pressed.- Specified by:
keyPressed
in interfaceCodeAreaCommandHandler
- Parameters:
keyEvent
- key event
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent keyEvent)
Description copied from interface:CodeAreaCommandHandler
Keyboard key was typed.- Specified by:
keyTyped
in interfaceCodeAreaCommandHandler
- Parameters:
keyEvent
- key event
-
enterPressed
public void enterPressed()
Description copied from interface:CodeAreaCommandHandler
Enter key was pressed.- Specified by:
enterPressed
in interfaceCodeAreaCommandHandler
-
backSpacePressed
public void backSpacePressed()
Description copied from interface:CodeAreaCommandHandler
Backspace key was pressed.- Specified by:
backSpacePressed
in interfaceCodeAreaCommandHandler
-
deletePressed
public void deletePressed()
Description copied from interface:CodeAreaCommandHandler
Delete key was pressed.- Specified by:
deletePressed
in interfaceCodeAreaCommandHandler
-
delete
public void delete()
Description copied from interface:CodeAreaCommandHandler
Deletes selection.- Specified by:
delete
in interfaceCodeAreaCommandHandler
-
copy
public void copy()
Description copied from interface:CodeAreaCommandHandler
Copies selection to clipboard.- Specified by:
copy
in interfaceCodeAreaCommandHandler
-
copyAsCode
public void copyAsCode()
Description copied from interface:CodeAreaCommandHandler
Copies selection to clipboard as code string.- Specified by:
copyAsCode
in interfaceCodeAreaCommandHandler
-
cut
public void cut()
Description copied from interface:CodeAreaCommandHandler
Cuts selection to clipboard.- Specified by:
cut
in interfaceCodeAreaCommandHandler
-
paste
public void paste()
Description copied from interface:CodeAreaCommandHandler
Pastes content of clipboard to cursor area.- Specified by:
paste
in interfaceCodeAreaCommandHandler
-
pasteFromCode
public void pasteFromCode()
Description copied from interface:CodeAreaCommandHandler
Pastes content of clipboard to cursor area analyzing string code.- Specified by:
pasteFromCode
in interfaceCodeAreaCommandHandler
-
canPaste
public boolean canPaste()
Description copied from interface:CodeAreaCommandHandler
Returns true if paste action is possible.- Specified by:
canPaste
in interfaceCodeAreaCommandHandler
- Returns:
- true if paste is possible
-
selectAll
public void selectAll()
Description copied from interface:CodeAreaCommandHandler
Expands selection to all data.- Specified by:
selectAll
in interfaceCodeAreaCommandHandler
-
clearSelection
public void clearSelection()
Description copied from interface:CodeAreaCommandHandler
Clears data selection.- Specified by:
clearSelection
in interfaceCodeAreaCommandHandler
-
getEnterKeyHandlingMode
@Nonnull public org.exbin.bined.basic.EnterKeyHandlingMode getEnterKeyHandlingMode()
-
setEnterKeyHandlingMode
public void setEnterKeyHandlingMode(org.exbin.bined.basic.EnterKeyHandlingMode enterKeyHandlingMode)
-
updateSelection
public void updateSelection(CodeAreaCommandHandler.SelectingMode selectingMode, org.exbin.bined.CodeAreaCaretPosition caretPosition)
-
moveCaret
public void moveCaret(int positionX, int positionY, CodeAreaCommandHandler.SelectingMode selecting)
Description copied from interface:CodeAreaCommandHandler
Moves caret with mouse event.- Specified by:
moveCaret
in interfaceCodeAreaCommandHandler
- Parameters:
positionX
- relative position XpositionY
- relative position Yselecting
- selection selecting
-
move
public void move(CodeAreaCommandHandler.SelectingMode selectingMode, org.exbin.bined.basic.MovementDirection direction)
-
scroll
public void scroll(org.exbin.bined.basic.ScrollingDirection direction)
-
wheelScroll
public void wheelScroll(int scrollSize, CodeAreaCommandHandler.ScrollbarOrientation orientation)
Description copied from interface:CodeAreaCommandHandler
Performs scrolling.- Specified by:
wheelScroll
in interfaceCodeAreaCommandHandler
- Parameters:
scrollSize
- number of scroll units (positive or negative)orientation
- scrollbar orientation
-
isValidChar
public boolean isValidChar(char value)
-
charToBytes
@Nonnull public byte[] charToBytes(char value)
-
checkEditAllowed
public boolean checkEditAllowed()
Description copied from interface:CodeAreaCommandHandler
Checks whether edit is allowed.- Specified by:
checkEditAllowed
in interfaceCodeAreaCommandHandler
- Returns:
- true if allowed
-
-