/** * Sets the syntax style being used for syntax highlighting in this document. You should call this * method if you've created a custom token maker for a language not normally supported by <code> * RSyntaxTextArea</code>. * * @param tokenMaker The new token maker to use. */ public void setSyntaxStyle(TokenMaker tokenMaker) { tokenMaker.setWhitespaceVisible(isWhitespaceVisible()); this.tokenMaker = tokenMaker; updateSyntaxHighlightingInformation(); }
/** * Sets the syntax style being used for syntax highlighting in this document. What styles are * supported by a document is determined by its {@link TokenMakerFactory}. By default, all <code> * RSyntaxDocument</code>s support all languages built into <code>RSyntaxTextArea</code>. * * @param styleKey The new style to use, such as {@link SyntaxConstants#SYNTAX_STYLE_JAVA}. If * this style is not known or supported by this document, then {@link * SyntaxConstants#SYNTAX_STYLE_NONE} is used. */ public void setSyntaxStyle(String styleKey) { boolean wsVisible = isWhitespaceVisible(); tokenMaker = tokenMakerFactory.getTokenMaker(styleKey); tokenMaker.setWhitespaceVisible(wsVisible); updateSyntaxHighlightingInformation(); }