|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.editor.caret.DefaultCaretModel
public class DefaultCaretModel
The default implementation of CaretModel
.
Constructor Summary | |
---|---|
DefaultCaretModel(CodeEditor editor)
|
Method Summary | |
---|---|
void |
addCaretListener(CaretListener caretlistener)
Adds caret listener to listen to any changes in the caret position. |
protected void |
fireCaretEvent(int type,
CaretPosition oldPosition,
CaretPosition newPosition)
|
CaretListener[] |
getCaretListeners()
Gets the CaretListeners register on DefaultCaretModel. |
CaretPosition |
getModelPosition()
Gets the caret model position. |
int |
getOffset()
Gets the offset. |
CaretPosition |
getViewPosition()
Gets the caret view position. |
void |
moveCaret(int xOffset,
int yOffset,
boolean select,
boolean columnSelection,
boolean scrollVisible)
Moves caret from its current position to another position using the x and y offset. |
void |
removeCaretListener(CaretListener caretlistener)
Removes caret listener that is added before. |
void |
setModelPosition(CaretPosition p)
Sets the caret model position. |
void |
setOffset(int offset)
Sets the offset. |
void |
setViewPosition(CaretPosition vp)
Sets the caret view position. |
void |
updateViewPosition()
Updates the caret view position from caret model position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultCaretModel(CodeEditor editor)
Method Detail |
---|
public CaretPosition getModelPosition()
getModelPosition
in interface CaretModel
public void setModelPosition(CaretPosition p)
setModelPosition
in interface CaretModel
p
- the caret model position.public CaretPosition getViewPosition()
getViewPosition
in interface CaretModel
public void setViewPosition(CaretPosition vp)
setViewPosition
in interface CaretModel
vp
- the caret view position.public void setOffset(int offset)
setOffset
in interface CaretModel
offset
- the offset in the Documentpublic int getOffset()
getOffset
in interface CaretModel
public void addCaretListener(CaretListener caretlistener)
CaretModel
addCaretListener
in interface CaretModel
caretlistener
- a CaretListener to be added.public void removeCaretListener(CaretListener caretlistener)
CaretModel
removeCaretListener
in interface CaretModel
caretlistener
- the CaretListener to be removed.public CaretListener[] getCaretListeners()
getCaretListeners
in interface CaretModel
protected void fireCaretEvent(int type, CaretPosition oldPosition, CaretPosition newPosition)
public void moveCaret(int xOffset, int yOffset, boolean select, boolean columnSelection, boolean scrollVisible)
moveCaret
in interface CaretModel
xOffset
- the x offset from its current caret model position. For example, if you move one char
left, the xOffset will be -1.yOffset
- the y offset from its current caret model position. For example, if you move one line up,
the yOffset will be -1.select
- whether to select from its current caret model position to the new position.columnSelection
- whether the selection is in column selection mode.scrollVisible
- whether scroll to the caret at its new position.public void updateViewPosition()
updateViewPosition
in interface CaretModel
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |