public abstract class TextInputControlBehavior<T extends TextInputControl> extends BehaviorBase<T>
Modifier and Type | Field and Description |
---|---|
private java.text.Bidi |
bidi |
private boolean |
editing |
private KeyEvent |
lastEvent
Used to keep track of the most recent key event.
|
private java.lang.Boolean |
mixed |
private java.lang.Boolean |
rtlText |
protected static java.util.List<KeyBinding> |
TEXT_INPUT_BINDINGS
Setup KeyBindings *
|
(package private) T |
textInputControl
Fields *
|
private InvalidationListener |
textListener |
IS_TOUCH_SUPPORTED, TRAVERSAL_BINDINGS, TRAVERSE_DOWN, TRAVERSE_LEFT, TRAVERSE_NEXT, TRAVERSE_PREVIOUS, TRAVERSE_RIGHT, TRAVERSE_UP
Constructor and Description |
---|
TextInputControlBehavior(T textInputControl,
java.util.List<KeyBinding> bindings)
Create a new TextInputControlBehavior.
|
Modifier and Type | Method and Description |
---|---|
void |
callAction(java.lang.String name)
Called to invoke the action associated with the given name.
|
protected void |
callActionForEvent(KeyEvent e)
Records the last KeyEvent we saw.
|
protected void |
cancelEdit(KeyEvent event) |
private void |
cut() |
private void |
defaultKeyTyped(KeyEvent event)
The default handler for a key typed event, which is called when none of
the other key bindings match.
|
protected abstract void |
deleteChar(boolean previous)
Abstract methods *
|
protected abstract void |
deleteFromLineStart() |
private void |
deleteNextChar() |
protected void |
deleteNextWord() |
private void |
deletePreviousChar() |
protected void |
deletePreviousWord() |
private void |
deleteSelection() |
void |
dispose()
Disposal methods *
|
protected void |
fire(KeyEvent event) |
protected void |
forwardToParent(KeyEvent event) |
private java.text.Bidi |
getBidi() |
private void |
invalidateBidi() |
boolean |
isEditing() |
protected boolean |
isMixed() |
protected boolean |
isRTLText() |
private void |
leftWord() |
private void |
nextCharacterVisually(boolean moveRight) |
protected void |
nextWord() |
private void |
paste() |
protected void |
previousWord() |
protected abstract void |
replaceText(int start,
int end,
java.lang.String txt) |
private void |
rightWord() |
protected void |
scrollCharacterToVisible(int index) |
private void |
selectEnd() |
private void |
selectEndExtend() |
private void |
selectHome() |
private void |
selectHomeExtend() |
private void |
selectLeft() |
private void |
selectLeftWord() |
protected void |
selectNextWord() |
protected void |
selectPreviousWord() |
private void |
selectRight() |
private void |
selectRightWord() |
protected void |
selectWord() |
protected abstract void |
setCaretAnimating(boolean play) |
protected void |
setEditing(boolean b) |
contextMenuRequested, focusChanged, getControl, matchActionForEvent, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased, traverse, traverseDown, traverseLeft, traverseNext, traversePrevious, traverseRight, traverseUp
protected static final java.util.List<KeyBinding> TEXT_INPUT_BINDINGS
T extends TextInputControl textInputControl
private KeyEvent lastEvent
private InvalidationListener textListener
private java.text.Bidi bidi
private java.lang.Boolean mixed
private java.lang.Boolean rtlText
private boolean editing
public TextInputControlBehavior(T textInputControl, java.util.List<KeyBinding> bindings)
textInputControl
- cannot be nullpublic void dispose()
dispose
in class BehaviorBase<T extends TextInputControl>
protected abstract void deleteChar(boolean previous)
protected abstract void replaceText(int start, int end, java.lang.String txt)
protected abstract void setCaretAnimating(boolean play)
protected abstract void deleteFromLineStart()
protected void scrollCharacterToVisible(int index)
protected void callActionForEvent(KeyEvent e)
callActionForEvent
in class BehaviorBase<T extends TextInputControl>
e
- public void callAction(java.lang.String name)
BehaviorBase
When a KeyEvent is handled, it is first passed through callActionForEvent which resolves which "action" should be executed based on the key event. This action is indicated by name. This name is then passed to this function which is responsible for invoking the right function based on the name.
callAction
in class BehaviorBase<T extends TextInputControl>
private void defaultKeyTyped(KeyEvent event)
event
- not nullprivate void invalidateBidi()
private java.text.Bidi getBidi()
protected boolean isMixed()
protected boolean isRTLText()
private void nextCharacterVisually(boolean moveRight)
private void selectLeft()
private void selectRight()
private void deletePreviousChar()
private void deleteNextChar()
protected void deletePreviousWord()
protected void deleteNextWord()
private void deleteSelection()
private void cut()
private void paste()
protected void selectPreviousWord()
protected void selectNextWord()
private void selectLeftWord()
private void selectRightWord()
protected void selectWord()
protected void previousWord()
protected void nextWord()
private void leftWord()
private void rightWord()
protected void fire(KeyEvent event)
protected void cancelEdit(KeyEvent event)
protected void forwardToParent(KeyEvent event)
private void selectHome()
private void selectEnd()
private void selectHomeExtend()
private void selectEndExtend()
protected void setEditing(boolean b)
public boolean isEditing()