本文整理汇总了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);
}
示例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);
}
示例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"));
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例8: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
if(delegate != null) {
return delegate.createDocumentationTask();
}
return null;
}
示例9: createToolTipTask
import org.netbeans.spi.editor.completion.CompletionTask; //导入依赖的package包/类
@Override
public CompletionTask createToolTipTask() {
if(delegate != null) {
return delegate.createToolTipTask();
}
return null;
}
示例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();
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}