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.cdm.vaadin.view.name;
|
10
|
|
11
|
import com.vaadin.server.Sizeable.Unit;
|
12
|
import com.vaadin.ui.Component;
|
13
|
import com.vaadin.ui.ListSelect;
|
14
|
import com.vaadin.ui.TextField;
|
15
|
|
16
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
17
|
import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
|
18
|
|
19
|
/**
|
20
|
* SpecimenTypeDesignationDTORow needs to be instantiated by a EditorInstantiator which can only be provided by the presenter
|
21
|
* {@link SpecimenTypeDesignationWorkingsetEditorPresenter#handleViewEntered()}
|
22
|
*
|
23
|
* @author a.kohlbecker
|
24
|
* @since Jun 22, 2017
|
25
|
*
|
26
|
*/
|
27
|
public class SpecimenTypeDesignationDTORow {
|
28
|
|
29
|
/* CONVENTION!
|
30
|
*
|
31
|
* The fieldname must match the properties of the SpecimenTypeDesignationDTO
|
32
|
*/
|
33
|
ListSelect kindOfUnit = new ListSelect(); // "Kind of unit");
|
34
|
ListSelect typeStatus = new ListSelect();
|
35
|
ToOneRelatedEntityCombobox<eu.etaxonomy.cdm.model.occurrence.Collection> collection =
|
36
|
new ToOneRelatedEntityCombobox<eu.etaxonomy.cdm.model.occurrence.Collection>(null, eu.etaxonomy.cdm.model.occurrence.Collection.class);
|
37
|
TextField accessionNumber = new TextField(); // "Accession number");
|
38
|
TextField mediaUri = new TextField(); // "Image URI");
|
39
|
ToOneRelatedEntityCombobox<Reference> mediaSpecimenReference =
|
40
|
new ToOneRelatedEntityCombobox<Reference>(null, Reference.class);
|
41
|
TextField mediaSpecimenReferenceDetail = new TextField(); //"Image reference detail");
|
42
|
|
43
|
public SpecimenTypeDesignationDTORow(){
|
44
|
kindOfUnit.setRows(1);
|
45
|
kindOfUnit.setRequired(true);
|
46
|
typeStatus.setRows(1);
|
47
|
typeStatus.setRequired(true);
|
48
|
accessionNumber.setWidth(100, Unit.PIXELS);
|
49
|
collection.setWidth(150, Unit.PIXELS);
|
50
|
mediaUri.setWidth(150, Unit.PIXELS);
|
51
|
mediaSpecimenReference.setWidth(200, Unit.PIXELS);
|
52
|
mediaSpecimenReferenceDetail.setWidth(200, Unit.PIXELS);
|
53
|
}
|
54
|
|
55
|
/**
|
56
|
* @return
|
57
|
*/
|
58
|
public Component[] components() {
|
59
|
return new Component[]{
|
60
|
kindOfUnit, typeStatus,
|
61
|
collection, accessionNumber,
|
62
|
mediaUri, mediaSpecimenReference,
|
63
|
mediaSpecimenReferenceDetail, mediaSpecimenReferenceDetail
|
64
|
};
|
65
|
}
|
66
|
}
|