C - public interface Editor<C> extends Closeable
| Modifier and Type | Field and Description |
|---|---|
static String |
CARRIEGE_RETURN |
static String |
NEW_LINE |
| Modifier and Type | Method and Description |
|---|---|
String |
backspace()
Deletes the previous character if exists.
|
String |
delete()
Deletes the current character, shifting remaining characters one position left.
|
void |
end()
Moves cursor to the end of the line.
|
void |
findNext(String str)
Finds the next appearance of the String.
|
void |
findPrevious(String str)
Finds the next appearance of the String.
|
int |
getColumn()
Returns the current column.
|
C |
getContent()
Returns the content of the file.
|
C |
getContent(int line)
Returns the content of the file.
|
File |
getFile()
Returns the
File being edited. |
int |
getLine()
Returns the number of the current line.
|
void |
home()
Moves the cursors to the start of the line.
|
Boolean |
isDirty()
Returns if editor contains 'dirty' data.
|
int |
lines()
Returns the number of lines.
|
void |
mergeLine()
Removes the new line character at the end of the line.
|
void |
move(int line,
int column)
Moves the cursor to the specified line and column.
|
void |
newLine()
Adds a new line to the current position.
|
void |
open(File source)
Opens a file for editing.
|
void |
put(String str)
Puts the
link to the current position. |
void |
save(File target)
Saves the file.
|
void |
setDirty(Boolean dirty)
Marks that the editor has unsaved changes.
|
static final String NEW_LINE
static final String CARRIEGE_RETURN
void open(File source) throws IOException
source - IOExceptionvoid save(File target) throws IOException
target - IOExceptionint getLine()
int getColumn()
void move(int line,
int column)
line - column - void home()
void end()
void put(String str)
link to the current position.str - String delete()
String backspace()
void newLine()
void mergeLine()
void findNext(String str)
str - int lines()
void findPrevious(String str)
str - void setDirty(Boolean dirty)
dirty - Boolean isDirty()
C getContent()
C getContent(int line)
Copyright © 2013. All Rights Reserved.