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


Java BasicCompletion类代码示例

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


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

示例1: addDirectives

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
/**
 * Adds the directives to the auto-complete options.
 */
private void addDirectives() {
	String desc = Lang.t("directive"), summ;
	
	summ = "<b><u><tt>.text </tt> (" + Lang.t("directive") + ")</u></b><br /><br /><dl>";
	summ += "<dt><b>" + Lang.t("usage") + ":</b></dt><dd><pre>.text</pre></dd>";
	summ += "<dt><br /><b>" + Lang.t("description") + ":</b></dt><dd>" + Lang.t("text_directive_description") +"</dd></dl>";
	completeProvider.addCompletion(new BasicCompletion(completeProvider, ".text", desc, summ));
	
	if(cpu.hasDataMemory()) {
		summ = "<b><u><tt>.data </tt> (" + Lang.t("directive") + ")</u></b><br /><br /><dl>";
		summ += "<dt><b>" + Lang.t("usage") + ":</b></dt><dd><pre>.data</pre></dd>";
		summ += "<dt><br /><b>" + Lang.t("description") + ":</b></dt><dd>" + Lang.t("data_directive_description") +"</dd></dl>";
		completeProvider.addCompletion(new BasicCompletion(completeProvider, ".data", desc, summ));

		summ = "<b><u><tt>.word </tt> (" + Lang.t("directive") + ")</u></b><br /><br /><dl>";
		summ += "<dt><b>" + Lang.t("usage") + ":</b></dt><dd><pre>.word 20, -13, 56, ...</pre></dd>";
		summ += "<dt><br /><b>" + Lang.t("description") + ":</b></dt><dd>" + Lang.t("word_directive_description") +"</dd></dl>";
		completeProvider.addCompletion(new BasicCompletion(completeProvider, ".word", desc, summ));

		summ = "<b><u><tt>.space </tt> (" + Lang.t("directive") + ")</u></b><br /><br /><dl>";
		summ += "<dt><b>" + Lang.t("usage") + ":</b></dt><dd><pre>.space 16</pre></dd>";
		summ += "<dt><br /><b>" + Lang.t("description") + ":</b></dt><dd>" + Lang.t("space_directive_description") +"</dd></dl>";
		completeProvider.addCompletion(new BasicCompletion(completeProvider, ".space", desc, summ));
	}
}
 
开发者ID:brunonova,项目名称:drmips,代码行数:29,代码来源:CodeEditor.java

示例2: CustomCodeSyntaxPane

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
public CustomCodeSyntaxPane() {

		panel = new JPanel(new BorderLayout());
		textArea = new RSyntaxTextArea();
		textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
		textArea.setAntiAliasingEnabled(true);
		textArea.setCodeFoldingEnabled(true);
		textArea.setFont(DerivedConfig.getPanelContentFont());

		// setup autocompletion
		for (String word : getAutocompletionStrings()) {
			provider.addCompletion(new BasicCompletion(provider, word));
		}
		new AutoCompletion(provider).install(textArea);

		scrollPane = new RTextScrollPane(textArea);
		scrollPane.setFoldIndicatorEnabled(true);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		panel.add(scrollPane);
		textArea.getDocument().putProperty(PlainDocument.tabSizeAttribute, 3); // Reduce tab size
	}
 
开发者ID:umlet,项目名称:umlet,代码行数:23,代码来源:CustomCodeSyntaxPane.java

示例3: createAutocompletionCompletionProvider

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
/**
 * create one per class
 * @param strings
 */
private void createAutocompletionCompletionProvider() {
	provider.clear();
	for (AutocompletionText word : words) {
		provider.addCompletion(new BasicCompletion(provider, word.getText(), word.getInfo()) {
			@Override
			public String toString() {
				if (getShortDescription() == null) {
					return getInputText();
				}
				return getInputText() + SEPARATOR + getShortDescription();
			}
		});
	}

}
 
开发者ID:umlet,项目名称:umlet,代码行数:20,代码来源:OwnSyntaxPane.java

示例4: updateCompletionProvider

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
/**
 * para o editor do jifi usar:
 *
 * updateCompletionProvider("s3f.jifi.functions.*","tokenInfo");
 * updateCompletionProvider("s3f.jifi.functions.*","tokenInfo");
 *
 *
 * @param em
 * @param path
 * @param property
 */
