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


Java LanguageSupportFactory.getSupportFor方法代码示例

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


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

示例1: setValuesImpl

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的package包/类
/**
 * Sets values in this panel to reflect those being used by the plugin.
 *
 * @param owner The application window.
 * @see #doApplyImpl(Frame)
 */
@Override
protected void setValuesImpl(Frame owner) {

	LanguageSupportFactory lsf = LanguageSupportFactory.get();
	LanguageSupport ls = lsf.getSupportFor(Plugin.SYNTAX_STYLE_ZSCRIPT);
	ZScriptLanguageSupport zls = (ZScriptLanguageSupport)ls;

	// Options dealing with code completion
	setEnabledCBSelected(zls.isAutoCompleteEnabled());
	paramAssistanceCB.setSelected(zls.isParameterAssistanceEnabled());
	showDescWindowCB.setSelected(zls.getShowDescWindow());

	// Options dealing with auto-activation
	setAutoActivateCBSelected(zls.isAutoActivationEnabled());
	aaDelayField.setText(Integer.toString(zls.getAutoActivationDelay()));

	// Options dealing with code folding
	RText rtext = (RText)owner;
	AbstractMainView view = rtext.getMainView();
	foldingCB.setSelected(view.isCodeFoldingEnabledFor(
			Plugin.SYNTAX_STYLE_ZSCRIPT));

}
 
开发者ID:bobbylight,项目名称:ZScriptLanguageSupport,代码行数:30,代码来源:ZScriptOptionPanel.java

示例2: updateAutocompletion

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的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

示例3: checkForJavaParsing

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的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

示例4: checkForZScriptParsing

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

	// Remove possible listener on old Java parser (in case they're just
	// changing syntax style AWAY from Java)
	if (parser!=null) {
		parser.removePropertyChangeListener(
				ZScriptParser.PROPERTY_AST, 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("text/zscript");
	ZScriptLanguageSupport zls = (ZScriptLanguageSupport)support;

	// Listen for re-parsing of the editor, and update the tree accordingly
	parser = zls.getParser(textArea);
	if (parser!=null) { // Should always be true
		parser.addPropertyChangeListener(
				ZScriptParser.PROPERTY_AST, listener);
		// Populate with any already-existing AST.
		update(parser.getAst());
	}
	else {
		update((ZScriptAst)null); // Clear the tree
	}

}
 
开发者ID:bobbylight,项目名称:ZScriptLanguageSupport,代码行数:33,代码来源:ZScriptOutlineTree.java

示例5: doApplyImpl

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的package包/类
/**
 * Applies the changes in this panel into the application.
 *
 * @see #setValuesImpl(Frame)
 */
@Override
protected void doApplyImpl(Frame owner) {

	LanguageSupportFactory lsf = LanguageSupportFactory.get();
	LanguageSupport ls = lsf.getSupportFor(Plugin.SYNTAX_STYLE_ZSCRIPT);
	ZScriptLanguageSupport zls = (ZScriptLanguageSupport)ls;

	// Options dealing with code completion.
	zls.setAutoCompleteEnabled(enabledCB.isSelected());
	zls.setParameterAssistanceEnabled(paramAssistanceCB.isSelected());
	zls.setShowDescWindow(showDescWindowCB.isSelected());

	// Options dealing with auto-activation.
	zls.setAutoActivationEnabled(autoActivateCB.isSelected());
	int delay = Integer.parseInt(AA_DELAY_DEFAULT);
	String temp = aaDelayField.getText();
	if (temp.length()>0) {
		try {
			delay = Integer.parseInt(aaDelayField.getText());
		} catch (NumberFormatException nfe) { // Never happens
			nfe.printStackTrace();
		}
	}
	zls.setAutoActivationDelay(delay);

	// Options dealing with code folding.
	RText rtext = (RText)owner;
	AbstractMainView view = rtext.getMainView();
	boolean folding = foldingCB.isSelected();
	view.setCodeFoldingEnabledFor(Plugin.SYNTAX_STYLE_ZSCRIPT, folding);

}
 
开发者ID:bobbylight,项目名称:ZScriptLanguageSupport,代码行数:38,代码来源:ZScriptOptionPanel.java

示例6: checkForXmlParsing

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

	// Remove possible listener on old Java parser (in case they're just
	// changing syntax style AWAY from Java)
	if (parser!=null) {
		parser.removePropertyChangeListener(XmlParser.PROPERTY_AST, 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_XML);
	XmlLanguageSupport xls = (XmlLanguageSupport)support;

	// Listen for re-parsing of the editor, and update the tree accordingly
	parser = xls.getParser(textArea);
	if (parser!=null) { // Should always be true
		parser.addPropertyChangeListener(XmlParser.PROPERTY_AST, listener);
		// Populate with any already-existing AST.
		XmlTreeNode root = parser.getAst();
		update(root);
	}
	else {
		update((XmlTreeNode)null); // Clear the tree
	}

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

示例7: checkForJavaScriptParsing

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

	// Remove possible listener on old Java parser (in case they're just
	// changing syntax style AWAY from Java)
	if (parser!=null) {
		parser.removePropertyChangeListener(
					JavaScriptParser.PROPERTY_AST, 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_JAVASCRIPT);
	JavaScriptLanguageSupport jls = (JavaScriptLanguageSupport)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(
				JavaScriptParser.PROPERTY_AST, listener);
		// Populate with any already-existing AST
		AstRoot ast = parser.getAstRoot();
		update(ast);
	}
	else {
		update((AstRoot)null); // Clear the tree
	}

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

示例8: AreaDeTexto

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的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

示例9: getParameterChoices

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的package包/类
@Override
public List<Completion> getParameterChoices(JTextComponent tc, Parameter param) {

	String type = param.getType();
	if (type==null) { // e.g. a template
		return null;
	}
	LanguageSupportFactory lsf = LanguageSupportFactory.get();
	LanguageSupport support = lsf.getSupportFor("text/zscript");
	ZScriptLanguageSupport zsls = (ZScriptLanguageSupport)support;

	RSyntaxTextArea textArea = (RSyntaxTextArea)tc;
	ZScriptParser parser = zsls.getParser(textArea);
	if (parser==null) {
		return null;
	}
	ZScriptAst ast = parser.getAst();
	if (ast==null) {
		return null;
	}
	RootNode root = ast.getRootNode();

	List<Completion> choices = new ArrayList<Completion>();

	int dot = textArea.getCaretPosition();
	VariablesInScopeGrabber grabber = new VariablesInScopeGrabber(dot);
	root.accept(grabber);
	List<VariableDecNode> vars = grabber.getVariableList();
	for (VariableDecNode varDec : vars) {
		if (type.equals(varDec.getType())) {
			choices.add(new ZScriptVariableCompletion(provider, varDec));
		}
	}

	List<Completion> constants = constantValueMap.get(type);
	if (constants!=null) {
		choices.addAll(constants);
	}

	return choices;

}
 
开发者ID:bobbylight,项目名称:ZScriptLanguageSupport,代码行数:43,代码来源:SourceParamChoicesProvider.java

示例10: DemoRootPane

import org.fife.rsta.ac.LanguageSupportFactory; //导入方法依赖的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


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