org.fife.rtext.plugins.macros.js.template.txt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rtext Show documentation
Show all versions of rtext Show documentation
RText is a powerful, cross-platform programmer's text editor written in Java. It is designed
to be easy to use, highly customizable and flexible. Part of RText's design is for the source code
to be simple, easy to understand, and well documented, so that other programmers can look into its
inner-workings and figure out how RText ticks with ease. A good place to start (besides the source
code) is the Javadoc for all classes used in the project.
/*
* This is a Rhino (Javascript) macro for RText.
*
* Global variables include:
* - rtext: The focused application window, an instance of
* org.fife.rtext.RText.
* - textArea: The active text area, an instance of
* org.fife.rtext.RTextEditorPane.
*
* You can use the entire RText and RSyntaxTextArea public API's:
* http://javadoc.fifesoft.com/rtext/
* http://javadoc.fifesoft.com/rsyntaxtextarea/
*/
importPackage(java.lang, javax.swing);
textArea.append("\nThis is new text\n");
textArea.caretPosition = textArea.document.length;
JOptionPane.showMessageDialog(rtext, "Text has been appended!");