public static final class DeletedTextInterceptor.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 removal offset.
|
String |
getText()
Gets the text being removed.
|
boolean |
isBackwardDelete()
Determines the type of the character removal action performed by a user.
|
public JTextComponent getComponent()
Document
.public Document getDocument()
public int getOffset()
KeyEvent
happened). This is also the offset with text, which will be removed.public boolean isBackwardDelete()
In other words one delete action removes characters backwards moving the caret towards the beginning if a document and the other action leaves the caret at the same position and removes characters towards the end of the document.
true
if the interceptor is called to handle the
backspace action. false
if the handled action is the
delete action.public String getText()
beforeRemove
method this
text is still present in the document, while in the other methods this
text has already been removed from the document. Nevertheless this method
always returns a copy of the text.