• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JavaLanguageSupport类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.fife.rsta.ac.java.JavaLanguageSupport的典型用法代码示例。如果您正苦于以下问题:Java JavaLanguageSupport类的具体用法?Java JavaLanguageSupport怎么用?Java JavaLanguageSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

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

示例1: updateAutocompletion

点赞 2

import org.fife.rsta.ac.java.JavaLanguageSupport; //导入依赖的package包/类
private void updateAutocompletion() {
    LanguageSupportFactory lsf = LanguageSupportFactory.get();
    LanguageSupport support = lsf.getSupportFor(
            org.fife.ui.rsyntaxtextarea.SyntaxConstants.SYNTAX_STYLE_JAVA);
    JavaLanguageSupport jls = (JavaLanguageSupport)support;
    JarManager jarManager = jls.getJarManager();

    try {
        boolean doUpdate = false;
        if (filesExist(m_autoCompletionJars)) {
            m_autoCompletionJars = m_snippet.getClassPath();
            doUpdate = true;
        } else {
            if (!Arrays.equals(m_autoCompletionJars, m_snippet.getClassPath())) {
                m_autoCompletionJars = m_snippet.getClassPath();
                doUpdate = true;
            }
        }

        if (doUpdate) {
            jarManager.clearClassFileSources();
            jarManager.addCurrentJreClassFileSource();
            for (File jarFile : m_autoCompletionJars) {
                jarManager.addClassFileSource(jarFile);
            }
        }


    } catch (IOException ioe) {
        LOGGER.error(ioe.getMessage(), ioe);
    }

}
 

开发者ID:pavloff-de,
项目名称:spark4knime,
代码行数:34,
代码来源:JavaSnippetForRDDNodeDialog.java

示例2: checkForJavaParsing

点赞 2

import org.fife.rsta.ac.java.JavaLanguageSupport; //导入依赖的package包/类
/**
 * Refreshes listeners on the text area when its syntax style changes.
 */
private void checkForJavaParsing() {

	// Remove possible listener on old Java parser (in case they're just
	// changing syntax style AWAY from Java)
	if (parser!=null) {
		parser.removePropertyChangeListener(
					JavaParser.PROPERTY_COMPILATION_UNIT, listener);
		parser = null;
	}

	// Get the Java language support (shared by all RSTA instances editing
	// Java that were registered with the LanguageSupportFactory).
	LanguageSupportFactory lsf = LanguageSupportFactory.get();
	LanguageSupport support = lsf.getSupportFor(SyntaxConstants.
												SYNTAX_STYLE_JAVA);
	JavaLanguageSupport jls = (JavaLanguageSupport)support;

	// Listen for re-parsing of the editor, and update the tree accordingly
	parser = jls.getParser(textArea);
	if (parser!=null) { // Should always be true
		parser.addPropertyChangeListener(
				JavaParser.PROPERTY_COMPILATION_UNIT, listener);
		// Populate with any already-existing CompilationUnit
		CompilationUnit cu = parser.getCompilationUnit();
		update(cu);
	}
	else {
		update((CompilationUnit)null); // Clear the tree
	}

}
 

开发者ID:pyros2097,
项目名称:GdxStudio,
代码行数:35,
代码来源:JavaOutlineTree.java

示例3: AreaDeTexto

点赞 2

