CARRIEGE_RETURN, NEW_LINE| Constructor and Description |
|---|
StringEditor() |
StringEditor(String content) |
| Modifier and Type | Method and Description |
|---|---|
String |
backspace()
Deletes the previous character if exists.
|
void |
close() |
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.
|
String |
getContent()
Returns the content of the file.
|
String |
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 index 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.
|
public StringEditor()
public StringEditor(String content)
public int getLine()
Editorpublic int getColumn()
Editorpublic void move(int line,
int column)
move in interface Editor<String>line - column - IndexOutOfBoundsException - When the requested line exceeds the number of lines in the content.public void home()
public void end()
public void put(String str)
Editorlink to the current position.public String delete()
Editorpublic String backspace()
Editorpublic void newLine()
Editorpublic void mergeLine()
Editorpublic void findNext(String str)
public int lines()
public void findPrevious(String str)
findPrevious in interface Editor<String>str - public void open(File source) throws IOException
Editoropen in interface Editor<String>IOExceptionpublic void save(File target) throws IOException
Editorsave in interface Editor<String>IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String getContent()
EditorgetContent in interface Editor<String>public String getContent(int line)
EditorgetContent in interface Editor<String>public Boolean isDirty()
EditorCopyright © 2013. All Rights Reserved.