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