本文整理汇总了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();
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
示例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());
}
示例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();
}
示例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();
}
示例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;
}
示例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());
}