CARRIEGE_RETURN, NEW_LINE| Constructor and Description |
|---|
StringEditor() |
StringEditor(java.lang.String content) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
backspace()
Deletes the previous character if exists.
|
void |
close() |
java.lang.String |
delete()
Deletes the current character, shifting remaining characters one position left.
|
void |
findNext(java.lang.String str)
Finds the next appearance of the String.
|
void |
findPrevious(java.lang.String str)
Finds the next appearance of the String.
|
int |
getColumn()
Returns the current column.
|
java.lang.String |
getContent()
Returns the content of the file.
|
java.lang.String |
getContent(int line)
Returns the content of the file.
|
ContentManager |
getContentManager()
Sets the
ContentManager. |
int |
getLine()
Returns the number of the current line.
|
java.lang.String |
getSource()
Returns the
File being edited. |
java.lang.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(java.lang.String source)
Opens a file for editing.
|
void |
put(java.lang.String str)
Puts the
link to the current position. |
void |
save(java.lang.String target)
Saves the file.
|
void |
setContentManager(ContentManager contentManager)
Returns the
ContentManager. |
void |
setDirty(java.lang.Boolean dirty)
Marks that the editor has unsaved changes.
|
public StringEditor()
public StringEditor(java.lang.String content)
public int getLine()
Editorpublic int getColumn()
Editorpublic void move(int line,
int column)
public void moveToStartOfLine()
moveToStartOfLine in interface Editor<java.lang.String>public void moveToEndOfLine()
moveToEndOfLine in interface Editor<java.lang.String>public void moveToStartOfFile()
moveToStartOfFile in interface Editor<java.lang.String>public void moveToEndOfFile()
moveToEndOfFile in interface Editor<java.lang.String>public void put(java.lang.String str)
Editorlink to the current position.public java.lang.String delete()
Editorpublic java.lang.String backspace()
Editorpublic void newLine()
Editorpublic void mergeLine()
Editorpublic void findNext(java.lang.String str)
public int lines()
public void findPrevious(java.lang.String str)
findPrevious in interface Editor<java.lang.String>str - public void open(java.lang.String source)
throws java.io.IOException
Editorpublic void save(java.lang.String target)
throws java.io.IOException
Editorpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic java.lang.String getContent()
EditorgetContent in interface Editor<java.lang.String>public java.lang.String getContent(int line)
EditorgetContent in interface Editor<java.lang.String>public java.lang.String getSource()
File being edited.public java.lang.Boolean isDirty()
Editorpublic void setDirty(java.lang.Boolean dirty)
Editorpublic ContentManager getContentManager()
EditorContentManager.getContentManager in interface Editor<java.lang.String>public void setContentManager(ContentManager contentManager)
EditorContentManager.setContentManager in interface Editor<java.lang.String>Copyright © 2018. All Rights Reserved.