public final class CaretMoveContext extends Object
CaretMoveHandler
.Modifier and Type | Method and Description |
---|---|
JTextComponent |
getComponent()
Return component in which the caret is currently installed.
|
Document |
getDocument()
Get document associated with the text component.
|
List<CaretInfo> |
getOriginalCarets()
Get list of carets at the time when transaction started.
|
CaretInfo |
getOriginalLastCaret()
Get last item from the list returned by
getOriginalCarets() . |
List<CaretInfo> |
getOriginalSortedCarets()
Get list of carets at the time when transaction started
sorted by dot positions in ascending order.
|
boolean |
moveDot(CaretInfo caret,
Position dotPos,
Position.Bias dotBias)
Move dot of the given caret so caret selection gets created or changed.
|
boolean |
setDot(CaretInfo caret,
Position dotPos,
Position.Bias dotBias)
Change dot of the given caret.
|
boolean |
setDotAndMark(CaretInfo caret,
Position dotPos,
Position.Bias dotBias,
Position markPos,
Position.Bias markBias)
Move dot of the given caret so caret selection gets created or changed.
|
boolean |
setMagicCaretPosition(CaretInfo caret,
Point p)
Set magic caret position of the given caret.
|
@NonNull public List<CaretInfo> getOriginalCarets()
@NonNull public CaretInfo getOriginalLastCaret()
getOriginalCarets()
.getOriginalCarets()
@NonNull public List<CaretInfo> getOriginalSortedCarets()
ComplexPositions
their order will reflect the increasing split offset.
public boolean setDot(@NonNull CaretInfo caret, @NonNull Position dotPos, @NonNull Position.Bias dotBias)
caret
- non-null caret.dotPos
- new dot position.EditorCaret
)
or true otherwise.public boolean moveDot(@NonNull CaretInfo caret, @NonNull Position dotPos, @NonNull Position.Bias dotBias)
caret
- non-null caret.dotPos
- new dot position.EditorCaret
)
or true otherwise.public boolean setDotAndMark(@NonNull CaretInfo caret, @NonNull Position dotPos, @NonNull Position.Bias dotBias, @NonNull Position markPos, @NonNull Position.Bias markBias)
caret
- non-null caret.dotPos
- new dot position.markPos
- starting position of the selection or the same position like dotPos if there should be no selection.
EditorCaret
)
or true otherwise.public boolean setMagicCaretPosition(@NonNull CaretInfo caret, Point p)
caret
- non-null caret.p
- new magic caret position.EditorCaret
)
or true otherwise.@NonNull public JTextComponent getComponent()
public Document getDocument()
getComponent()