|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.raelity.jvi.swing.CommandLine
public class CommandLine
This class presents a editable combo box UI for picking up command entry
data. A mode, usually a single character like "?" or ":", can be
set for display. This UI supports the maintenance of a history of commands.
This component builds a keymap through which the action events are
delivered. When an event is delivered, the history list is updated.
The command line has a label that can be set with setMode(java.lang.String)
.
Take steps to prevent this component from taking focus throught the focus manager. But ultimately need to subclass the editor component to handle it.
Nested Class Summary | |
---|---|
static class |
CommandLine.CommandLineEntry
The CommandLine JPanel may be embedded in a Dialog or put on a glass pane; CommandLineEntry is some common handling particularly for the ViCmdEntry interface. |
static class |
CommandLine.FilteredKeymap
|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
DEFAULT_HISTORY_SIZE
|
static KeyStroke |
EXECUTE_KEY
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CommandLine()
|
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this textfield. |
void |
append(char c)
This is used to append characters to the the combo box. |
void |
clear()
This is used when the combo box is going to be displayed. |
protected Action |
createSimpleEvent(String name)
|
protected void |
fireActionPerformed(ActionEvent e)
Take the argument event and create an action event copy with this as its source. |
protected Action[] |
getActions()
|
protected JTextComponent.KeyBinding[] |
getBindings()
|
String |
getCommand()
Retrieve the contents of the command line. |
int |
getHistorySize()
the max size of the history list |
List |
getList()
retrieve the history list. |
String |
getMode()
|
void |
init(String s)
This is used to initialize the text of the combo box, needed so that characters entered before the combo box gets focus are not lost. |
void |
removeActionListener(ActionListener l)
Removes the specified action listener so that it no longer receives action events from this textfield. |
void |
setHistorySize(int newHistorySize)
Use this to limit the size of the history list |
void |
setList(List<String> newList)
This installs the history list. |
void |
setMode(String newMode)
This sets the mode of the command line, e.g. |
void |
setupBorder()
|
void |
takeFocus(boolean flag)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_HISTORY_SIZE
public static final KeyStroke EXECUTE_KEY
Constructor Detail |
---|
public CommandLine()
Method Detail |
---|
public void init(String s)
public void append(char c)
public void setupBorder()
public void clear()
public void takeFocus(boolean flag)
public String getCommand()
public void setMode(String newMode)
public String getMode()
public void setList(List<String> newList)
public List getList()
public void setHistorySize(int newHistorySize)
public int getHistorySize()
protected Action createSimpleEvent(String name)
protected JTextComponent.KeyBinding[] getBindings()
protected Action[] getActions()
protected void fireActionPerformed(ActionEvent e)
public void addActionListener(ActionListener l)
l
- the action listenerpublic void removeActionListener(ActionListener l)
l
- the action listener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |