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


Java CompletionResultSet.setDocumentation方法代码示例

本文整理汇总了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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:CodeTemplateCompletionItem.java

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

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

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

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

示例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();
        }
    });
}
 
开发者ID:ArturWisniewski,项目名称:NB-Thymeleaf-Code-Completion,代码行数:17,代码来源:ThymeleafCompletionItem.java

示例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();
        }
    });
}
 
开发者ID:AlexFalappa,项目名称:nb-springboot,代码行数:12,代码来源:CfgPropCompletionItem.java

示例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();
        }
    });
}
 
开发者ID:AlexFalappa,项目名称:nb-springboot,代码行数:11,代码来源:CfgPropValueCompletionItem.java

示例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();
        }
    });
}
 
开发者ID:pedrohidalgo,项目名称:nbshell,代码行数:11,代码来源:ShellScriptCompletionItem.java

示例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();
        }
    });
}
 
开发者ID:pedrohidalgo,项目名称:pleasure,代码行数:11,代码来源:RoutesHTTPMethodCompletionItem.java

示例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();
        }
    });
}
 
开发者ID:pedrohidalgo,项目名称:pleasure,代码行数:11,代码来源:ConfCompletionItem.java

示例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();
        }
    });
}
 
开发者ID:shannah,项目名称:mirah-nbm,代码行数:14,代码来源:MirahMethodCompletionItem.java

示例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();
                }
            });
        }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:16,代码来源:GlslCompletionProvider.java

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


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