1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.vaadin.mvp;
|
10
|
|
11
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
12
|
import eu.etaxonomy.cdm.vaadin.model.CdmEntityAdapterDTO;
|
13
|
|
14
|
/**
|
15
|
* Provides generic save operations of modified cdm entities.
|
16
|
*
|
17
|
* @author a.kohlbecker
|
18
|
* @since Apr 5, 2017
|
19
|
*
|
20
|
*/
|
21
|
public abstract class AbstractCdmDTOEditorPresenter<DTO extends CdmEntityAdapterDTO<CDM>, CDM extends CdmBase, V extends ApplicationView<?>>
|
22
|
extends CdmEditorPresenterBase<DTO, CDM, V> {
|
23
|
|
24
|
private static final long serialVersionUID = -6315824180341694825L;
|
25
|
|
26
|
protected BeanInstantiator<CDM> cdmEntityInstantiator = null;
|
27
|
|
28
|
@Override
|
29
|
protected BeanInstantiator<DTO> defaultBeanInstantiator(){
|
30
|
// not needed in the AbstractCdmDTOEditorPresenter since replaced by cdmEntityInstantiator
|
31
|
return null;
|
32
|
}
|
33
|
|
34
|
|
35
|
@Override
|
36
|
protected CDM cdmEntity(DTO dto) {
|
37
|
return dto.cdmEntity();
|
38
|
}
|
39
|
|
40
|
|
41
|
/**
|
42
|
* @param cdmEntityInstantiator the cdmEntityInstantiator to set
|
43
|
*/
|
44
|
public void setCdmEntityInstantiator(BeanInstantiator<CDM> cdmEntityInstantiator) {
|
45
|
this.cdmEntityInstantiator = cdmEntityInstantiator;
|
46
|
}
|
47
|
|
48
|
|
49
|
|
50
|
}
|