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


Java UISelectItems类代码示例

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


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

示例1: setup

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    mockContext = MockFacesContext.mockFacesContext();
    testee = new DatePickerComponent();
    mockContext.getViewRoot().getChildren().add(testee);
    testee.setDayComponent(dayComponent);
    testee.setMonthComponent(monthComponent);
    testee.setYearComponent(yearComponent);

    //  create SelectItems
    dayItems = new UISelectItems();
    dayItems.setId("dayItems");
    monthItems = new UISelectItems();
    monthItems.setId("monthItems");
    yearItems = new UISelectItems();
    yearItems.setId("yearItems");

    Mockito.when(dayComponent.findComponent("dayItems")).thenReturn(dayItems);
    Mockito.when(monthComponent.findComponent("monthItems")).thenReturn(monthItems);
    Mockito.when(yearComponent.findComponent("yearItems")).thenReturn(yearItems);

}
 
开发者ID:studentloanscompany,项目名称:ft-components,代码行数:24,代码来源:DatePickerComponentTest.java

示例2: visit

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Override
public VisitResult visit(final VisitContext context, final UIComponent target) {
	// if (!target.isRendered()) {
	// return VisitResult.REJECT;
	// }

	if (target instanceof UIInput) {
		this.inputs.add((UIInput) target);
	}
	if (target instanceof UIForm) {
		this.forms.add((UIForm) target);
	}

	if (target instanceof UICommand) {
		this.commands.add((UICommand) target);
	}
	if (target instanceof UIOutput) {
		this.outputs.add((UIOutput) target);
	}
	if (target instanceof UISubmenu) {
		this.subMenus.add((UISubmenu) target);
	}
	if (target instanceof Column) {
		this.columns.add((Column) target);
	}
	if (target instanceof DataTable) {
		this.tables.add((DataTable) target);
	}
	if (target instanceof UISelectItems) {
		this.selectItems.add((UISelectItems) target);
	}
	if (target instanceof PanelGrid) {
		this.panelGrids.add((PanelGrid) target);
	}
	return VisitResult.ACCEPT;
}
 
开发者ID:kiswanij,项目名称:jk-faces,代码行数:37,代码来源:UIFacesVisitor.java

