本文整理汇总了Java中org.netbeans.spi.editor.completion.support.AsyncCompletionTask类的典型用法代码示例。如果您正苦于以下问题:Java AsyncCompletionTask类的具体用法?Java AsyncCompletionTask怎么用?Java AsyncCompletionTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AsyncCompletionTask类属于org.netbeans.spi.editor.completion.support包,在下文中一共展示了AsyncCompletionTask类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的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: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
int a = isFirstJavaLine(component);
if ((queryType != COMPLETION_ALL_QUERY_TYPE && queryType != COMPLETION_QUERY_TYPE) ||
isFirstJavaLine(component) == -1) {
return null;
}
// check that the caret is at the first line of the editable area:
ShellSession session = checkInputSection(component);
if (session == null) {
return null;
}
return new AsyncCompletionTask(new T(
session,
session.getModel(),
session.getModel().getInputSection()
), component);
}
示例3: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, final JTextComponent component) {
int a = isFirstJavaLine(component);
if (queryType != COMPLETION_ALL_QUERY_TYPE) {
if (queryType != COMPLETION_QUERY_TYPE || a != 0) {
return null;
}
}
// check that the caret is at the first line of the editable area:
ShellSession session = checkInputSection(component);
if (session == null) {
return null;
}
return new AsyncCompletionTask(new T(
session,
session.getModel(),
session.getModel().getInputSection()
), component);
}
示例4: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的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;
}
示例5: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的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);
}
示例6: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask( int queryType, JTextComponent component )
{
if (VaadinConfiguration.getInstance().isAddonCodeCompletionEnabled()) {
VaadinSupport support = getSupport(component.getDocument());
if (support == null || !support.isEnabled()) {
return null;
}
if (queryType == CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {
return new AsyncCompletionTask(new AddonCompletionQuery(
component.getSelectionStart()), component);
}
}
return null;
}
示例7: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE && queryType != CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {
return null;
}
return new AsyncCompletionTask(new JPACodeCompletionQuery(queryType, component, component.getSelectionStart(), true), component);
}
示例8: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE && queryType !=CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {
return null;
}
return new AsyncCompletionTask(new PUCompletionQuery(queryType, component, component.getSelectionStart(), true), component);
}
示例9: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
public CompletionTask createTask(int queryType, JTextComponent component) {
if (queryType == COMPLETION_QUERY_TYPE || queryType == COMPLETION_ALL_QUERY_TYPE) {
return new AsyncCompletionTask(new CompletionQuery(CompletionUtil.getPrimaryFile(component.getDocument())), component);
}
return null;
}
示例10: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
public CompletionTask createTask(int queryType, JTextComponent component) {
if (queryType == COMPLETION_QUERY_TYPE) {
return new AsyncCompletionTask(new Query(), component);
}
return null;
}
示例11: createDocumentationTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的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();
}
});
}
示例12: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
if ((queryType & COMPLETION_QUERY_TYPE) == COMPLETION_QUERY_TYPE) {
return new AsyncCompletionTask(new SpringXMLConfigCompletionQuery(queryType), component);
}
return null;
}
示例13: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
if (queryType == COMPLETION_QUERY_TYPE) {
return new AsyncCompletionTask(new Query(), component);
}
return null;
}
示例14: createTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
public CompletionTask createTask(int type, JTextComponent component) {
if (((type & COMPLETION_QUERY_TYPE) != 0) || (type == TOOLTIP_QUERY_TYPE) ||
(type == DOCUMENTATION_QUERY_TYPE)) {
return new AsyncCompletionTask(new JavaCompletionQuery(type,
component.getSelectionStart()), component);
}
return null;
}
示例15: createDocTask
import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
static CompletionTask createDocTask(ElementHandle element, ParserResult info) { // TODO - use ComObjectHandle ??
JavaCompletionQuery query = new JavaCompletionQuery(DOCUMENTATION_QUERY_TYPE, -1);
query.element = element;
//return new AsyncCompletionTask(query, Registry.getMostActiveComponent());
return new AsyncCompletionTask(query, EditorRegistry.lastFocusedComponent());
}