当前位置: 首页>>代码示例>>Java>>正文


Java SyntaxConstants.SYNTAX_STYLE_C属性代码示例

本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.SyntaxConstants.SYNTAX_STYLE_C属性的典型用法代码示例。如果您正苦于以下问题:Java SyntaxConstants.SYNTAX_STYLE_C属性的具体用法?Java SyntaxConstants.SYNTAX_STYLE_C怎么用?Java SyntaxConstants.SYNTAX_STYLE_C使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.fife.ui.rsyntaxtextarea.SyntaxConstants的用法示例。


在下文中一共展示了SyntaxConstants.SYNTAX_STYLE_C属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testParse_happyPath

@Test
public void testParse_happyPath() throws Exception {

	TaskTagParser parser = new TaskTagParser();

	RSyntaxDocument doc = new RSyntaxDocument(
			SyntaxConstants.SYNTAX_STYLE_C);
	doc.insertString(0, "/* TODO: Fix this */", null);

	ParseResult res = parser.parse(doc, doc.getSyntaxStyle());
	Assert.assertEquals(parser, res.getParser());
	Assert.assertEquals(0, res.getFirstLineParsed());
	Assert.assertEquals(0, res.getLastLineParsed());
	List<ParserNotice> notices = res.getNotices();
	Assert.assertEquals(1, notices.size());
	// Note that the parser does not understand EOL vs. MLC comments, so
	// it just returns everything from the start of the task to the end of
	// the line.
	Assert.assertEquals("TODO: Fix this */", notices.get(0).getToolTipText());

}
 
开发者ID:curiosag,项目名称:ftc,代码行数:21,代码来源:TaskTagParserTest.java

示例2: testParse_nullTaskPattern

@Test
public void testParse_nullTaskPattern() throws Exception {

	TaskTagParser parser = new TaskTagParser();
	parser.setTaskPattern(null);

	RSyntaxDocument doc = new RSyntaxDocument(
			SyntaxConstants.SYNTAX_STYLE_C);
	doc.insertString(0, "/* TODO: Fix this */ for", null);

	ParseResult res = parser.parse(doc, doc.getSyntaxStyle());
	Assert.assertEquals(parser, res.getParser());
	Assert.assertEquals(0, res.getFirstLineParsed());
	Assert.assertEquals(0, res.getLastLineParsed());
	List<ParserNotice> notices = res.getNotices();
	Assert.assertEquals(0, notices.size());

}
 
开发者ID:curiosag,项目名称:ftc,代码行数:18,代码来源:TaskTagParserTest.java

示例3: EditorArduino

public EditorArduino(final String boundServiceName, final GUIService myService, final JTabbedPane tabs) {
	super(boundServiceName, myService, tabs, SyntaxConstants.SYNTAX_STYLE_C);
	ServiceInterface sw = Runtime.getService(boundServiceName);
	myArduino = (Arduino) sw;
	examplesMenu.add(createExamplesMenu());
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:6,代码来源:EditorArduino.java

示例4: 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;
}
 
开发者ID:massimozappino,项目名称:tagmycode-java-plugin-framework,代码行数:49,代码来源:SyntaxSnippetEditor.java


注:本文中的org.fife.ui.rsyntaxtextarea.SyntaxConstants.SYNTAX_STYLE_C属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。