| java.lang.Object org.netbeans.modules.visualweb.gravy.model.project.SourceFile
All known Subclasses: org.netbeans.modules.visualweb.gravy.model.project.JSPFile, org.netbeans.modules.visualweb.gravy.model.project.JavaFile, org.netbeans.modules.visualweb.gravy.model.project.XMLFile,
SourceFile | abstract class SourceFile (Code) | | Common class for all source files.
|
Method Summary | |
public void | close() Close source file. | abstract public boolean | contains(String text) Checks if source file contains text specified as parameter text.
Parameters: text - Text to compare to. | abstract public void | delete(int offset, int length) Deletes given number of characters from specified possition. | abstract public void | delete(int length) Deletes given number of characters from current caret possition. | abstract public void | delete(int lineNumber, int column1, int column2) Deletes characters between column1 and column2 on the specified line. | abstract public void | deleteLine(int line) Delete specified line. | abstract public String | getText() Gets text from the currently opened source file. | abstract public String | getText(int lineNumber) Gets text from specified line.
Parameters: lineNumber - Number of line. | abstract public void | insert(String text) Insert text to current position. | abstract public void | insert(String text, int lineNumber, int column) Inserts text to position specified by line number and column. | public void | open() Open source file. | abstract public void | replace(String oldText, String newText) Replaces first occurence of oldText by newText. | abstract public void | replace(String oldText, String newText, int index) Replaced index-th occurence of oldText by newText. |
SourceFile | SourceFile(TreePath path, String name)(Code) | | Creates a new instance of web page.
Parameters: path - Path to web page in project. Parameters: name - Name of web page. |
close | public void close()(Code) | | Close source file.
|
contains | abstract public boolean contains(String text)(Code) | | Checks if source file contains text specified as parameter text.
Parameters: text - Text to compare to. true if text was found, false otherwise. |
delete | abstract public void delete(int offset, int length)(Code) | | Deletes given number of characters from specified possition.
Parameters: offset - Position inside document. Parameters: length - Number of characters to be deleted. |
delete | abstract public void delete(int length)(Code) | | Deletes given number of characters from current caret possition.
Parameters: length - Number of characters to be deleted. |
delete | abstract public void delete(int lineNumber, int column1, int column2)(Code) | | Deletes characters between column1 and column2 on the specified line.
Parameters: lineNumber - Number of line. Parameters: column1 - Column position where to start deleting. Parameters: column2 - Column position where to stop deleting. |
deleteLine | abstract public void deleteLine(int line)(Code) | | Delete specified line.
Parameters: line - Number of line. |
getText | abstract public String getText()(Code) | | Gets text from the currently opened source file.
String representing whole content of the source fiole.(including new line characters) |
getText | abstract public String getText(int lineNumber)(Code) | | Gets text from specified line.
Parameters: lineNumber - Number of line. String representing content of the line. |
insert | abstract public void insert(String text)(Code) | | Insert text to current position.
Parameters: text - String to be inserted. |
insert | abstract public void insert(String text, int lineNumber, int column)(Code) | | Inserts text to position specified by line number and column.
Parameters: text - String to be inserted. Parameters: lineNumber - Number of line. Parameters: column - Column position. |
open | public void open()(Code) | | Open source file.
|
replace | abstract public void replace(String oldText, String newText)(Code) | | Replaces first occurence of oldText by newText.
Parameters: oldText - Text to be replaced. Parameters: newText - Text to write instead. |
replace | abstract public void replace(String oldText, String newText, int index)(Code) | | Replaced index-th occurence of oldText by newText.
Parameters: oldText - Text to be replaced Parameters: newText - Text to write instead Parameters: index - Index of oldText occurence. |
|
|