Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
com.fifesoft:rsyntaxtextarea
Advanced tools
RSyntaxTextArea is the syntax highlighting text editor for Swing applications. Features include syntax highlighting for 40+ languages, code folding, code completion, regex find and replace, macros, code templates, undo/redo, line numbering and bracket matching.
RSyntaxTextArea is a customizable, syntax highlighting text component for Java Swing applications. Out of the box, it supports syntax highlighting for 50+ programming languages, code folding, search and replace, and has add-on libraries for code completion and spell checking. Syntax highlighting for additional languages can be added via tools such as JFlex.
RSyntaxTextArea is available under a BSD 3-Clause license. For more information, visit http://bobbylight.github.io/RSyntaxTextArea/.
Available in the Maven Central repository (com.fifesoft:rsyntaxtextarea:XXX
).
SNAPSHOT builds of the in-development, unreleased version are hosted on Sonatype.
Please see the wiki for an overview of features and a deep-dive into the code!
RSyntaxTextArea uses Gradle to build. To compile, run all unit tests, and create the jar, run:
./gradlew build --warning-mode all
RSTA 3.0 and newer requires Java 8 to compile and run. If you need Java 6 compatibility, you'll need to use a 2.6.x version.
There are several simple demo applications in the
RSyntaxTextAreaDemo
submodule. To run the "main" one, which
shows off syntax highlighting and code folding for several
languages as well as several common configuration options,
run:
./gradlew RSyntaxTextAreaDemo:run
RSyntaxTextArea is simply a subclass of JTextComponent, so it can be dropped into any Swing application with ease.
import javax.swing.*;
import java.awt.BorderLayout;
import org.fife.ui.rtextarea.*;
import org.fife.ui.rsyntaxtextarea.*;
public class TextEditorDemo extends JFrame {
public TextEditorDemo() {
JPanel cp = new JPanel(new BorderLayout());
RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
textArea.setCodeFoldingEnabled(true);
RTextScrollPane sp = new RTextScrollPane(textArea);
cp.add(sp);
setContentPane(cp);
setTitle("Text Editor Demo");
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setLocationRelativeTo(null);
}
public static void main(String[] args) {
// Start all Swing applications on the EDT.
SwingUtilities.invokeLater(() -> new TextEditorDemo().setVisible(true));
}
}
RSyntaxTextArea provides syntax highlighting, code folding, and many other features out-of-the-box, but when building a code editor you often want to go further. Below is a list of small add-on libraries that add more complex functionality:
FAQs
Unknown package
We found that com.fifesoft:rsyntaxtextarea demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.