com.raelity.jvi
Interface ViCmdEntry

All Known Implementing Classes:
CommandLine.CommandLineEntry, InlineCmdEntry, WindowCmdEntry

public interface ViCmdEntry

This is used by vi to get command line input. An LRU history of commands should be maintained, though this history is transparent. When multiple objects are constructed, each has its own history. When active, a focus listener may be set up on the parent to keep grabing focus until the entry is stopped.

The command entry widget is responsible for adding user keystrokes to the recorded input by calling com.raelity.tools.vi.GetChar#userInput(String). The user input should not include any initialText. If the user changes the initialText during entry, and recording is going on, results are undefined.


Field Summary
static int COLON_ENTRY
           
static int SEARCH_ENTRY
           
 
Method Summary
 void activate(String mode, ViTextView parent)
          Start command entry.
 void activate(String mode, ViTextView parent, String initialText, boolean passThru)
          Start command entry.
 void addActionListener(ActionListener l)
          When command entry is complete, this listener is invoked.
 void append(char c)
          This method is used to append characters to the command line.
 void cancel()
          Stop command entry.
 String getCommand()
          This is used to retrieve the command that was entered.
 JTextComponent getTextComponent()
          Retrieve the component used for the data entry.
 void removeActionListener(ActionListener l)
           
 

Field Detail

SEARCH_ENTRY

static final int SEARCH_ENTRY
See Also:
Constant Field Values

COLON_ENTRY

static final int COLON_ENTRY
See Also:
Constant Field Values
Method Detail

activate

void activate(String mode,
              ViTextView parent)
Start command entry. The mode can be used to label the entry field.


activate

void activate(String mode,
              ViTextView parent,
              String initialText,
              boolean passThru)
Start command entry. The mode can be used to label the entry field.

Parameters:
parent - component associated with the entry
initialText - text widget starts out with this text
passThru - when true, fire action with initialText as the command

getCommand

String getCommand()
This is used to retrieve the command that was entered.


cancel

void cancel()
Stop command entry.


append

void append(char c)
This method is used to append characters to the command line. It is used to prevent lost characters that may occur between the character that initiates command entry and the time the entry field is ready to take characters.


getTextComponent

JTextComponent getTextComponent()
Retrieve the component used for the data entry.


addActionListener

void addActionListener(ActionListener l)
                       throws TooManyListenersException
When command entry is complete, this listener is invoked. The event is the key event that stopped entry, either a <CR> or an <ESC>. Only a single listener is needed.

Throws:
TooManyListenersException

removeActionListener

void removeActionListener(ActionListener l)