本文整理汇总了Java中org.apache.wicket.markup.html.IHeaderContributor类的典型用法代码示例。如果您正苦于以下问题:Java IHeaderContributor类的具体用法?Java IHeaderContributor怎么用?Java IHeaderContributor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IHeaderContributor类属于org.apache.wicket.markup.html包,在下文中一共展示了IHeaderContributor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: syndicationDiscoveryLink
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
public static HeaderContributor syndicationDiscoveryLink(final String feedTitle,
final String url) {
return new HeaderContributor(new IHeaderContributor() {
private static final long serialVersionUID = 1L;
public void renderHead(IHeaderResponse response) {
String contentType = "application/rss+xml";
StringBuilder buffer = new StringBuilder();
buffer.append("<link rel=\"alternate\" ");
buffer.append("type=\"").append(contentType).append("\" ");
buffer.append("title=\"").append(feedTitle).append("\" ");
buffer.append("href=\"").append(url).append("\" />");
response.renderString(buffer.toString());
}
});
}
示例2: addCss
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
public ResourcePackage addCss(final String path, final String media) {
add(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
response.renderCSSReference(new CssResourceReference(scope, path), media);
}
});
return this;
}
示例3: addJavaScript
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
public ResourcePackage addJavaScript(final String path) {
add(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
response.renderJavaScriptReference(new JavaScriptResourceReference(scope, path));
}
});
return this;
}
示例4: addCssTemplate
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
public ResourcePackage addCssTemplate(final String path) {
add(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
String script = readInterpolatedString(path);
ICssCompressor compressor = Application.get().getResourceSettings().getCssCompressor();
if (compressor != null) {
script = compressor.compress(script);
}
response.renderCSS(script, null);
}
});
return this;
}
示例5: addJavaScriptTemplate
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
public ResourcePackage addJavaScriptTemplate(final String path) {
add(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
String script = readInterpolatedString(path);
script = JavaScriptUtils.compress(script);
response.renderJavaScript(script, null);
}
});
return this;
}
示例6: add
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
private void add(IHeaderContributor contributor) {
contributors.add(contributor);
}
示例7: renderHead
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
@Override
public void renderHead(Component component, IHeaderResponse response) {
for (IHeaderContributor contributor : contributors) {
contributor.renderHead(response);
}
}
示例8: ActionsColumn
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
public ActionsColumn(AbstractDataTablePanel<T> dataTablePanel, AccessController accessController) {
super(Model.of(""));
this.dataTablePanel = dataTablePanel;
this.accessController = accessController;
ajaxBehavior = new AbstractDefaultAjaxBehavior() {
@Override
protected void respond(AjaxRequestTarget target) {
onAction(target);
}
};
dataTablePanel.add(ajaxBehavior);
dataTablePanel.addHeaderContributor(new IHeaderContributor() {
@Override
public void renderHead(IHeaderResponse response) {
String script = String.format("Panelized.DataTable.initActions('#%s', '%s');", ActionsColumn.this.dataTablePanel.getMarkupId(), getCallbackUrl());
response.render(OnDomReadyHeaderItem.forScript(script));
}
});
// multiActionConfirmPopup = new ConfirmationPopUpPanel<Void>(newPanelId(), "Confirm Action");
// addPanel(multiActionConfirmPopup);
// multiActionConfirmPopup.setEscapeHtml(false);
// multiActionConfirmPopup.setSize(PopUpFormPanel.Size.LARGE);
//
// multiActionConfirmPopup.addSaveButton("Continue", new AjaxAction() {
// @Override
// public void invoke(AjaxRequestTarget target) {
// multiAction.invoke(target, multiActionRowIds);
// multiActionConfirmPopup.hide(target);
// }
// });
//
// multiActionConfirmPopup.addCancelButton();
}
示例9: renderHead
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
for (IHeaderContributor contributor : headerContributors) {
contributor.renderHead(response);
}
}
示例10: addHeaderContributor
import org.apache.wicket.markup.html.IHeaderContributor; //导入依赖的package包/类
/**
* Adds an IHeaderContributor to be rendered by this component to the page
* header. This is used by colums that need to hook into the component
* initialization process.
*/
public void addHeaderContributor(IHeaderContributor headerContributor) {
headerContributors.add(headerContributor);
}