|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fife.ui.rsyntaxtextarea.templates.AbstractCodeTemplate
org.fife.ui.rsyntaxtextarea.templates.StaticCodeTemplate
public class StaticCodeTemplate
A code template that inserts static text before and after the caret.
For example, you can associate the identifier forb
(short for "for-block") with the following code:
for (<caret>) {
}
Then, whenever you type forb followed by a trigger
(e.g., a space) into a text area with this CodeTemplate,
the code snippet is added in place of forb. Further,
the caret is placed at the position denoted by <caret>.
CodeTemplate,
Serialized Form| Constructor Summary | |
|---|---|
StaticCodeTemplate()
Constructor. |
|
StaticCodeTemplate(String id,
String beforeCaret,
String afterCaret)
Constructor. |
|
| Method Summary | |
|---|---|
String |
getAfterCaretText()
Returns the text that will be placed after the caret. |
String |
getBeforeCaretText()
Returns the text that will be placed before the caret. |
void |
invoke(RSyntaxTextArea textArea)
Invokes this code template. |
void |
setAfterCaretText(String afterCaret)
Sets the text to place after the caret. |
void |
setBeforeCaretText(String beforeCaret)
Sets the text to place before the caret. |
String |
toString()
Returns a string representation of this template for debugging purposes. |
| Methods inherited from class org.fife.ui.rsyntaxtextarea.templates.AbstractCodeTemplate |
|---|
clone, compareTo, equals, getID, hashCode, setID |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StaticCodeTemplate()
public StaticCodeTemplate(String id,
String beforeCaret,
String afterCaret)
id - The ID of this code template.beforeCaret - The text to place before the caret.afterCaret - The text to place after the caret.| Method Detail |
|---|
public String getAfterCaretText()
setAfterCaretText(java.lang.String)public String getBeforeCaretText()
setBeforeCaretText(java.lang.String)
public void invoke(RSyntaxTextArea textArea)
throws BadLocationException
textArea - The text area to operate on.
BadLocationException - If something bad happens.public void setAfterCaretText(String afterCaret)
afterCaret - The text.getAfterCaretText()public void setBeforeCaretText(String beforeCaret)
beforeCaret - The text.getBeforeCaretText()public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||