javax.faces.component.UISelectItems Java Examples

The following examples show how to use javax.faces.component.UISelectItems. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SelectItemsIterator.java    From ctsms with GNU Lesser General Public License v2.1 5 votes vote down vote up
private ArrayIterator(FacesContext ctx,
		UISelectItems sourceComponent,
		Object array) {
	super(sourceComponent);
	this.ctx = ctx;
	this.array = array;
	count = Array.getLength(array);
}
 
Example #2
Source File: SelectItemsIterator.java    From ctsms with GNU Lesser General Public License v2.1 5 votes vote down vote up
private IterableItemIterator(FacesContext ctx,
		UISelectItems sourceComponent,
		Iterable<?> iterable) {
	super(sourceComponent);
	this.ctx = ctx;
	this.iterator = iterable.iterator();
}
 
Example #3
Source File: SelectItemsIterator.java    From ctsms with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * @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;
}
 
Example #4
Source File: SelectItemUtils.java    From BootsFaces-OSP with Apache License 2.0 5 votes vote down vote up
/**
 * Copied from the InputRenderer class of PrimeFaces 5.1.
 *
 * @param context
 * @param uiSelectItems
 * @param value
 * @param label
 * @return
 */
private static SelectItem createSelectItem(FacesContext context, UISelectItems uiSelectItems, Object value,
        Object label) {
    String var = (String) uiSelectItems.getAttributes().get("var");
    Map<String, Object> attrs = uiSelectItems.getAttributes();
    Map<String, Object> requestMap = context.getExternalContext().getRequestMap();

    if (var != null) {
        requestMap.put(var, value);
    }

    Object itemLabelValue = attrs.get("itemLabel");
    Object itemValue = attrs.get("itemValue");
    String description = (String) attrs.get("itemDescription");
    Object itemDisabled = attrs.get("itemDisabled");
    Object itemEscaped = attrs.get("itemLabelEscaped");
    Object noSelection = attrs.get("noSelectionOption");

    if (itemValue == null) {
        itemValue = value;
    }

    if (itemLabelValue == null) {
        itemLabelValue = label;
    }

    String itemLabel = itemLabelValue == null ? String.valueOf(value) : String.valueOf(itemLabelValue);
    boolean disabled = itemDisabled == null ? false : Boolean.valueOf(itemDisabled.toString());
    boolean escaped = itemEscaped == null ? false : Boolean.valueOf(itemEscaped.toString());
    boolean noSelectionOption = noSelection == null ? false : Boolean.valueOf(noSelection.toString());

    if (var != null) {
        requestMap.remove(var);
    }

    return new SelectItem(itemValue, itemLabel, description, disabled, escaped, noSelectionOption);
}
 
Example #5
Source File: SelectMultiMenuRenderer.java    From BootsFaces-OSP with Apache License 2.0 5 votes vote down vote up
/**
 * Copied from the InputRenderer class of PrimeFaces 5.1.
 *
 * @param context
 * @param uiSelectItems
 * @param value
 * @param label
 * @return
 */
protected SelectItem createSelectItem(FacesContext context, UISelectItems uiSelectItems, Object value,
		Object label) {
	String var = (String) uiSelectItems.getAttributes().get("var");
	Map<String, Object> attrs = uiSelectItems.getAttributes();
	Map<String, Object> requestMap = context.getExternalContext().getRequestMap();

	if (var != null) {
		requestMap.put(var, value);
	}

	Object itemLabelValue = attrs.get("itemLabel");
	Object itemValue = attrs.get("itemValue");
	String description = (String) attrs.get("itemDescription");
	Object itemDisabled = attrs.get("itemDisabled");
	Object itemEscaped = attrs.get("itemLabelEscaped");
	Object noSelection = attrs.get("noSelectionOption");

	if (itemValue == null) {
		itemValue = value;
	}

	if (itemLabelValue == null) {
		itemLabelValue = label;
	}

	String itemLabel = itemLabelValue == null ? String.valueOf(value) : String.valueOf(itemLabelValue);
	boolean disabled = itemDisabled == null ? false : Boolean.valueOf(itemDisabled.toString());
	boolean escaped = itemEscaped == null ? false : Boolean.valueOf(itemEscaped.toString());
	boolean noSelectionOption = noSelection == null ? false : Boolean.valueOf(noSelection.toString());

	if (var != null) {
		requestMap.remove(var);
	}

	return new SelectItem(itemValue, itemLabel, description, disabled, escaped, noSelectionOption);
}
 
Example #6
Source File: CreateExecutionDegreesForExecutionYearBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
public UISelectItems getDegreeCurricularPlansSelectItems() {
    if (this.degreeCurricularPlansSelectItems == null) {
        final DegreeType degreeType = getDegreeType(getChosenDegreeType());

        final List<SelectItem> result;
        if (degreeType == null) {
            result = Collections.EMPTY_LIST;
        } else {
            result = new ArrayList<SelectItem>();

            final List<DegreeCurricularPlan> toShow =
                    DegreeCurricularPlan.readByDegreeTypeAndState(Predicate.isEqual(degreeType),
                            DegreeCurricularPlanState.ACTIVE);
            Collections
                    .sort(toShow,
                            DegreeCurricularPlan.DEGREE_CURRICULAR_PLAN_COMPARATOR_BY_DEGREE_TYPE_AND_EXECUTION_DEGREE_AND_DEGREE_CODE);

            for (final DegreeCurricularPlan degreeCurricularPlan : toShow) {
                result.add(new SelectItem(degreeCurricularPlan.getExternalId(), degreeType.getName().getContent() + " "
                        + degreeCurricularPlan.getDegree().getName() + " - " + degreeCurricularPlan.getName()));
            }
        }
        this.degreeCurricularPlansSelectItems = new UISelectItems();
        this.degreeCurricularPlansSelectItems.setValue(result);
    }

    return this.degreeCurricularPlansSelectItems;
}
 
