本文整理匯總了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);
}