当前位置: 首页>>代码示例>>Java>>正文


Java OnLoadHeaderItem类代码示例

本文整理汇总了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));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:38,代码来源:MarkdownEditor.java

示例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));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:23,代码来源:SourceEditPanel.java

示例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"));
}
 
开发者ID:webanno,项目名称:webanno,代码行数:20,代码来源:AnnotationPage.java

示例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.
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:22,代码来源:WidgetPage.java

示例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.
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:22,代码来源:WidgetPage.java

示例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"));

}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:19,代码来源:BasePage.java

示例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.
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:24,代码来源:WidgetPage.java

示例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.

}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:27,代码来源:WidgetPage.java

示例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")));
		}
       }

;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:21,代码来源:ProductManagementPage.java

示例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")));
		}
       }

	;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:25,代码来源:AdapterManagementPage.java

示例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")));
		}
       }

	;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:21,代码来源:IssueTrackerDataManagementPage.java

示例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")));
		}
       }

;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:21,代码来源:TestFrameworkDataManagementPage.java

示例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")));
		}
       }

;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:21,代码来源:StaticAnalysisDataManagementPage.java

示例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);"));
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:19,代码来源:ImplementationModalPanel.java

示例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)"));
}
 
开发者ID:apache,项目名称:syncope,代码行数:26,代码来源:BinaryTextPreviewer.java


注:本文中的org.apache.wicket.markup.head.OnLoadHeaderItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。