本文整理汇总了Java中org.apache.wicket.util.resource.StringResourceStream类的典型用法代码示例。如果您正苦于以下问题:Java StringResourceStream类的具体用法?Java StringResourceStream怎么用?Java StringResourceStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringResourceStream类属于org.apache.wicket.util.resource包,在下文中一共展示了StringResourceStream类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StartSharingButton
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
public StartSharingButton(String id, String uid) {
super(id);
this.uid = uid;
setOutputMarkupPlaceholderTag(true);
setVisible(false);
add(download = new AjaxDownloadBehavior(new ResourceStreamResource() {
private static final long serialVersionUID = 1L;
{
setCacheDuration(NONE);
}
@Override
protected IResourceStream getResourceStream(Attributes attributes) {
setFileName(String.format("public_%s.jnlp", getOnlineClient(uid).getRoom().getId()));
StringResourceStream srs = new StringResourceStream(app, "application/x-java-jnlp-file");
srs.setCharset(UTF_8);
return srs;
}
}));
}
示例2: createFormPageMarkup
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
private IMarkupFragment createFormPageMarkup(final String componentId) {
String markup = /*"<html><head></head>" +*/ "<body><form wicket:id='form'><select wicket:id='" + componentId
+ "' /></form></body>" /*+ "</html>"*/;
try {
// set a ContainerInfo to be able to use HtmlHeaderContainer so header contribution
// still work. WICKET-3700
ContainerInfo containerInfo = new ContainerInfo(new ExtendedWicketTester.StartComponentInForm());
MarkupResourceStream markupResourceStream = new MarkupResourceStream(new StringResourceStream(markup),
containerInfo, ExtendedWicketTester.StartComponentInForm.class);
MarkupParser markupParser = getTester().getApplication().getMarkupSettings().getMarkupFactory()
.newMarkupParser(markupResourceStream);
return markupParser.parse();
} catch (Exception e) {
fail("Error while parsing the markup for the autogenerated page: " + e.getMessage());
return null;
}
}
示例3: getMarkupResourceStream
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
public IResourceStream getMarkupResourceStream(
MarkupContainer container, Class<?> containerClass) {
String html =
"<wicket:panel>" +
" <input type='checkbox' wicket:id='checkbox'></input>" +
"</wicket:panel>";
return new StringResourceStream(html);
}
示例4: getResourceStream
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
@Override
protected IResourceStream getResourceStream(Attributes attributes) {
final ChatDao dao = getBean(ChatDao.class);
final boolean admin = hasAdminLevel(getRights());
final StringBuilder sb = new StringBuilder();
chatForm.process(
() -> {
if (admin) {
setFileName(String.format(CHAT_FNAME_TMPL, "global"));
export(dao.getGlobal(0, Integer.MAX_VALUE), sb);
}
return true;
}
, r -> {
if (admin || isModerator(getUserId(), r.getId())) {
setFileName(String.format(CHAT_FNAME_TMPL, "room_" + r.getId()));
export(dao.getRoom(r.getId(), 0, Integer.MAX_VALUE, true), sb);
}
return true;
}, u -> {
setFileName(String.format(CHAT_FNAME_TMPL, "user_" + u.getId()));
export(dao.getUser(u.getId(), 0, Integer.MAX_VALUE), sb);
return true;
});
StringResourceStream srs = new StringResourceStream(sb, "text/csv");
srs.setCharset(UTF_8);
return srs;
}
示例5: ReadOnlySettingsModalPanel
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
public ReadOnlySettingsModalPanel(final DownloadModalSettings settings) {
super(new SyntaxHighlighter("content", settings.getContent(), settings.getSyntax()));
final AjaxSettingsDownloadBehavior ajaxSettingsDownloadBehavior =
new AjaxSettingsDownloadBehavior(settings.getSaveToFileName()) {
@Override
protected StringResourceStream getResourceStream() {
FilteredResourcesWebAddon filteredResourcesWebAddon = addonsManager.addonByType(
FilteredResourcesWebAddon.class);
String settingsMimeType = settings.getSettingsMimeType();
String settingsContent = settings.getContent();
try {
String filtered = filteredResourcesWebAddon.filterResource(null,
(Properties) InfoFactoryHolder.get().createProperties(),
new StringReader(settingsContent));
return new StringResourceStream(filtered, settingsMimeType);
} catch (Exception e) {
log.error("Unable to filter settings: " + e.getMessage());
return new StringResourceStream(settingsContent, settingsMimeType);
}
}
};
add(ajaxSettingsDownloadBehavior);
Component exportLink = new TitledAjaxLink("export", settings.getDownloadButtonTitle()) {
public void onClick(AjaxRequestTarget target) {
ajaxSettingsDownloadBehavior.initiate(target);
}
};
exportLink.add(new CssClass(new DefaultButtonStyleModel(exportLink)));
add(exportLink);
setWidth(700);
add(new ModalCloseLink("cancel", "Cancel"));
}
示例6: PlainTextExampleResponder
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
public PlainTextExampleResponder(final PageParameters parameters) {
super(parameters);
StringBuilder sb = new StringBuilder();
sb.append("plain text example.");
getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(new StringResourceStream(sb.toString()))
);
}
示例7: getMarkupResourceStream
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
@Override
public IResourceStream getMarkupResourceStream(MarkupContainer container, Class<?> containerClass)
{
return new StringResourceStream("");
}
示例8: getMarkupResourceStream
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
@Override
public IResourceStream getMarkupResourceStream(final MarkupContainer container,
final Class<?> containerClass) {
return new StringResourceStream("<html><body>"
+ "<form wicket:id=\"form\"><span wicket:id=\"field\"></span></form></body></html>");
}
示例9: getResourceStream
import org.apache.wicket.util.resource.StringResourceStream; //导入依赖的package包/类
protected abstract StringResourceStream getResourceStream();