org.gjt.sp.jedit.input
Class AbstractInputHandler

java.lang.Object
  extended by org.gjt.sp.jedit.input.AbstractInputHandler
Direct Known Subclasses:
InputHandler, TextAreaInputHandler

public abstract class AbstractInputHandler
extends java.lang.Object


Field Summary
protected  java.awt.event.KeyListener keyEventInterceptor
          This listener will receive keyboard events if it is not null.
protected  int lastActionCount
           
protected  java.lang.String readNextChar
           
protected static int REPEAT_COUNT_THRESHOLD
           
protected  int repeatCount
           
 
Constructor Summary
AbstractInputHandler()
           
 
Method Summary
 java.awt.event.KeyListener getKeyEventInterceptor()
           
 int getLastActionCount()
          Returns the number of times the last action was executed.
abstract  boolean handleKey(KeyEventTranslator.Key keyStroke, boolean dryRun)
          Handles a keystroke.
 boolean isPrefixActive()
          Returns if a prefix key has been pressed.
abstract  void processKeyEvent(java.awt.event.KeyEvent evt, int from, boolean global)
           
protected  void processKeyEventKeyStrokeHandling(java.awt.event.KeyEvent evt, int from, java.lang.String mode, boolean global)
           
 void resetLastActionCount()
          Resets the last action count.
 void setKeyEventInterceptor(java.awt.event.KeyListener keyEventInterceptor)
          Sets the listener that will handle all key events in this view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastActionCount

protected int lastActionCount

keyEventInterceptor

protected java.awt.event.KeyListener keyEventInterceptor
This listener will receive keyboard events if it is not null.


readNextChar

protected java.lang.String readNextChar

repeatCount

protected int repeatCount

REPEAT_COUNT_THRESHOLD

protected static final int REPEAT_COUNT_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

AbstractInputHandler

public AbstractInputHandler()
Method Detail

getLastActionCount

public int getLastActionCount()
Returns the number of times the last action was executed.

Since:
jEdit 2.5pre5

resetLastActionCount

public void resetLastActionCount()
Resets the last action count. This should be called when an editing operation that is not an action is invoked, for example a mouse click.

Since:
jEdit 4.0pre1

getKeyEventInterceptor

public java.awt.event.KeyListener getKeyEventInterceptor()

setKeyEventInterceptor

public void setKeyEventInterceptor(java.awt.event.KeyListener keyEventInterceptor)
Sets the listener that will handle all key events in this view. For example, the complete word command uses this so that all key events are passed to the word list popup while it is visible.

Parameters:
keyEventInterceptor - the KeyListener that will receive the events

isPrefixActive

public boolean isPrefixActive()
Returns if a prefix key has been pressed.


handleKey

public abstract boolean handleKey(KeyEventTranslator.Key keyStroke,
                                  boolean dryRun)
Handles a keystroke.

Parameters:
keyStroke - The key stroke.
dryRun - only calculate the return value, do not have any other effect
Returns:
true if the input could be handled.
Since:
jEdit 4.3pre7

processKeyEvent

public abstract void processKeyEvent(java.awt.event.KeyEvent evt,
                                     int from,
                                     boolean global)

processKeyEventKeyStrokeHandling

protected void processKeyEventKeyStrokeHandling(java.awt.event.KeyEvent evt,
                                                int from,
                                                java.lang.String mode,
                                                boolean global)