Class AbstractApplicationFormUIModel<E,B extends AbstractApplicationFormUIModel<E,B>>
java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.beans.AbstractSerializableBean
org.nuiton.jaxx.application.swing.AbstractApplicationFormUIModel<E,B>
- All Implemented Interfaces:
Serializable,JavaBeanObject
public abstract class AbstractApplicationFormUIModel<E,B extends AbstractApplicationFormUIModel<E,B>> extends org.jdesktop.beans.AbstractSerializableBean implements JavaBeanObject
A ui form model.
Created on 8/15/14.
- Since:
- 2.10
- Author:
- Tony Chemit - chemit@codelutin.com
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractApplicationFormUIModel.ModifyPropertyChangeListener -
Field Summary
Fields Modifier and Type Field Description static com.google.common.collect.ImmutableSet<String>MODIFY_IGNORE_PROPERTIESstatic StringPROPERTY_CREATEstatic StringPROPERTY_MODIFYstatic StringPROPERTY_VALID -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractApplicationFormUIModel()protectedAbstractApplicationFormUIModel(Class<E> entityType, Class<B> uiModelType)protectedAbstractApplicationFormUIModel(org.nuiton.util.beans.Binder<E,B> fromBeanBinder, org.nuiton.util.beans.Binder<B,E> toBeanBinder) -
Method Summary
Modifier and Type Method Description protected static <E, B extends AbstractApplicationFormUIModel<E, B>>
com.google.common.base.Function<E,B>entityToModel(Class<B> modelType)voidfirePropertyChanged(String propertyName, Object oldValue, Object newValue)voidfromBean(E bean)voidfromEntity(E entity)Method to override the copy of incoming entity into the form.protected Set<String>getModifyIgnorePropertyNames()booleanisCreate()booleanisModify()booleanisValid()protected <B extends JavaBeanObject>
voidlistenAndModifyModel(Iterable<B> javaBeanObjects)<B extends JavaBeanObject>
voidlistenModelIsModify(B... javaBeanObjects)protected static <E, B extends AbstractApplicationFormUIModel<E, B>>
com.google.common.base.Function<B,E>modelToEntity()protected abstract EnewEntity()Used to copy the form to outside world.voidsetCreate(boolean create)voidsetModify(boolean modify)voidsetValid(boolean valid)EtoBean()EtoBean(E bean)EtoEntity()Note: the method isfinal, if you need to customize something, do it in thetoEntity(Object)method.voidtoEntity(E entity)Method to override the copy of the form to outside world (entity).Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListenerMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuiton.jaxx.application.bean.JavaBeanObject
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
PROPERTY_MODIFY
- See Also:
- Constant Field Values
-
PROPERTY_VALID
- See Also:
- Constant Field Values
-
PROPERTY_CREATE
- See Also:
- Constant Field Values
-
MODIFY_IGNORE_PROPERTIES
-
-
Constructor Details
-
AbstractApplicationFormUIModel
protected AbstractApplicationFormUIModel() -
AbstractApplicationFormUIModel
-
AbstractApplicationFormUIModel
-
-
Method Details
-
newEntity
Used to copy the form to outside world.- Returns:
- a new instance of outisde world object.
-
fromEntity
Method to override the copy of incoming entity into the form. By default, invoke the simple binder copy (methodfromBean(Object).- Parameters:
entity- incoming entity to copy inside the form
-
toEntity
Method to override the copy of the form to outside world (entity). By default, invoke the simple binder copy (methodtoBean(Object).- Parameters:
entity- the outside world object to fill
-
toEntity
Note: the method isfinal, if you need to customize something, do it in thetoEntity(Object)method.- Returns:
- a new instance of object to persist from this form
-
fromBean
- Parameters:
bean- object to copy into form using thefromBeanBinderbinder
-
toBean
- Returns:
- the new instance of bean binded from form to outside world
-
toBean
- Parameters:
bean- the bean to bind- Returns:
- the binded form to the given
result
-
isModify
public boolean isModify() -
setModify
public void setModify(boolean modify) -
isValid
public boolean isValid() -
setValid
public void setValid(boolean valid) -
isCreate
public boolean isCreate() -
setCreate
public void setCreate(boolean create) -
getModifyIgnorePropertyNames
- Returns:
- set of property names that will not change the modify state.
-
firePropertyChanged
- Specified by:
firePropertyChangedin interfaceJavaBeanObject
-
listenModelIsModify
-
listenAndModifyModel
-
modelToEntity
protected static <E, B extends AbstractApplicationFormUIModel<E, B>> com.google.common.base.Function<B,E> modelToEntity() -
entityToModel
protected static <E, B extends AbstractApplicationFormUIModel<E, B>> com.google.common.base.Function<E,B> entityToModel(Class<B> modelType)
-