Package org.qdl_lang.gui.editor
Class EditorKeyPressedAdapter
- java.lang.Object
-
- java.awt.event.KeyAdapter
-
- org.qdl_lang.gui.editor.EditorKeyPressedAdapter
-
- All Implemented Interfaces:
KeyListener
,EventListener
- Direct Known Subclasses:
QDLEditor.ControlOperations
,SwingTerminal.QDLHistoryKeyAdapter
public class EditorKeyPressedAdapter extends KeyAdapter
Created by Jeff Gaynor
on 3/20/23 at 3:56 PM
-
-
Constructor Summary
Constructors Constructor Description EditorKeyPressedAdapter(WorkspaceCommands workspaceCommands, JFrame frame, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea input, JTextArea output)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createHelpMessage(String functionHelp, String text, String example)
protected void
doQuit(boolean forceQuit)
protected void
doSave()
protected String
getGUIHelp()
protected String
getHelp(String text)
int
getLineNumber(int position)
Returns the line number (starting at 0) of the current cursor position.void
keyPressed(KeyEvent e)
NOTEprotected void
showHelp(String title, String message)
Show's help for the selected area.protected String
toggleSelectionComment(String selection)
-
Methods inherited from class java.awt.event.KeyAdapter
keyReleased, keyTyped
-
-
-
-
Field Detail
-
input
protected org.fife.ui.rsyntaxtextarea.RSyntaxTextArea input
-
output
protected JTextArea output
-
-
Constructor Detail
-
EditorKeyPressedAdapter
public EditorKeyPressedAdapter(WorkspaceCommands workspaceCommands, JFrame frame, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea input, JTextArea output)
-
-
Method Detail
-
getLineNumber
public int getLineNumber(int position)
Returns the line number (starting at 0) of the current cursor position.- Returns:
-
getGUIHelp
protected String getGUIHelp()
-
createHelpMessage
protected String createHelpMessage(String functionHelp, String text, String example)
-
keyPressed
public void keyPressed(KeyEvent e)
NOTE
This is not just a text area, it is anRSyntaxTextArea
which masks off various keystroked for itself. A symptom of this is if you attempt to use one of the (not well documented) reserved keystrokes, you will get mysterious enter key events as it tries to reformat (or whatever) the input area. So far the list of reserved keys are- a -- select all
- c -- copy select to clipboard
- d -- delete current line
- j --(justify?)
- k -- beeps?
- v -- paste from clipbaord
- x -- cut selected to clipboard
- Specified by:
keyPressed
in interfaceKeyListener
- Overrides:
keyPressed
in classKeyAdapter
- Parameters:
e
-
-
doQuit
protected void doQuit(boolean forceQuit)
-
doSave
protected void doSave()
-
-