| |
|
| java.lang.Object org.millstone.base.ui.AbstractComponent org.millstone.base.ui.AbstractField org.millstone.base.ui.Form
Form | public class Form extends AbstractField implements Item.Editor,Buffered,Item,Validatable(Code) | | Form component provides easy way of creating and managing sets fields.
Form is a container for fields implementing
Field interface. It
provides support for any layouts and provides buffering interface for easy
connection of commit- and discard buttons. All the form fields can be
customized by adding validators, setting captions and icons, setting
immediateness, etc. Also direct mechanism for replacing existing fields with
selections is given.
Form provides customizable editor for classes implementing
org.millstone.base.data.Item interface. Also the form itself
implements this interface for easier connectivity to other items.
To use the form as editor for an item, just connect the item to
form with
Form.setItemDataSource(Item) . If only a part of the
item needs to be edited,
Form.setItemDataSource(ItemCollection) can be used instead. After the item has been connected to the form,
the automatically created fields can be customized and new fields can
be added. If you need to connect a class that does not implement
org.millstone.base.data.Item interface, most properties of any
class following bean pattern, can be accessed trough
org.millstone.base.data.util.BeanItem .
author: IT Mill Ltd. version: 3.1.1 since: 3.0 |
Constructor Summary | |
public | Form() Contruct a new form with default layout. | public | Form(Layout formLayout) Contruct a new form with given layout. | public | Form(Layout formLayout, FieldFactory fieldFactory) Contruct a new form with given layout and FieldFactory. |
Form | public Form()(Code) | | Contruct a new form with default layout.
By default the form uses OrderedLayout
with form -style.
Parameters: formLayout - The layout of the form. |
Form | public Form(Layout formLayout)(Code) | | Contruct a new form with given layout.
Parameters: formLayout - The layout of the form. |
Form | public Form(Layout formLayout, FieldFactory fieldFactory)(Code) | | Contruct a new form with given layout and FieldFactory.
Parameters: formLayout - The layout of the form. Parameters: fieldFactory - FieldFactory of the form |
addField | public void addField(Object propertyId, Field field)(Code) | | Add field to form.
The property id must not be already used in the form.
This field is added to the form layout in the default position
(the position used by
Layout.addComponent(Component) method.
In the special case that the underlying layout is a custom layout,
string representation of the property id is used instead of the
default location.
Parameters: propertyId - Property id the the field. Parameters: field - New field added to the form. |
focus | public void focus()(Code) | | Focuses the first field in the form.
See Also: org.millstone.base.ui.Component.Focusable.focus |
getField | public Field getField(Object propertyId)(Code) | | Get the field identified by the propertyid
|
getFieldFactory | public FieldFactory getFieldFactory()(Code) | | Get the field factory of the form.
FieldFactory Factory used to create the fields |
getItemDataSource | public Item getItemDataSource()(Code) | | |
getItemProperty | public Property getItemProperty(Object id)(Code) | | The property identified by the property id.
The property data source of the field specified with
property id is returned. If there is a (with specified property id)
having no data source,
the field is returned instead of the data source.
See Also: org.millstone.base.data.Item.getItemProperty(Object) |
getLayout | public Layout getLayout()(Code) | | Get the layout of the form.
By default form uses OrderedLayout with form -style.
Layout of the form. |
getVisibleItemProperties | public Collection getVisibleItemProperties()(Code) | | Returns the visibleProperties.
Collection |
isModified | public boolean isModified()(Code) | | |
isReadThrough | public boolean isReadThrough()(Code) | | |
isWriteThrough | public boolean isWriteThrough()(Code) | | |
removeAllProperties | public boolean removeAllProperties()(Code) | | Removes all properties and fields from the form.
Success of the operation. Removal of all fields succeeded if (and only if) the return value is true. |
replaceWithSelect | public Select replaceWithSelect(Object propertyId, Object[] values, Object[] descriptions)(Code) | | Set a form field to be selectable from static list of changes.
The list values and descriptions are given as array. The value-array must contain the
current value of the field and the lengths of the arrays must match. Null values are not
supported.
The select property generated |
setFieldFactory | public void setFieldFactory(FieldFactory fieldFactory)(Code) | | Set the field factory of Form.
FieldFacroty is used to create fields for form properties.
By default the form uses BaseFieldFactory to create Field instances.
Parameters: fieldFactory - New factory used to create the fields See Also: Field See Also: FieldFactory |
setFormDataSource | protected void setFormDataSource(Object data, Collection properties)(Code) | | Update the internal form datasource.
Method setFormDataSource.
Parameters: value - |
setItemDataSource | public void setItemDataSource(Item newDataSource)(Code) | | Set the item datasource for the form.
Setting item datasource clears any fields, the form might contain
and adds all the properties as fields to the form.
See Also: org.millstone.base.data.Item.Viewer.setItemDataSource(Item) |
setItemDataSource | public void setItemDataSource(Item newDataSource, Collection propertyIds)(Code) | | Set the item datasource for the form, but limit the form contents
to specified properties of the item.
Setting item datasource clears any fields, the form might contain
and adds the specified the properties as fields to the form, in the
specified order.
See Also: org.millstone.base.data.Item.Viewer.setItemDataSource(Item) |
setLayout | public void setLayout(Layout newLayout)(Code) | | Set the layout of the form.
By default form uses OrderedLayout with form -style.
Parameters: layout - Layout of the form. |
setReadThrough | public void setReadThrough(boolean readThrough)(Code) | | |
setTabIndex | public void setTabIndex(int tabIndex)(Code) | | See Also: org.millstone.base.ui.Component.Focusable.setTabIndex(int) |
setVisibleItemProperties | public void setVisibleItemProperties(Collection visibleProperties)(Code) | | Sets the visibleProperties.
Parameters: visibleProperties - The visibleProperties to set |
setWriteThrough | public void setWriteThrough(boolean writeThrough)(Code) | | |
Methods inherited from org.millstone.base.ui.AbstractComponent | public void addListener(RepaintRequestListener listener)(Code)(Java Doc) public void addListener(Class eventType, Object object, Method method)(Code)(Java Doc) public void addListener(Class eventType, Object object, String methodName)(Code)(Java Doc) public void addListener(Component.Listener listener)(Code)(Java Doc) public void attach()(Code)(Java Doc) public void changeVariables(Object source, Map variables)(Code)(Java Doc) public void childRequestedRepaint(Collection alreadyNotified)(Code)(Java Doc) public void dependsOn(VariableOwner depended)(Code)(Java Doc) public void detach()(Code)(Java Doc) protected void fireComponentErrorEvent()(Code)(Java Doc) protected void fireComponentEvent()(Code)(Java Doc) protected void fireEvent(Component.Event event)(Code)(Java Doc) public Application getApplication()(Code)(Java Doc) public String getCaption()(Code)(Java Doc) public ErrorMessage getComponentError()(Code)(Java Doc) public Object getData()(Code)(Java Doc) public String getDescription()(Code)(Java Doc) public Set getDirectDependencies()(Code)(Java Doc) public ErrorMessage getErrorMessage()(Code)(Java Doc) public Resource getIcon()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Component getParent()(Code)(Java Doc) public String getStyle()(Code)(Java Doc) abstract public String getTag()(Code)(Java Doc) public Window getWindow()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isImmediate()(Code)(Java Doc) public boolean isReadOnly()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) final public void paint(PaintTarget target) throws PaintException(Code)(Java Doc) public void paintContent(PaintTarget target) throws PaintException(Code)(Java Doc) public void removeDirectDependency(VariableOwner depended)(Code)(Java Doc) public void removeListener(RepaintRequestListener listener)(Code)(Java Doc) public void removeListener(Class eventType, Object target)(Code)(Java Doc) public void removeListener(Class eventType, Object target, Method method)(Code)(Java Doc) public void removeListener(Class eventType, Object target, String methodName)(Code)(Java Doc) public void removeListener(Component.Listener listener)(Code)(Java Doc) public void requestRepaint()(Code)(Java Doc) public void requestRepaintRequests()(Code)(Java Doc) public void setCaption(String caption)(Code)(Java Doc) public void setComponentError(ErrorMessage componentError)(Code)(Java Doc) public void setData(Object data)(Code)(Java Doc) public void setDescription(String description)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setIcon(Resource icon)(Code)(Java Doc) public void setImmediate(boolean immediate)(Code)(Java Doc) public void setLocale(Locale locale)(Code)(Java Doc) public void setParent(Component parent)(Code)(Java Doc) public void setReadOnly(boolean readOnly)(Code)(Java Doc) public void setStyle(String style)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc)
|
|
|
|