|
Jalopy 1.0b11 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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(java.util.List annotations)
Attaches the given annotations to this view. |
java.util.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. |
java.lang.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. |
java.lang.String |
getText()
Returns the text contained in this editor. |
void |
paste(java.lang.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(java.lang.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).
java.lang.IllegalArgumentException
- if offset < 0 ||
offset > getLength()
public void setCaretPosition(int line, int column)
line
- line number.column
- column offset in the given line.
java.lang.IllegalArgumentException
- if line < 1 || column
< 1
public int getCaretPosition()
>=
0
).public int getColumn()
>= 1
).public ProjectFile getFile()
public int getLength()
>= 0
).public int getLine()
>= 1
).public java.lang.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).
java.lang.IllegalArgumentException
- if startOffset < 0 ||
endOffset < 0
public 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(java.lang.String text)
null
or empty, has the effect of simply deleting the old text.
text
- the new text to be set.public java.lang.String getText()
public void attachAnnotations(java.util.List annotations)
annotations
- list of annotations (of type <Annotation>
) to attach.Annotation
public java.util.List detachAnnotations()
<Annotation>
). Returns an
empty list, if no annotations were attached.attachAnnotations(java.util.List)
public void paste(java.lang.String text)
text
- the string to replace the selection with.public void requestFocus()
public void selectAll()
|
Jalopy 1.0b11 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |