本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.SyntaxConstants.SYNTAX_STYLE_JAVA属性的典型用法代码示例。如果您正苦于以下问题:Java SyntaxConstants.SYNTAX_STYLE_JAVA属性的具体用法?Java SyntaxConstants.SYNTAX_STYLE_JAVA怎么用?Java SyntaxConstants.SYNTAX_STYLE_JAVA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.fife.ui.rsyntaxtextarea.SyntaxConstants
的用法示例。
在下文中一共展示了SyntaxConstants.SYNTAX_STYLE_JAVA属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CodeEditor
/**
* Creates the code editor
*/
public CodeEditor() {
this(SyntaxConstants.SYNTAX_STYLE_JAVA);
}
示例2: getMimeFromLanguage
private String getMimeFromLanguage(Language language) {
String code = language.getCode();
String mimeType = "text/plain";
switch (code) {
case "java":
mimeType = SyntaxConstants.SYNTAX_STYLE_JAVA;
break;
case "php":
mimeType = SyntaxConstants.SYNTAX_STYLE_RUBY;
break;
case "bash":
mimeType = SyntaxConstants.SYNTAX_STYLE_UNIX_SHELL;
break;
case "ruby":
mimeType = SyntaxConstants.SYNTAX_STYLE_RUBY;
break;
case "javascript":
mimeType = SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT;
break;
case "css":
mimeType = SyntaxConstants.SYNTAX_STYLE_CSS;
break;
case "html":
mimeType = SyntaxConstants.SYNTAX_STYLE_HTML;
break;
case "csharp":
mimeType = SyntaxConstants.SYNTAX_STYLE_CSHARP;
break;
case "sql":
mimeType = SyntaxConstants.SYNTAX_STYLE_SQL;
break;
case "xml":
mimeType = SyntaxConstants.SYNTAX_STYLE_XML;
break;
case "c":
mimeType = SyntaxConstants.SYNTAX_STYLE_C;
break;
case "objc":
mimeType = SyntaxConstants.SYNTAX_STYLE_CPLUSPLUS;
break;
case "python":
mimeType = SyntaxConstants.SYNTAX_STYLE_PYTHON;
break;
case "perl":
mimeType = SyntaxConstants.SYNTAX_STYLE_PERL;
break;
}
return mimeType;
}
示例3: getSyntaxName
@Override
public String getSyntaxName() {
return SyntaxConstants.SYNTAX_STYLE_JAVA;
}
示例4: JSyntaxTextArea
/**
* 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
* @param cols
* @param disableUndo true to disable undo manager, defaults to false
*/
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;
}