public final void updateCompletionProvider(EntityManager em, String path, String property) {

    AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
    TokenMaker tokenMaker = atmf.getTokenMaker(textArea.getSyntaxEditingStyle());
    TokenMap tokenMap = null;
    if (tokenMaker instanceof ExtensibleTokenMaker) {
        tokenMap = ((ExtensibleTokenMaker) tokenMaker).getTokenMap();
    }

    for (Object o : em.getAllProperties(path, property, Object.class)) {
        if (o instanceof Completion) {
            completionProvider.addCompletion((Completion) o);
            if (tokenMap != null) {
                //TODO: verificar!
                tokenMap.put(((Completion) o).getReplacementText(), Token.FUNCTION);
            }
        } else {
            completionProvider.addCompletion(
                    new BasicCompletion(completionProvider, o.toString())
            );
            if (tokenMap != null) {
                //TODO: verificar!
                tokenMap.put(o.toString(), Token.DATA_TYPE);
            }
        }
    }
}
 
开发者ID:anderson-,项目名称:S3F,代码行数:39,代码来源:CodeEditorTab.java

示例5: updateLocationCompletionProvider

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的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

示例6: createCompletionProvider

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的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

示例7: createCompletionProvider

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的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

示例8: getSchemaValueCompletions

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
public List<Completion> getSchemaValueCompletions(JTextComponent comp) {
	List<Completion> result = new ArrayList<Completion>();

	String text = comp.getText();
	int caretPosition = comp.getCaretPosition();

	for (AbstractCompletion c : completionsSource.get(text, caretPosition).getAll())
		if (Op.in(c.completionType, schemaCompletions))
			result.add(new BasicCompletion(this, c.displayName));

	return result;
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:13,代码来源:FtcCompletionProvider.java

示例9: createCompletion

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的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

示例10: setAutoComplete

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
/**
 * Sets the auto-complete options for the given CPU.
 */
private void setAutoComplete() {
	completeProvider.clear();
	String desc;
	
	for(Instruction instruction: cpu.getInstructionSet().getInstructions()) { // add instructions
		completeProvider.addCompletion(new BasicCompletion(completeProvider, instruction.getMnemonic(), instruction.getUsage(), getInstructionSummary(instruction)));
	}
	
	for(PseudoInstruction pseudo: cpu.getInstructionSet().getPseudoInstructions()) { // add pseudo-instructions
		completeProvider.addCompletion(new BasicCompletion(completeProvider, pseudo.getMnemonic(), pseudo.getUsage(), getInstructionSummary(pseudo)));
	}
	
	addDirectives();
}
 
开发者ID:brunonova,项目名称:drmips,代码行数:18,代码来源:CodeEditor.java

示例11: checkDefaultCompletions

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
private void checkDefaultCompletions(DefaultCompletionProvider provider) {

        final List<Completion> bubbles = Lists.newArrayList();
        final List<Completion> milkshake = Lists.newArrayList();
        final List<Completion> calc = Lists.newArrayList();

        if (provider.getCompletionByInputText("JCR8YTww") != null) {
            bubbles.addAll(provider.getCompletionByInputText("JCR8YTww"));
        }

        if (provider.getCompletionByInputText("6gyLvm4K") != null) {
            milkshake.addAll(provider.getCompletionByInputText("6gyLvm4K"));
        }

        if (provider.getCompletionByInputText("nAinUn1h") != null) {
            calc.addAll(provider.getCompletionByInputText("nAinUn1h"));
        }

        if (bubbles.size() != 0) {
            provider.removeCompletion(bubbles.get(0));
            provider.addCompletion(new BasicCompletion(provider, "JCR8YTww", "Bubbles! by KingofGamesYami"));
        }
        if (milkshake.size() != 0) {
            provider.removeCompletion(milkshake.get(0));
            provider.addCompletion(new BasicCompletion(provider, this.locations[1], "Milkshake GUI by lednerg"));
        }
        if (calc.size() != 0) {
            provider.removeCompletion(calc.get(0));
            provider.addCompletion(new BasicCompletion(provider, this.locations[2], "Advanced Calculator by Cranium"));
        }

    }
 
开发者ID:Matt529,项目名称:CCAutotyper,代码行数:33,代码来源:AutotyperWindow.java

示例12: createCompletionProvider

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

    URL[] urls = new URL[3];
    urls[0] = getClass().getResource("/openlatexstudio/tex.cwl");
    urls[1] = getClass().getResource("/openlatexstudio/latex-document.cwl");
    urls[2] = getClass().getResource("/openlatexstudio/latex-mathsymbols.cwl");

    for (URL url : urls) {
        InputStream is = null;
        try {
            is = url.openStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String line;
            while ((line = br.readLine()) != null) {
                if (!line.startsWith("#")) {
                    provider.addCompletion(new BasicCompletion(provider, line.substring(1)));
                }
            }
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        } finally {
            IOUtils.closeQuietly(is);
        }
    }

    return provider;
}
 
