|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.editor.textEditor.CaretManager
public class CaretManager
Each TextEditor can have its own CaretManager. CaretManager holds an instance of Caret and shows it on Canvas, that is stated in constructor. Using CaretManager can be divided into two parts
Constructor Summary | |
---|---|
CaretManager(Canvas canvas,
XMLAccess xmlAccess)
Constructor |
|
CaretManager(Canvas canvas,
XMLAccess xmlAccess,
ITextPieceKeeper keeper,
int offset)
Constructor |
Method Summary | |
---|---|
void |
activateCaret(ITextPieceKeeper keeper,
int offset)
Activates Caret and shows it in keeper before character at
offset offset . |
protected boolean |
checkCaret()
Checks if Caret is ready to use |
void |
deactivateCaret()
Deactivates and hides Caret |
static int |
directionToKeyCode(String s)
Converts direction string to key code |
ITextPieceKeeper |
getActiveTextPieceKeeper()
|
int |
getCaretOffset()
|
sk.baka.ikslibs.ptr.DomPointer |
getDOMPointer()
|
org.eclipse.draw2d.geometry.Point |
getLocation()
see Caret.getLocation() |
protected void |
hideCaret()
|
void |
moveCaret(String direction)
Moves Caret from the current position to one positions further in LEFT,RIGHT,UP,DOWN or to the end or start of the current line. |
protected void |
showCaret()
|
protected void |
showCaretBefore(int index,
ITextPieceKeeper keeper)
Shows caret before character at index index in ITextPieceKeeper keeper |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CaretManager(Canvas canvas, XMLAccess xmlAccess)
canvas
- Canvas on that the Caret will be paintedxmlAccess
- The source document accessorpublic CaretManager(Canvas canvas, XMLAccess xmlAccess, ITextPieceKeeper keeper, int offset)
canvas
- Canvas on that the Caret will be paintedxmlAccess
- The source document accessorkeeper
- ITextPieceKeeper in that the Caret will be activatedoffset
- Index of character in ITextPieceKeeper before that Caret will be activatedMethod Detail |
---|
public static int directionToKeyCode(String s)
s
- One of RequestConstants.LEFT[RIGHT,UP,DOWN,HOME,END]
public ITextPieceKeeper getActiveTextPieceKeeper()
null
public org.eclipse.draw2d.geometry.Point getLocation()
Caret.getLocation()
null
if it is not activepublic sk.baka.ikslibs.ptr.DomPointer getDOMPointer()
null
public int getCaretOffset()
public void activateCaret(ITextPieceKeeper keeper, int offset)
keeper
before character at
offset offset
.
Use this when, clicking in the text or when the model is changed and Caret have to be activated
in this new model
keeper
- ITextPieceKeeper in that Caret will be shownoffset
- Offset of character before that the Caret will be shown. If offset is less then 0
or more then last valid index, then IllegalArgumentException will be thrownpublic void deactivateCaret()
public void moveCaret(String direction)
direction
- One of RequestConstants.LEFT[RIGHT,UP,DOWN,HOME,END]
protected boolean checkCaret()
true
if caret is not null
and is not disposedprotected void showCaret()
protected void hideCaret()
protected void showCaretBefore(int index, ITextPieceKeeper keeper)
index
in ITextPieceKeeper keeper
index
- Offset of charecter in ITextPieceKeeper before that the Caret will be shownkeeper
- ITextPieceKeeper where to show Caret
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |