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

The following examples show how to use org.fife.ui.rsyntaxtextarea.SyntaxConstants#SYNTAX_STYLE_JAVA . 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: JSyntaxTextArea.java    From jmeter-plugins-webdriver with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the default syntax highlighting text area. The following are set:
 * <ul>
 * <li>setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA)</li>
 * <li>setCodeFoldingEnabled(true)</li>
 * <li>setAntiAliasingEnabled(true)</li>
 * <li>setLineWrap(true)</li>
 * <li>setWrapStyleWord(true)</li>
 * </ul>
 * 
 * @param rows
 *            The number of rows for the text area
 * @param cols
 *            The number of columns for the text area
 * @param disableUndo
 *            true to disable undo manager, defaults to false
 * @deprecated use {@link #getInstance(int, int, boolean)} instead
 */
@Deprecated
public JSyntaxTextArea(int rows, int cols, boolean disableUndo) {
    super(rows, cols);
    super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    super.setCodeFoldingEnabled(CODE_FOLDING);
    super.setAntiAliasingEnabled(true);
    super.setLineWrap(LINE_WRAP);
    super.setWrapStyleWord(WRAP_STYLE_WORD);
    this.disableUndo = disableUndo;
    if (USER_FONT_FAMILY != null) {
        int fontSize = USER_FONT_SIZE > 0 ? USER_FONT_SIZE : getFont().getSize();
        setFont(new Font(USER_FONT_FAMILY, Font.PLAIN, fontSize));
        if (log.isDebugEnabled()) {
            log.debug("Font is set to: {}", getFont());
        }
    }
    if(disableUndo) {
        // We need to do this to force recreation of undoManager which
        // will use the disableUndo otherwise it would always be false
        // See BUG 57440
        discardAllEdits();
    }
}
 
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: DesktopSourceCodeEditor.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void setMode(HighlightMode mode) {
    Preconditions.checkNotNullArgument(mode, "HighlightMode of SourceCodeEditor cannot be null");

    this.mode = mode;

    String modeId = "text/" + mode.getId();

    switch (modeId) {
        case SyntaxConstants.SYNTAX_STYLE_GROOVY:
        case SyntaxConstants.SYNTAX_STYLE_HTML:
        case SyntaxConstants.SYNTAX_STYLE_JAVA:
        case SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT:
        case SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE:
        case SyntaxConstants.SYNTAX_STYLE_SQL:
        case SyntaxConstants.SYNTAX_STYLE_XML:
        case SyntaxConstants.SYNTAX_STYLE_CSS:
            impl.setSyntaxEditingStyle(modeId);
            break;

        default:
            if (mode.getId().equals(HighlightMode.SCSS.getId())) {
                impl.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_CSS);
            } else {
                impl.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
            }
            break;
    }
}
 
Example 6
Source File: ClassFilePage.java    From jd-gui with GNU General Public License v3.0 4 votes vote down vote up
@Override
public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_JAVA; }
 
Example 7
Source File: JClass.java    From jadx with Apache License 2.0 4 votes vote down vote up
@Override
public String getSyntaxName() {
	return SyntaxConstants.SYNTAX_STYLE_JAVA;
}
 
Example 8
Source File: JavaFilePage.java    From jd-gui with GNU General Public License v3.0 votes vote down vote up
public String getSyntaxStyle() { return SyntaxConstants.SYNTAX_STYLE_JAVA; }