开发者ID:sebbrudzinski,项目名称:Open-LaTeX-Studio,代码行数:30,代码来源:EditorTopComponent.java

示例13: createStringCompletionProvider

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
/**
 * Returns the completion provider to use when the caret is in a string.
 *
 * @return The provider.
 * @see #createCodeCompletionProvider()
 * @see #createCommentCompletionProvider()
 */
protected CompletionProvider createStringCompletionProvider() {
	DefaultCompletionProvider cp = new DefaultCompletionProvider();
	cp.addCompletion(new BasicCompletion(cp, "%c", "char", "Prints a character"));
	cp.addCompletion(new BasicCompletion(cp, "%i", "signed int", "Prints a signed integer"));
	cp.addCompletion(new BasicCompletion(cp, "%f", "float", "Prints a float"));
	cp.addCompletion(new BasicCompletion(cp, "%s", "string", "Prints a string"));
	cp.addCompletion(new BasicCompletion(cp, "%u", "unsigned int", "Prints an unsigned integer"));
	cp.addCompletion(new BasicCompletion(cp, "\\n", "Newline", "Prints a newline"));
	return cp;
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:18,代码来源:CCompletionProvider.java

示例14: addMembersImpl

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
private void addMembersImpl(List<? extends Completion> members,
		String alreadyEntered, List<Completion> list) {

	BasicCompletion alreadyEnteredC = new BasicCompletion(null, alreadyEntered);
	int index = Collections.binarySearch(members, alreadyEnteredC, completionComparator);
	if (index<0) { // No exact match
		index = -index - 1;
	}
	else {
		// If there are several overloads for the function being
		// completed, Collections.binarySearch() will return the index
		// of one of those overloads, but we must return all of them,
		// so search backward until we find the first one.
		int pos = index - 1;
		while (pos>0 && completionComparator.compare(
						members.get(pos), alreadyEnteredC)==0) {
			list.add(members.get(pos));
			pos--;
		}
	}

	while (index<members.size()) {
		Completion c = members.get(index);
		if (Util.startsWithIgnoreCase(c.getInputText(), alreadyEntered)) {
			list.add(c);
			index++;
		}
		else {
			break;
		}
	}

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

示例15: getVariableCompletions

import org.fife.ui.autocomplete.BasicCompletion; //导入依赖的package包/类
/**
 * Does a crude search for variables up to the caret position.
 *
 * @param comp The text area.
 * @return The completions for variables, or <code>null</code> if there
 *         were none.
 */
private SortedSet<Completion> getVariableCompletions(String text, int dot) {

	if (text==null) {
		return null;
	}

	SortedSet<Completion> varCompletions = new TreeSet<Completion>(completionComparator);

	// Go through all code blocks in scope and look for variables
	// declared before the caret.
	VariablesInScopeGrabber varGrabber = new VariablesInScopeGrabber(dot);
	ast.getRootNode().accept(varGrabber);
	List<VariableDecNode> varList = varGrabber.getVariableList();
	for (VariableDecNode varDec : varList) {
		VariableCompletion vc = new ZScriptVariableCompletion(this, varDec);
		varCompletions.add(vc);
	}
	List<FunctionDecNode> funcList = varGrabber.getFunctionList();
	for (FunctionDecNode funcDec : funcList) {
		FunctionCompletion fc = new ZScriptFunctionCompletion(this, funcDec);
		varCompletions.add(fc);
	}

	// Get only those that match what's typed
	if (varCompletions.size()>0) {
		Completion start = new BasicCompletion(null, text);
		Completion end = new BasicCompletion(null, text + '{');
		varCompletions = varCompletions.subSet(start, end);
	}

	return varCompletions;

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


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