Class RSyntaxTextAreaEditorKit.InsertBreakAction

    • Constructor Detail

      • InsertBreakAction

        public InsertBreakAction()
    • Method Detail

      • atEndOfLine

        private static int atEndOfLine​(int pos,
                                       java.lang.String s,
                                       int sLen)
        Returns:
        The first location in the string past pos that is NOT a whitespace char, or -1 if only whitespace chars follow pos (or it is the end position in the string).
      • getOpenBraceCount

        private static int getOpenBraceCount​(RSyntaxDocument doc,
                                             int languageIndex)
      • handleInsertBreak

        protected void handleInsertBreak​(RSyntaxTextArea textArea,
                                         boolean noSelection)
        Actually inserts the newline into the document, and auto-indents if appropriate. This method can be called by token makers who implement a custom action for inserting newlines.
        Parameters:
        textArea - The text area to examine.
        noSelection - Whether there is no selection.
      • handleInsertBreakWithoutSelection

        private void handleInsertBreakWithoutSelection​(RSyntaxTextArea textArea)
                                                throws javax.swing.text.BadLocationException
        Throws:
        javax.swing.text.BadLocationException
      • isAllWhitespace

        private static boolean isAllWhitespace​(java.lang.String str,
                                               int from,
                                               int to)
      • possiblyCloseCurlyBrace

        private void possiblyCloseCurlyBrace​(RSyntaxTextArea textArea,
                                             java.lang.String leadingWS)