|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.DocumentFilter
adams.gui.tools.RConsoleFilter
public class RConsoleFilter
Filters input to a console to only allow edits after the prompt.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.text.DocumentFilter |
|---|
DocumentFilter.FilterBypass |
| Field Summary | |
|---|---|
protected RConsolePanel |
m_Console
|
protected int |
m_DocLength
Total length of the document. |
protected int |
m_PromptPosition
Current position of the prompt. |
| Constructor Summary | |
|---|---|
RConsoleFilter(RConsolePanel console)
Initializes the filter with a console. |
|
| Method Summary | |
|---|---|
void |
insertString(DocumentFilter.FilterBypass fb,
int off,
String str,
AttributeSet attr)
Called when a string is about to be inserted into the Document. |
void |
remove(DocumentFilter.FilterBypass fb,
int off,
int len)
Called when a string is to be removed from the Document. |
void |
replace(DocumentFilter.FilterBypass fb,
int off,
int len,
String str,
AttributeSet attr)
Called when a string to be replaced within the Document. |
void |
setPromptPosition(int pos)
Sets the position of the prompt. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int m_PromptPosition
protected int m_DocLength
protected RConsolePanel m_Console
| Constructor Detail |
|---|
public RConsoleFilter(RConsolePanel console)
console - the console whose input this is filtering| Method Detail |
|---|
public void setPromptPosition(int pos)
pos - position in the sequence of characters
public void insertString(DocumentFilter.FilterBypass fb,
int off,
String str,
AttributeSet attr)
throws BadLocationException
insertString in class DocumentFilterfb - can use this to bypass the filteroff - where the string is to be insertedstr - the string to be insertedattr - attributes to associate with the inserted
content, may be null
BadLocationException - when the offset is not a
valid part of the document
public void remove(DocumentFilter.FilterBypass fb,
int off,
int len)
throws BadLocationException
remove in class DocumentFilterfb - can use this to bypass the filteroff - where the string is to be removed fromlen - how many characters are to be removed
BadLocationException - when some of the range is
not a valid part of the document
public void replace(DocumentFilter.FilterBypass fb,
int off,
int len,
String str,
AttributeSet attr)
throws BadLocationException
replace in class DocumentFilterfb - can be used to bypass the filteroff - where string is to be insertedlen - how many characters are to be replacedstr - the string that is being insertedattr - attributes to be associated with the
inserted content, may be null
BadLocationException - when some of the range is
not a valid part of the Document
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||