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


Java HtmlCanvas.write方法代码示例

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


在下文中一共展示了HtmlCanvas.write方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: displayResultsOnCanvas

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void displayResultsOnCanvas(StateSpaceExplorer.StateSpaceExplorerResults results)
        throws IOException, StateSpaceLoaderException {
    HtmlCanvas html = new HtmlCanvas();
    html.html().head();
    html.style(type("text/css").media("screen")).content(HTML_STYLE);
    html._head();
    html.body();
    if (results.numberOfStates < MAX_DISPLAY_STATES) {
        StateSpaceLoader.Results stateSpace = stateSpaceLoader.loadStateSpace();
        solveSteadyState(stateSpace.records, stateSpace.stateMappings, html);
    } else {
        html.write("State space is too large to show tabular results");
        html.br();
        html.write("Number of states: " + results.numberOfStates);
        html.br();
        html.write("Number of transitions: " + results.processedTransitions);
    }
    html._body()._html();
    resultsPane.setText(html.toHtml());
}
 
开发者ID:sarahtattersall,项目名称:PIPE,代码行数:21,代码来源:GSPNAnalysis.java

示例4: generateNode

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
protected void generateNode(ContentNode contentNode, HtmlCanvas html) throws IOException {

        if (contentNode.getType().equals(ContentNodeType.TEXT)) {
            html/* .div(class_(contentNode.getCss())) */.write(HtmlEscape.unescapeHtml(contentNode.getContent()),
                false)/* ._div() */;
        }

        if (contentNode.getType().equals(ContentNodeType.WIDGET) && contentNode.getWidget() != null
            && !contentNode.getWidget().isEmpty()) {
            generateWidgetNode(contentNode, html);
        }

    }
 
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:14,代码来源:DefaultContentService.java

