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


Java HtmlOutputLabel.setValue方法代码示例

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


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

示例1: makeEditorLabel

import javax.faces.component.html.HtmlOutputLabel; //导入方法依赖的package包/类
/**
 * Makes a Faces HtmlOutputLabel for a metadata editor parameter.
 * @param context the UI context
 * @param section the parent section
 * @param parameter the associated parameter
 * @return the UI component
 */
public UIComponent makeEditorLabel(UiContext context,
                                   Section section,
                                   Parameter parameter) {
  HtmlOutputLabel outLabel = new HtmlOutputLabel();
  MessageBroker msgBroker = context.extractMessageBroker();
  if (parameter.getInput() != null) {
    // even label has to have unique id (for GlassFish)
    outLabel.setId(parameter.getInput().getFacesId()+"label");
    outLabel.setFor(parameter.getInput().getFacesId());
  }
  outLabel.setValue(msgBroker.retrieveMessage(getResourceKey()));
  if (parameter.getValidation().getRequired()) {
    outLabel.setStyleClass("requiredField");
  }
  return outLabel;
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:24,代码来源:Label.java

示例2: addOneRowToTable

import javax.faces.component.html.HtmlOutputLabel; //导入方法依赖的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

示例3: writeContent

import javax.faces.component.html.HtmlOutputLabel; //导入方法依赖的package包/类
private static void writeContent(List<String> row, StringListResponseWriter writer, FacesContext facesContext,
                                 int columnCount, UIComponent child) throws IOException {
    if (child instanceof HtmlCommandLink) {
        final HtmlOutputLabel label = new HtmlOutputLabel();
        label.setValue(((HtmlCommandLink) child).getValue());
        label.setRendered(child.isRendered());
        label.encodeBegin(facesContext);
        label.encodeEnd(facesContext);
    } else if (child instanceof HtmlGraphicImage) {
        writer.writeText("", "");
    //} else if (child instanceof UIInstructions) {
    //    child.encodeBegin(facesContext);
    //    child.encodeEnd(facesContext);
    //    postCleanUp(row, columnCount);
    } else if (child instanceof HtmlPanelGroup || child instanceof HtmlOutputLink) {
        final UIComponentBase uiComponent = (UIComponentBase) child;
        if (uiComponent.isRendered()) {
            for (UIComponent uiChildComponent : uiComponent.getChildren()) {
                writeContent(row, writer, facesContext, columnCount, uiChildComponent);
            }
        }
        postCleanUp(row, columnCount);
    } else {
        child.encodeBegin(facesContext);
        child.encodeEnd(facesContext);
    }
}
 
开发者ID:ButterFaces,项目名称:ButterFaces,代码行数:28,代码来源:TableExportELResolver.java

示例4: configureComponent

import javax.faces.component.html.HtmlOutputLabel; //导入方法依赖的package包/类
@Override
public void configureComponent(FacesContext facesContext, UIComponent uiComponent, Map<String, Object> metaData) {
    HtmlOutputLabel label = (HtmlOutputLabel) uiComponent;
    if (label.getFor() != null && !label.getFor().trim().isEmpty()) {
        UIComponent targetComponent = label.findComponent(label.getFor());

        if (targetComponent != null && targetComponent instanceof UIInput) {

            informationManager.determineInformation(facesContext, targetComponent);
            initializerManager.performInitialization(facesContext, targetComponent);

            boolean required = ComponentUtils.isRequired(targetComponent, facesContext);

            Object value = ComponentUtils.getValue(label, facesContext);

            if (required) {
                label.setValue(value + " *");
            } else {
                label.setValue(value);

            }
        } else {
            logger.warn("target component specified in for ('" + label.getFor() + "') not found from component " + label.getClientId(facesContext));
        }

    }
}
 
开发者ID:atbashEE,项目名称:jsf-renderer-extensions,代码行数:28,代码来源:RequiredMarkerInitializer.java

示例5: makeResultsLabel

import javax.faces.component.html.HtmlOutputLabel; //导入方法依赖的package包/类
/**
 * Makes an HtmlOutputLabel component for result text display.
 * @param facesContext the active Faces context
 * @param text the text to display
 * @return the new HtmlOutputLabel component
 */
private HtmlOutputLabel makeResultsLabel(FacesContext facesContext, String text) {
  HtmlOutputLabel outLabel = new HtmlOutputLabel();
  outLabel.setEscape(false);
  outLabel.setValue(text);
  if (getResultStyleClass().length() > 0) {
    outLabel.setStyleClass(getResultStyleClass());
  }
  return outLabel;
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:16,代码来源:PageCursorPanel.java

示例6: makeInputComponent

import javax.faces.component.html.HtmlOutputLabel; //导入方法依赖的package包/类
/**
 * Makes a Faces HtmlPanelGroup of HtmlSelectBooleanCheckbox components
 * for a parameter.
 * <p/>
 * The check boxes are based upon the defined codes for the parameter.
 * <p/>
 * The multiple values associated with the parameter 
 * (parameter.getMultipleValues()) are used to establish the 
 * selected/unselected status for each check box.
 * @param context the UI context
 * @param section the parent section
 * @param parameter the associated parameter
 * @return the UI component
 */
public UIComponent makeInputComponent(UiContext context,
                                      Section section,
                                      Parameter parameter) {
  
  // initialize the panel
  MessageBroker msgBroker = context.extractMessageBroker();
  HtmlPanelGroup panel = new HtmlPanelGroup();
  String sIdPfx = getFacesId();
  panel.setId(sIdPfx);
  
  // build a map of values
  HashMap<String,String> valuesMap = new HashMap<String,String>();
  for (ContentValue value: parameter.getContent().getMultipleValues()) {
    valuesMap.put(value.getValue(),"");
  }
  
  // add a checkbox for each code
  Codes codes = parameter.getContent().getCodes();
  for (Code code: codes.values()) {
    
    // make the checkbox
    String sKey = code.getKey();
    String sFKey = sKey.replace('.','_');
    sFKey = sKey.replace(':','_');
    String sId  = sIdPfx+"-"+sFKey;
    HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
    checkBox.setId(sId);
    checkBox.setDisabled(!getEditable());
    checkBox.setSelected(valuesMap.containsKey(sKey));
    checkBox.setOnchange(getOnChange());
    checkBox.setOnclick(getOnClick());
    panel.getChildren().add(checkBox);
    
    // make the label
    String sLabel = sKey;
    String sResKey = code.getResourceKey();
    if (sResKey.length() > 0) {
      sLabel = msgBroker.retrieveMessage(sResKey);
    }
    HtmlOutputLabel outLabel = new HtmlOutputLabel();
    // even label has to have unique id (for GlassFish)
    outLabel.setId(sId+"label");
    outLabel.setFor(sId);
    outLabel.setValue(sLabel);
    panel.getChildren().add(outLabel);
    panel.getChildren().add(makeBR());
  } 

  return panel;
}
 
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:65,代码来源:InputSelectManyCheckbox.java


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