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 intLAST_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 voidbackSpacePressed()Backspace key was pressed.booleancanPaste()Returns true if paste action is possible.voidclearSelection()Clears data selection.voidcopy()Copies selection to clipboard.voidcopyAsCode()Copies selection to clipboard as code string.static CodeAreaCommandHandler.CodeAreaCommandHandlerFactorycreateDefaultCodeAreaCommandHandlerFactory()voidcut()Cuts selection to clipboard.voiddelete()Deletes selection.voiddeletePressed()Delete key was pressed.voidenterPressed()Enter key was pressed.org.exbin.bined.basic.EnterKeyHandlingModegetEnterKeyHandlingMode()byte[]charToBytes(char value)booleancheckEditAllowed()Checks whether edit is allowed.booleanisValidChar(char value)voidkeyPressed(java.awt.event.KeyEvent keyEvent)Keyboard key was pressed.voidkeyTyped(java.awt.event.KeyEvent keyEvent)Keyboard key was typed.voidmove(CodeAreaCommandHandler.SelectingMode selectingMode, org.exbin.bined.basic.MovementDirection direction)voidmoveCaret(int positionX, int positionY, CodeAreaCommandHandler.SelectingMode selecting)Moves caret with mouse event.voidpaste()Pastes content of clipboard to cursor area.voidpasteFromCode()Pastes content of clipboard to cursor area analyzing string code.voidscroll(org.exbin.bined.basic.ScrollingDirection direction)voidselectAll()Expands selection to all data.voidsetEnterKeyHandlingMode(org.exbin.bined.basic.EnterKeyHandlingMode enterKeyHandlingMode)voidundoSequenceBreak()Notifies command handler about end of sequence of append-able commands.voidupdateSelection(CodeAreaCommandHandler.SelectingMode selectingMode, org.exbin.bined.CodeAreaCaretPosition caretPosition)voidwheelScroll(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:CodeAreaCommandHandlerNotifies command handler about end of sequence of append-able commands.- Specified by:
undoSequenceBreakin interfaceCodeAreaCommandHandler
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent keyEvent)
Description copied from interface:CodeAreaCommandHandlerKeyboard key was pressed.- Specified by:
keyPressedin interfaceCodeAreaCommandHandler- Parameters:
keyEvent- key event
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent keyEvent)
Description copied from interface:CodeAreaCommandHandlerKeyboard key was typed.- Specified by:
keyTypedin interfaceCodeAreaCommandHandler- Parameters:
keyEvent- key event
-
enterPressed
public void enterPressed()
Description copied from interface:CodeAreaCommandHandlerEnter key was pressed.- Specified by:
enterPressedin interfaceCodeAreaCommandHandler
-
backSpacePressed
public void backSpacePressed()
Description copied from interface:CodeAreaCommandHandlerBackspace key was pressed.- Specified by:
backSpacePressedin interfaceCodeAreaCommandHandler
-
deletePressed
public void deletePressed()
Description copied from interface:CodeAreaCommandHandlerDelete key was pressed.- Specified by:
deletePressedin interfaceCodeAreaCommandHandler
-
delete
public void delete()
Description copied from interface:CodeAreaCommandHandlerDeletes selection.- Specified by:
deletein interfaceCodeAreaCommandHandler
-
copy
public void copy()
Description copied from interface:CodeAreaCommandHandlerCopies selection to clipboard.- Specified by:
copyin interfaceCodeAreaCommandHandler
-
copyAsCode
public void copyAsCode()
Description copied from interface:CodeAreaCommandHandlerCopies selection to clipboard as code string.- Specified by:
copyAsCodein interfaceCodeAreaCommandHandler
-
cut
public void cut()
Description copied from interface:CodeAreaCommandHandlerCuts selection to clipboard.- Specified by:
cutin interfaceCodeAreaCommandHandler
-
paste
public void paste()
Description copied from interface:CodeAreaCommandHandlerPastes content of clipboard to cursor area.- Specified by:
pastein interfaceCodeAreaCommandHandler
-
pasteFromCode
public void pasteFromCode()
Description copied from interface:CodeAreaCommandHandlerPastes content of clipboard to cursor area analyzing string code.- Specified by:
pasteFromCodein interfaceCodeAreaCommandHandler
-
canPaste
public boolean canPaste()
Description copied from interface:CodeAreaCommandHandlerReturns true if paste action is possible.- Specified by:
canPastein interfaceCodeAreaCommandHandler- Returns:
- true if paste is possible
-
selectAll
public void selectAll()
Description copied from interface:CodeAreaCommandHandlerExpands selection to all data.- Specified by:
selectAllin interfaceCodeAreaCommandHandler
-
clearSelection
public void clearSelection()
Description copied from interface:CodeAreaCommandHandlerClears data selection.- Specified by:
clearSelectionin 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:CodeAreaCommandHandlerMoves caret with mouse event.- Specified by:
moveCaretin 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:CodeAreaCommandHandlerPerforms scrolling.- Specified by:
wheelScrollin 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:CodeAreaCommandHandlerChecks whether edit is allowed.- Specified by:
checkEditAllowedin interfaceCodeAreaCommandHandler- Returns:
- true if allowed
-
-