示例5: renderCodeBlock

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
protected void renderCodeBlock(HtmlCanvas html, String language, String[] codeLines)  {
    try {
        if (codeLines != null) {
            int intentLevel = getIntentLevel(codeLines);
            html.pre().code(class_(language));
            for (String line : codeLines) {
                html.write(unindentLine(line, intentLevel) + '\n');
            }
            html._code()._pre();
        }
    } catch(IOException e) {
        // ignore...
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:15,代码来源:MarkupContentRenderable.java

示例6: renderImplementedInterfaces

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void renderImplementedInterfaces(HtmlCanvas html, ClassDocAccess classDocAccess) throws IOException {
    List<Type> interfaces = classDocAccess.getImplementedInterfaces();
    if (interfaces.size() > 0) {
        html.p().write("implements ");
        for (int cnt = 0; cnt < interfaces.size(); cnt++) {
            Type intf = interfaces.get(cnt);
            if (cnt > 0) {
                html.write(", ");
            }
            html.render(new ClassNameRenderable(generator, intf, ClassNameRenderable.LINK));
        }
        html._p();
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:15,代码来源:ClassContentRenderable.java

示例7: renderSubclasses

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void renderSubclasses(HtmlCanvas html, ClassDocAccess classDocAccess) throws IOException {
    List<Type> subclasses = classDocAccess.getSubclasses();
    if (!subclasses.isEmpty()) {
        html.h4().content("Subclasses:").p(class_("indent"));
        for (int cnt = 0; cnt < subclasses.size(); cnt++) {
            if (cnt >= 1) {
                html.write(", ");
            }
            html.render(new ClassNameRenderable(generator, subclasses.get(cnt), ClassNameRenderable.LINK));
        }
        html._p();
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:14,代码来源:ClassContentRenderable.java

示例8: renderMethodsSummary

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void renderMethodsSummary(HtmlCanvas html, ClassDocAccess classDocAccess) throws IOException {
    TableRenderer tableRenderer = new TableRenderer(2, "Methods");
    List<MethodDoc> methods = classDocAccess.getMethods(true);
    // methods
    for (MethodDoc methodDoc : methods) {
        if (!methodDoc.isSynthetic()) {
            tableRenderer.startRow(html);
            html.td().write(methodDoc.modifiers()).write(' ').render(new ClassNameRenderable(generator,
                    methodDoc.returnType(), ClassNameRenderable.LINK))._td();
            html.td().a(href("#" + getAnchor(methodDoc))).content(methodDoc.name());
            renderExecutableMemberParams(html, methodDoc);
            html.br();
            html.p(class_("indent")).render(new InlineTagsRenderer(generator, methodDoc.firstSentenceTags(),
                    methodDoc.position()))._p();
            html._td();
            tableRenderer.closeRow(html);
        }
    }
    // inherited methods
    for (ClassDocAccess.InheritedClassMethods inheritedMethods : classDocAccess.getInheritedMethods(true)) {
        tableRenderer.startRow(html);
        html.td().write("from ").render(new ClassNameRenderable(generator, inheritedMethods.getClassType(),
                ClassNameRenderable.LINK))._td();
        html.td();
        for (int i = 0; i < inheritedMethods.getMethods().size(); i++) {
            if (i > 0) {
                html.write(", ");
            }
            ExecutableMemberDoc memberDoc = inheritedMethods.getMethods().get(i);
            DocReferenceable referenceable = generator.getRefLocator().getExecutableMemberDocRef(memberDoc);
            html.a(href(PageRenderer.getPage(html).getReferenceTo(referenceable))).content(memberDoc.name(),
                    HtmlCanvas.NO_ESCAPE);
        }
        html._td();
        tableRenderer.closeRow(html);
    }
    tableRenderer.closeTable(html);
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:39,代码来源:ClassContentRenderable.java

示例9: renderExecutableMemberParams

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void renderExecutableMemberParams(HtmlCanvas html, ExecutableMemberDoc executableMemberDoc) throws
        IOException {
    html.write('(');
    Parameter[] params = executableMemberDoc.parameters();
    for (int i = 0; i < params.length; i++) {
        if (i > 0) {
            html.write(", ");
        }
        Parameter param = params[i];
        html.render(new ClassNameRenderable(generator, param.type(), ClassNameRenderable.LINK));
        html.write(' ').write(param.name());
        html.write(param.type().dimension());
    }
    html.write(')');
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:16,代码来源:ClassContentRenderable.java

示例10: renderReferenceable

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
public void renderReferenceable(DocReferenceable referenceable, HtmlCanvas html) throws IOException {
    String ref = PageRenderer.getPage(html).getReferenceTo(referenceable);
    if (ref != null) {
        html.a(href(ref)).content(referenceable.getName(), HtmlCanvas.NO_ESCAPE);
    } else {
        html.write(referenceable.getName(), HtmlCanvas.NO_ESCAPE);
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:9,代码来源:ClassNameRenderable.java

示例11: renderTextTag

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
private void renderTextTag(Tag tag, HtmlCanvas html) throws IOException {
    html.write(tag.text(), HtmlCanvas.NO_ESCAPE);
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:4,代码来源:InlineTagsRenderer.java

示例12: renderOn

import org.rendersnake.HtmlCanvas; //导入方法依赖的package包/类
@Override
public void renderOn(HtmlCanvas html) throws IOException {
    if (type.isPrimitive()) {
        html.write(type.typeName() + type.dimension());
    } else {
        String name;
        ClassDoc classDoc = type.asClassDoc();
        DocReferenceable referenceable = generator.getRefLocator().getClassDocRef(classDoc);
        String ref = PageRenderer.getPage(html).getReferenceTo(referenceable);
        if ((flags & FQN) != 0) {
            name = classDoc.qualifiedName();
        } else {
            name = referenceable.getName();
        }
        if ((flags & LINK) != 0 && ref != null) {
            html.a(href(PageRenderer.getPage(html).getReferenceTo(referenceable))).content(name,
                    HtmlCanvas.NO_ESCAPE);
        } else {
            html.write(name);
        }
    }

    ParameterizedType parameterizedType = type.asParameterizedType();
    if (parameterizedType != null) {
        Type[] typeArguments = parameterizedType.typeArguments();
        if (typeArguments.length > 0) {
            html.write("<");
            for (int typeVarCount = 0; typeVarCount < typeArguments.length; typeVarCount++) {
                Type typeArgument = typeArguments[typeVarCount];
                if (typeVarCount > 0) {
                    html.write(", ");
                }
                renderReferenceable(generator.getRefLocator().getClassDocRef(typeArgument.asClassDoc()), html);
            }
            html.write(">");
        }
    } else if (!type.isPrimitive()) {
        TypeVariable[] typeVariables = type.asClassDoc().typeParameters();
        if (typeVariables.length > 0) {
            html.write("<");
            for (int typeVarCount = 0; typeVarCount < typeVariables.length; typeVarCount++) {
                TypeVariable typeVariable = typeVariables[typeVarCount];
                if (typeVarCount > 0) {
                    html.write(", ");
                }
                html.write(typeVariable.typeName());
                if ((flags & BOUNDS) != 0) {
                    Type[] bounds = typeVariable.bounds();
                    if (bounds.length > 0) {
                        html.write(" extends ");
                        for (int boundCnt = 0; boundCnt < bounds.length; boundCnt++) {
                            ClassDoc boundClass = bounds[boundCnt].asClassDoc();
                            if (boundCnt > 0) {
                                html.write(" & ");
                            }
                            renderReferenceable(generator.getRefLocator().getClassDocRef(boundClass), html);
                        }
                    }
                }
            }
            html.write(">");
        }
    }
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:65,代码来源:ClassNameRenderable.java


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