本文整理汇总了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);
}
}
示例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;
}
示例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 "";
}
示例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);
}
}
}
示例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);
}