processing.app
Class EditorListener
java.lang.Object
processing.app.EditorListener
public class EditorListener
- extends java.lang.Object
Filters key events for tab expansion/indent/etc.
For version 0099, some changes have been made to make the indents
smarter. There are still issues though:
+ indent happens when it picks up a curly brace on the previous line,
but not if there's a blank line between them.
+ It also doesn't handle single indent situations where a brace
isn't used (i.e. an if statement or for loop that's a single line).
It shouldn't actually be using braces.
Solving these issues, however, would probably best be done by a
smarter parser/formatter, rather than continuing to hack this class.
|
Method Summary |
void |
applyPreferences()
|
boolean |
keyPressed(java.awt.event.KeyEvent event)
Intercepts key pressed events for JEditTextArea. |
boolean |
keyTyped(java.awt.event.KeyEvent event)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EditorListener
public EditorListener(Editor editor,
JEditTextArea textarea)
applyPreferences
public void applyPreferences()
keyPressed
public boolean keyPressed(java.awt.event.KeyEvent event)
- Intercepts key pressed events for JEditTextArea.
Called by JEditTextArea inside processKeyEvent(). Note that this
won't intercept actual characters, because those are fired on
keyTyped().
- Returns:
- true if the event has been handled (to remove it from the queue)
keyTyped
public boolean keyTyped(java.awt.event.KeyEvent event)