|
Jalopy 1.0b10 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Represents an editor view used to display and interactively modify the contents of a Java source file.
| Method Summary | |
void |
attachAnnotations(List annotations)
Attaches the given annotations to this view. |
List |
detachAnnotations()
Detaches all existing annotations of this view. |
int |
getCaretPosition()
Returns the current location of the caret. |
int |
getColumn()
Returns the column offset in the current line. |
ProjectFile |
getFile()
Returns the file of the editor. |
int |
getLength()
Returns the number of characters in the editor document. |
int |
getLine()
Returns the current line number. |
String |
getSelectedText()
Returns the selected text contained in this editor. |
int |
getSelectionEnd()
Returns the selected text's end position. |
int |
getSelectionStart()
Returns the selected text's start position. |
String |
getText()
Returns the text contained in this editor. |
void |
paste(String text)
Replaces the currently selected content with new content represented by the given string. |
void |
requestFocus()
Tries to set the focus on the receiving component. |
void |
selectAll()
Selects the whole text of the editor. |
void |
setCaretPosition(int offset)
Moves the caret to the given location. |
void |
setCaretPosition(int line,
int column)
Moves the caret to the given location. |
void |
setSelection(int startOffset,
int endOffset)
Selects the specified text. |
void |
setText(String text)
Sets the text of this editor to the specified text. |
| Method Detail |
public void setCaretPosition(int offset)
offset - the text offset where the caret should be placed (absolute character
position).IllegalArgumentException - if offset < 0 ||
offset > getLength()
public void setCaretPosition(int line,
int column)
line - line number.column - column offset in the given line.IllegalArgumentException - if line < 1 || column
< 1public int getCaretPosition()
>=
0).public int getColumn()
>= 1).public ProjectFile getFile()
public int getLength()
>= 0).public int getLine()
>= 1).public String getSelectedText()
null.
public void setSelection(int startOffset,
int endOffset)
startOffset - the offset you wish to start selection on (absolute character
position).endOffset - the offset you wish to end selection on (absolute character
position).IllegalArgumentException - if startOffset < 0 ||
endOffset < 0public int getSelectionEnd()
>=0). Returns
0 if the document is empty, or the position of the caret if
there is no selection.public int getSelectionStart()
>=0). Returns 0 for an
empty document, or the position of the caret if there is no selection.public void setText(String text)
null or empty, has the effect of simply deleting the old text.text - the new text to be set.public String getText()
public void attachAnnotations(List annotations)
annotations - list of annotations (of type <Annotation>) to attach.Annotationpublic List detachAnnotations()
<Annotation>). Returns an
empty list, if no annotations were attached.attachAnnotations(java.util.List)public void paste(String text)
text - the string to replace the selection with.public void requestFocus()
public void selectAll()
|
Jalopy 1.0b10 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||