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


Java HtmlCanvas类代码示例

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


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

示例1: generateNode

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
@Override
public void generateNode(ContentNode contentNode, HtmlCanvas html) throws IOException {
    String widget = "<@" + contentNode.getWidget() + " ";

    if (contentNode.getParameterValues() != null) {
        for (String key : contentNode.getParameterValues().keySet()) {
            Object value = contentNode.getParameterValues().get(key);
            if (value != null && !value.toString().isEmpty())
                widget += key + "=\"" + value.toString() + "\" ";
        }
    }
    widget += "/>";

    html/* .div(class_(contentNode.getCss())) */.write(widget,
        false)/* ._div() */;
}
 
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:17,代码来源:DefaultWidgetNodeGenerator.java

示例2: generateNode

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
@Override
public void generateNode(ContentNode contentNode, HtmlCanvas html) throws IOException {
    /*
     * String widget = "<@" + contentNode.getContent() + " ";
     * 
     * if (contentNode.getParameters() != null) { for (String key :
     * contentNode.getParameters().keySet()) { String value =
     * contentNode.getParameters().get(key); if (key.equals("product")) {
     * Product product = products.havingArticleNumber(value); if (product !=
     * null) { value = product.getId().str(); key = "product_id"; } } if
     * (value != null && !value.isEmpty()) widget += key + "=\"" + value +
     * "\" "; } } widget += "/>";
     * 
     * html.div(class_(contentNode.getCss())).write(widget, false)._div();
     */
}
 
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:17,代码来源:ImageProductWidgetNodeGenerator.java

示例3: generateNode

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
protected void generateNode(StructureNode structureNode, HtmlCanvas html, Content content) throws IOException {
    if (structureNode.getNodes() != null && structureNode.getNodes().size() > 0) {
        html.div(class_(structureNode.getCss()));
        for (StructureNode childNode : structureNode.getNodes()) {
            generateNode(childNode, html, content);
        }
        html._div();
    } else {
        html.div(class_(structureNode.getCss()));
        if (!StringUtils.isBlank(structureNode.getNodeId())) {
            if (content.getContentNodes() != null) {
                Optional<ContentNode> node = content.getContentNodes().stream()
                    .filter(n -> n.getNodeId().equals(structureNode.getNodeId())).findFirst();
                if (node.isPresent()) {
                    generateNode(node.get(), html);
                }
            }
        }
        html._div();
    }
}
 
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:22,代码来源:DefaultContentService.java

示例4: renderOn

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
@Override
		public void renderOn(HtmlCanvas html) throws IOException {
			String projectName;
			if ("project.name".equals(projectNameProperty)) {
				projectName = project.getName();
			} else {
				projectName = project.getProperties().getProperty(projectNameProperty);
			}
			String outputDirectory = project.getProperties().getProperty("project.build.test.directory");
//			String outputDirectory = project.getProperties().getProperty(outputDirectoryProperty);
//			String outputDirectory = project.getBuild().getOutputDirectory();
			File projectLink = getTheNewestFile(new File(outputDirectory), "html");

			if (projectLink != null) {
				html.li().a(href(project.getArtifactId() + "/" + projectLink.getName()).target("content")).write(projectName)._a()._li();
			}
		}
 
开发者ID:fastconnect,项目名称:tibco-fcunit,代码行数:18,代码来源:MenuPage.java

