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


Java CompletionTask类代码示例

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


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

示例1: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例2: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例3: testPlainContent

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
public void testPlainContent() throws Exception {
    MockGrammarResult r = new MockGrammarResult();
    
    r.setDescription(PLAIN_DESCRIPTION_TEXT);
    ElementResultItem item = new ElementResultItem(0, r);
    CompletionTask task = item.doCreateDocumentationTask(r);

    CompletionResultSet rs = resultSetFor(task, CompletionProvider.DOCUMENTATION_QUERY_TYPE);
    task.query(rs);
    
    assertTrue(rs.isFinished());
    
    assertEquals(PLAIN_DESCRIPTION_TEXT, rsImpl.getDocumentation().getText());
 
    // should return null from the url.
    assertNull(rsImpl.getDocumentation().getURL());
    
    // should not be able to resolve links
    assertNull(rsImpl.getDocumentation().resolveLink("link"));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ElementResultItemDocumentationTest.java

示例4: createDocResourceResultSet

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
private CompletionDocumentation createDocResourceResultSet(MockUrlGrammarResult r) throws Exception {
    if (r == null) {
        r = new MockUrlGrammarResult();
        r.setContentURL(createResourceName("res/docResource.html"));
        r.setExternal(true);
    }
    
    ElementResultItem item = new ElementResultItem(0, r);
    CompletionTask task = item.doCreateDocumentationTask(r);
    CompletionResultSet rs = resultSetFor(task, CompletionProvider.DOCUMENTATION_QUERY_TYPE);
    task.query(rs);

    assertTrue(rs.isFinished());
    
    return rsImpl.getDocumentation();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ElementResultItemDocumentationTest.java

示例5: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例6: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例7: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例8: createDocumentationTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
    if(delegate != null) {
        return delegate.createDocumentationTask();
    }
    
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LazyTypeCompletionItem.java

示例9: createToolTipTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createToolTipTask() {
    if(delegate != null) {
        return delegate.createToolTipTask();
    }
    
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:LazyTypeCompletionItem.java

示例10: createDocumentationTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例11: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例12: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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

示例13: createDocumentationTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
    final ElementHandle element = item.getElement();
    if (element != null) {
        return GsfCompletionProvider.createDocTask(element,info);
    }

    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:GsfCompletionItem.java

示例14: createTask

import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的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.CompletionTask; //导入依赖的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


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