public static class TypedTextInterceptor.Context extends Object
Modifier and Type | Method and Description |
---|---|
JTextComponent |
getComponent()
Gets the editor component where the currently processed key typed event
occurred.
|
Document |
getDocument()
Gets the edited document.
|
int |
getOffset()
Gets the insertion offset.
|
String |
getText()
Gets the insertion text.
|
public JTextComponent getComponent()
Document
.public Document getDocument()
public int getOffset()
KeyEvent
happened). This is also the offset where the insertion text will end up.public String getText()
It is guaranteed that the text will have length equal to 1 for contexts
that are passed to beforeInsert
and insert
methods. In these methods getText
returns exactly what
a user typed in the editor.
In the afterInsert
method the text returned from getText
method can have any length and will correspond to either the originally typed
text or to text supplied by one of the interceptors participating in
the key typed event processing.