com.borland.primetime.editor
Class ModalKeymap.ModeStateInfo

java.lang.Object
  |
  +--com.borland.primetime.editor.ModalKeymap.ModeStateInfo
Enclosing class:
ModalKeymap

public static class ModalKeymap.ModeStateInfo
extends java.lang.Object

This class is used to maintain any information about the editor state that may be specific to a particular keymap. Classes deriving from ModalKeymap which do special processing may subclass ModeStateInfo to store any additional information they need.


Field Summary
static int CHAR_SELECTION
          Keymap is in non inclusive character selecting state (when started the current char was not included).
static int COLUMN_SELECTION
          Keymap is in column selecting state.
static int DEFAULT
          Keymap is in no particular state.
protected  EditorPane editor
          The editor this state belongs to.
 boolean hasModalSelection
          This member remembers if the keymap has modal selection states, like Brief and Visual Studio, in which case special modal actions in the EditorActions will be called.
static int INC_CHAR_SELECTION
          Keymap is in inclusive character selecting state (when started the current char was selected).
static int LINE_SELECTION
          Keymap is in line selecting state.
 int mode
          This member records the mode that this editor instance is in.
 boolean processedKeyPressed
          This member records whether or not the previous KeyPressed event was processed.
 
Constructor Summary
ModalKeymap.ModeStateInfo(EditorPane editor)
          Construct a new ModeStateInfo object with default settings.
 
Method Summary
 int getMode()
          Get the mode of the editor.
 void setMode(int mode)
          Set the mode of the editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final int DEFAULT
Keymap is in no particular state.

LINE_SELECTION

public static final int LINE_SELECTION
Keymap is in line selecting state.

COLUMN_SELECTION

public static final int COLUMN_SELECTION
Keymap is in column selecting state.

CHAR_SELECTION

public static final int CHAR_SELECTION
Keymap is in non inclusive character selecting state (when started the current char was not included).

INC_CHAR_SELECTION

public static final int INC_CHAR_SELECTION
Keymap is in inclusive character selecting state (when started the current char was selected).

editor

protected EditorPane editor
The editor this state belongs to.

mode

public int mode
This member records the mode that this editor instance is in.

processedKeyPressed

public boolean processedKeyPressed
This member records whether or not the previous KeyPressed event was processed. We need it because hitting a key once actually results in up to three separate KeyEvents, but we don't want to do anything on KeyTyped if we did something on the previous KeyPressed.

hasModalSelection

public boolean hasModalSelection
This member remembers if the keymap has modal selection states, like Brief and Visual Studio, in which case special modal actions in the EditorActions will be called.
Constructor Detail

ModalKeymap.ModeStateInfo

public ModalKeymap.ModeStateInfo(EditorPane editor)
Construct a new ModeStateInfo object with default settings.
Method Detail

getMode

public int getMode()
Get the mode of the editor.
Returns:
the current mode.

setMode

public void setMode(int mode)
Set the mode of the editor.
Parameters:
mode - the new editor mode.