Class RSyntaxTextAreaEditorKit

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class RSyntaxTextAreaEditorKit
    extends RTextAreaEditorKit
    An extension of RTextAreaEditorKit that adds functionality for programming-specific stuff. There are currently subclasses to handle:
    • Toggling code folds.
    • Aligning "closing" curly braces with their matches, if the current programming language uses curly braces to identify code blocks.
    • Copying the current selection as RTF.
    • Block indentation (increasing the indent of one or multiple lines)
    • Block un-indentation (decreasing the indent of one or multiple lines)
    • Inserting a "code template" when a configurable key (e.g. a space) is pressed
    • Decreasing the point size of all fonts in the text area
    • Increasing the point size of all fonts in the text area
    • Moving the caret to the "matching bracket" of the one at the current caret position
    • Toggling whether the currently selected lines are commented out.
    • Better selection of "words" on mouse double-clicks for programming languages.
    • Better keyboard navigation via Ctrl+arrow keys for programming languages.
    Version:
    0.5
    See Also:
    Serialized Form
    • Field Detail

      • rstaBacktickAction

        public static final java.lang.String rstaBacktickAction
        See Also:
        Constant Field Values
      • rstaCloseCurlyBraceAction

        public static final java.lang.String rstaCloseCurlyBraceAction
        See Also:
        Constant Field Values
      • rstaCloseMarkupTagAction

        public static final java.lang.String rstaCloseMarkupTagAction
        See Also:
        Constant Field Values
      • rstaCollapseAllFoldsAction

        public static final java.lang.String rstaCollapseAllFoldsAction
        See Also:
        Constant Field Values
      • rstaCollapseAllCommentFoldsAction

        public static final java.lang.String rstaCollapseAllCommentFoldsAction
        See Also:
        Constant Field Values
      • rstaCollapseFoldAction

        public static final java.lang.String rstaCollapseFoldAction
        See Also:
        Constant Field Values
      • rstaCopyAsStyledTextAction

        public static final java.lang.String rstaCopyAsStyledTextAction
        See Also:
        Constant Field Values
      • rstaCutAsStyledTextAction

        public static final java.lang.String rstaCutAsStyledTextAction
        See Also:
        Constant Field Values
      • rstaDecreaseIndentAction

        public static final java.lang.String rstaDecreaseIndentAction
        See Also:
        Constant Field Values
      • rstaDoubleQuoteAction

        public static final java.lang.String rstaDoubleQuoteAction
        See Also:
        Constant Field Values
      • rstaExpandAllFoldsAction

        public static final java.lang.String rstaExpandAllFoldsAction
        See Also:
        Constant Field Values
      • rstaExpandFoldAction

        public static final java.lang.String rstaExpandFoldAction
        See Also:
        Constant Field Values
      • rstaGoToMatchingBracketAction

        public static final java.lang.String rstaGoToMatchingBracketAction
        See Also:
        Constant Field Values
      • rstaOpenParenAction

        public static final java.lang.String rstaOpenParenAction
        See Also:
        Constant Field Values
      • rstaOpenSquareBracketAction

        public static final java.lang.String rstaOpenSquareBracketAction
        See Also:
        Constant Field Values
      • rstaOpenCurlyAction

        public static final java.lang.String rstaOpenCurlyAction
        See Also:
        Constant Field Values
      • rstaPossiblyInsertTemplateAction

        public static final java.lang.String rstaPossiblyInsertTemplateAction
        See Also:
        Constant Field Values
      • rstaSingleQuoteAction

        public static final java.lang.String rstaSingleQuoteAction
        See Also:
        Constant Field Values
      • rstaToggleCommentAction

        public static final java.lang.String rstaToggleCommentAction
        See Also:
        Constant Field Values
      • rstaToggleCurrentFoldAction

        public static final java.lang.String rstaToggleCurrentFoldAction
        See Also:
        Constant Field Values
      • msg

        private static final java.util.ResourceBundle msg
      • defaultActions

        private static final javax.swing.Action[] defaultActions
        The actions that RSyntaxTextAreaEditorKit adds to those of RTextAreaEditorKit.
    • Constructor Detail

      • RSyntaxTextAreaEditorKit

        public RSyntaxTextAreaEditorKit()
        Constructor.
    • Method Detail

      • createDefaultDocument

        public javax.swing.text.Document createDefaultDocument()
        Returns the default document used by RSyntaxTextAreas.
        Overrides:
        createDefaultDocument in class javax.swing.text.DefaultEditorKit
        Returns:
        The document.
      • getActions

        public javax.swing.Action[] getActions()
        Fetches the set of commands that can be used on a text component that is using a model and view produced by this kit.
        Overrides:
        getActions in class RTextAreaEditorKit
        Returns:
        the command list
      • getString

        public static java.lang.String getString​(java.lang.String key)
        Returns localized text for an action. There's definitely a better place for this functionality.
        Parameters:
        key - The key into the action resource bundle.
        Returns:
        The localized text.