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


Java Html类代码示例

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


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

示例1: addHeader

import org.apache.ecs.html.Html; //导入依赖的package包/类
protected void addHeader(Html html) {
    //<head>
    //  <link rel="stylesheet" href="../../../../../resources/webapp/css/bootstrap.css" type="text/css" />
    // </head>
    String[] headerlinks = getContext().getHeaderlinks();
    if (headerlinks != null && headerlinks.length > 0) {
        String relativePath = constructRelativeLinkPath();
        Head head = new Head();
        for (String headerlink : headerlinks) {
            Link link = new Link();
            link.setRel("stylesheet");
            link.setType("text/css");
            link.setHref(relativePath + headerlink.trim());
            head.addElement(link);
        }
        html.addElement(head);
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:19,代码来源:CreateHtmlVisitor.java

示例2: getSource

import org.apache.ecs.html.Html; //导入依赖的package包/类
public String getSource(WebSession s)
{
	String source = null;
	String src = null;

	try
	{
		// System.out.println("Loading source file: " +
		// getSourceFileName());
		src = convertMetacharsJavaCode(readFromFile(new BufferedReader(new FileReader(s
				.getWebResource(getSourceFileName()))), true));

		// TODO: For styled line numbers and better memory efficiency,
		// use a custom FilterReader
		// that performs the convertMetacharsJavaCode() transform plus
		// optionally adds a styled
		// line number. Wouldn't color syntax be great too?
	} catch (Exception e)
	{
		s.setMessage("Could not find source file");
		src = ("Could not find the source file or source file does not exist.<br/>"
				+ "Send this message to: <a href=\"mailto:" + s.getWebgoatContext().getFeedbackAddress()
				+ "?subject=Source " + getSourceFileName() + " not found. Lesson: "
				+ s.getCurrentLesson().getLessonName() + "\">" + s.getWebgoatContext().getFeedbackAddress() + "</a>");
	}

	Html html = new Html();

	Head head = new Head();
	head.addElement(new Title(getSourceFileName()));

	Body body = new Body();
	body.addElement(new StringElement(src));

	html.addElement(head);
	html.addElement(body);

	source = html.toString();

	return source;
}
 
开发者ID:RIGS-IT,项目名称:sonar-xanitizer,代码行数:42,代码来源:AbstractLesson.java

示例3: createHtml

import org.apache.ecs.html.Html; //导入依赖的package包/类
public Html createHtml() {
    final Html html = new Html();
    html.addAttribute("xmlns:wicket", "http://wicket.apache.org");
    return html;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:6,代码来源:HtmlComponentBuilder.java

示例4: newHtml

import org.apache.ecs.html.Html; //导入依赖的package包/类
@Override
protected Html newHtml() {
    Html html = super.newHtml();
    addTablegrid();
    return html;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:7,代码来源:HtmlGeneratorVisitorTablegrid.java


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