to.etc.domui.component.form
Class ControlFactoryMoney
java.lang.Object
to.etc.domui.component.form.ControlFactoryMoney
- All Implemented Interfaces:
- ControlFactory
public class ControlFactoryMoney
- extends java.lang.Object
- implements ControlFactory
Factory which creates a Text input specialized for entering monetary amounts. This
accepts properties with type=Double/double or BigDecimal, and with one of the monetary
numeric presentations.
- Author:
- Frits Jalvingh
Created on Aug 4, 2009
Method Summary |
int |
accepts(PropertyMetaModel<?> pmm,
boolean editable,
java.lang.Class<?> controlClass,
java.lang.Object context)
Accept any type using a string. |
|
createControl(IReadOnlyModel<?> model,
PropertyMetaModel<T> pmm,
boolean editable,
java.lang.Class<?> controlClass,
java.lang.Object context)
Create a Text control with the basic monetary converter, or the proper converter for the specified type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControlFactoryMoney
public ControlFactoryMoney()
accepts
public int accepts(PropertyMetaModel<?> pmm,
boolean editable,
java.lang.Class<?> controlClass,
java.lang.Object context)
- Accept any type using a string.
- Specified by:
accepts
in interface ControlFactory
controlClass
- When set the control factory *must* be able to return a component which is assignment-compatible with this class type. If it cannot it MUST refuse to create the control.context
- TODO
- Returns:
- See Also:
to.etc.domui.component.form.ControlFactory#accepts(to.etc.domui.component.meta.PropertyMetaModel)
createControl
public <T> ControlFactoryResult createControl(IReadOnlyModel<?> model,
PropertyMetaModel<T> pmm,
boolean editable,
java.lang.Class<?> controlClass,
java.lang.Object context)
- Create a Text control with the basic monetary converter, or the proper converter for the specified type.
- Specified by:
createControl
in interface ControlFactory
controlClass
- When set the control factory *must* return a component which is assignment-compatible with this
class type. When this method is called it has already (by it's accept method) told us it can, so
not creating the proper type is not an option.context
- TODO
- Returns:
- See Also:
to.etc.domui.component.form.ControlFactory#createControl(to.etc.domui.util.IReadOnlyModel, to.etc.domui.component.meta.PropertyMetaModel, boolean)