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


Java SelectItem.getLabel方法代码示例

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


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

示例1: _convertSelectItemListToIndices

import javax.faces.model.SelectItem; //导入方法依赖的package包/类
/**
 * Rips through the list of SelectItems, and sets all item's
 * values to their index
 */
static private void _convertSelectItemListToIndices(
  List<SelectItem>     itemsToConvert)
{
  int length = itemsToConvert.size();
  // loop through each item to convert.
  for (int j=0; j < length; j++)
  {
    SelectItem oldSelectItem = itemsToConvert.get(j);
    // We have to create a new item - the old ones are not
    // necessarily ours, so we can't just mutate 'em
    SelectItem newSelectItem = new SelectItem(j,
                                             oldSelectItem.getLabel(),
                                             oldSelectItem.getDescription(),
                                             oldSelectItem.isDisabled());
    itemsToConvert.set(j, newSelectItem);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:22,代码来源:SelectManyShuttleRenderer.java

示例2: getOrgName

import javax.faces.model.SelectItem; //导入方法依赖的package包/类
String getOrgName() {

        DeleteCustomerPriceModelModel m = getModel();
        String orgId = m.getSelectedOrgId();
        String result = orgId;
        List<SelectItem> customers = m.getCustomers();
        for (SelectItem si : customers) {
            if (si.getValue().equals(orgId)) {
                result = si.getLabel();
                break;
            }
        }

        return result;
    }
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:16,代码来源:DeleteCustomerPriceModelCtrl.java

示例3: getSelectedTenantId

import javax.faces.model.SelectItem; //导入方法依赖的package包/类
private String getSelectedTenantId() {
    for (SelectItem selectedTenantItem : getSelectableTenants()) {
        if (selectedTenantItem.getValue().toString().equals(selectedTenant)) {
            return selectedTenantItem.getLabel();
        }
    }
    return "";
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:9,代码来源:OperatorOrgBean.java

示例4: ContainerInfo

import javax.faces.model.SelectItem; //导入方法依赖的package包/类
public ContainerInfo(List<SelectItem> itemsList)
{
  this.itemsList = itemsList;
  this.listCount = itemsList.size();
  for (SelectItem item : itemsList)
  {
    String text  = item.getLabel();
    if (text != null)
    {
      maxWidth = Math.max( text.length(),
                           maxWidth);
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:15,代码来源:SelectManyShuttleRenderer.java

示例5: renderNonElementContent

import javax.faces.model.SelectItem; //导入方法依赖的package包/类
@Override
protected void renderNonElementContent(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  FacesBean        bean
  ) throws IOException
{
  // http://issues.apache.org/jira/browse/ADFFACES-151
  // Getting default converter for null value leads to exception but
  // if value of component is null than there is no need to perform
  // this method
  if (getValue(component, bean) == null)
    return;

  Converter converter = getConverter(component, bean);
  if ( converter == null)
    converter = getDefaultConverter(context, component, bean);
  boolean valuePassThru = getValuePassThru(component, bean);

  // =-=AEW If needed, this could be made more efficient
  // by iterating through the list instead of getting
  // all the items
  List<SelectItem> selectItems = getSelectItems(component, converter, false);

  int selectedIndex = _getSelectedIndex(context,
                                        component,
                                        bean,
                                        selectItems,
                                        converter,
                                        valuePassThru);

  // If an item is selected, get its label.
  String text;
  if (selectedIndex >= 0)
  {
    SelectItem item = selectItems.get(selectedIndex);
    text = item.getLabel();
  }
  else
  {
    text = getUnselectedLabel(component, bean);
  }

  context.getResponseWriter().writeText(text, null);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:47,代码来源:SimpleSelectOneRenderer.java


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