示例3: encodeBegin

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void encodeBegin(FacesContext context) throws IOException
{
   // if the component does not have any children yet create the
   // list of Charsets the user can choose from as a child 
   // SelectItems component.
   if (getChildren().size() == 0)
   {
      UISelectItems items = (UISelectItems)context.getApplication().createComponent("javax.faces.SelectItems");
      items.setId(this.getId() + "_items");
      items.setValue(createList());
      
      // add the child component
      getChildren().add(items);
   }
   
   // do the default processing
   super.encodeBegin(context);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:21,代码来源:UICharsetSelector.java

示例4: encodeBegin

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void encodeBegin(FacesContext context) throws IOException
{
   // if the component does not have any children yet create the
   // list of MIME types the user can choose from as a child 
   // SelectItems component.
   if (getChildren().size() == 0)
   {
      UISelectItems items = (UISelectItems)context.getApplication().
            createComponent("javax.faces.SelectItems");
      items.setId(this.getId() + "_items");
      items.setValue(createList());
      
      // add the child component
      getChildren().add(items);
   }
   
   // do the default processing
   super.encodeBegin(context);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:22,代码来源:UIMimeTypeSelector.java

示例5: encodeBegin

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void encodeBegin(FacesContext context) throws IOException
{
   if (getChildren().size() == 0)
   {
      UISelectItems items = (UISelectItems)context.getApplication().
            createComponent("javax.faces.SelectItems");
      items.setId(this.getId() + "_items");
      items.setValue(createList());
      
      // add the child component
      getChildren().add(items);
   }
   
   // do the default processing
   super.encodeBegin(context);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:19,代码来源:UIStoreSelector.java

示例6: encodeBegin

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void encodeBegin(FacesContext context) throws IOException
{
   // if the component does not have any children yet create the
   // list of Languages the user can choose from as a child 
   // SelectItems component.
   if (getChildren().size() == 0)
   {
      UISelectItems items = (UISelectItems) context.getApplication().
            createComponent("javax.faces.SelectItems");
      items.setId(this.getId() + "_items");
      items.setValue(createList());        
      // add the child component
      getChildren().add(items);
   }
   // do the default processing
   super.encodeBegin(context);      
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:20,代码来源:UILanguageSelector.java

示例7: generate

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public UIComponent generate(FacesContext context, String id)
{
      UIComponent component = context.getApplication().
            createComponent(UISelectOne.COMPONENT_TYPE);
      FacesHelper.setupComponentId(context, component, id);        
      
      // create the list of choices
       UISelectItems itemsComponent = (UISelectItems)context.getApplication().
          createComponent("javax.faces.SelectItems");
      
       itemsComponent.setValue(getLanguageItems());
       
       // add the items as a child component
       component.getChildren().add(itemsComponent);
       
      return component;
 }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:19,代码来源:LanguageSelectorGenerator.java

示例8: findNextValidChild

import javax.faces.component.UISelectItems; //导入依赖的package包/类
/**
 * @return the next valid child for processing
 */
private Object findNextValidChild() {

	if (kids.hasNext()) {
		Object next = kids.next();
		while (kids.hasNext()
				&& !(next instanceof UISelectItem || next instanceof UISelectItems)) {
			next = kids.next();
		}
		if (next instanceof UISelectItem || next instanceof UISelectItems) {
			return next;
		}
	}
	return null;

}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:19,代码来源:SelectItemsIterator.java

示例9: getSelectRemoteType

import javax.faces.component.UISelectItems; //导入依赖的package包/类
/**
 * @return
 */
public HtmlSelectOneMenu getSelectRemoteType() {
	remoteDropDown = new HtmlSelectOneMenu();
	final Collection<SelectItem> list = new ArrayList<SelectItem>();

	initComponents();

	for (RemoteType r : this.remoteList) {
		list.add(new SelectItem(r.getRemoteTypeName()));
	}
	final UISelectItems items = new UISelectItems();
	items.setValue(list);
	remoteDropDown.getChildren().add(items);

	return remoteDropDown;
}
 
开发者ID:Comcast,项目名称:cats,代码行数:19,代码来源:KeyManager.java

示例10: getSelectKeyCodeFormat

import javax.faces.component.UISelectItems; //导入依赖的package包/类
/**
 * @return
 */
public HtmlSelectOneMenu getSelectKeyCodeFormat() {

	kcFormatDropDown = new HtmlSelectOneMenu();
	final Collection<SelectItem> list = new ArrayList<SelectItem>();

	initComponents();

	for (KeyCodeFormat kcf : this.kcfList) {
		list.add(new SelectItem(kcf.getKeyCodeFormatName()));
	}
	final UISelectItems items = new UISelectItems();
	items.setValue(list);
	this.kcFormatDropDown.getChildren().add(items);

	return kcFormatDropDown;
}
 
开发者ID:Comcast,项目名称:cats,代码行数:20,代码来源:KeyManager.java

示例11: ArrayIterator

import javax.faces.component.UISelectItems; //导入依赖的package包/类
private ArrayIterator(FacesContext ctx,
		UISelectItems sourceComponent,
		Object array) {
	super(sourceComponent);
	this.ctx = ctx;
	this.array = array;
	count = Array.getLength(array);
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:9,代码来源:SelectItemsIterator.java

示例12: GenericObjectSelectItem

import javax.faces.component.UISelectItems; //导入依赖的package包/类
private GenericObjectSelectItem(UISelectItems sourceComponent) {
	var = (String) sourceComponent.getAttributes().get(VAR);
	this.sourceComponent = sourceComponent;
	// itemValue = sourceComponent.getValueExpression(ITEM_VALUE);
	// itemLabel = sourceComponent.getValueExpression(ITEM_LABEL);
	// itemDescription = sourceComponent.getValueExpression(ITEM_DESCRIPTION);
	// itemEscaped = sourceComponent.getValueExpression(ITEM_ESCAPED);
	// itemDisabled = sourceComponent.getValueExpression(ITEM_DISABLED);
	// noSelectionOption = sourceComponent.getValueExpression(NO_SELECTION_OPTION);
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:11,代码来源:SelectItemsIterator.java

示例13: IterableItemIterator

import javax.faces.component.UISelectItems; //导入依赖的package包/类
private IterableItemIterator(FacesContext ctx,
		UISelectItems sourceComponent,
		Iterable<?> iterable) {
	super(sourceComponent);
	this.ctx = ctx;
	this.iterator = iterable.iterator();
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:8,代码来源:SelectItemsIterator.java

示例14: findNextValidChild

import javax.faces.component.UISelectItems; //导入依赖的package包/类
/**
 * @return the next valid child for processing
 */
private Object findNextValidChild() {
	if (kids.hasNext()) {
		Object next = kids.next();
		while (kids.hasNext() && !(next instanceof UISelectItem || next instanceof UISelectItems)) {
			next = kids.next();
		}
		if (next instanceof UISelectItem || next instanceof UISelectItems) {
			return next;
		}
	}
	return null;
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:16,代码来源:SelectItemsIterator.java

示例15: encodeBegin

import javax.faces.component.UISelectItems; //导入依赖的package包/类
@Override
public void encodeBegin(FacesContext context) throws IOException {

    // Dynamically generate dropdown selectItems based on component
    // attributes
    UISelectItems dayItems = (UISelectItems) dayComponent.findComponent(SELECT_ITEMS_DAY_ID);
    dayItems.setValue(getDays());

    UISelectItems monthItems = (UISelectItems) monthComponent.findComponent(SELECT_ITEMS_MONTH_ID);
    monthItems.setValue(getMonths());

    UISelectItems yearItems = (UISelectItems) yearComponent.findComponent(SELECT_ITEMS_YEAR_ID);
    yearItems.setValue(getYears());

    // set dropdowns to values in bound date in model
    Date dateValue = (Date) getValue();
    if (dateValue != null) {

        Calendar cal = Calendar.getInstance();
        cal.setTime(dateValue);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        dayComponent.setValue(day);
        int month = cal.get(Calendar.MONTH);
        monthComponent.setValue(month + 1);
        int year = cal.get(Calendar.YEAR);
        yearComponent.setValue(year);
    } else {
        dayComponent.setValue(null);
        monthComponent.setValue(null);
        yearComponent.setValue(null);
    }
    super.encodeBegin(context);
}
 
开发者ID:studentloanscompany,项目名称:ft-components,代码行数:34,代码来源:DatePickerComponent.java


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