本文整理汇总了Java中org.netbeans.spi.editor.completion.CompletionResultSet.setDocumentation方法的典型用法代码示例。如果您正苦于以下问题:Java CompletionResultSet.setDocumentation方法的具体用法?Java CompletionResultSet.setDocumentation怎么用?Java CompletionResultSet.setDocumentation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.editor.completion.CompletionResultSet
的用法示例。
在下文中一共展示了CompletionResultSet.setDocumentation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: query
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
protected void query(CompletionResultSet resultSet, Document doc, int caretOffset) {
StringBuffer sb = new StringBuffer(); // NOI18N
sb.append("<html><pre>"); //NOI18N
ParametrizedTextParser.parseToHtml(sb, codeTemplate.getParametrizedText());
sb.append("</pre>"); // NOI18N
String desc = codeTemplate.getDescription();
if (desc != null && desc.length() > 0) {
sb.append("<p>").append(desc).append("</p>"); //NOI18N
}
// Append abbreviation
CodeTemplateManagerOperation operation = CodeTemplateApiPackageAccessor.get().getOperation(codeTemplate);
sb.append("<p>"); //NOI18N
sb.append(NbBundle.getMessage(CodeTemplateCompletionItem.class,
"DOC_ITEM_Abbreviation", //NOI18N
ParametrizedTextParser.toHtmlText(codeTemplate.getAbbreviation()),
operation.getExpandKeyStrokeText()
));
sb.append("<p>"); //NOI18N
resultSet.setDocumentation(new DocItem(sb.toString()));
resultSet.finish();
}
示例2: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的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;
}
示例3: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的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();
}
});
}
示例4: query
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public void query(CompletionResultSet resultSet) {
String cmd = "/" + command + " ";
String doc = shellTool.commandDocumentation(cmd, cmd.length(), false);
////COMMENTED BY MERGE
//=======
// String doc = session.getJShellTool().commandDocumentation(cmd, cmd.length(), false);
//>>>>>>> merge rev
if (doc == null) {
resultSet.finish();
return;
}
String[] lines = doc.split("\n"); // NOI18N
StringBuilder htmlStringContents = new StringBuilder();
String match = "^/" + command;
Pattern p = Pattern.compile(match);
boolean paragraph = false;
for (String l : lines) {
String l2 = l.trim();
if (l2.isEmpty() && !paragraph) {
htmlStringContents.append("<p/>"); // NOI18N
paragraph = true;
} else {
paragraph = false;
}
if (p.matcher(l).find()) {
htmlStringContents.append("<code><pre><b>").append(l).append("</b></pre></code><br/>"); // NOI18N
} else {
String emphasis = l.replaceAll("(/\\p{Alpha}+)", "<code><i><u>$1</u></i><code>");
htmlStringContents.append(emphasis).append(" "); // NOI18N
}
}
this.htmlText = htmlStringContents.toString();
resultSet.setDocumentation(this);
resultSet.finish();
}
示例5: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的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();
}
});
}
示例6: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
/**
* Returns a task used to obtain a documentation associated with the item if
* there is any.
*
* @return CompletionTask
*/
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new ThymeleafCompletionDocumentation(ThymeleafCompletionItem.this));
completionResultSet.finish();
}
});
}
示例7: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet
.setDocumentation(new CfgPropCompletionDocumentation(CfgPropCompletionItem.this, bootService));
completionResultSet.finish();
}
});
}
示例8: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new CfgPropValueCompletionDocumentation(CfgPropValueCompletionItem.this));
completionResultSet.finish();
}
});
}
示例9: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new ShellScriptCompletionDocumentation(item));
completionResultSet.finish();
}
});
}
示例10: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new RoutesHTTPMethodCompletionDocumentation(RoutesHTTPMethodCompletionItem.this));
completionResultSet.finish();
}
});
}
示例11: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new ConfCompletionDocumentation(item));
completionResultSet.finish();
}
});
}
示例12: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(new SpringBootConfigurationCompletionDocumentation(SpringBootConfigurationCompletionItem.this));
completionResultSet.finish();
}
});
}
开发者ID:keevosh,项目名称:nb-springboot-configuration-support,代码行数:11,代码来源:SpringBootConfigurationCompletionItem.java
示例13: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
return new AsyncCompletionTask(new AsyncCompletionQuery() {
@Override
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
MethodCompletionDocumentation doc = new MethodCompletionDocumentation(MirahMethodCompletionItem.this);
// Get the text in this query to cache it so that it doesn't block the UI thread.
doc.getText();
completionResultSet.setDocumentation(doc);
completionResultSet.finish();
}
});
}
示例14: createDocumentationTask
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
public CompletionTask createDocumentationTask() {
if (content.doc == null) {
return null;
}
return new AsyncCompletionTask(new AsyncCompletionQuery() {
private GlslDocItem item = new GlslDocItem(key, content);
protected void query(CompletionResultSet completionResultSet, Document document, int i) {
completionResultSet.setDocumentation(item);
completionResultSet.finish();
}
});
}
示例15: query
import org.netbeans.spi.editor.completion.CompletionResultSet; //导入方法依赖的package包/类
@Override
protected void query( CompletionResultSet resultSet, Document document,
int offset )
{
resultSet.setDocumentation(new AddonCompletionDoc(myClass));
resultSet.finish();
}