Revision 0e7a9b4f
Added by Andreas Kohlbecker almost 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/editor/reference/ReferencePopupEditor.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.cdm.vaadin.editor.reference; |
10 | 10 |
|
11 |
import org.springframework.beans.factory.annotation.Autowired; |
|
11 | 12 |
import org.springframework.context.annotation.Scope; |
12 | 13 |
|
13 |
import com.vaadin.data.fieldgroup.FieldGroup.CommitException; |
|
14 | 14 |
import com.vaadin.spring.annotation.SpringComponent; |
15 |
import com.vaadin.ui.GridLayout; |
|
15 | 16 |
import com.vaadin.ui.TextField; |
16 | 17 |
|
17 | 18 |
import eu.etaxonomy.cdm.model.reference.Reference; |
18 |
import eu.etaxonomy.vaadin.ui.view.AbstractPopupEditor;
|
|
19 |
import eu.etaxonomy.vaadin.mvp.AbstractPopupEditor;
|
|
19 | 20 |
|
20 | 21 |
/** |
21 | 22 |
* @author a.kohlbecker |
... | ... | |
25 | 26 |
|
26 | 27 |
@SpringComponent |
27 | 28 |
@Scope("prototype") |
28 |
public class ReferencePopupEditor extends AbstractPopupEditor<Reference> {
|
|
29 |
public class ReferencePopupEditor extends AbstractPopupEditor<Reference, ReferenceEditorPresenter> implements ReferencePopupEditorView {
|
|
29 | 30 |
|
30 | 31 |
private static final long serialVersionUID = -4347633563800758815L; |
31 | 32 |
|
... | ... | |
36 | 37 |
* @param dtoType |
37 | 38 |
*/ |
38 | 39 |
public ReferencePopupEditor() { |
39 |
super(Reference.class); |
|
40 |
super(new GridLayout(), Reference.class);
|
|
40 | 41 |
/* |
41 | 42 |
"type", |
42 | 43 |
"uri", |
... | ... | |
102 | 103 |
* {@inheritDoc} |
103 | 104 |
*/ |
104 | 105 |
@Override |
105 |
public void storeDto(Reference bean) throws CommitException { |
|
106 |
//TODO this should happen in the AbstractPopupEditor! |
|
107 |
getRepsitory().getReferenceService().saveOrUpdate(bean); |
|
106 |
public boolean isResizable() { |
|
107 |
return true; |
|
108 |
} |
|
109 |
|
|
110 |
/** |
|
111 |
* {@inheritDoc} |
|
112 |
*/ |
|
113 |
@Autowired |
|
114 |
@Override |
|
115 |
protected void injectPresenter(ReferenceEditorPresenter presenter) { |
|
116 |
setPresenter(presenter); |
|
108 | 117 |
} |
109 | 118 |
|
110 | 119 |
|
Also available in: Unified diff
better popup views and editors fully compliant to MVP