本文整理汇总了Java中org.apache.tapestry5.MarkupWriter.end方法的典型用法代码示例。如果您正苦于以下问题:Java MarkupWriter.end方法的具体用法?Java MarkupWriter.end怎么用?Java MarkupWriter.end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tapestry5.MarkupWriter
的用法示例。
在下文中一共展示了MarkupWriter.end方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: after
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
@AfterRender
void after(MarkupWriter writer){
Resource res;
Asset asset;
if(!isListEmpty())
{
for (String script : scriptList){
try{
res=moduleManager.findResourceForModule(script);
asset=assetSource.getUnlocalizedAsset(res.toString());
String url = asset.toClientURL();
writer.element("script", "type", "text/javascript", "src", url);
writer.end();}
catch(Exception ex)
{
logger.error("Script not found:"+ ex.getMessage());
}
}
}
}
示例2: afterRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
void afterRender(final MarkupWriter writer) {
writer.end();
JSONObject parameters = new JSONObject();
for (String informalParameterName : componentResources.getInformalParameterNames()) {
parameters.put(informalParameterName,
componentResources.getInformalParameter(informalParameterName, Object.class));
}
javaScriptSupport.require("angular2/js/a2component").with(module, clientId, parameters);
}
示例3: afterRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
void afterRender(final MarkupWriter writer) {
writer.end();
JSONObject parameters = new JSONObject();
for (String informalParameterName : componentResources.getInformalParameterNames()) {
parameters.put(informalParameterName,
componentResources.getInformalParameter(informalParameterName, Object.class));
}
javaScriptSupport.require("eddyson/react/components/reactcomponent").with(module, clientId, parameters);
}
示例4: setJS
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
@AfterRender
public void setJS(MarkupWriter writer){
// resources.renderInformalParameters(writer);
writer.end();
javascript.addInitializerCall(this.getInitializerName(), this.opts);
}
示例5: beginRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
boolean beginRender(MarkupWriter writer)
{
hiddenInputElement =
writer.element("input", "type", "hidden", "name", name, "value", tokenManager.getSessionToken().getToken());
resources.renderInformalParameters(writer);
writer.end();
return false;
}
示例6: beginRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
/**
* Writes the RSS document
* @param writer a {@link MarkupWriter}.
*/
boolean beginRender(MarkupWriter writer) {
writer.element("rss", "version", "2.0", "xmlns:atom", "http://www.w3.org/2005/Atom");
writer.element("channel");
write(writer, "title", channel.getTitle());
write(writer, "link", channel.getLink());
write(writer, "description", channel.getDescription());
writer.element("atom:link", "href", channel.getLink(), "rel", "self", "type", "application/rss+xml");
writer.end(); // atom:link
for (Item item : channel.getItems()) {
writer.element("item");
write(writer, "title", item.getTitle());
write(writer, "description", item.getDescription());
write(writer, "author", item.getAuthor());
write(writer, "pubDate", item.getPublicationDate());
write(writer, "link", item.getLink());
write(writer, "guid", item.getGuid());
writer.end(); // item
}
writer.end(); // channel
writer.end(); // rss
return false;
}
示例7: afterRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
void afterRender(MarkupWriter writer) {
writer.end(); // ul
environment.pop(MenuContext.class);
}
示例8: afterRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
void afterRender(MarkupWriter writer) {
writer.end(); // li
}
示例9: afterRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
final void afterRender(MarkupWriter writer) {
writer.end(); // input
}
示例10: beginRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
boolean beginRender(MarkupWriter writer) {
writer.element("time", "datetime", formatPubdate()).text(formatDate());
writer.end();
return false;
}
示例11: afterRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
/**
* Closes the wrapping element if such.
* @param writer a {@link MarkupWriter}.
*/
void afterRender(MarkupWriter writer) {
if (elementName != null) {
writer.end();
}
}
示例12: write
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
private void write(MarkupWriter writer, String elementName, String content) {
if (content != null) {
writer.element(elementName).text(content);
writer.end();
}
}
示例13: beginRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
/**
* Renders the tags.
*
* @param writer a {@link MarkupWriter}.
* @return <code>false</code> so the component body isn't rendered.
*/
boolean beginRender(MarkupWriter writer) {
if (tags.size() > 0) {
Tag tag;
String tagTitle;
writer.element("ol", "class", "tag-list");
// TagController.findByName() will be heavily cached, so we can do this loop this way,
// instead of trying to load all tags from the database at once.
for (String tagName : tags) {
writer.element("li");
tag = tagController.findByName(tagName);
tagTitle = tag != null ? tag.getTitle() : tagName;
final Link link = pageRenderLinkSource.createPageRenderLinkWithContext(Index.class, tagName);
final Element a = writer.element("a", "href", link.toAbsoluteURI(), "class", "tag-link");
a.text(tagName);
if (!tagName.equals(tagTitle)) {
a.attribute("title", tagTitle);
}
writer.end(); // li
writer.end(); // a
}
writer.end(); // ol
}
return false;
}
示例14: beginRender
import org.apache.tapestry5.MarkupWriter; //导入方法依赖的package包/类
void beginRender(MarkupWriter writer) {
List<String> itemClass = CollectionFactory.newList();
Element e = writer.element("li");
if (itemCssClass != null) {
itemClass.add(itemCssClass);
}
if (menuContext.isActive(name)) {
itemClass.add("active");
}
//TODO: FIXME
// Hack to handle just sub-menus
if (page != null && page.startsWith("admin") && page.contains(resources.getPageName().toLowerCase())) {
itemClass.add("active");
}
if (!itemClass.isEmpty()) {
e.addClassName(TapestryInternalUtils.toClassAttributeValue(itemClass));
}
Element href = writer.element("a",
"id", name,
"href", getUrl(),
"title", title
);
if (style != null) {
href.attribute("style", style);
}
resources.renderInformalParameters(writer);
writer.write(title);
writer.end(); //a
}