• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UIOutput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testFindInPanelComponents

import javax.faces.component.UIOutput; //导入依赖的package包/类
public void testFindInPanelComponents()
{
  UIViewRoot root = facesContext.getViewRoot(); root.setId("root");
  UIPanel panel1 = new UIPanel(); panel1.setId("panel1");
  UIPanel panel2 = new UIPanel(); panel2.setId("panel2");
  UIPanel panel3 = new UIPanel(); panel3.setId("panel3");
  UIOutput txt = new UIOutput(); txt.setId("txt");

  // build the Tree...
  root.getChildren().add(panel1);
  panel1.getChildren().add(panel2);
  panel2.getChildren().add(panel3);
  panel3.getChildren().add(txt);

  // Get the ComponentReference util
  ComponentReference<UIOutput> uiRef = ComponentReference.newUIComponentReference(txt);

  // find the component...
  UIOutput referencedComp = uiRef.getComponent();

  assertEquals(txt, referencedComp);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:23,代码来源:ComponentReferenceTest.java


示例2: visit

import javax.faces.component.UIOutput; //导入依赖的package包/类
@Override
public VisitResult visit(final VisitContext context, final UIComponent target) {
	// if (!target.isRendered()) {
	// return VisitResult.REJECT;
	// }

	if (target instanceof UIInput) {
		this.inputs.add((UIInput) target);
	}
	if (target instanceof UIForm) {
		this.forms.add((UIForm) target);
	}

	if (target instanceof UICommand) {
		this.commands.add((UICommand) target);
	}
	if (target instanceof UIOutput) {
		this.outputs.add((UIOutput) target);
	}
	if (target instanceof UISubmenu) {
		this.subMenus.add((UISubmenu) target);
	}
	if (target instanceof Column) {
		this.columns.add((Column) target);
	}
	if (target instanceof DataTable) {
		this.tables.add((DataTable) target);
	}
	if (target instanceof UISelectItems) {
		this.selectItems.add((UISelectItems) target);
	}
	if (target instanceof PanelGrid) {
		this.panelGrids.add((PanelGrid) target);
	}
	return VisitResult.ACCEPT;
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:37,代码来源:UIFacesVisitor.java


示例3: 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


示例4: generateAndAdd

import javax.faces.component.UIOutput; //导入依赖的package包/类
@Override
public UIComponent generateAndAdd(FacesContext context, UIPropertySheet propertySheet,
         PropertySheetItem item)
{
   UIComponent component = super.generateAndAdd(context, propertySheet, item);
   
   if ((component instanceof UIInput) && (component instanceof UISelectOne) == false)
   {
      component.setRendererType(RepoConstants.ALFRESCO_FACES_MLTEXTAREA_RENDERER);
   }
   else if ((component instanceof UIOutput))
   {
      component.setRendererType(RepoConstants.ALFRESCO_FACES_MLTEXT_RENDERER);
   }
   
   return component;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:MultilingualTextAreaGenerator.java


示例5: generate

import javax.faces.component.UIOutput; //导入依赖的package包/类
/**
 * @see org.alfresco.web.bean.generator.IComponentGenerator#generate(javax.faces.context.FacesContext, java.lang.String)
 */
@SuppressWarnings("unchecked")
public UIComponent generate(FacesContext context, String id)
{
    UIComponent component = null;
    if (this.inEditMode == false)
    {
        component = context.getApplication().createComponent(UIOutput.COMPONENT_TYPE);
        component.setRendererType("javax.faces.Link");
        component.getAttributes().put("target", "new");
    }
    else
    {
        component = context.getApplication().createComponent(ComponentConstants.JAVAX_FACES_INPUT);
        component.setRendererType(ComponentConstants.JAVAX_FACES_TEXT);
    }
    
    FacesHelper.setupComponentId(context, component, id);    
    return component;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:23,代码来源:LinkGenerator.java


示例6: setupProperty

import javax.faces.component.UIOutput; //导入依赖的package包/类
/**
 * @see org.alfresco.web.bean.generator.BaseComponentGenerator#setupProperty(javax.faces.context.FacesContext, org.alfresco.web.ui.repo.component.property.UIPropertySheet, org.alfresco.web.ui.repo.component.property.PropertySheetItem, org.alfresco.service.cmr.dictionary.PropertyDefinition, javax.faces.component.UIComponent)
 */
@SuppressWarnings("unchecked")
@Override
protected void setupProperty(FacesContext context, UIPropertySheet propertySheet,
      PropertySheetItem item, PropertyDefinition propertyDef, UIComponent component)
{
    super.setupProperty(context, propertySheet, item, propertyDef, component);
    
    if (component.getRendererType().equals("javax.faces.Link") == true)
    {
        // Add child text component
        UIOutput output = createOutputTextComponent(context, "linklabel_" + component.getId());
        output.setValueBinding("value", component.getValueBinding("value"));
        component.getChildren().add(output);
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:19,代码来源:LinkGenerator.java


示例7: setupConverter

import javax.faces.component.UIOutput; //导入依赖的package包/类
@Override
protected void setupConverter(FacesContext context, 
      UIPropertySheet propertySheet, PropertySheetItem property, 
      PropertyDefinition propertyDef, UIComponent component)
{
   if (property.getConverter() != null)
   {
      // create and add the custom converter
      createAndSetConverter(context, property.getConverter(), component);
   }
   else
   {
      // use the default converter for the date component
      // we can cast this as we know it is an UIOutput type
      ((UIOutput)component).setConverter(getDefaultConverter(context));
   }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:18,代码来源:DatePickerGenerator.java


示例8: createAndSetConverter

import javax.faces.component.UIOutput; //导入依赖的package包/类
/**
 * Creates the converter with the given id and adds it to the component.
 * 
 * @param context FacesContext
 * @param converterId The name of the converter to create
 * @param component The component to add the converter to
 */
protected void createAndSetConverter(FacesContext context, String converterId, 
      UIComponent component)
{
   if (converterId != null && component instanceof UIOutput)
   {
      try
      {
         Converter conv = context.getApplication().createConverter(converterId);
         ((UIOutput)component).setConverter(conv);
      }
      catch (NullPointerException npe)
      {
         // workaround a NPE bug in MyFaces
         logger.warn("Converter " + converterId + " could not be applied");
      }
      catch (FacesException fe)
      {
         logger.warn("Converter " + converterId + " could not be applied");
      }
   }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:29,代码来源:BaseComponentGenerator.java


示例9: processUIComponent

import javax.faces.component.UIOutput; //导入依赖的package包/类
private void processUIComponent(UIComponent uiComponent) {

		if (uiComponent instanceof PickerUpdater) {
			PickerUpdater pu = (PickerUpdater) uiComponent;
			if (pu.isRequired()) {
				markOutputRequired(lastOutput);
			}
			return;
		}
		if (uiComponent instanceof UIInput) {
			processInput((UIInput) uiComponent);
			return;
		}
		if (uiComponent instanceof UIOutput) {
			processUIOutput((UIOutput) uiComponent);
			return;
		}
	}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:19,代码来源:RequiredPhaseListener.java


示例10: 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


示例11: 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


示例12: decode

import javax.faces.component.UIOutput; //导入依赖的package包/类
public void decode(FacesContext facesContext, UIComponent component)
{
    RendererUtils.checkParamValidity(facesContext,component,null);

    if (component instanceof UIInput)
    {
        HtmlRendererUtils.decodeUIInput(facesContext, component);
        if (component instanceof ClientBehaviorHolder &&
                !HtmlRendererUtils.isDisabled(component))
        {
            HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
        }
    }
    else if (component instanceof UIOutput)
    {
        //nothing to decode
    }
    else
    {
        throw new IllegalArgumentException("Unsupported component class " + component.getClass().getName());
    }
}
 
开发者ID:OWASP,项目名称:EJSF,代码行数:23,代码来源:EsapiTextRenderer.java


示例13: testCustomFacet

import javax.faces.component.UIOutput; //导入依赖的package包/类
public void testCustomFacet()
{
  UIViewRoot root = facesContext.getViewRoot();
  root.setId("root");
  UIForm form = new UIForm(); form.setId("form");
  UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
  UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
  UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
  UIPanel panel = new UIPanel(); panel.setId("panel");
  UIInput input = new UIInput(); input.setId("input1");

  // build the Tree...
  panel.getFacets().put("fancyFacet", input);
  nc3.getChildren().add(panel);
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(nc3);
  nc1.getChildren().add(nc2);
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(nc1);
  root.getChildren().add(new UIOutput());
  root.getChildren().add(form);

  // Get the ComponentReference util
  ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);

  // find the component...
  UIInput referencedComp = uiRef.getComponent();
  assertEquals(input, referencedComp);
  
  // find it again!
  assertEquals(input, uiRef.getComponent());
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:36,代码来源:ComponentReferenceTest.java


示例14: testCustomFacetWithFind

import javax.faces.component.UIOutput; //导入依赖的package包/类
public void testCustomFacetWithFind()
{
  UIViewRoot root = new UIViewRoot();
  root.setId("root");
  UIForm form = new UIForm(); form.setId("form");
  UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
  UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
  UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
  UIPanel panel = new UIPanel(); panel.setId("panel");
  UIInput input = new UIInput(); input.setId("input1");

  // build the Tree...
  panel.getFacets().put("fancyFacet", input);
  panel.getChildren().add(input);
  nc3.getChildren().add(panel);
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(nc3);
  nc1.getChildren().add(nc2);
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(nc1);
  root.getChildren().add(new UIOutput());
  root.getChildren().add(form);
  
  facesContext.setViewRoot(root);

  // Get the ComponentReference util
  ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);

  // find the component...
  UIInput referencedComp = uiRef.getComponent();
  assertEquals(input, referencedComp);

  // find it again!
  assertEquals(input, uiRef.getComponent());

}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:40,代码来源:ComponentReferenceTest.java


示例15: testUIDataFooterFacet

import javax.faces.component.UIOutput; //导入依赖的package包/类
public void testUIDataFooterFacet()
{
  UIViewRoot root = facesContext.getViewRoot();
  root.setId("root");
  UIForm form = new UIForm(); form.setId("form");
  UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
  UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
  UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
  UIData table = new UIData(); table.setId("table1");
  UIInput input = new UIInput(); input.setId("input1");

  // build the Tree...
  table.setFooter(input);
  nc3.getChildren().add(table);
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(nc3);
  nc1.getChildren().add(nc2);
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(nc1);
  root.getChildren().add(new UIOutput());
  root.getChildren().add(form);

  // Get the ComponentReference util
  ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);

  // find the component...
  UIInput referencedComp = uiRef.getComponent();

  assertEquals(input, referencedComp);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:34,代码来源:ComponentReferenceTest.java


示例16: testIndex

import javax.faces.component.UIOutput; //导入依赖的package包/类
public void testIndex()
{
  UIViewRoot root = facesContext.getViewRoot();
  root.setId("root");
  UIForm form = new UIForm(); form.setId("form");
  UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
  UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
  UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
  UIInput input1 = new UIInput(); input1.setId("input1");

  // build the Tree...
  nc3.getChildren().add(input1);
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(new UIOutput());
  nc2.getChildren().add(nc3);
  nc1.getChildren().add(nc2);
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(new UIOutput());
  form.getChildren().add(nc1);
  root.getChildren().add(new UIOutput());
  root.getChildren().add(form);

  // Get the ComponentReference util
  ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input1);

  // find the component...
  UIInput referencedComp = uiRef.getComponent();

  assertEquals(input1, referencedComp);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:32,代码来源:ComponentReferenceTest.java


示例17: createOutputText

import javax.faces.component.UIOutput; //导入依赖的package包/类
/**
 * Creates a new JSFComponent object.
 *
 * @param value
 *            the value
 * @return the UI output
 */
public static UIOutput createOutputText(final String value) {
	final UIOutput out = (UIOutput) JSFComponentFactory.createComponent(UIOutput.COMPONENT_TYPE);
	if (value != null) {
		out.setValueExpression("value", JSFComponentFactory.createLabelValueExpression(value));
	}
	return out;
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:15,代码来源:JSFComponentFactory.java


示例18: 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


示例19: getAudioMediaUploadPath

import javax.faces.component.UIOutput; //导入依赖的package包/类
/**
 * Get audio media upload path from the event's component tree.
 * @param ae  the event
 * @return
 */
private String getAudioMediaUploadPath(FacesEvent ae)
{
  String audioMediaUploadPath = null;

  // now find what component fired the event
  UIComponent component = ae.getComponent();
  // get the subview containing the audio question
  UIComponent parent = component.getParent();

  // get the its peer components from the parent
  List peers = parent.getChildren();

  // look for the correct file upload path information
  // held in the value of the component 'audioMediaUploadPath'
  for (int i = 0; i < peers.size(); i++)
  {
    UIComponent peer = (UIComponent) peers.get(i);

    if ("audioMediaUploadPath".equals(peer.getId()) && peer instanceof UIOutput)
    {
      audioMediaUploadPath = "" + ((UIOutput) peer).getValue();
      log.info("FOUND: Component " + i +
               " peer.getId(): " + peer.getId()+
               " peer.getValue(): " + audioMediaUploadPath );
      break;
    }
  }

  return audioMediaUploadPath;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:36,代码来源:AudioUploadActionListener.java


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CreateTxn类代码示例发布时间:2022-05-21
下一篇:
Java StaxUtils类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap