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
           
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)
           
 
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

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)

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)