本文整理汇总了Java中org.apache.wicket.markup.MarkupStream类的典型用法代码示例。如果您正苦于以下问题:Java MarkupStream类的具体用法?Java MarkupStream怎么用?Java MarkupStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MarkupStream类属于org.apache.wicket.markup包,在下文中一共展示了MarkupStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onConfigure
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
protected void onConfigure() {
super.onConfigure();
WebMarkupContainer container = new WebMarkupContainer("output") {
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
try {
CharArrayWriter baos = new CharArrayWriter(0);
DocumentationDefinitionResolver.get().renderDocumentationHTML(typeLoader.loadTypeOrException(stypeClass), baos);
replaceComponentTagBody(markupStream, openTag, baos.toString());
} catch (Exception e) {
throw SingularException.rethrow(e.getMessage(), e);
}
}
};
queue(container);
}
示例2: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
// render the hidden field
if (isRootForm()) {
final AppendingStringBuffer buffer = new AppendingStringBuffer("<input type=\"hidden\" name=\"");
buffer.append(TOKEN_NAME)
.append("\" id=\"")
.append(TOKEN_NAME)
.append("\" value=\"")
.append(token)
.append("\" />");
getResponse().write(buffer);
}
// do the rest of the processing
super.onComponentTagBody(markupStream, openTag);
}
示例3: populateItem
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@SuppressWarnings({"unchecked"})
@Override
public void populateItem(final Item cellItem, String componentId, IModel model) {
final ActionableArchiveSearchResult result =
(ActionableArchiveSearchResult) cellItem.getParent().getParent().getDefaultModelObject();
final String relDirPath = result.getSearchResult().getRelDirPath();
Link linkToTreeView = new Link<String>(componentId, Model.of(relDirPath)) {
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, relDirPath);
}
@Override
public void onClick() {
RequestCycle.get().setResponsePage(new BrowseRepoPage(result.getArchiveRepoPath()));
}
};
linkToTreeView.add(new CssClass("item-link"));
cellItem.add(linkToTreeView);
}
示例4: BreadCrumbItem
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
private BreadCrumbItem(String id, final String crumbTitle, final PageParameters pageParameters, boolean first) {
super(id);
add(new AjaxLink("link") {
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, crumbTitle);
}
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(BuildBrowserRootPage.class, pageParameters);
}
});
add(new WebMarkupContainer("sep").setVisible(!first));
}
示例5: getModuleNameLink
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
/**
* Returns a link that redirects to the module info
*
* @param componentId ID to assign to the link
* @param moduleId ID of module to display
* @return Module redirection link
*/
private AjaxLink getModuleNameLink(String componentId, final String moduleId) {
AjaxLink link = new AjaxLink<String>(componentId, Model.of(moduleId)) {
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, moduleId);
}
@Override
public void onClick(AjaxRequestTarget target) {
PageParameters pageParameters = new PageParameters();
pageParameters.set(BUILD_NAME, build.getName());
pageParameters.set(BUILD_NUMBER, build.getNumber());
pageParameters.set(BUILD_STARTED, build.getStarted());
pageParameters.set(MODULE_ID, moduleId);
setResponsePage(BuildBrowserRootPage.class, pageParameters);
}
};
link.add(new CssClass("item-link"));
return link;
}
示例6: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
// render the hidden field
if (isRootForm()) {
AppendingStringBuffer buffer = new AppendingStringBuffer(
"<div style=\"display:none\"><input type=\"hidden\" name=\"");
buffer.append(TOKEN_NAME)
.append("\" id=\"")
.append(TOKEN_NAME)
.append("\" value=\"")
.append(getToken())
.append("\" /></div>");
getResponse().write(buffer);
}
// do the rest of the processing
super.onComponentTagBody(markupStream, openTag);
}
示例7: UploadIFrame
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
public UploadIFrame(FieldValueModel fieldValueModel) {
this.fieldValueModel = fieldValueModel;
// add header contributor for stylesheet
add(CSSPackageResource.getHeaderContribution(getStylesheet()));
WebMarkupContainer container = new WebMarkupContainer("container");
container.setOutputMarkupId(true);
add(container);
// add form
container.add(new UploadForm("form", container));
// add onUploaded method
container.add(new WebComponent("onUploaded") {
@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
if (uploaded) {
replaceComponentTagBody(markupStream, openTag,
"window.parent." + getOnUploadedCallback() + "('', '')");
uploaded = false;
}
}
});
}
示例8: UploadPanel
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
public UploadPanel(String id, FieldInstanceImageField parentField) {
super(id);
this.parentField = parentField;
// add onUploaded behavior
final OnUploadedBehavior onUploadBehavior = new OnUploadedBehavior();
add(onUploadBehavior);
add(new WebComponent("onUploaded") {
@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
// calling it through setTimeout we ensure that the callback is called
// in the proper execution context, that is the parent frame
replaceComponentTagBody(markupStream, openTag,
"function onUpload_" + UploadPanel.this.getMarkupId() +
"(uploadedFile, clientFileName) { window.setTimeout(function() { " + // window.location.reload(true); " +
onUploadBehavior.getCallback() + "; }, 0 )}");
}
});
}
示例9: getLink
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
protected Component getLink(String id) {
PageParameters pageParameters = new PageParameters();
pageParameters.put("topicMapId", getTopicMapId());
pageParameters.put("topicId", getTopicId());
return new BookmarkablePageLink<Page>(id, VizigatorPage.class, pageParameters) {
@Override
protected void onComponentTag(ComponentTag tag) {
tag.setName("a");
//tag.put("target", "_blank");
super.onComponentTag(tag);
}
@Override
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, new ResourceModel("vizigator.text2").getObject().toString());
}
};
}
示例10: getMarkUp
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
private String getMarkUp(final Throwable throwable) {
String resource = "";
String markup = "";
MarkupStream markupStream;
if (throwable instanceof MarkupException) {
markupStream = ((MarkupException) throwable).getMarkupStream();
if (markupStream != null) {
markup = markupStream.toHtmlDebugString();
resource = markupStream.getResource().toString();
}
}
String markupStr = "Resource: " + (resource.isEmpty() ? "[No Resource]" : resource);
markupStr += "\nMarkup: " + (markup.isEmpty() ? "[No Markup]" : markup);
return markupStr;
}
示例11: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
Object e = getDefaultModelObject();
String s;
if (e == null) {
s = "";
} else if (e instanceof String) {
assert enumType != null : "For String model objects you must specify the enum type in the constructor";
s = EnumUtils.toString(Enum.valueOf(enumType, (String) e));
} else if (e instanceof Enum<?>){
s = EnumUtils.toString((Enum<?>) e, getLocale());
} else {
throw new RuntimeException("EnumLabel can't handle model objects of type " + e.getClass().getName());
}
replaceComponentTagBody(markupStream, openTag, s);
}
示例12: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
Response response = getResponse();
response.write("\n");
// add all object's parameters:
for (String name : getParameterNames()) {
String value = getValue(name);
if (value != null) {
response.write("<param name=\"");
response.write(name);
response.write("\" value=\"");
response.write(value);
response.write("\"/>\n");
}
}
super.onComponentTagBody(markupStream, openTag);
}
示例13: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
super.onComponentTagBody(markupStream, openTag);
if (addFakeInputFields) {
final Response response = getResponse();
response.write("<input style=\"display:none\">\n" +
"<input type=\"password\" style=\"display:none\">");
}
}
示例14: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
String icon = getModelObject();
if (StringUtils.isNotEmpty(icon)) {
replaceComponentTagBody(markupStream, openTag, "<i class=\"" + icon + "\"></i>");
return;
}
super.onComponentTagBody(markupStream, openTag);
}
示例15: onComponentTagBody
import org.apache.wicket.markup.MarkupStream; //导入依赖的package包/类
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
String text = getModelObject();
if (StringUtils.isNotEmpty(text)) {
replaceComponentTagBody(markupStream, openTag, text);
return;
}
super.onComponentTagBody(markupStream, openTag);
}