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 |
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.
|
ContentManager |
getContentManager()
Sets the
ContentManager. |
int |
getLine()
Returns the number of the current line.
|
String |
getSource()
Returns the
File being edited. |
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 |
moveToEndOfFile()
Moves cursor to the end of the line.
|
void |
moveToEndOfLine()
Moves cursor to the end of the line.
|
void |
moveToStartOfFile()
Moves the cursors to the start of the line.
|
void |
moveToStartOfLine()
Moves the cursors to the start of the line.
|
void |
newLine()
Adds a new line to the current position.
|
void |
open(String source)
Opens a file for editing.
|
void |
put(String str)
Puts the
link to the current position. |
void |
save(String target)
Saves the file.
|
void |
setContentManager(ContentManager contentManager)
Returns the
ContentManager. |
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 moveToStartOfLine()
moveToStartOfLine in interface Editor<String>public void moveToEndOfLine()
moveToEndOfLine in interface Editor<String>public void moveToStartOfFile()
moveToStartOfFile in interface Editor<String>public void moveToEndOfFile()
moveToEndOfFile in interface Editor<String>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(String source) throws IOException
Editoropen in interface Editor<String>IOExceptionpublic void save(String 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()
Editorpublic void setDirty(Boolean dirty)
Editorpublic ContentManager getContentManager()
EditorContentManager.getContentManager in interface Editor<String>public void setContentManager(ContentManager contentManager)
EditorContentManager.setContentManager in interface Editor<String>Copyright © 2013. All Rights Reserved.