|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ControlFactory
A factory which creates the correct EDITING control to edit a property, specified by the property's PropertyMetaModel. The DomApplication will contain a list of ControlFactories. When an edit control is needed this list is obtained and each ControlFactory in it has it's accepts() method called. This returns a "score" for each control factory. The first factory with the highest score (which must be > 0) will be used to create the control. If no factory returns a > 0 score a control cannot be created which usually results in an exception.
Field Summary | |
---|---|
static ControlFactory |
BOOLEAN_AND_ENUM_CF
|
static ControlFactory |
DATE_CF
|
static ControlFactory |
RELATION_COMBOBOX_CF
Factory for UP relations. |
static ControlFactory |
RELATION_LOOKUP_CF
|
static ControlFactory |
STRING_CF
This is a fallback factory; it accepts anything and shows a String edit component for it. |
static ControlFactory |
TEXTAREA_CF
|
Method Summary | ||
---|---|---|
int |
accepts(PropertyMetaModel<?> pmm,
boolean editable,
java.lang.Class<?> controlClass,
java.lang.Object context)
This must return a +ve value when this factory accepts the specified property; the returned value is an eagerness score. |
|
|
createControl(IReadOnlyModel<?> model,
PropertyMetaModel<T> pmm,
boolean editable,
java.lang.Class<?> controlClass,
java.lang.Object context)
This MUST create all nodes necessary for a control to edit the specified item. |
Field Detail |
---|
static final ControlFactory TEXTAREA_CF
static final ControlFactory STRING_CF
static final ControlFactory BOOLEAN_AND_ENUM_CF
static final ControlFactory DATE_CF
static final ControlFactory RELATION_COMBOBOX_CF
static final ControlFactory RELATION_LOOKUP_CF
Method Detail |
---|
int accepts(@Nonnull PropertyMetaModel<?> pmm, boolean editable, @Nullable java.lang.Class<?> controlClass, @Nullable java.lang.Object context)
pmm
- editable
- 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
<T> ControlFactoryResult createControl(@Nonnull IReadOnlyModel<?> model, @Nonnull PropertyMetaModel<T> pmm, boolean editable, @Nullable java.lang.Class<?> controlClass, @Nullable java.lang.Object context)
pmm
- editable
- 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
- TODOcontainer
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |