Git Product home page Git Product logo

rsyntaxtextarea's Introduction

RSyntaxTextArea

Java Build Java Build codecov

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.

Building

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.

Example Usage

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));
    }

}

Sister Projects

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:

  • AutoComplete - Adds code completion to RSyntaxTextArea (or any other JTextComponent).
  • RSTALanguageSupport - Code completion for RSTA for the following languages: Java, JavaScript, HTML, PHP, JSP, Perl, C, Unix Shell. Built on both RSTA and AutoComplete.
  • SpellChecker - Adds squiggle-underline spell checking to RSyntaxTextArea.
  • RSTAUI - Common dialogs needed by text editing applications: Find, Replace, Go to Line, File Properties.

Getting Help

rsyntaxtextarea's People

Contributors

bobbylight avatar apxeolog-df avatar kosivantsov avatar stevenupton avatar digro avatar pokab avatar paul-griffith avatar ricardojlrufino avatar mike-smith-ps avatar manticore-projects avatar todaviacaliente avatar emmanue1 avatar vipas-ana avatar timepath avatar dersascha avatar ondrejspanel avatar ncwoehler avatar mgarin avatar miho avatar joelmoniz avatar indieboyjeff avatar ebourg avatar elvaro avatar jonsn0w avatar amrdeveloper avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.