Package de.xima.fc.gui.bean
Class TimeDurationBean
java.lang.Object
de.xima.fc.gui.bean.TimeDurationBean
Bean for the time duration component.
- Since:
- 8.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMaxDurationValue
(Long value, String unitName, TimeDuration target) Gets the value for the max attribute of the component.getMinDurationValue
(Long value, String unitName, TimeDuration target) Gets the value for the min attribute of the component.List<javax.faces.model.SelectItem>
getSelectItems
(Map<String, Object> attrs) Gets a list of select items for the available time units.boolean
showUnitSelect
(Map<String, Object> attrs) Whether to show the unit select.long
updateDuration
(TimeDuration duration, Map<String, Object> attrs) Converts the duration to one of the available units when the current unit is not available.
-
Constructor Details
-
TimeDurationBean
public TimeDurationBean()
-
-
Method Details
-
getMaxDurationValue
Gets the value for the max attribute of the component. Converts the configured maximum value to the currently selected unit.- Parameters:
value
- Configured maximum value.unitName
- Configured unit of the maximum value.target
- Target time duration with the currently selected unit.- Returns:
- The maximum value in the currently selected unit.
-
getMinDurationValue
Gets the value for the min attribute of the component. Converts the configured minimum value to the currently selected unit.- Parameters:
value
- Configured minimum value.unitName
- Configured unit of the minimum value.target
- Target time duration with the currently selected unit.- Returns:
- The minimum value in the currently selected unit.
-
getSelectItems
Gets a list of select items for the available time units.- Parameters:
attrs
- Attributes of the component.- Returns:
- List of available time units.
-
showUnitSelect
Whether to show the unit select. If only one unit is available, the unit select is not shown.- Parameters:
attrs
- Attributes of the component.- Returns:
- Whether to show the unit select.
-
updateDuration
Converts the duration to one of the available units when the current unit is not available.- Parameters:
duration
- Duration to modify.attrs
- Attributes of the component.- Returns:
- Always 0.
-