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


Java SelectItem类代码示例

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


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

示例1: initServiceInstanceRows

import javax.faces.model.SelectItem; //导入依赖的package包/类
private List<ServiceInstanceRow> initServiceInstanceRows()
        throws ServiceInstanceException {
    List<ServiceInstance> serviceInstances = getServiceInstanceService()
            .getInstancesForController(getControllerId());
    List<ServiceInstanceRow> result = new ArrayList<>();
    if (serviceInstances == null) {
        return result;
    }
    for (ServiceInstance serviceInstance : serviceInstances) {
        List<SelectItem> selectableOperations = initSelectableOperaions(
                serviceInstance);
        ServiceInstanceRow row = new ServiceInstanceRow(serviceInstance,
                selectableOperations);
        result.add(row);
    }
    return result;

}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:19,代码来源:ManageServiceInstanceCtrl.java

示例2: _isNothingSelected

import javax.faces.model.SelectItem; //导入依赖的package包/类
private boolean _isNothingSelected(
  UIComponent      component,
  List<SelectItem> selectItems)
{
  // Assume the component is a value holder
  Object value = ((ValueHolder) component).getValue();
  if (value == null)
    return true;
  // now check if none of the items' values match the value.
  int size = selectItems.size();
  for (int i=0; i < size; i++)
  {
    SelectItem item = selectItems.get(i);
    if (value.equals(item.getValue()))
      return false;
  }
  return true;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:19,代码来源:ChoiceRenderer.java

示例3: initSets

import javax.faces.model.SelectItem; //导入依赖的package包/类
private void initSets() {
	collidingProbandStatusEntryModelCache.clear();
	visitScheduleItemModel.setTrialId(in.getTrialId());
	visitScheduleItemModel.updateRowCount();
	visits = WebUtil.getVisits(in.getTrialId());
	probandGroups = WebUtil.getProbandGroups(in.getTrialId());
	filterProbandGroups = new ArrayList<SelectItem>(probandGroups);
	filterProbandGroups.add(0, new SelectItem(CommonUtil.NO_SELECTION_VALUE, ""));
	filterVisits = new ArrayList<SelectItem>(visits);
	filterVisits.add(0, new SelectItem(CommonUtil.NO_SELECTION_VALUE, ""));
	matrix.initPages();
	// loadMatrix();
	trial = WebUtil.getTrial(this.in.getTrialId());
	if (WebUtil.isTrialLocked(trial)) {
		Messages.addLocalizedMessage(FacesMessage.SEVERITY_WARN, MessageCodes.TRIAL_LOCKED);
	}
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:18,代码来源:VisitScheduleBean.java

示例4: getItemValue

import javax.faces.model.SelectItem; //导入依赖的package包/类
/**
 * Return the value to output for an item.
 */
static public Object getItemValue(
  FacesContext context,
  UIComponent  component,
  SelectItem   item,
  Converter    converter,
  boolean      valuePassThru,
  int          index)
{
  if (!valuePassThru)
  {
    return IntegerUtils.getString(index);
  }
  else
  {
    Object itemValue = item.getValue();
    if ((itemValue != null) && (converter != null))
    {
      itemValue = converter.getAsString(context,
                                        component,
                                        itemValue);
    }

    return itemValue;
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:SimpleSelectOneRenderer.java

示例5: getAsObject

import javax.faces.model.SelectItem; //导入依赖的package包/类
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
	// if (submittedValue.trim().equals(CommonUtil.NO_SELECTION_VALUE)) {
	// return null;
	// } else {
	// http://stackoverflow.com/questions/9147119/avoid-extra-db-reads-in-the-getasobject-method-of-converter-class-by-caching-dat
	Iterator<SelectItem> it = new SelectItemsIterator(facesContext, component);
	while (it.hasNext()) {
		Object value = it.next().getValue();
		if (value instanceof ECRFSectionProgressVO) {
			if (submittedValue.equals(((ECRFSectionProgressVO) value).getSection())) {
				return value;
			}
		} else if (value instanceof String) {
			if (submittedValue.equals(value)) {
				ECRFSectionProgressVO progress = new EcrfSectionProgressItemValue();
				progress.setSection((String) value);
				return progress;
			}
		}
	}
	// System.out.println("section progress for " + submittedValue + " not found");
	return null;
	// }
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:26,代码来源:ECRFSectionProgressConverter.java

示例6: calcItems

import javax.faces.model.SelectItem; //导入依赖的package包/类
private static int calcItems(
  SelectItem item)
{
  if(item instanceof SelectItemGroup)
  {
    int count = 0;
    SelectItem[] items;
    items = ((SelectItemGroup)item).getSelectItems();

    for(int i = 0; i < items.length; i++)
    {
      count += calcItems( items[i] );
    }

    return count;
  }

  return 1;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:20,代码来源:SimpleSelectOneRenderer.java

示例7: loadMarketplaces_NoMarketplaceOwner

import javax.faces.model.SelectItem; //导入依赖的package包/类
/**
 * The user has only the SERVICE_MANAGER role, therefore only marketplaces
 * with publishing rights must be loaded.
 */
@Test
public void loadMarketplaces_NoMarketplaceOwner() {
    // given two marketplaces
    doReturn(Boolean.FALSE).when(marketplaceGotoBean)
            .isLoggedInAndMarketplaceOwner();
    given(mpServiceMock.getMarketplacesForOrganization()).willReturn(
            marketplace(1L, "publishedMp"));
    given(mpServiceMock.getMarketplacesOwned()).willReturn(
            marketplace(2L, "ownedMp"));

    // when
    List<SelectItem> marketplaces = marketplaceGotoBean.getMarketplaces();

    // then only one is loaded
    assertEquals(1, marketplaces.size());
    assertEquals("publishedMp", marketplaces.get(0).getValue());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:22,代码来源:GotoMarketplaceBeanTest.java

示例8:

import javax.faces.model.SelectItem; //导入依赖的package包/类
@PostConstruct
/*     */   public void init()
/*     */   {
/*  48 */     SelectItemGroup g1 = new SelectItemGroup("German Cars");
/*  49 */     g1.setSelectItems(new SelectItem[] { new SelectItem("BMW", "BMW"), new SelectItem("Mercedes", "Mercedes"), new SelectItem("Volkswagen", "Volkswagen") });
/*     */ 
/*  51 */     SelectItemGroup g2 = new SelectItemGroup("American Cars");
/*  52 */     g2.setSelectItems(new SelectItem[] { new SelectItem("Chrysler", "Chrysler"), new SelectItem("GM", "GM"), new SelectItem("Ford", "Ford") });
/*     */ 
/*  54 */     this.cars = new ArrayList();
/*  55 */     this.cars.add(g1);
/*  56 */     this.cars.add(g2);
/*     */ 
/*  59 */     this.cities = new HashMap();
/*  60 */     this.cities.put("New York", "New York");
/*  61 */     this.cities.put("London", "London");
/*  62 */     this.cities.put("Paris", "Paris");
/*  63 */     this.cities.put("Barcelona", "Barcelona");
/*  64 */     this.cities.put("Istanbul", "Istanbul");
/*  65 */     this.cities.put("Berlin", "Berlin");
/*     */ 
/*  68 */     this.themes = this.service.getThemes();
/*     */   }
 
开发者ID:marlonalexis,项目名称:Multicentro_Mascotas,代码行数:24,代码来源:SelectOneMenuView.java

示例9: _createNavigationItem

import javax.faces.model.SelectItem; //导入依赖的package包/类
private SelectItem _createNavigationItem(
  FacesContext     context,
  RenderingContext rc,
  UIComponent      component,
  long             blockStart,
  int              blockSize,
  long             maxValue,
  String           text,
  UIComponent      rangeLabel
  )
{
  // if text isn't null, it is More or Previous.
  if (text == null)
    text = _getRangeString(context,
                           rc,
                           component,
                           blockStart,
                           blockSize,
                           maxValue,
                           rangeLabel);

  return new SelectItem(IntegerUtils.getString(blockStart),
                        text);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:25,代码来源:SelectRangeChoiceBarRenderer.java

示例10: selectTypeUser

import javax.faces.model.SelectItem; //导入依赖的package包/类
public void selectTypeUser(){
    selectTypeDoc = new SelectItem[alltd.size()];
    
    for(int i = 0; i < alltd.size();i++){
        TypeDoc td1 = alltd.get(i);
        selectTypeDoc[i] = new SelectItem(td1.getTypedocId(),td1.getName());
    }
}
 
开发者ID:Whistler092,项目名称:programacion4-final,代码行数:9,代码来源:ControllerDocument.java

示例11: getFilterEventImportances

import javax.faces.model.SelectItem; //导入依赖的package包/类
public synchronized ArrayList<SelectItem> getFilterEventImportances() {
	if (filterEventImportances == null) {
		filterEventImportances = WebUtil.getEventImportances();
		filterEventImportances.add(0, new SelectItem(CommonUtil.NO_SELECTION_VALUE, ""));
	}
	return filterEventImportances;
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:8,代码来源:SessionScopeBean.java

示例12: initSelectableOperaions

import javax.faces.model.SelectItem; //导入依赖的package包/类
private List<SelectItem> initSelectableOperaions(
        ServiceInstance serviceInstance) {
    List<SelectItem> selectableOperations = new ArrayList<>();
    for (InstanceOperation operation : getServiceInstanceService()
            .listOperationsForInstance(serviceInstance)) {
        if (filterOperation(operation, serviceInstance)) {
            selectableOperations.add(new SelectItem(operation));
        }
    }
    return selectableOperations;
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:12,代码来源:ManageServiceInstanceCtrl.java

示例13: getFilterVariablePeriods

import javax.faces.model.SelectItem; //导入依赖的package包/类
public synchronized ArrayList<SelectItem> getFilterVariablePeriods() {
	if (filterVariablePeriods == null) {
		filterVariablePeriods = WebUtil.getVariablePeriods();
		filterVariablePeriods.add(0, new SelectItem(CommonUtil.NO_SELECTION_VALUE, ""));
	}
	return filterVariablePeriods;
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:8,代码来源:SessionScopeBean.java

示例14: initSets

import javax.faces.model.SelectItem; //导入依赖的package包/类
private void initSets() {
	costTypesTruncated = null;
	isCostTypeColumnsTruncated = false;
	truncatedCostTypes = null;
	if (costTypes == null) {
		costTypes = new ArrayList<String>();
		costTypesTruncated = costTypes;
		truncatedCostTypes = new ArrayList<SelectItem>();
		truncatedCostTypeIndex = null;
	} else {
		Long limit = Settings.getLongNullable(SettingCodes.MAX_COST_TYPES_COLUMNS, Bundle.SETTINGS, DefaultSettings.MAX_COST_TYPES_COLUMNS);
		truncatedCostTypes = new ArrayList<SelectItem>();
		if (limit != null && costTypes.size() > limit) {
			costTypesTruncated = new ArrayList<String>();
			Iterator<String> it = costTypes.iterator();
			Long index = 0l;
			while (it.hasNext()) {
				if ((costTypesTruncated.size() + 1) < limit) {
					costTypesTruncated.add(it.next());
				} else {
					if (truncatedCostTypeIndex == null) {
						truncatedCostTypeIndex = index;
					}
					truncatedCostTypes.add(new SelectItem(index.toString(), it.next()));
				}
				index++;
			}
			isCostTypeColumnsTruncated = true;
		} else {
			costTypesTruncated = costTypes;
			truncatedCostTypeIndex = null;
		}
	}
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:35,代码来源:ProbandMoneyTransferSummaryLazyModelBase.java

示例15: setPublicLandingpageSelected

import javax.faces.model.SelectItem; //导入依赖的package包/类
private void setPublicLandingpageSelected() {
    model.setLandingpageType(LandingpageType.PUBLIC.name());
    model.setSelectedMarketplace(PUBLIC_MARKETPLACE_ID);
    model.setLandingpageConfig(new POPublicLandingpageConfig());
    model.setAvailableServices(new ArrayList<POService>());
    model.setFillinItems(new ArrayList<SelectItem>());
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:8,代码来源:CustomizeLandingpageCtrlTest.java


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