Example #7
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setDegreeModuleItems(UISelectItems degreeModuleItems) {
    this.degreeModuleItems = degreeModuleItems;
}
 
Example #8
Source File: SelectItemsIterator.java    From ctsms with GNU Lesser General Public License v2.1 4 votes vote down vote up
private GenericObjectSelectItem(UISelectItems sourceComponent) {
	var = (String) sourceComponent.getAttributes().get(VAR);
	this.sourceComponent = sourceComponent;
}
 
Example #9
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCourseGroupItems(UISelectItems courseGroupItems) {
    this.courseGroupItems = courseGroupItems;
}
 
Example #10
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setDegreeTypeItems(final UISelectItems input) {
    this.degreeTypeItems = input;
}
 
Example #11
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setDegreeItems(UISelectItems degreeItems) {
    this.degreeItems = degreeItems;
}
 
Example #12
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setDepartmentUnitItems(UISelectItems departmentUnitItems) {
    this.departmentUnitItems = departmentUnitItems;
}
 
Example #13
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setBeginExecutionPeriodItemsForRule(UISelectItems beginExecutionPeriodItemsForRule) {
    this.beginExecutionPeriodItemsForRule = beginExecutionPeriodItemsForRule;
}
 
Example #14
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setEndExecutionPeriodItemsForRule(UISelectItems endExecutionPeriodItemsForRule) {
    this.endExecutionPeriodItemsForRule = endExecutionPeriodItemsForRule;
}
 
Example #15
Source File: CompositeRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCurricularRuleItems(UISelectItems curricularRuleItems) {
    this.curricularRuleItems = curricularRuleItems;
}
 
Example #16
Source File: CompositeRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setBeginExecutionPeriodItemsForCompositeRule(UISelectItems beginExecutionPeriodItemsForCompositeRule) {
    this.beginExecutionPeriodItemsForCompositeRule = beginExecutionPeriodItemsForCompositeRule;
}
 
Example #17
Source File: CompositeRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setEndExecutionPeriodItemsForCompositeRule(UISelectItems endExecutionPeriodItemsForCompositeRule) {
    this.endExecutionPeriodItemsForCompositeRule = endExecutionPeriodItemsForCompositeRule;
}
 
Example #18
Source File: CurricularRulesManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCurricularRuleTypeItems(UISelectItems ruleTypeItems) {
    this.curricularRuleTypeItems = ruleTypeItems;
}
 
Example #19
Source File: CompetenceCourseManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCompetenceCourseExecutionSemesters(UISelectItems competenceCourseExecutionSemesters) {
    this.competenceCourseExecutionSemesters = competenceCourseExecutionSemesters;
}
 
Example #20
Source File: CompetenceCourseManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setFutureExecutionSemesterItems(UISelectItems futureExecutionSemesterItems) {
    this.futureExecutionSemesterItems = futureExecutionSemesterItems;
}
 
Example #21
Source File: CompetenceCourseManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCompetenceCourseGroupUnitItems(UISelectItems competenceCourseGroupUnitItems) {
    this.competenceCourseGroupUnitItems = competenceCourseGroupUnitItems;
}
 
Example #22
Source File: CompetenceCourseManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setScientificAreaUnitItems(UISelectItems scientificAreaUnitItems) {
    this.scientificAreaUnitItems = scientificAreaUnitItems;
}
 
Example #23
Source File: CompetenceCourseManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setDepartmentUnitItems(UISelectItems departmentUnitItems) {
    this.departmentUnitItems = departmentUnitItems;
}
 
Example #24
Source File: CreateExecutionDegreesForExecutionYearBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setBolonhaDegreeCurricularPlansSelectItems(UISelectItems bolonhaDegreeCurricularPlansSelectItems) {
    this.bolonhaDegreeCurricularPlansSelectItems = bolonhaDegreeCurricularPlansSelectItems;
}
 
Example #25
Source File: CreateExecutionDegreesForExecutionYearBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setDegreeCurricularPlansSelectItems(UISelectItems degreeCurricularPlansSelectItems) {
    this.degreeCurricularPlansSelectItems = degreeCurricularPlansSelectItems;
}
 
Example #26
Source File: SelectItemsIterator.java    From ctsms with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected GenericObjectSelectItemIterator(UISelectItems sourceComponent) {
	this.sourceComponent = sourceComponent;
}
 
Example #27
Source File: CompetenceCourseManagementBackingBean.java    From fenixedu-academic with GNU Lesser General Public License v3.0 2 votes vote down vote up
public void setExecutionSemesterItems(UISelectItems executionSemesterItems) {

    }