示例#1
0
 /**
  * Sets the token maker factory used by this document.
  *
  * @param tmf The <code>TokenMakerFactory</code> for this document. If this is <code>null</code>,
  *     a default factory is used.
  */
 public void setTokenMakerFactory(TokenMakerFactory tmf) {
   tokenMakerFactory = tmf != null ? tmf : TokenMakerFactory.getDefaultInstance();
 }
示例#2
0
 /**
  * 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();
 }