• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AsyncCompletionTask类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AsyncCompletionTask类属于org.netbeans.spi.editor.completion.support包,在下文中一共展示了AsyncCompletionTask类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:JPACompletionItem.java


示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:CommandCompletionProvider.java


示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:HistoryCompletionProvider.java


示例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;
}
 
开发者ID:rostanek,项目名称:freemarker-support-for-netbeans,代码行数:19,代码来源:FTLCompletionItem.java


示例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);
}
 
开发者ID:iti-luebeck,项目名称:RTeasy2,代码行数:26,代码来源:RTCompletionProvider.java


示例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;
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:17,代码来源:AddOnCompletionProvider.java


示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:JPQLEditorCodeCompletionProvider.java


示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:PUCompletionProvider.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:SchemaBasedCompletionProvider.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:WordCompletion.java


示例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();
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SpringXMLConfigCompletionItem.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:SpringXMLConfigCompletionProvider.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:SearchCompletion.java


示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:GsfCompletionProvider.java


示例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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:GsfCompletionProvider.java


示例16: createTask

import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createTask(int queryType, JTextComponent component) {
    if (component == null) {
        return null;
    }
    return new AsyncCompletionTask(new Q(component, queryType), component);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:FXMLCompletion2.java


示例17: createTask

import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
@Override
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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:JavaCompletionProvider.java


示例18: createTask

import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
public CompletionTask createTask(int queryType, JTextComponent component) {
    if( queryType != CompletionProvider.COMPLETION_QUERY_TYPE ) 
        return null;
    
        return new AsyncCompletionTask(new HibernateCfgCompletionQuery(queryType,
                component.getSelectionStart()), component);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:HibernateCfgCompletionProvider.java


示例19: createTask

import org.netbeans.spi.editor.completion.support.AsyncCompletionTask; //导入依赖的package包/类
public CompletionTask createTask(int queryType, JTextComponent component) {
    if( queryType != CompletionProvider.COMPLETION_QUERY_TYPE ) 
        return null;
    
        return new AsyncCompletionTask(new HibernateRevengCompletionQuery(queryType,
                component.getSelectionStart()), component);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:HibernateRevengCompletionProvider.java


示例20: 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) {
            if (docText != null) {
                CompletionDocumentation documentation = HibernateCompletionDocumentation.getAttribValueDoc(docText);
                resultSet.setDocumentation(documentation);
            }
            resultSet.finish();
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:HibernateCompletionItem.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OutputStream类代码示例发布时间:2022-05-21
下一篇:
Java ArtifactMetadataRetrievalException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap