|
Oxygen XML Editor 11.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WSTextBasedEditorPage
Provides access to methods related to the editor actions and information for
the Text and Author pages.
*********************************
EXPERIMENTAL - Subject to change
*********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
Method Summary | |
---|---|
void |
deleteSelection()
Delete the selected text, if any. |
int |
getCaretOffset()
The current caret offset. |
Point |
getLocationOnScreenAsPoint(int x,
int y)
Take relative mouse coordinates and translate then to absolute on-screen coordinates. |
String |
getSelectedText()
Get the selected text. |
int |
getSelectionEnd()
Get selection end offset. |
int |
getSelectionStart()
Get selection start offset. |
int[] |
getWordAtCaret()
Compute the offsets of the word that contains the caret position. |
boolean |
hasSelection()
Check if the editor page has a selection |
Rectangle |
modelToViewRectangle(int offset)
Returns a representation of the caret shape for the specified document offset. |
void |
select(int startOffset,
int endOffset)
Select the interval between start and end offset. |
void |
selectWord()
Select the word at caret, if any. |
void |
setCaretPosition(int offset)
Move the caret to the specified offset. |
int |
viewToModelOffset(int x,
int y)
Get the position in the document corresponding to the point in the editing component. |
Method Detail |
---|
int getSelectionStart()
int getSelectionEnd()
String getSelectedText()
int getCaretOffset()
void deleteSelection()
boolean hasSelection()
true
if there is a selection, false
otherwise.void selectWord()
void setCaretPosition(int offset)
offset
- The offset where the caret should be positioned, 0 based.void select(int startOffset, int endOffset)
startOffset
- Inclusive start offsetendOffset
- Exclusive end offsetint[] getWordAtCaret()
null
if the values couldn't be obtained.
The start offset is inclusive and greater or equal than 1.
The end offset is also inclusive and less or equal than the content length.Point getLocationOnScreenAsPoint(int x, int y)
x
- The "x" coordinate relative to the viewport origin.y
- The "y" coordinate relative to the viewport origin.
null
Point.Rectangle modelToViewRectangle(int offset)
offset
- The document offset to get the corresponding caret shape for.
null
Rectangle.int viewToModelOffset(int x, int y)
x
- The "x" coordinate relative to the editing component origin.y
- The "y" coordinate relative to the editing component origin.
null
,
instead an undefined view to model info object is returned if a valid one could not be determined.
|
Oxygen XML Editor 11.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |