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


Java CompletionProvider类代码示例

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


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

示例1: SQLEditor

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
public SQLEditor() {
	super(new RSyntaxDocument(TextType.SQL.getSyntaxIdentifier()));
	setAnimateBracketMatching(true);
	setAutoIndentEnabled(true);
	setAutoscrolls(true);

	// A CompletionProvider is what knows of all possible completions, and
	// analyzes the contents of the text area at the caret position to
	// determine what completion choices should be presented. Most instances
	// of CompletionProvider (such as DefaultCompletionProvider) are designed
	// so that they can be shared among multiple text components.
	CompletionProvider provider = new LanguageAwareCompletionProvider(new DefaultCompletionProvider(BASIC_SQL_DIALECT));

	// An AutoCompletion acts as a "middle-man" between a text component
	// and a CompletionProvider. It manages any options associated with
	// the auto-completion (the popup trigger key, whether to display a
	// documentation window along with completion choices, etc.). Unlike
	// CompletionProviders, instances of AutoCompletion cannot be shared
	// among multiple text components.
	AutoCompletion ac = new AutoCompletion(provider);
	ac.install(this);

	requestFocusInWindow();
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:25,代码来源:SQLEditor.java

示例2: doNew

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
public void doNew() {
	RSyntaxTextArea /* JTextArea */textPane;
	textPane = new RSyntaxTextArea();
	textPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
	textPane.setCodeFoldingEnabled(true);
	textPane.setAntiAliasingEnabled(true);
	textPane.addKeyListener(this);
    textPane.getDocument().addDocumentListener(this);
	
    CompletionProvider provider = createCompletionProvider();
    AutoCompletion ac = new AutoCompletion(provider);
    ac.install(textPane);		

    addTab("New file", textPane);
    editorUnChanged.add(textPane);
	fileNames.add(null);
}
 
开发者ID:CompEvol,项目名称:beastshell,代码行数:18,代码来源:EditorPanel.java

示例3: updateLocationCompletionProvider

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
private CompletionProvider updateLocationCompletionProvider(DefaultCompletionProvider provider) {
    provider.clear();

    if (this.pointer == 0) {
        this.locations[0] = "JCR8YTww";
        this.locations[1] = "6gyLvm4K";
        this.locations[2] = "nAinUn1h";
        this.pointer = 3;
    }

    for (int i = 0; i < this.locations.length; i++) {
        if (this.locations[i] == null) {
            break;
        }

        provider.addCompletion(new BasicCompletion(provider, this.locations[i]));
    }

    checkDefaultCompletions(provider);
    return provider;
}
 
开发者ID:Matt529,项目名称:CCAutotyper,代码行数:22,代码来源:AutotyperWindow.java

示例4: createCompletionProvider

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
private CompletionProvider createCompletionProvider()
{
  DefaultCompletionProvider provider = new DefaultCompletionProvider();

  provider.addCompletion(new BasicCompletion(provider, "WM"));
  provider.addCompletion(new BasicCompletion(provider, "Eingabefelder"));
  provider.addCompletion(new BasicCompletion(provider, "Fenster"));
  provider.addCompletion(new BasicCompletion(provider, "Formular"));
  provider.addCompletion(new BasicCompletion(provider, "Tab"));
  provider.addCompletion(new BasicCompletion(provider, "TITLE"));
  provider.addCompletion(new BasicCompletion(provider, "CLOSEACTION"));
  provider.addCompletion(new BasicCompletion(provider, "TIP"));
  provider.addCompletion(new BasicCompletion(provider, "LABEL"));
  provider.addCompletion(new BasicCompletion(provider, "TYPE"));
  provider.addCompletion(new BasicCompletion(provider, "READONLY"));
  provider.addCompletion(new BasicCompletion(provider, "AUTOFILL"));
  provider.addCompletion(new BasicCompletion(provider, "DIALOG"));
  provider.addCompletion(new BasicCompletion(provider, "ID"));
  provider.addCompletion(new BasicCompletion(provider, "HOTKEY"));
  provider.addCompletion(new BasicCompletion(provider, "EDIT"));
  provider.addCompletion(new BasicCompletion(provider, "FRAG_ID"));
  
  return provider;
}
 
开发者ID:WollMux,项目名称:WollMux,代码行数:25,代码来源:ConfigEditor.java

示例5: MethodCompletion

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * Creates a completion for a method discovered when parsing a Java
 * source file.
 *
 * @param provider
 * @param m Meta data about the method.
 */
public MethodCompletion(CompletionProvider provider, Method m) {

	// NOTE: "void" might not be right - I think this might be constructors
	super(provider, m.getName(), m.getType()==null ? "void" : m.getType().toString());
	setDefinedIn(m.getParentTypeDeclaration().getName());
	this.data = new MethodData(m);
	setRelevanceAppropriately();

	int count = m.getParameterCount();
	List params = new ArrayList(count);
	for (int i=0; i<count; i++) {
		FormalParameter param = m.getParameter(i);
		Type type = param.getType();
		String name = param.getName();
		params.add(new ParameterizedCompletion.Parameter(type, name));
	}
	setParams(params);

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

示例6: MethodCompletion

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * Creates a completion for a method discovered when parsing a Java
 * source file.
 *
 * @param provider
 * @param m Meta data about the method.
 */
public MethodCompletion(CompletionProvider provider, Method m) {

	// NOTE: "void" might not be right - I think this might be constructors
	super(provider, m.getName(), m.getType()==null ? "void" : m.getType().toString());
	setDefinedIn(m.getParentTypeDeclaration().getName());
	this.data = new MethodData(m);
	setRelevanceAppropriately();

	int count = m.getParameterCount();
	List<Parameter> params = new ArrayList<Parameter>(count);
	for (int i=0; i<count; i++) {
		FormalParameter param = m.getParameter(i);
		Type type = param.getType();
		String name = param.getName();
		params.add(new Parameter(type, name));
	}
	setParams(params);

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

示例7: generate

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<Completion> generate(CompletionProvider provider, String input){

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

	completions.add(new FontFamilyCompletion(provider, "Georgia"));
	completions.add(new FontFamilyCompletion(provider, "\"Times New Roman\""));
	completions.add(new FontFamilyCompletion(provider, "Arial"));
	completions.add(new FontFamilyCompletion(provider, "Helvetica"));
	completions.add(new FontFamilyCompletion(provider, "Impact"));
	completions.add(new FontFamilyCompletion(provider, "\"Lucida Sans Unicode\""));
	completions.add(new FontFamilyCompletion(provider, "Tahoma"));
	completions.add(new FontFamilyCompletion(provider, "Verdana"));
	completions.add(new FontFamilyCompletion(provider, "Geneva"));
	completions.add(new FontFamilyCompletion(provider, "\"Courier New\""));
	completions.add(new FontFamilyCompletion(provider, "Courier"));
	completions.add(new FontFamilyCompletion(provider, "\"Lucida Console\""));
	completions.add(new FontFamilyCompletion(provider, "Menlo"));
	completions.add(new FontFamilyCompletion(provider, "Monaco"));
	completions.add(new FontFamilyCompletion(provider, "Consolas"));

	return completions;
}
 
开发者ID:bobbylight,项目名称:RSTALanguageSupport,代码行数:27,代码来源:CommonFontCompletionGenerator.java

示例8: generate

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public List<Completion> generate(CompletionProvider provider, String input){

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

	completions.add(new BorderStyleCompletion(provider, "none"));
	completions.add(new BorderStyleCompletion(provider, "hidden"));
	completions.add(new BorderStyleCompletion(provider, "dotted"));
	completions.add(new BorderStyleCompletion(provider, "dashed"));
	completions.add(new BorderStyleCompletion(provider, "solid"));
	completions.add(new BorderStyleCompletion(provider, "double"));
	completions.add(new BorderStyleCompletion(provider, "groove"));
	completions.add(new BorderStyleCompletion(provider, "ridge"));
	completions.add(new BorderStyleCompletion(provider, "inset"));
	completions.add(new BorderStyleCompletion(provider, "outset"));

	return completions;
}
 
开发者ID:bobbylight,项目名称:RSTALanguageSupport,代码行数:22,代码来源:BorderStyleCompletionGenerator.java

示例9: SparqlTextArea

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
public SparqlTextArea() {
	// Whether templates are enabled is a global property affecting all
	// RSyntaxTextAreas, so this method is static.
	RSyntaxTextArea.setTemplatesEnabled( true );

	// Code templates are shared among all RSyntaxTextAreas. You add and
	// remove templates through the shared CodeTemplateManager instance.
	ctm = RSyntaxTextArea.getCodeTemplateManager();

	AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
	atmf.putMapping( "text/sparql", SPARQLTokenMaker.class.getCanonicalName() );

	setSyntaxEditingStyle( "text/sparql" );
	changeStyleViaThemeXml();
	setCodeFoldingEnabled( false );
	setAntiAliasingEnabled( true );
	setLineWrap( true );
	setWrapStyleWord( true );

	Font f = getFont();
	// use a mono-spaced font so indentation works well		
	setFont( new Font( Font.MONOSPACED, f.getStyle(), f.getSize() ) );

	CompletionProvider provider = createCompletionProvider();

	AutoCompletion ac = new AutoCompletion( provider );
	ac.install( this );

	setBracketMatchingEnabled( true );

	// Remove the code-folding component and it's separator from the popup menu:
	JPopupMenu popup = getPopupMenu();
	popup.remove( popup.getComponent( 9 ) ); // the separator
	popup.remove( popup.getComponent( 9 ) ); // the item
	popup.addSeparator();
	popup.add( saver );
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:38,代码来源:SparqlTextArea.java

示例10: createCompletionProvider

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * Create a simple provider that adds some Java-related completions.
 */
private static CompletionProvider createCompletionProvider() {
    DefaultCompletionProvider provider = new DefaultCompletionProvider();

    for (String suggestion : suggestions)
        provider.addCompletion(new BasicCompletion(provider, suggestion));

    return provider;
}
 
开发者ID:CalebABG,项目名称:Sparkz_Engine,代码行数:12,代码来源:ParticleGraph.java

示例11: createCompletion

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
public static org.fife.ui.autocomplete.AbstractCompletion createCompletion(CompletionProvider provider,
		AbstractCompletion c) {
	if (Op.in(c.completionType, schemaCompletions) || !c.hasParameter())
		return new BasicCompletion(provider, c.getPatch());
	else
		return new TemplateCompletion(provider, c.displayName, c.displayName, c.getPatch());
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:8,代码来源:FtcCompletionProvider.java

示例12: createCompletionProvider

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * 
 * @return
 */
private CompletionProvider createCompletionProvider() {
	// TODO -> LanguageSupportFactory.get().register(editor);

	// A DefaultCompletionProvider is the simplest concrete implementation
	// of CompletionProvider. This provider has no understanding of
	// language semantics. It simply checks the text entered up to the
	// caret position for a match against known completions. This is all
	// that is needed in the majority of cases.
	return new MRLCompletionProvider();
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:15,代码来源:PythonGUI.java

示例13: createCompletionProvider

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
CompletionProvider createCompletionProvider() {
	// TODO -> LanguageSupportFactory.get().register(editor);

	// A DefaultCompletionProvider is the simplest concrete implementation
	// of CompletionProvider. This provider has no understanding of
	// language semantics. It simply checks the text entered up to the
	// caret position for a match against known completions. This is all
	// that is needed in the majority of cases.
	return new JavaCompletionProvider();
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:11,代码来源:Editor.java

示例14: ObjectMethodCompletion

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
 * 
 * @param provider
 * @param name
 * @param returnType
 * @param o
 */
public ObjectMethodCompletion(CompletionProvider provider, String name, String returnType, ObjectCompletion o) {
	super(provider, name, returnType);
	
	if (o != null)
		setObjectCompletion(o);
	
	replacementText = name;
	this.name = name;
}
 
开发者ID:gentunian,项目名称:tellapic,代码行数:17,代码来源:ObjectMethodCompletion.java

示例15: completarPotigol

import org.fife.ui.autocomplete.CompletionProvider; //导入依赖的package包/类
/**
* Adiciona o recurso de autocompletar para a linguagem Potigol na
* aba atual.
*/
private void completarPotigol() {
	CompletionProvider provedor = new AutocompletarPotigol().criar();
	AutoCompletion ac = new AutoCompletion(provedor);
	ac.setAutoActivationDelay(300);
	ac.setAutoActivationEnabled(true);
	ac.setAutoCompleteSingleChoices(false);
	ac.setParameterAssistanceEnabled(true);
	ac.setShowDescWindow(true);
	ac.install(lista.get(arquivos.getSelectedIndex()).getRSyntax());
}
 
开发者ID:cristian-henrique,项目名称:JCEditor,代码行数:15,代码来源:JCEditor.java


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