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

The following examples show how to use org.fife.ui.rsyntaxtextarea.SyntaxConstants#SYNTAX_STYLE_PYTHON . 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: 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 3
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 4
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 5
Source File: JythonEngineWrapper.java    From zap-extensions with Apache License 2.0 4 votes vote down vote up
@Override
public String getSyntaxStyle() {
    return SyntaxConstants.SYNTAX_STYLE_PYTHON;
}