public class GenericConfigForm extends com.vaadin.ui.VerticalLayout implements IModuleConfigForm, UIConstants
Generic form builder based on Vaadin framework This auto-generates widget giving types of properties.
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Modifier and Type | Field and Description |
---|---|
protected List<IModuleConfigForm> |
allForms |
protected List<com.vaadin.ui.Field<?>> |
checkBoxes |
protected com.vaadin.data.fieldgroup.FieldGroup |
fieldGroup |
protected List<com.vaadin.ui.Field<?>> |
labels |
protected List<com.vaadin.ui.Field<?>> |
listBoxes |
protected static String |
MAIN_CONFIG |
protected List<com.vaadin.ui.Field<?>> |
numberBoxes |
protected IModuleConfigForm |
parentForm |
protected List<com.vaadin.ui.Component> |
subForms |
protected boolean |
tabJustRemoved |
protected List<com.vaadin.ui.Field<?>> |
textBoxes |
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
ADD_ICON, APPLY_ICON, DEL_ICON, EDIT_ICON, ERROR_ICON, HELP_ICON, INFO_ICON, LINK_ICON, MSG_REQUIRED_FIELD, PROP_AUTOSTART, PROP_ID, PROP_MODULECLASS, PROP_NAME, PROP_SEP, REFRESH_ICON, STYLE_COLORED, STYLE_H1, STYLE_H2, STYLE_H3, STYLE_LINK, STYLE_PRESSED, STYLE_QUIET, STYLE_SECTION_BUTTONS, STYLE_SMALL
Constructor and Description |
---|
GenericConfigForm() |
Modifier and Type | Method and Description |
---|---|
protected void |
addChangeModuleButton(com.vaadin.ui.ComponentContainer parentForm,
String propId,
ComplexProperty prop,
Class<?> objectType) |
protected void |
addChangeObjectButton(com.vaadin.ui.ComponentContainer parentForm,
String propId,
ComplexProperty prop,
Map<String,Class<?>> typeList) |
protected com.vaadin.ui.TabSheet.Tab |
addTab(com.vaadin.ui.TabSheet tabs,
Object itemId,
MyBeanItem<?> beanItem,
int tabIndex) |
void |
build(String propId,
ComplexProperty prop,
boolean includeSubForms)
Builds the whole form for a complex property (i.e.
|
void |
build(String title,
String popupText,
MyBeanItem<? extends Object> beanItem,
boolean includeSubForms)
Builds the whole form for a given config object.
|
protected com.vaadin.ui.Field<?> |
buildAndBindField(String label,
String propId,
com.vaadin.data.Property<?> prop)
Method called to generate and bind the Field component corresponding to a
scalar property
|
protected void |
buildListComponent(String propId,
ContainerProperty prop,
com.vaadin.data.fieldgroup.FieldGroup fieldGroup) |
protected com.vaadin.ui.Component |
buildSimpleList(String propId,
ContainerProperty prop,
Class<?> eltType) |
protected com.vaadin.ui.ComponentContainer |
buildSubForm(String propId,
ComplexProperty prop) |
protected com.vaadin.ui.Component |
buildTable(String propId,
ContainerProperty prop,
Class<?> eltType) |
protected com.vaadin.ui.Component |
buildTabs(String propId,
ContainerProperty prop,
com.vaadin.data.fieldgroup.FieldGroup fieldGroup) |
void |
commit()
Commit all changes made in the UI values to the underlying bean object
|
IModuleConfigForm |
getParentForm() |
Class<?> |
getPolymorphicBeanParentType()
Get the class whose allowed bean types should derive from
|
Map<String,Class<?>> |
getPossibleTypes(String propId)
Return possible object types for the given property ID
|
List<Object> |
getPossibleValues(String propId)
Return possible values for the given property ID
|
List<com.vaadin.ui.Component> |
getSubForms() |
protected String |
getTabCaption(Object itemId,
MyBeanItem<?> beanItem,
int tabIndex) |
protected boolean |
isFieldVisible(String propId) |
protected com.vaadin.ui.Field<Object> |
makeAddressSelectField(com.vaadin.ui.Field<Object> field,
ICommNetwork.NetworkType addressType) |
protected com.vaadin.ui.Field<Object> |
makeModuleSelectField(com.vaadin.ui.Field<Object> field,
Class<? extends IModule> moduleType) |
protected com.vaadin.ui.Field<String> |
makePasswordField(com.vaadin.ui.Field<String> field) |
void |
setParentForm(IModuleConfigForm parentForm) |
addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, addListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getCustomAttributes, getDefaultComponentAlignment, getExpandRatio, getMargin, getState, getState, isSpacing, iterator, readDesign, removeComponent, removeLayoutClickListener, removeListener, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setExpandRatio, setMargin, setMargin, setSpacing, writeDesign
addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, removeListener, removeListener, setHeight, setWidth
addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addComponent, addComponents, addListener, addListener, getComponentCount, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponent, removeListener, removeListener, replaceComponent
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, readDesign, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible, writeDesign
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
protected static final String MAIN_CONFIG
protected List<com.vaadin.ui.Field<?>> labels
protected List<com.vaadin.ui.Field<?>> textBoxes
protected List<com.vaadin.ui.Field<?>> listBoxes
protected List<com.vaadin.ui.Field<?>> numberBoxes
protected List<com.vaadin.ui.Field<?>> checkBoxes
protected List<com.vaadin.ui.Component> subForms
protected List<IModuleConfigForm> allForms
protected com.vaadin.data.fieldgroup.FieldGroup fieldGroup
protected boolean tabJustRemoved
protected IModuleConfigForm parentForm
public void build(String propId, ComplexProperty prop, boolean includeSubForms)
IModuleConfigForm
build
in interface IModuleConfigForm
public void build(String title, String popupText, MyBeanItem<? extends Object> beanItem, boolean includeSubForms)
IModuleConfigForm
build
in interface IModuleConfigForm
title
- title of the formpopupText
- help popup text shown when hovering on the form titlebeanItem
- object to render a form forincludeSubForms
- true to include sub forms in the componentprotected boolean isFieldVisible(String propId)
protected com.vaadin.ui.Field<?> buildAndBindField(String label, String propId, com.vaadin.data.Property<?> prop)
label
- propId
- prop
- protected com.vaadin.ui.Field<Object> makeModuleSelectField(com.vaadin.ui.Field<Object> field, Class<? extends IModule> moduleType)
protected com.vaadin.ui.Field<Object> makeAddressSelectField(com.vaadin.ui.Field<Object> field, ICommNetwork.NetworkType addressType)
protected com.vaadin.ui.Field<String> makePasswordField(com.vaadin.ui.Field<String> field)
protected com.vaadin.ui.ComponentContainer buildSubForm(String propId, ComplexProperty prop)
protected void addChangeModuleButton(com.vaadin.ui.ComponentContainer parentForm, String propId, ComplexProperty prop, Class<?> objectType)
protected void addChangeObjectButton(com.vaadin.ui.ComponentContainer parentForm, String propId, ComplexProperty prop, Map<String,Class<?>> typeList)
protected void buildListComponent(String propId, ContainerProperty prop, com.vaadin.data.fieldgroup.FieldGroup fieldGroup)
protected com.vaadin.ui.Component buildSimpleList(String propId, ContainerProperty prop, Class<?> eltType)
protected com.vaadin.ui.Component buildTable(String propId, ContainerProperty prop, Class<?> eltType)
protected com.vaadin.ui.Component buildTabs(String propId, ContainerProperty prop, com.vaadin.data.fieldgroup.FieldGroup fieldGroup)
protected com.vaadin.ui.TabSheet.Tab addTab(com.vaadin.ui.TabSheet tabs, Object itemId, MyBeanItem<?> beanItem, int tabIndex)
protected String getTabCaption(Object itemId, MyBeanItem<?> beanItem, int tabIndex)
public void commit() throws com.vaadin.data.fieldgroup.FieldGroup.CommitException
IModuleConfigForm
commit
in interface IModuleConfigForm
com.vaadin.data.fieldgroup.FieldGroup.CommitException
- if data cannot be committedpublic List<com.vaadin.ui.Component> getSubForms()
getSubForms
in interface IModuleConfigForm
public Map<String,Class<?>> getPossibleTypes(String propId)
IModuleConfigForm
getPossibleTypes
in interface IModuleConfigForm
propId
- property IDpublic List<Object> getPossibleValues(String propId)
IModuleConfigForm
getPossibleValues
in interface IModuleConfigForm
propId
- property IDpublic Class<?> getPolymorphicBeanParentType()
IModuleConfigForm
getPolymorphicBeanParentType
in interface IModuleConfigForm
public IModuleConfigForm getParentForm()
getParentForm
in interface IModuleConfigForm
public void setParentForm(IModuleConfigForm parentForm)
setParentForm
in interface IModuleConfigForm
Copyright © 2016 Sensia Software LLC. All rights reserved.