Class AbstractApplicationFormUIModel<E,​B extends 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
    • Constructor Detail

      • AbstractApplicationFormUIModel

        protected AbstractApplicationFormUIModel()
      • AbstractApplicationFormUIModel

        protected AbstractApplicationFormUIModel​(Class<E> entityType,
                                                 Class<B> uiModelType)
      • AbstractApplicationFormUIModel

        protected AbstractApplicationFormUIModel​(org.nuiton.util.beans.Binder<E,​B> fromBeanBinder,
                                                 org.nuiton.util.beans.Binder<B,​E> toBeanBinder)
    • Method Detail

      • newEntity

        protected abstract E newEntity()
        Used to copy the form to outside world.
        Returns:
        a new instance of outisde world object.
      • fromEntity

        public void fromEntity​(E entity)
        Method to override the copy of incoming entity into the form. By default, invoke the simple binder copy (method fromBean(Object).
        Parameters:
        entity - incoming entity to copy inside the form
      • toEntity

        public void toEntity​(E entity)
        Method to override the copy of the form to outside world (entity). By default, invoke the simple binder copy (method toBean(Object).
        Parameters:
        entity - the outside world object to fill
      • toEntity

        public final E toEntity()
        Note: the method is final, if you need to customize something, do it in the toEntity(Object) method.
        Returns:
        a new instance of object to persist from this form
      • fromBean

        public final void fromBean​(E bean)
        Parameters:
        bean - object to copy into form using the fromBeanBinder binder
      • toBean

        public final E toBean()
        Returns:
        the new instance of bean binded from form to outside world
      • toBean

        public final E toBean​(E bean)
        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

        protected Set<String> getModifyIgnorePropertyNames()
        Returns:
        set of property names that will not change the modify state.
      • listenModelIsModify

        public final <B extends JavaBeanObject> void listenModelIsModify​(B... javaBeanObjects)
      • listenAndModifyModel

        protected <B extends JavaBeanObject> void listenAndModifyModel​(Iterable<B> javaBeanObjects)