本文整理汇总了Java中org.netbeans.spi.editor.completion.support.AsyncCompletionQuery类的典型用法代码示例。如果您正苦于以下问题:Java AsyncCompletionQuery类的具体用法?Java AsyncCompletionQuery怎么用?Java AsyncCompletionQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AsyncCompletionQuery类属于org.netbeans.spi.editor.completion.support包,在下文中一共展示了AsyncCompletionQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
if(query != null){
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
String docText = null;
try{
docText = NbBundle.getMessage(PUCompletionManager.class, "NAMED_QUERY_TEXT", getSubstitutionText(), entity, query);//NOI18N
} catch (Exception ex){
//just do not have doc by any reason
}
if (docText != null) {
CompletionDocumentation documentation = PersistenceCompletionDocumentation.getAttribValueDoc(docText);
resultSet.setDocumentation(documentation);
}
resultSet.finish();
}
});
}
return null;
}
示例2: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
if (type != null) {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet result, Document doc, int i) {
if (type == Type.DIRECTIVE) {
result.setDocumentation(FTLCompletionItem.getDocForDirective(text));
} else if (type == Type.BUILTIN) {
result.setDocumentation(FTLCompletionItem.getDocForBuiltin(text));
}
result.finish();
}
});
}
return null;
}
示例3: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
return null;
}
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
//Iterate through the available locales
//and assign each country display name
//to a CompletionResultSet:
String text = DocumentHelper.getWordBeforeCaret(doc, caretOffset);
CompletionProposals[] words = CompletionProposals.values();
Arrays.sort(words);
for (CompletionProposals word : words) {
final String name = word.name().toLowerCase();
if (name.startsWith(text)) {
resultSet.addItem(new RTCompletionItem(name, caretOffset));
}
}
resultSet.finish();
}
}, component);
}
示例4: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
CompletionDocumentation docItem = SpringXMLConfigCompletionDoc.createBeanRefDoc(beanId,
beanNames, beanClass, beanLocFile, goToBeanAction);
resultSet.setDocumentation(docItem);
resultSet.finish();
}
});
}
示例5: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
if (docText != null) {
CompletionDocumentation documentation = HibernateCompletionDocumentation.getAttribValueDoc(docText);
resultSet.setDocumentation(documentation);
}
resultSet.finish();
}
});
}
示例6: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
/**
* Returns a task used to obtain a documentation associated with the item if
* there is any.
*
* @return CompletionTask
*/
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new ThymeleafCompletionDocumentation(ThymeleafCompletionItem.this));
completionResultSet.finish();
}
});
}
示例7: createToolTipTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
/**
* Returns a task used to obtain a tooltip hint associated with the item if
* there is any.
*
* @return CompletionTask
*/
@Override
public CompletionTask createToolTipTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
JToolTip toolTip = new JToolTip();
toolTip.setTipText("Press Enter to insert \"" + text + "\"");
completionResultSet.setToolTip(toolTip);
completionResultSet.finish();
}
});
}
示例8: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet
.setDocumentation(new CfgPropCompletionDocumentation(CfgPropCompletionItem.this, bootService));
completionResultSet.finish();
}
});
}
示例9: createToolTipTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createToolTipTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
JToolTip toolTip = new JToolTip();
toolTip.setTipText("Press Enter to insert \"" + getText() + "\"");
completionResultSet.setToolTip(toolTip);
completionResultSet.finish();
}
});
}
示例10: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new CfgPropValueCompletionDocumentation(CfgPropValueCompletionItem.this));
completionResultSet.finish();
}
});
}
示例11: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new ShellScriptCompletionDocumentation(item));
completionResultSet.finish();
}
});
}
示例12: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new RoutesHTTPMethodCompletionDocumentation(RoutesHTTPMethodCompletionItem.this));
completionResultSet.finish();
}
});
}
示例13: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new ConfCompletionDocumentation(item));
completionResultSet.finish();
}
});
}
示例14: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new SpringBootConfigurationCompletionDocumentation(SpringBootConfigurationCompletionItem.this));
completionResultSet.finish();
}
});
}
开发者ID:keevosh,项目名称:nb-springboot-configuration-support,代码行数:11,代码来源:SpringBootConfigurationCompletionItem.java
示例15: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionQuery; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
MethodCompletionDocumentation doc = new MethodCompletionDocumentation(MirahMethodCompletionItem.this);
// Get the text in this query to cache it so that it doesn't block the UI thread.
doc.getText();
completionResultSet.setDocumentation(doc);
completionResultSet.finish();
}
});
}