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


Java UIOutput.setRendererType方法代码示例

本文整理汇总了Java中javax.faces.component.UIOutput.setRendererType方法的典型用法代码示例。如果您正苦于以下问题:Java UIOutput.setRendererType方法的具体用法?Java UIOutput.setRendererType怎么用?Java UIOutput.setRendererType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.component.UIOutput的用法示例。


在下文中一共展示了UIOutput.setRendererType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: installAjaxResourceIfNecessary

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
/**
 *  Copy-pasted from {@link AjaxHandler}
 */
private void installAjaxResourceIfNecessary() {

    FacesContext context = FacesContext.getCurrentInstance();
    if (RenderKitUtils.hasScriptBeenRendered(context)) {
        // Already included, return
        return;
    }

    final String name = "jsf.js";
    final String library = "javax.faces";

    if (RenderKitUtils.hasResourceBeenInstalled(context, name, library)) {
        RenderKitUtils.setScriptAsRendered(context);
        return;
    }
    UIOutput output = new UIOutput();
    output.setRendererType("javax.faces.resource.Script");
    output.getAttributes().put("name", name);
    output.getAttributes().put("library", library);
    context.getViewRoot().addComponentResource(context, output, "head");

    // Set the context to record script as included
    RenderKitUtils.setScriptAsRendered(context);

}
 
开发者ID:Doctusoft,项目名称:jsf-builder,代码行数:29,代码来源:JsfBaseComponentRenderer.java

示例2: addMetaTags

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
/**
 * Add the viewport meta tag if not disabled from context-param
 *
 * @param root
 * @param context
 * @param isProduction
 */
private void addMetaTags(UIViewRoot root, FacesContext context) {
	// Check context-param
	String viewportParam = BsfUtils.getInitParam(C.P_VIEWPORT, context);

	viewportParam = evalELIfPossible(viewportParam);
	String content = "width=device-width, initial-scale=1";
	if (!viewportParam.isEmpty() && isFalseOrNo(viewportParam))
		return;
	if(!viewportParam.isEmpty() && !isTrueOrYes(viewportParam))
		content = viewportParam;

	// Otherwise
	String viewportMeta = "<meta name=\"viewport\" content=\"" + content + "\"/>";
	UIOutput viewport = new UIOutput();
	viewport.setRendererType("javax.faces.Text");
	viewport.getAttributes().put("escape", false);
	viewport.setValue(viewportMeta);

	UIComponent header = findHeader(root);
	if(header != null) {
		header.getChildren().add(0, viewport);
	}
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:31,代码来源:AddResourcesListener.java

示例3: createAndAddComponent

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
private void createAndAddComponent(UIViewRoot root, FacesContext context,
		String rendererType, String name, String library, String position) {

	//		if (library != null && BSF_LIBRARY.equals(library)) {
	//			boolean loadBsfResource = shouldLibraryBeLoaded(P_GET_BOOTSTRAP_COMPONENTS_FROM_CDN, true);
	//			
	//			if (! loadBsfResource) {
	//				return;
	//			}
	//		}
	UIOutput output = new UIOutput();
	output.setRendererType(rendererType);
	output.getAttributes().put("name", name);
	output.getAttributes().put("library", library);
	output.getAttributes().put("target", "head");
	if (position != null) {
		output.getAttributes().put("position", position);
	}
	addResourceIfNecessary(root, context, output);
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:21,代码来源:AddResourcesListener.java

示例4: addGeneratedResource

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
/**
 * Add a new resource.
 */
private void addGeneratedResource(FacesContext context, String resourceName, String rendererType, String value,
                                  UIViewRoot view) {
    final UIOutput resource = new UIOutput();
    resource.getAttributes().put("name", resourceName);
    resource.setRendererType(rendererType);
    resource.getAttributes().put("library", value);
    view.addComponentResource(context, resource, HEAD);
}
 
开发者ID:ButterFaces,项目名称:ButterFaces,代码行数:12,代码来源:HandleResourceListener.java

示例5: generateLabel

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
/**
 * Generates a JSF OutputText component/renderer
 * 
 * @param context JSF context
 * @param displayLabel The display label text
 * 
 * @return UIComponent
 */
private UIComponent generateLabel(FacesContext context, String displayLabel)
{
   UIOutput label = (UIOutput)context.getApplication().createComponent(ComponentConstants.JAVAX_FACES_OUTPUT);
   label.setId(context.getViewRoot().createUniqueId());
   label.setRendererType(ComponentConstants.JAVAX_FACES_TEXT);
   label.setValue(displayLabel);
   return label;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:17,代码来源:UISearchCustomProperties.java

示例6: addSpacingRow

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
/**
 * Creates an output text component to represent a spacing row.
 * 
 * @param context Faces context
 */
@SuppressWarnings("unchecked")
protected void addSpacingRow(FacesContext context)
{
   UIOutput spacingRow = (UIOutput)context.getApplication().createComponent(
         ComponentConstants.JAVAX_FACES_OUTPUT);
   spacingRow.setRendererType(ComponentConstants.JAVAX_FACES_TEXT);
   FacesHelper.setupComponentId(context, spacingRow, null);
   spacingRow.setValue("<div class=\"wizardButtonSpacing\" />");
   spacingRow.getAttributes().put("escape", Boolean.FALSE);
   this.getChildren().add(spacingRow);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:17,代码来源:UIDialogButtons.java

示例7: createOutputTextComponent

import javax.faces.component.UIOutput; //导入方法依赖的package包/类
/**
 * Creates an output text component.
 * 
 * @param context FacesContext
 * @param id Optional id to set
 * @return The new component
 */
protected UIOutput createOutputTextComponent(FacesContext context, String id)
{
   UIOutput component = (UIOutput)context.getApplication().createComponent(
         ComponentConstants.JAVAX_FACES_OUTPUT);
   
   component.setRendererType(ComponentConstants.JAVAX_FACES_TEXT);
   FacesHelper.setupComponentId(context, component, id);
   
   return component;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:BaseComponentGenerator.java


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