|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CaretModel
Provides services for moving the caret and retrieving information about caret position.
Editor.getCaretModel()| Method Summary | |
|---|---|
void |
addCaretListener(CaretListener listener)
Adds a listener for receiving notifications about caret movement. |
LogicalPosition |
getLogicalPosition()
Returns the logical position of the caret. |
int |
getOffset()
Returns the offset of the caret in the document. |
VisualPosition |
getVisualPosition()
Returns the visual position of the caret. |
void |
moveCaretRelatively(int columnShift,
int lineShift,
boolean withSelection,
boolean blockSelection,
boolean scrollToCaret)
Moves the caret by the specified number of lines and/or columns. |
void |
moveToLogicalPosition(LogicalPosition pos)
Moves the caret to the specified logical position. |
void |
moveToOffset(int offset)
Moves the caret to the specified offset in the document. |
void |
moveToVisualPosition(VisualPosition pos)
Moves the caret to the specified visual position. |
void |
removeCaretListener(CaretListener listener)
Removes a listener for receiving notifications about caret movement. |
| Method Detail |
|---|
void moveCaretRelatively(int columnShift,
int lineShift,
boolean withSelection,
boolean blockSelection,
boolean scrollToCaret)
columnShift - the number of columns to move the caret by.lineShift - the number of lines to move the caret by.withSelection - if true, the caret move should extend the range or block selection in the document.blockSelection - if true and withSelection is true, the caret move should extend
the block selection in the document.scrollToCaret - if true, the document should be scrolled so that the caret is visible after the move.void moveToLogicalPosition(LogicalPosition pos)
pos - the position to move to.void moveToVisualPosition(VisualPosition pos)
pos - the position to move to.void moveToOffset(int offset)
offset - the offset to move to.LogicalPosition getLogicalPosition()
VisualPosition getVisualPosition()
int getOffset()
void addCaretListener(CaretListener listener)
listener - the listener instance.void removeCaretListener(CaretListener listener)
listener - the listener instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||