Modifier and Type | Interface and Description |
---|---|
static interface |
SourceCodeEditor.EditListener
Defines an object that listen to edits of text.
|
static interface |
SourceCodeEditor.SelectionListener
Defines an object that listen to changes in the selection.
|
Modifier and Type | Method and Description |
---|---|
void |
closeFile(java.lang.Runnable onClose) |
byte[] |
getBytes()
returns the contents of the editor as UTF8 code bytes.
|
java.io.File |
getFile()
returns the file associated with this editor.
|
int |
getSelectionEnd()
returns the index of the last selected char + 1.
|
int |
getSelectionStart()
returns the index of the first selected char.
|
boolean |
isDirty()
returns true if the contents have changed since the last Save or (since
the editor was opened).
|
boolean |
saveFile()
causes the contents of the editor to be saved to the associated file.
|
void |
setCurrentLine(int currentLine)
sets the currently highlighted line.
|
void |
setEditListener(SourceCodeEditor.EditListener listener)
sets the selection listener, replacing existing if any.
|
void |
setErrorLine(int errorLine)
sets the currently highlighted error line.
|
void |
setSelectionListener(SourceCodeEditor.SelectionListener listener)
sets the selection listener, replacing existing if any.
|
setEnabled, setVisible
boolean saveFile()
byte[] getBytes()
void closeFile(java.lang.Runnable onClose)
void setErrorLine(int errorLine)
errorLine
- the currently highlighted error linevoid setCurrentLine(int currentLine)
currentLine
- the line to highlightboolean isDirty()
java.io.File getFile()
void setEditListener(SourceCodeEditor.EditListener listener)
listener
- the selection listener.void setSelectionListener(SourceCodeEditor.SelectionListener listener)
listener
- the selection listener.int getSelectionStart()
int getSelectionEnd()