本文整理汇总了Java中org.netbeans.spi.editor.completion.CompletionResultSet.setHasAdditionalItems方法的典型用法代码示例。如果您正苦于以下问题:Java CompletionResultSet.setHasAdditionalItems方法的具体用法?Java CompletionResultSet.setHasAdditionalItems怎么用?Java CompletionResultSet.setHasAdditionalItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.editor.completion.CompletionResultSet
的用法示例。
在下文中一共展示了CompletionResultSet.setHasAdditionalItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: query
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
try {
ClasspathInfo cpInfo = ClasspathInfo.create(doc);
ParserManager.parse(Collections.singleton(Source.create(doc)),
createTask(cpInfo,
component,
resultSet,
doc, caretOffset, queryType)
);
resultSet.setHasAdditionalItems(additionalItems);
resultSet.addAllItems(items);
resultSet.finish();
} catch (ParseException ex) {
Exceptions.printStackTrace(ex);
}
}
示例2: queryImpl
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
private void queryImpl(CompletionResultSet resultSet, Document doc, int caretOffset) throws InterruptedException, ExecutionException {
JavadocContext jdctx = new JavadocContext();
items = new ArrayList<CompletionItem>();
this.caretOffset = caretOffset;
runInJavac(JavaSource.forDocument(doc), jdctx);
if (!ignoreCancel && isTaskCancelled()) {
return;
}
if ((queryType & CompletionProvider.COMPLETION_QUERY_TYPE) != 0) {
if (!items.isEmpty()) {
resultSet.addAllItems(items);
}
resultSet.setHasAdditionalItems(hasAdditionalItems);
}
if (jdctx.anchorOffset >= 0) {
resultSet.setAnchorOffset(jdctx.anchorOffset);
}
}
示例3: populateResultSet
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
private void populateResultSet(CompletionResultSet resultSet, SpringCompletionResult springCompletionResult) {
if(springCompletionResult == SpringCompletionResult.NONE) {
return;
}
resultSet.addAllItems(springCompletionResult.getItems());
if (completor.getAnchorOffset() != -1) {
resultSet.setAnchorOffset(completor.getAnchorOffset());
}
if(springCompletionResult.hasAdditionalItems()) {
resultSet.setHasAdditionalItems(true);
resultSet.setHasAdditionalItemsText(springCompletionResult.getAdditionalItemsText());
}
}