public class InstantUI extends Object
Constructor and Description |
---|
InstantUI() |
Modifier and Type | Method and Description |
---|---|
Container |
createEditUI(PropertyBusinessObject bo,
boolean autoCommit)
Creates editing UI for the given business object
|
void |
excludeProperties(PropertyBase... exclude)
Excludes the properties from the generated UI
|
void |
excludeProperty(PropertyBase exclude)
Excludes the property from the generated UI
|
UiBinding.Binding |
getBindings(Container cnt)
Returns the Binding object for the given container which allows us control over the widgets
and their commit status
|
PropertyBase[] |
getOrder()
Returns the order of the properties or null if they should use their
natural order as they were submitted to the index object
|
int |
getTextFieldConstraint(PropertyBase p)
The text field constraint for the property.
|
boolean |
isExcludedProperty(PropertyBase exclude)
Returns true if the property was excluded from the GUI
|
void |
setComponentClass(PropertyBase p,
Class cmpCls)
The component class used to map this property
|
void |
setMultiChoiceLabels(PropertyBase p,
String... labels)
A property that's a multi-choice can use this API to define the options used e.g.:
iui.setMultiChoiceLabels(c.gender, "Male", "Female", "Undefined");
iui.setMultiChoiceValues(c.gender, "M", "F", "U");
|
void |
setMultiChoiceValues(PropertyBase p,
Object... values)
A property that's a multi-choice can use this API to define the options used, notice that
this API won't work correctly without
setMultiChoiceLabels(com.codename1.properties.PropertyBase, java.lang.String...) |
void |
setOrder(PropertyBase... order)
Sets the order of the properties, notice that this can also replace exclude
|
void |
setTextFieldConstraint(PropertyBase p,
int cons)
Sets the text field constraint for the property explicitly, notice that some constraints
are implicit unless set manually e.g.
|
public void excludeProperty(PropertyBase exclude)
exclude
- the property to excludepublic void excludeProperties(PropertyBase... exclude)
exclude
- the properties to excludepublic boolean isExcludedProperty(PropertyBase exclude)
exclude
- the propertypublic void setMultiChoiceLabels(PropertyBase p, String... labels)
iui.setMultiChoiceLabels(c.gender, "Male", "Female", "Undefined");
iui.setMultiChoiceValues(c.gender, "M", "F", "U");
p
- the propertylabels
- label for each optionpublic void setMultiChoiceValues(PropertyBase p, Object... values)
setMultiChoiceLabels(com.codename1.properties.PropertyBase, java.lang.String...)
p
- the propertyvalues
- actual values used for each labelpublic void setComponentClass(PropertyBase p, Class cmpCls)
p
- the propertycmpCls
- class of the component e.g. Button.class
public void setTextFieldConstraint(PropertyBase p, int cons)
p
- the propertycons
- the text field constraintpublic int getTextFieldConstraint(PropertyBase p)
p
- the propertypublic void setOrder(PropertyBase... order)
order
- the order of the propertiespublic PropertyBase[] getOrder()
public Container createEditUI(PropertyBusinessObject bo, boolean autoCommit)
bo
- the business objectautoCommit
- true if the bindings used should be auto-committedpublic UiBinding.Binding getBindings(Container cnt)
cnt
- the container returned by the #createUI(boolean)
method