Project

General

Profile

« Previous | Next » 

Revision 6d636c9e

Added by Andreas Kohlbecker over 5 years ago

ref #7648 generalizing bean instantiation in cdm presenters

View differences:

src/main/java/eu/etaxonomy/vaadin/mvp/CdmEditorPresenterBase.java
48 48

  
49 49
    private static final Logger logger = Logger.getLogger(CdmEditorPresenterBase.class);
50 50

  
51
    protected BeanInstantiator<DTO> beanInstantiator = null;
52

  
53

  
54
    /**
55
     * @param beanInstantiator the beanInstantiator to set
56
     */
57
    public void setBeanInstantiator(BeanInstantiator<DTO> beanInstantiator) {
58
        this.beanInstantiator = beanInstantiator;
59
    }
60

  
61

  
62
    protected DTO createNewBean() {
63
        if(this.beanInstantiator != null){
64
            return beanInstantiator.createNewBean();
65
        }
66
        return defaultBeanInstantiator().createNewBean();
67
    }
68

  
69
    /**
70
     * @return
71
     */
72
    protected abstract BeanInstantiator<DTO> defaultBeanInstantiator();
73

  
51 74
    /**
52 75
     * if not null, this CRUD set is to be used to create a CdmAuthoritiy for the base entity which will be
53 76
     * granted to the current use as long this grant is not assigned yet.

Also available in: Unified diff