Java Code Examples for org.fife.ui.rsyntaxtextarea.SyntaxConstants#SYNTAX_STYLE_NONE

The following examples show how to use org.fife.ui.rsyntaxtextarea.SyntaxConstants#SYNTAX_STYLE_NONE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConsolePanel.java    From zap-extensions with Apache License 2.0 6 votes vote down vote up
private static String getSyntaxForScript(String engine) {
    String engineLc = engine.toLowerCase(Locale.ROOT);
    if (engineLc.startsWith("clojure")) {
        return SyntaxConstants.SYNTAX_STYLE_CLOJURE;
    } else if (engineLc.startsWith("groovy")) {
        return SyntaxConstants.SYNTAX_STYLE_GROOVY;
    } else if (engineLc.startsWith("ecmacript")) {
        return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
    } else if (engineLc.startsWith("javascript")) {
        return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
    } else if (engineLc.startsWith("python")) {
        return SyntaxConstants.SYNTAX_STYLE_PYTHON;
    } else if (engineLc.startsWith("ruby")) {
        return SyntaxConstants.SYNTAX_STYLE_RUBY;
    } else if (engineLc.startsWith("scala")) {
        return SyntaxConstants.SYNTAX_STYLE_SCALA;
    } else {
        return SyntaxConstants.SYNTAX_STYLE_NONE;
    }
}
 
Example 2
Source File: PmdDataSourceEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final ScriptEngineFactory script ) {
  if ( script == null ) {
    return SyntaxConstants.SYNTAX_STYLE_NONE;
  }

  final String language = script.getLanguageName();
  if ( "ECMAScript".equalsIgnoreCase( language )
     || "js".equalsIgnoreCase( language )
     || "rhino".equalsIgnoreCase( language )
     || "javascript".equalsIgnoreCase( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "groovy".equalsIgnoreCase( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example 3
Source File: ScriptableDataSourceEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final String language ) {
  if ( "beanshell".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVA;
  }
  if ( "groovy".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  if ( "javascript".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "jython".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
  }
  if ( "xslt".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_XML;
  }

  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example 4
Source File: BeanShellScriptingExpressionEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final String language ) {
  if ( "beanshell".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVA;
  }
  if ( "groovy".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  if ( "javascript".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "jython".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
  }
  if ( "xslt".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_XML;
  }

  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example 5
Source File: BSFScriptingExpressionEditor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
private String mapLanguageToSyntaxHighlighting( final String language ) {
  if ( "beanshell".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVA;
  }
  if ( "groovy".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_GROOVY;
  }
  if ( "javascript".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
  }
  if ( "jython".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
  }
  if ( "xslt".equals( language ) ) {
    return SyntaxConstants.SYNTAX_STYLE_XML;
  }

  return SyntaxConstants.SYNTAX_STYLE_NONE;
}
 
Example 6
Source File: JSyntaxTextArea.java    From jmeter-plugins-webdriver with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the language of the text area.
 * 
 * @param language
 *            The language to be set
 */
public void setLanguage(String language) {
    if(language == null) {
      // But how to find the name of the offending GUI element in the case of a TestBean?
      super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
    } else {
      final String style = languageProperties.getProperty(language);
      if (style == null) {
          super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
      } else {
          super.setSyntaxEditingStyle(style);
      }
    }
}
 
Example 7
Source File: ConsolePanel.java    From zap-extensions with Apache License 2.0 5 votes vote down vote up
private static String getSyntaxForExtension(String name) {
    String nameLc = name.toLowerCase(Locale.ROOT);
    if (nameLc.endsWith(".js")) {
        return SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
    } else if (nameLc.endsWith(".html")) {
        return SyntaxConstants.SYNTAX_STYLE_HTML;
    } else if (nameLc.endsWith(".css")) {
        return SyntaxConstants.SYNTAX_STYLE_CSS;
    } else {
        return SyntaxConstants.SYNTAX_STYLE_NONE;
    }
}
 
Example 8
Source File: DesktopSourceCodeEditor.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
protected Document createDocument() {
    return new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_NONE);
}
 
Example 9
Source File: JNode.java    From jadx with Apache License 2.0 4 votes vote down vote up
public String getSyntaxName() {
	return SyntaxConstants.SYNTAX_STYLE_NONE;
}