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/cdm/vaadin/view/occurrence/CollectionEditorPresenter.java
33 33
import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityReloader;
34 34
import eu.etaxonomy.cdm.vaadin.view.common.InstitutionPopupEditor;
35 35
import eu.etaxonomy.vaadin.mvp.AbstractCdmEditorPresenter;
36
import eu.etaxonomy.vaadin.mvp.BeanInstantiator;
36 37
import eu.etaxonomy.vaadin.mvp.BoundField;
37 38
import eu.etaxonomy.vaadin.ui.view.PopupView;
38 39

  
......
47 48

  
48 49
    private static final long serialVersionUID = -1996365248431425021L;
49 50

  
51
    protected static BeanInstantiator<Collection> defaultBeanInstantiator = new BeanInstantiator<Collection>() {
52

  
53
        @Override
54
        public Collection createNewBean() {
55
            return Collection.NewInstance();
56
        }
57
    };
58

  
59

  
60
    @Override
61
    protected BeanInstantiator<Collection> defaultBeanInstantiator(){
62
       return defaultBeanInstantiator;
63
    }
50 64

  
51 65
    /**
52 66
     * {@inheritDoc}
......
66 80
        if(identifier != null){
67 81
            bean = getRepo().getCollectionService().load(identifier, initStrategy);
68 82
        } else {
69
            bean = Collection.NewInstance();
83
            bean = createNewBean();
70 84
        }
71 85
        return bean;
72 86
    }

Also available in: Unified diff