示例5: renderHierarchy

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void renderHierarchy(HtmlCanvas html, ClassDocAccess classDocAccess) throws IOException {
    List<Type> hierarchy = classDocAccess.getHierarchy();
    if (!hierarchy.isEmpty()) {
        html.div(class_("hierarchy"));
        for (int cnt = 0; cnt < hierarchy.size(); cnt++) {
            int flags = ClassNameRenderable.FQN;
            if (cnt < hierarchy.size() - 1) {
                flags |= ClassNameRenderable.LINK;
            }
            html.p(style("text-indent:" + cnt * 2 + "em;")).write(cnt > 0 ? "&#8627;" : "&nbsp;",
                    false).render(new ClassNameRenderable(generator, hierarchy.get(cnt), flags))._p();
        }
        html._div();
    } else {
        html.div(class_("separator")).close();
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:18,代码来源:ClassContentRenderable.java

示例6: renderConstructorsSummary

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void renderConstructorsSummary(HtmlCanvas html, ClassDocAccess classDocAccess) throws IOException {
    TableRenderer tableRenderer = new TableRenderer(2, "Constructors");

    List<ConstructorDoc> constructors = classDocAccess.getConstructors(true);
    for (ConstructorDoc constructorDoc : constructors) {
        if (!constructorDoc.isSynthetic()) {
            tableRenderer.startRow(html);
            html.td().write(constructorDoc.modifiers())._td();
            html.td().a(href("#" + getAnchor(constructorDoc))).content(constructorDoc.name());
            renderExecutableMemberParams(html, constructorDoc);
            html.br();
            html.p(class_("indent")).render(new InlineTagsRenderer(generator, constructorDoc.firstSentenceTags(),
                    constructorDoc.position()))._p();
            html._td();
            tableRenderer.closeRow(html);
        }
    }
    tableRenderer.closeTable(html);
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:20,代码来源:ClassContentRenderable.java

示例7: renderConstructors

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void renderConstructors(HtmlCanvas html, ClassDocAccess classDoc) throws IOException {
    List<ConstructorDoc> constructors = classDoc.getConstructors(false);
    if (constructors.size() > 0) {
        html.h2().content("Constructors");
    }
    for (ConstructorDoc constructor : constructors) {
        html.div(class_("api")).a(name(getAnchor(constructor)))._a();
        html.write(constructor.modifiers()).write(' ').strong().content(constructor.name());
        renderExecutableMemberParams(html, constructor);
        html._div();
        renderDeprecated(html, constructor);
        html.p().render(new InlineTagsRenderer(generator, constructor.inlineTags(), constructor.position()))._p();
        if (constructor.paramTags().length > 0) {
            html.h4().content("Parameters:");
            html.p(class_("indent"));
            for (ParamTag param : constructor.paramTags()) {
                html.strong().content(param.parameterName()).write(": ").render(new InlineTagsRenderer(generator,
                        param.inlineTags(), param.position())).br();
            }
            html._p();
        }
        renderSince(html, constructor);
        renderSee(html, constructor);
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:26,代码来源:ClassContentRenderable.java

示例8: doRenderOn

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
@Override
protected void doRenderOn(HtmlCanvas html) throws IOException {
    PackagePage page = PageRenderer.getPage(html);
    PackageDoc packageDoc = page.getPackageDoc();

    html.div(class_("api_header")).p().content("package").h1().content(packageDoc.name())._div();
    if (packageDoc.inlineTags() != null && packageDoc.inlineTags().length > 0) {
        html.h2().content("Overview");
        html.p().render(new InlineTagsRenderer(generator, packageDoc.inlineTags(), packageDoc.position()))._p();
    }
    renderTypes(packageDoc.interfaces(), "Interfaces", page, html);
    renderTypes(packageDoc.ordinaryClasses(), "Classes", page, html);
    renderTypes(packageDoc.errors(), "Exceptions", page, html);
    renderTypes(packageDoc.enums(), "Enums", page, html);
    renderTypes(packageDoc.annotationTypes(), "Annotation Types", page, html);
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:17,代码来源:PackageContentRenderable.java

示例9: renderTypes

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void renderTypes(ClassDoc[] classDocs, String title, PackagePage page, HtmlCanvas html) throws IOException {
    if (classDocs.length > 0) {
        Arrays.sort(classDocs);
        html.h2().content(title);
        html.table().tbody();
        int lineCnt = 0;
        for (ClassDoc classDoc : classDocs) {
            if ((lineCnt++) % 2 == 0) {
                html.tr(class_("alt-color"));
            } else {
                html.tr();
            }
            html.td().render(new ClassNameRenderable(generator, classDoc, ClassNameRenderable.LINK))._td();
            html.td().render(new InlineTagsRenderer(generator, classDoc.firstSentenceTags(),
                    classDoc.position()))._td();
            html._tr();
        }
        html._tbody()._table();
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:21,代码来源:PackageContentRenderable.java

示例10: renderOn

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
@Override
public void renderOn(HtmlCanvas html) throws IOException {
    boolean needSeparator = false;
    for (Tag tag : tags) {
        switch (tag.kind()) {
            case "@see":
                renderSeeTag((SeeTag) tag, needSeparator, html);
                needSeparator = true;
                break;
            case "@doclink":
                renderLinkDocTag(tag, needSeparator, html);
                needSeparator = true;
                break;
            case "Text":
            default:
                renderTextTag(tag, html);
                needSeparator = false;
                break;
        }
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:22,代码来源:InlineTagsRenderer.java

示例11: renderRef

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void renderRef(boolean separator, HtmlCanvas html, DocReferenceable referenceable,
                       String label) throws IOException {
    if (referenceable != null) {
        String text;
        if (label != null && !label.isEmpty()) {
            text = label;
        } else {
            text = referenceable.getName();
        }
        if (separator) {
            html.write(", ");
        }
        String ref = PageRenderer.getPage(html).getReferenceTo(referenceable);
        if (ref != null) {
            html.a(href(ref)).content(text, HtmlCanvas.NO_ESCAPE);
        } else {
            html.code().content(text, HtmlCanvas.NO_ESCAPE);
        }
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:21,代码来源:InlineTagsRenderer.java

示例12: renderOn

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
@Override
public void renderOn(HtmlCanvas html) throws IOException {
    MarkupPage page = PageRenderer.getPage(html);
    MarkupDoc markupDoc = page.getMarkupDoc();
    LinkedList<IndexDoc> indexes = new LinkedList<>();

    // build indexes list in reverse order
    IndexDoc indexDoc = generator.getRootProjectDoc().getIndexDoc(markupDoc);
    while (indexDoc != null && indexDoc != rootIndexDoc) {
        indexes.addFirst(indexDoc);
        indexDoc = generator.getRootProjectDoc().getIndexDoc(indexDoc.getParentContainer());
    }

    html.div(class_("nav"));
    writeIndexes(indexes, 0, markupDoc, page, html);
    html._div();
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:18,代码来源:MarkupNavContentRenderable.java

示例13: writeIndexes

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void writeIndexes(List<IndexDoc> indexes, int pos, MarkupDoc markupDoc, MarkupPage page,
                          HtmlCanvas html) throws IOException {
    if (pos < indexes.size()) {
        IndexDoc index = indexes.get(pos);
        IndexDoc subIndex = (pos + 1) < indexes.size() ? indexes.get(pos + 1) : null;
        for (IndexDoc.Entry entry : index.getContent()) {
            html.ul();
            MarkupDoc target = entry.getTarget();
            if (target != null) {
                if (target.equals(markupDoc)) {
                    html.li().span(class_("highlighted")).content(entry.getLabel())._li();
                } else {
                    DocReferenceable ref = generator.getRefLocator().getMarkupDocRef(target);
                    String relPath = page.getReferenceTo(ref);
                    html.li().a(href(relPath)).content(entry.getLabel())._li();
                }
                if (generator.getRootProjectDoc().getIndexDoc(target).equals(subIndex)) {
                    writeIndexes(indexes, pos + 1, markupDoc, page, html);
                }
            }
            html._ul();
        }
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:25,代码来源:MarkupNavContentRenderable.java

示例14: generateReport

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
public void generateReport(IRunTestResults iRunTestResults, String reportDirectory) throws IOException {
    String reportFileName = String.format(TEST_CASE_REPORT_NAME + FORMATTER_STRING +
            REPORT_EXTENSION, valueOf(currentTimeMillis()));
    Path path = Paths.get(reportDirectory, reportFileName);

    try (Writer writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
            new FileOutputStream(path.toFile(), false), UTF_8)))) {
        HtmlCanvas reportPage = new HtmlCanvas(writer);

        HtmlCanvas reportPageHtml = reportPage.html();
        appendReportPageHead(reportPageHtml);

        HtmlCanvas reportPageBody = reportPageHtml.body();
        createResourcesFolder(reportDirectory);
        copyResources(reportDirectory);

        generateHeader(reportPageBody, CURRENT_DIRECTORY + RES + SLASH + CLOUD_SLANG_LOGO_PNG);
        generatePiechart(reportPageBody, iRunTestResults);
        generateTestCaseReportTable(reportPageBody, iRunTestResults);
    }
}
 
开发者ID:CloudSlang,项目名称:cloud-slang,代码行数:22,代码来源:SlangTestCaseRunReportGeneratorService.java

示例15: generatePiechart

import org.rendersnake.HtmlCanvas; //导入依赖的package包/类
private void generatePiechart(HtmlCanvas reportPageBody, IRunTestResults iRunTestResults) throws IOException {
    HtmlCanvas divSummary = reportPageBody.div();
    divSummary.div(new HtmlAttributes().id(PIECHART_ID))._div();
    HtmlCanvas divTestSummary = divSummary.div(new HtmlAttributes().class_(TEST_SUMMARY_CLASS));

    int passedCount = iRunTestResults.getPassedTests().size();
    int skippedCount = iRunTestResults.getSkippedTests().size();
    int failedCount = iRunTestResults.getFailedTests().size();

    divTestSummary.h2().content(format(PASSED_TESTS, passedCount));
    divTestSummary.h2().content(format(FAILED_TESTS, failedCount));
    divTestSummary.h2().content(format(SKIPPED_TESTS, skippedCount));
    divTestSummary._div();
    divSummary._div();

    // Hidden divs used to be able to link data to piechart.js
    reportPageBody.div(new HtmlAttributes().id(PASSED.toLowerCase(ENGLISH))
            .class_(HIDDEN_CLASS)).content(passedCount);
    reportPageBody.div(new HtmlAttributes().id(FAILED.toLowerCase(ENGLISH))
            .class_(HIDDEN_CLASS)).content(failedCount);
    reportPageBody.div(new HtmlAttributes().id(SKIPPED.toLowerCase(ENGLISH))
            .class_(HIDDEN_CLASS)).content(skippedCount);
}
 
开发者ID:CloudSlang,项目名称:cloud-slang,代码行数:24,代码来源:SlangTestCaseRunReportGeneratorService.java


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