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


Java HtmlOutputText类代码示例

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


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

示例1: testRIManyAttributes

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void testRIManyAttributes() throws IOException
{
  HtmlOutputText out = _createHtmlOutputText();
  out.setValue("Plain value");
  out.setEscape(true);
  out.setId("OutId");
  out.setTitle("Short Desc");
  out.setStyleClass("Style Class");
  out.setStyle("The Style");

  UIViewRoot root = createTestTree(out, "testRIManyAttributes()");
  renderRoot(root);

  root = createTestTree(out, "testRIManyAttributes() 2");
  renderRoot(root);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:17,代码来源:CoreRenderKitPerf.java

示例2: testRISimplePerf

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void testRISimplePerf() throws IOException
{
  HtmlOutputText out = _createHtmlOutputText();
  out.setValue("Plain value");
  UIViewRoot root = createTestTree(out, "testRISimplePerf()");
  renderRoot(root);

  root = createTestTree(out, "testRISimplePerf() 2");
  renderRoot(root);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:11,代码来源:CoreRenderKitPerf.java

示例3: testComponentState

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void testComponentState() throws Exception
{
  RequestContext context = _createContext();

  try
  {
    CorePanelGroupLayout cpgl = new CorePanelGroupLayout();
    cpgl.setLayout("horizontal");
    HtmlOutputText hot = new HtmlOutputText();
    hot.setValue("foo");
    CoreOutputText cot = new CoreOutputText();
    cot.setValue("bar");

    cpgl.getChildren().add(hot);
    cpgl.getChildren().add(cot);

    Object state = context.saveComponent(cpgl);
    UIComponent restored = context.restoreComponent(state);

    assertTrue(restored instanceof CorePanelGroupLayout);
    assertEquals(restored.getChildCount(), 2);
    assertEquals(restored.getAttributes().get("layout"), "horizontal");
    UIComponent childOne = (UIComponent) restored.getChildren().get(0);
    assertTrue(childOne instanceof HtmlOutputText);
    assertEquals(childOne.getAttributes().get("value"), "foo");

    UIComponent childTwo = (UIComponent) restored.getChildren().get(1);
    assertTrue(childTwo instanceof CoreOutputText);
    assertEquals(childTwo.getAttributes().get("value"), "bar");
  }
  finally
  {
    context.release();
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:37,代码来源:RequestContextTest.java

示例4: addOneRowToTable

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
private void addOneRowToTable(List<FormFieldMetadata> row, List<UIComponent> tableChildrens, int maxFieldCounts,
		Map<String, Object> formRecordValueMap) {
	for (FormFieldMetadata field : row) {
		// Skip the reference field and non-printable field
		if ((field.getReferToFormMetadataId() != null && field.getReferToFormMetadataId() > 0)
				|| !field.getIsPrintable()) {
			continue;
		}

		HtmlOutputLabel label = new HtmlOutputLabel();
		label.setValue(field.getFieldLabel());
		HtmlOutputText text = new HtmlOutputText();
		Object value = formRecordValueMap.get(field.getColumnName());
		if (value instanceof Date) {
			value = simpleDateFormat.format(value);
		}
		text.setValue(value == null ? EMPTY_STRING : value.toString());
		tableChildrens.add(label);
		tableChildrens.add(text);
	}

	for (int i = row.size(); i < maxFieldCounts; i++) {
		HtmlOutputText emptyLabel = new HtmlOutputText();
		emptyLabel.setValue(EMPTY_STRING);
		HtmlOutputText emptyValue = new HtmlOutputText();
		emptyValue.setValue(EMPTY_STRING);
		tableChildrens.add(emptyLabel);
		tableChildrens.add(emptyValue);
	}
}
 
开发者ID:dynamo2,项目名称:tianma,代码行数:31,代码来源:FormPrintMgmtBean.java

示例5: _createHtmlOutputText

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
private HtmlOutputText _createHtmlOutputText()
{
  return new HtmlOutputText();
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:5,代码来源:CoreRenderKitPerf.java

示例6: getAsPanel

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
@Override
public Panel getAsPanel() {
	Panel p = (Panel) application.createComponent(FacesContext.getCurrentInstance(),
			"org.primefaces.component.Panel", "org.primefaces.component.PanelRenderer");
	p.setId(getPanelId());
	p.setHeader("Lamp widget");
	p.setClosable(true);
	p.setToggleable(false);
	
	AjaxBehavior ajaxBehavior = new AjaxBehavior();
	ajaxBehavior.addAjaxBehaviorListener(new AjaxBehaviorListener() {
		
		@Override
		public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException {
			manager.closedWidget(event.getComponent().getId());
		}
	});
	ajaxBehavior.setTransient(true);
	p.addClientBehavior("close", ajaxBehavior);
	
	HtmlOutputText title = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
	title.setValue(lampActor.getName());
	title.setStyle("color: #666; font-size: 25px; margin: 10px 0; display: block; text-align: center;");
	
	p.getChildren().add(title);
	p.getChildren().add(button);
	
	return p;
}
 
开发者ID:daergoth,项目名称:hiots,代码行数:30,代码来源:LampWidget.java

示例7: constructDatalinkPanelGrid

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
private void constructDatalinkPanelGrid() {
    List<UIComponent> children = this.datalinkPanelGrid.getChildren();
    children.clear();
    for (Param p : parsedVotable.getDatalinkInputParams()) {
        if (p.isIdParam()) {
            continue;
        }
        HtmlOutputText label = new HtmlOutputText();
        label.setValue(p.getName() + ": ");
        children.add(label);
        //check if there are some options available
        if (p.getOptions().isEmpty()) {
            //no options - just inputText
            InputText text = new InputText();
            text.setId("datalinkProperty" + p.getName());
            children.add(text);
        } else {
            SelectOneMenu menu = new SelectOneMenu();
            menu.setId("datalinkProperty" + p.getName());
            List<SelectItem> items = new ArrayList<>();
            SelectItem item = new SelectItem();//null value
            item.setValue("");
            item.setLabel("Nothing selected");
            items.add(item);
            for (Option o : p.getOptions()) {
                item = new SelectItem();
                item.setValue(o.getValue());
                if (o.getValue().equals(o.getName())) {
                    item.setLabel(o.getName());
                } else if (o.getName().trim().isEmpty()) {
                    item.setLabel(o.getValue());
                } else {
                    item.setLabel(o.getName() + ": " + o.getValue());
                }
                items.add(item);
            }
            UISelectItems uiContainer = new UISelectItems();
            uiContainer.setValue(items);
            menu.getChildren().add(uiContainer);
            children.add(menu);
        }
    }
}
 
开发者ID:vodev,项目名称:vocloud,代码行数:44,代码来源:SsapBean.java

示例8: encodeBegin

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {

  if (!component.isRendered()) {
    return;
  }

  ResponseWriter writer = context.getResponseWriter();
  String jsfId = (String) RendererUtil.getAttribute(context, component, "id");
  String id = jsfId;

  if (component.getId() != null &&
      !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
  {
    id = component.getClientId(context);
  }

  String title = (String) RendererUtil.getAttribute(context, component, "title");
  Object tmpFoldStr = RendererUtil.getAttribute(context, component, "hideByDefault");
  boolean foldDiv = tmpFoldStr != null && "true".equals(tmpFoldStr);
  String foldImage = foldDiv ? FOLD_IMG_HIDE : FOLD_IMG_SHOW;
  writer.write("<" + BARTAG + " class=\"" + BARSTYLE + "\">");
  writer.write("<table style=\"width: 100%;\" class=\"discTria\" cellpadding=\"0\" cellspacing=\"0\" >");
  writer.write("<tr><td  class=\"discTria\" onclick=\"javascript:showHideDivBlock('" + id +
      "', '" +  RESOURCE_PATH + "');\">" );
  writer.write("  <img id=\"" + id + "__img_hide_division_" + "\" alt=\"" +
      title + "\"");
  writer.write("    src=\""   + foldImage + "\" style=\"" + CURSOR + "\" />");
  writer.write("<h4>"  + title + "</h4>");
  writer.write("</td><td class=\"discTria\">&nbsp;</td>");
  writer.write("<td  class=\"itemAction\" style=\"text-align: right;\">");
  List childrenList = component.getChildren();
  for(int i=0; i<childrenList.size(); i++)
  	{
	UIComponent thisComponent = (UIComponent)childrenList.get(i);
    if(thisComponent instanceof org.sakaiproject.tool.messageforums.jsf.BarLinkComponent
       ||thisComponent instanceof HtmlOutputText)
    {
      thisComponent.encodeBegin(context);
      thisComponent.encodeChildren(context);
      thisComponent.encodeEnd(context);
    }
  }
  writer.write("</td></tr></table>");
  writer.write("</"+ BARTAG + ">");
  if(foldDiv) {
    writer.write("<div style=\"display:none\" " +
        " id=\"" + id + "__hide_division_" + "\">");
          } else {
              writer.write("<div style=\"display:block\" " +
                      " id=\"" + id + "__hide_division_" + "\">");
          }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:54,代码来源:HideDivisionRenderer.java

示例9: getColResourceTimeRows

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColResourceTimeRows() { return colResourceTimeRows; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:ItemParams.java

示例10: getColEngineTimeRows

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColEngineTimeRows() { return colEngineTimeRows; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:ItemParams.java

示例11: getColNameRows

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColNameRows() { return colNameRows; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:calendarMgt.java

示例12: setColNameRows

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void setColNameRows(HtmlOutputText hot) { colNameRows = hot; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:calendarMgt.java

示例13: getColNameHeader

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColNameHeader() { return colNameHeader; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:calendarMgt.java

示例14: setColNameHeader

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void setColNameHeader(HtmlOutputText hot) { colNameHeader = hot; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:calendarMgt.java

示例15: getColStartTimeRows

import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColStartTimeRows() { return colStartTimeRows; } 
开发者ID:yawlfoundation,项目名称:yawl,代码行数:2,代码来源:calendarMgt.java


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