public class InstantUI
- Object
- InstantUI
Instant UI generates a user interface for editing a property business object based on common
conventions and settings within the properties. UI’s are automatically bound and work seamlessly.
Important: These UI’s are subject to change, e.g. a generated UI might not have
validation for a specific property in one build and might introduce it in an update. We try to generate
great UI’s seamlessly and some improvements might break functionality.
Constructors
public InstantUI() |
Methods
public void excludeProperty(PropertyBase exclude) | Excludes the property from the generated UI |
public void excludeProperties(PropertyBase... exclude) | Excludes the properties from the generated UI |
public boolean isExcludedProperty(PropertyBase exclude) | Returns true if the property was excluded from the GUI |
public 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"); |
public 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 java.lang.String...) |
public void setComponentClass(PropertyBase p, Class cmpCls) | The component class used to map this property |
public 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. numeric for numbers or password for fields with password in the name |
public int getTextFieldConstraint(PropertyBase p) | The text field constraint for the property. |
public 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 |
public void setOrder(PropertyBase... order) | Sets the order of the properties, notice that this can also replace exclude |
public Container createEditUI(PropertyBusinessObject bo, boolean autoCommit) | Creates editing UI for the given business object |
public UiBinding.Binding getBindings(Container cnt) | Returns the Binding object for the given container which allows us control over the widgets and their commit status |
Inherited methods
Constructor details
InstantUI
public InstantUI()Method details
excludeProperty
public void excludeProperty(PropertyBase exclude)Excludes the property from the generated UI
Parameters
excludePropertyBase- the property to exclude
excludeProperties
public void excludeProperties(PropertyBase... exclude)Excludes the properties from the generated UI
Parameters
excludePropertyBase...- the properties to exclude
isExcludedProperty
public boolean isExcludedProperty(PropertyBase exclude)Returns true if the property was excluded from the GUI
Parameters
excludePropertyBase- the property
Returns
true if the property was excluded from the GUI
setMultiChoiceLabels
public 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");Parameters
pPropertyBase- the property
labelsString...- label for each option
setMultiChoiceValues
public 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
java.lang.String...)Parameters
pPropertyBase- the property
valuesObject...- actual values used for each label
setComponentClass
public void setComponentClass(PropertyBase p, Class cmpCls)The component class used to map this property
Parameters
pPropertyBase- the property
cmpClsClass- class of the component e.g.
Button.class
setTextFieldConstraint
public 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. numeric for numbers or password for fields with password
in the name
Parameters
pPropertyBase- the property
consint- the text field constraint
getTextFieldConstraint
public int getTextFieldConstraint(PropertyBase p)The text field constraint for the property. notice that some constraints
are implicit unless set manually e.g. numeric for numbers or password for fields with password
in the name
Parameters
pPropertyBase- the property
Returns
the constraint matching this property
getOrder
public 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
Returns
the property order
setOrder
public void setOrder(PropertyBase... order)Sets the order of the properties, notice that this can also replace exclude
Parameters
orderPropertyBase...- the order of the properties
createEditUI
public Container createEditUI(PropertyBusinessObject bo, boolean autoCommit)Creates editing UI for the given business object
Parameters
boPropertyBusinessObject- the business object
autoCommitboolean- true if the bindings used should be auto-committed
Returns
a UI container that can be used to edit the business object
getBindings
public UiBinding.Binding getBindings(Container cnt)Returns the Binding object for the given container which allows us control over the widgets
and their commit status
Parameters
cntContainer- the container returned by the
#createUI(boolean)method
Returns
a binding object