import org.fife.rsta.ac.java.JavaLanguageSupport; //导入依赖的package包/类
/**
* O construtor da classe define uma lista do tipo HashMap, esta lista
* armazena a extensão e sintaxe da linguagem. Também define o recurso
* de autocompletar o código.
*/
public AreaDeTexto() {

	extensao.put("java", SyntaxConstants.SYNTAX_STYLE_JAVA);
	extensao.put("cpp", SyntaxConstants.SYNTAX_STYLE_CPLUSPLUS);
	extensao.put("py", SyntaxConstants.SYNTAX_STYLE_PYTHON);
	extensao.put("xml", SyntaxConstants.SYNTAX_STYLE_XML);
	extensao.put("html", SyntaxConstants.SYNTAX_STYLE_HTML);
	extensao.put("js", SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
	extensao.put("css", SyntaxConstants.SYNTAX_STYLE_CSS);
	extensao.put("c", SyntaxConstants.SYNTAX_STYLE_C);
	extensao.put("sh", SyntaxConstants.SYNTAX_STYLE_UNIX_SHELL);
	extensao.put("properties", SyntaxConstants.SYNTAX_STYLE_PROPERTIES_FILE);
	extensao.put("groovy", SyntaxConstants.SYNTAX_STYLE_GROOVY);
	extensao.put("jsp", SyntaxConstants.SYNTAX_STYLE_JSP);
	extensao.put("as", SyntaxConstants.SYNTAX_STYLE_ACTIONSCRIPT);
	extensao.put("asm", SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
	extensao.put("clj", SyntaxConstants.SYNTAX_STYLE_CLOJURE);
	extensao.put("d", SyntaxConstants.SYNTAX_STYLE_D);
	extensao.put("dfm", SyntaxConstants.SYNTAX_STYLE_DELPHI);
	extensao.put("pas", SyntaxConstants.SYNTAX_STYLE_DELPHI);
	extensao.put("f", SyntaxConstants.SYNTAX_STYLE_FORTRAN);
	extensao.put("json", SyntaxConstants.SYNTAX_STYLE_JSON);
	extensao.put("lof", SyntaxConstants.SYNTAX_STYLE_LATEX);
	extensao.put("lisp", SyntaxConstants.SYNTAX_STYLE_LISP);
	extensao.put("lua", SyntaxConstants.SYNTAX_STYLE_LUA);
	extensao.put("perl", SyntaxConstants.SYNTAX_STYLE_PERL);
	extensao.put("php", SyntaxConstants.SYNTAX_STYLE_PHP);
	extensao.put("rb", SyntaxConstants.SYNTAX_STYLE_RUBY);
	extensao.put("scala", SyntaxConstants.SYNTAX_STYLE_SCALA);
	extensao.put("cs", SyntaxConstants.SYNTAX_STYLE_CSHARP);
	extensao.put("vb", SyntaxConstants.SYNTAX_STYLE_VISUAL_BASIC);
	extensao.put("bat", SyntaxConstants.SYNTAX_STYLE_WINDOWS_BATCH);
	extensao.put("alg", "text/portugol");
	extensao.put("poti", "text/potigol");

	this.setLayout(new BorderLayout());
	this.setBorder(null);
	this.add(barraDeRolagem());

	LanguageSupportFactory lsf = LanguageSupportFactory.get();
	LanguageSupport support = lsf.getSupportFor(SyntaxConstants.SYNTAX_STYLE_JAVA);
	JavaLanguageSupport jls = (JavaLanguageSupport) support;

	try {
		jls.getJarManager().addCurrentJreClassFileSource();
	} catch (IOException ex) {  }

	lsf.register(getRSyntax());

	bPesquisa = new Pesquisar(getRSyntax());
	bPesquisa.setVisible(false);
	this.add(BorderLayout.SOUTH, bPesquisa);
}
 

开发者ID:cristian-henrique,
项目名称:JCEditor,
代码行数:59,
代码来源:AreaDeTexto.java

示例4: DemoRootPane

点赞 2

import org.fife.rsta.ac.java.JavaLanguageSupport; //导入依赖的package包/类
public DemoRootPane() {

		LanguageSupportFactory lsf = LanguageSupportFactory.get();
		LanguageSupport support = lsf.getSupportFor(SYNTAX_STYLE_JAVA);
		JavaLanguageSupport jls = (JavaLanguageSupport)support;
		// TODO: This API will change!  It will be easier to do per-editor
		// changes to the build path.
		try {
			jls.getJarManager().addCurrentJreClassFileSource();
			//jsls.getJarManager().addClassFileSource(ji);
		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
		
		// Dummy tree keeps JViewport's "background" looking right initially
		JTree dummy = new JTree((TreeNode)null);
		treeSP = new JScrollPane(dummy);

		textArea = createTextArea();
		setText("CExample.txt", SYNTAX_STYLE_C);
		scrollPane = new RTextScrollPane(textArea, true);
		scrollPane.setIconRowHeaderEnabled(true);
		scrollPane.getGutter().setBookmarkingEnabled(true);

		final JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
										treeSP, scrollPane);
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				sp.setDividerLocation(0.25);
			}
		});
		sp.setContinuousLayout(true);
//		setContentPane(sp);

		setJMenuBar(createMenuBar());

		ErrorStrip errorStrip = new ErrorStrip(textArea);
//errorStrip.setBackground(java.awt.Color.blue);
JPanel cp = new JPanel(new BorderLayout());
cp.add(sp);
cp.add(errorStrip, BorderLayout.LINE_END);
setContentPane(cp);
	}
 

开发者ID:bobbylight,
项目名称:RSTALanguageSupport,
代码行数:45,
代码来源:DemoRootPane.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)