本文整理汇总了Java中org.apache.wicket.markup.head.OnLoadHeaderItem类的典型用法代码示例。如果您正苦于以下问题:Java OnLoadHeaderItem类的具体用法?Java OnLoadHeaderItem怎么用?Java OnLoadHeaderItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnLoadHeaderItem类属于org.apache.wicket.markup.head包,在下文中一共展示了OnLoadHeaderItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new MarkdownResourceReference()));
String encodedAttachmentSupport;
if (getAttachmentSupport() != null) {
encodedAttachmentSupport = Base64.encodeBase64String(SerializationUtils.serialize(getAttachmentSupport()));
encodedAttachmentSupport = StringUtils.deleteWhitespace(encodedAttachmentSupport);
encodedAttachmentSupport = StringEscapeUtils.escapeEcmaScript(encodedAttachmentSupport);
encodedAttachmentSupport = "'" + encodedAttachmentSupport + "'";
} else {
encodedAttachmentSupport = "undefined";
}
String callback = ajaxBehavior.getCallbackFunction(explicit("action"), explicit("param1"), explicit("param2"),
explicit("param3")).toString();
String autosaveKey = getAutosaveKey();
if (autosaveKey != null)
autosaveKey = "'" + JavaScriptEscape.escapeJavaScript(autosaveKey) + "'";
else
autosaveKey = "undefined";
String script = String.format("gitplex.server.markdown.onDomReady('%s', %s, %d, %s, %d, %b, %b, %s);",
container.getMarkupId(),
callback,
ATWHO_LIMIT,
encodedAttachmentSupport,
getAttachmentSupport()!=null?getAttachmentSupport().getAttachmentMaxSize():0,
getUserMentionSupport() != null,
getPullRequestReferenceSupport() != null,
autosaveKey);
response.render(OnDomReadyHeaderItem.forScript(script));
script = String.format("gitplex.server.markdown.onWindowLoad('%s');", container.getMarkupId());
response.render(OnLoadHeaderItem.forScript(script));
}
示例2: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(new SourceEditResourceReference()));
String autosaveKey = JavaScriptEscape.escapeJavaScript(context.getAutosaveKey());
String jsonOfMark = context.getMark()!=null?getJson(context.getMark()):"undefined";
String script = String.format("gitplex.server.sourceEdit.onDomReady('%s', '%s', %s, '%s', %s, '%s', %b, '%s');",
sourceFormComponent.getMarkupId(),
JavaScriptEscape.escapeJavaScript(context.getNewPath()),
jsonOfMark,
sourceFormat.getIndentType(),
sourceFormat.getTabSize(),
sourceFormat.getLineWrapMode(),
context.getMode() == Mode.EDIT,
autosaveKey);
response.render(OnDomReadyHeaderItem.forScript(script));
script = String.format("gitplex.server.sourceEdit.onWindowLoad('%s', %s, '%s');",
sourceFormComponent.getMarkupId(), jsonOfMark, autosaveKey);
response.render(OnLoadHeaderItem.forScript(script));
}
示例3: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
/**
* for the first time, open the <b>open document dialog</b>
*/
@Override
public void renderHead(IHeaderResponse aResponse)
{
super.renderHead(aResponse);
if (!initialLoadCompleted) {
aResponse.render(OnLoadHeaderItem
.forScript("jQuery('#initialLoadComplete').trigger('click');"));
initialLoadCompleted = true;
}
aResponse.render(CssContentHeaderItem.forCSS(
String.format(Locale.US, ".sidebarCell { flex-basis: %d%%; }",
getModelObject().getPreferences().getSidebarSize()),
"sidebar-width"));
}
示例4: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
// get the Sakai skin header fragment from the request attribute
final HttpServletRequest request = (HttpServletRequest) getRequest().getContainerRequest();
response.render(StringHeaderItem.forString((String) request.getAttribute("sakai.html.head")));
response.render(OnLoadHeaderItem.forScript("setMainFrameHeight( window.name )"));
// Tool additions (at end so we can override if required)
response.render(StringHeaderItem.forString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"));
// render jQuery and the Wicket event library
// Both must be priority so they are emitted into the head
final String cdnQuery = PortalUtils.getCDNQuery();
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format(PortalUtils.getLatestJQueryPath()+ "?version=%s", cdnQuery))));
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format("/my-calendar/scripts/wicket/wicket-event-jquery.min.js?version=%s", cdnQuery))));
// NOTE: All libraries apart from jQuery and Wicket Event must be rendered inline with the application. See WidgetPage.html.
}
示例5: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
// get the Sakai skin header fragment from the request attribute
final HttpServletRequest request = (HttpServletRequest) getRequest().getContainerRequest();
response.render(StringHeaderItem.forString((String) request.getAttribute("sakai.html.head")));
response.render(OnLoadHeaderItem.forScript("setMainFrameHeight( window.name )"));
// Tool additions (at end so we can override if required)
response.render(StringHeaderItem.forString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"));
// render jQuery and the Wicket event library
// Both must be priority so they are emitted into the head
final String cdnQuery = PortalUtils.getCDNQuery();
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format(PortalUtils.getLatestJQueryPath()+ "?version=%s", cdnQuery))));
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format("/my-calendar/scripts/wicket/wicket-event-jquery.min.js?version=%s", cdnQuery))));
// NOTE: All libraries apart from jQuery and Wicket Event must be rendered inline with the application. See WidgetPage.html.
}
示例6: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
// get the Sakai skin header fragment from the request attribute
final HttpServletRequest request = (HttpServletRequest) getRequest().getContainerRequest();
final String sakaiHtmlHead = (String) request.getAttribute("sakai.html.head");
if (StringUtils.isNotBlank(sakaiHtmlHead)) {
response.render(StringHeaderItem.forString((String) request.getAttribute("sakai.html.head")));
}
response.render(OnLoadHeaderItem.forScript("setMainFrameHeight( window.name )"));
// Tool additions (at end so we can override if required)
response.render(StringHeaderItem.forString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"));
response.render(CssHeaderItem.forUrl("/profile2-tool/css/profile2.css"));
response.render(JavaScriptHeaderItem.forUrl("/profile2-tool/javascript/profile2.js"));
}
示例7: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
final String version = this.serverConfigurationService.getString("portal.cdn.version", "");
// get the Sakai skin header fragment from the request attribute
final HttpServletRequest request = (HttpServletRequest) getRequest().getContainerRequest();
response.render(StringHeaderItem.forString((String) request.getAttribute("sakai.html.head")));
response.render(OnLoadHeaderItem.forScript("setMainFrameHeight( window.name )"));
// Tool additions (at end so we can override if required)
response.render(StringHeaderItem.forString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"));
// render jQuery and the Wicket event library
// Both must be priority so they are emitted into the head
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format("/library/webjars/jquery/1.12.4/jquery.min.js?version=%s", version))));
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format("/site-description/scripts/wicket/wicket-event-jquery.min.js?version=%s", version))));
// NOTE: All libraries apart from jQuery and Wicket Event must be rendered inline with the application. See WidgetPage.html.
}
示例8: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
final String version = this.serverConfigurationService.getString("portal.cdn.version", "");
// get the Sakai skin header fragment from the request attribute
final HttpServletRequest request = (HttpServletRequest) getRequest().getContainerRequest();
response.render(StringHeaderItem.forString((String) request.getAttribute("sakai.html.head")));
response.render(OnLoadHeaderItem.forScript("setMainFrameHeight( window.name )"));
// Tool additions (at end so we can override if required)
response.render(StringHeaderItem.forString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"));
// render jQuery and the Wicket event library
// Both must be priority so they are emitted into the head
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format("/library/webjars/jquery/1.12.4/jquery.min.js?version=%s", version))));
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forUrl(String.format("/mycalendar/scripts/wicket/wicket-event-jquery.min.js?version=%s", version))));
// additional styles (datepicker, this widget etc)
response.render(CssHeaderItem.forUrl(String.format("/library/webjars/jquery-ui/1.12.1/jquery-ui.min.css?version=%s", version)));
// NOTE: All libraries apart from jQuery and Wicket Event must be rendered inline with the application. See WidgetPage.html.
}
示例9: newProductsContainer
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
/**
*
* @return
*/
private WebMarkupContainer newProductsContainer() {
return new WebMarkupContainer("productsContainer") {
private static final long serialVersionUID = -6725820191388731244L;
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// add javascript to load tagsinput plugin
response.render(OnLoadHeaderItem.forScript(String.format(
JSTemplates.LOAD_TABLE_SORTER, "Product-list")));
}
}
;
}
示例10: newAdapterSettingsContainer
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
/**
*
* @return
*/
private WebMarkupContainer newAdapterSettingsContainer() {
return new WebMarkupContainer("adapterContainer") {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// add javascript to load tagsinput plugin
response.render(OnLoadHeaderItem.forScript(String.format(
JSTemplates.LOAD_TABLE_SORTER, "AdapterSettings-list")));
}
}
;
}
示例11: newJiraContainer
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
/**
*
* @return
*/
private WebMarkupContainer newJiraContainer() {
return new WebMarkupContainer("jiraContainer") {
private static final long serialVersionUID = -6725820191388731244L;
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// add javascript to load tagsinput plugin
response.render(OnLoadHeaderItem.forScript(String.format(
JSTemplates.LOAD_TABLE_SORTER, "Product-list")));
}
}
;
}
示例12: newTestLinkContainer
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
/**
*
* @return
*/
private WebMarkupContainer newTestLinkContainer() {
return new WebMarkupContainer("testLinkContainer") {
private static final long serialVersionUID = -6725820191388731244L;
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// add javascript to load tagsinput plugin
response.render(OnLoadHeaderItem.forScript(String.format(
JSTemplates.LOAD_TABLE_SORTER, "Product-list")));
}
}
;
}
示例13: newSonarContainer
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
/**
*
* @return
*/
private WebMarkupContainer newSonarContainer() {
return new WebMarkupContainer("sonarContainer") {
private static final long serialVersionUID = -6725820191388731244L;
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// add javascript to load tagsinput plugin
response.render(OnLoadHeaderItem.forScript(String.format(
JSTemplates.LOAD_TABLE_SORTER, "Product-list")));
}
}
;
}
示例14: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
if (viewMode != ViewMode.JAVA_CLASS) {
response.render(OnLoadHeaderItem.forScript(
"editor = CodeMirror.fromTextArea("
+ "document.getElementById('groovyClassForm').children['groovyClass'], {"
+ " readOnly: false, "
+ " lineNumbers: true, "
+ " lineWrapping: true, "
+ " matchBrackets: true,"
+ " autoCloseBrackets: true,"
+ (viewMode == ViewMode.GROOVY_BODY ? " mode: 'text/x-groovy'," : "")
+ " autoRefresh: true"
+ "});"
+ "editor.on('change', updateTextArea);"));
}
}
示例15: renderHead
import org.apache.wicket.markup.head.OnLoadHeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
super.renderHead(response);
String options;
switch (mimeType) {
case MediaType.APPLICATION_JSON:
options = "matchBrackets: true, autoCloseBrackets: true,";
break;
case MediaType.APPLICATION_XML:
options = "autoCloseTags: true, mode: 'text/html',";
break;
default:
options = "mode: 'text/html',";
}
response.render(OnLoadHeaderItem.forScript(
"var editor = CodeMirror.fromTextArea(document.getElementById('" + jsonEditorInfoId + "'), {"
+ " readOnly: true, "
+ " lineNumbers: true, "
+ " lineWrapping: false, "
+ options
+ " autoRefresh: true"
+ "});"
+ "editor.setSize('500', 100)"));
}