Project

General

Profile

« Previous | Next » 

Revision fe785c1e

Added by Andreas Kohlbecker almost 7 years ago

fix #6687 per view implementation of the 'session-per-conversation' pattern

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItemEditButtonGroup.java
20 20
import eu.etaxonomy.cdm.remote.dto.tdwg.voc.TaxonName;
21 21
import eu.etaxonomy.cdm.vaadin.model.TypedEntityReference;
22 22
import eu.etaxonomy.cdm.vaadin.util.converter.TypeDesignationSetManager.TypeDesignationWorkingSet;
23
import eu.etaxonomy.cdm.vaadin.util.converter.TypeDesignationSetManager.TypeDesignationWorkingSetType;
23 24
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO;
24 25
import eu.etaxonomy.vaadin.component.CompositeStyledComponent;
25 26

  
......
42 43

  
43 44
    private IdButton<TaxonName> nameIdButton = null;
44 45

  
45
    private List<IdButton<TypeDesignationWorkingSet>> typeDesignationButtons = new ArrayList<>();
46
    private List<TypeDesignationWorkingSetButton> typeDesignationButtons = new ArrayList<>();
46 47

  
47 48
    private List<Label> labels = new ArrayList<>();
48 49

  
......
74 75
//                Set<Integer> idSet = new HashSet<>();
75 76
//                typeDesignationWorkingSet.getTypeDesignations().forEach(td -> idSet.add(td.getId()));
76 77

  
77
                typeDesignationButtons.add(new IdButton<TypeDesignationWorkingSet>(
78
                        TypeDesignationWorkingSet.class,
78
                typeDesignationButtons.add(new TypeDesignationWorkingSetButton(
79
                        typeDesignationWorkingSet.getWorkingsetType(),
79 80
                        typeDesignationWorkingSet.getWorkingSetId(),
80 81
                        tdButton)
81 82
                        );
......
102 103
        return nameIdButton;
103 104
    }
104 105

  
105
    public List<IdButton<TypeDesignationWorkingSet>> getTypeDesignationButtons() {
106
    public List<TypeDesignationWorkingSetButton> getTypeDesignationButtons() {
106 107
        return typeDesignationButtons;
107 108
    }
108 109

  
......
121 122
        addTypeDesignationButton.addStyleName(DEFAULT_BUTTON_STYLES);
122 123
    }
123 124

  
125
    public class TypeDesignationWorkingSetButton {
126
        private Integer id;
127
        private TypeDesignationWorkingSetType type;
128
        private Button button;
129

  
130
        public TypeDesignationWorkingSetButton(TypeDesignationWorkingSetType type, Integer id, Button button){
131
            this.type = type;
132
            this.id = id;
133
            this.button = button;
134
        }
135

  
136
        /**
137
         * @return the id
138
         */
139
        public Integer getId() {
140
            return id;
141
        }
142

  
143
        /**
144
         * @return the button
145
         */
146
        public Button getButton() {
147
            return button;
148
        }
149

  
150
        /**
151
         * @return the type
152
         */
153
        public TypeDesignationWorkingSetType getType() {
154
            return type;
155
        }
156

  
157
    }
158

  
124 159
    public class IdButton<T> {
125 160
        private Integer id;
126
        private Class<T> type;
161
        private Class<T> entityType;
127 162
        private Button button;
128 163

  
129 164
        public IdButton(Class<T> type, Integer id, Button button){
130
            this.type = type;
165
            this.entityType = type;
131 166
            this.id = id;
132 167
            this.button = button;
133 168
        }
......
150 185
         * @return the type
151 186
         */
152 187
        public Class<T> getType() {
153
            return type;
188
            return entityType;
154 189
        }
155 190

  
156 191
    }

Also available in: Unified diff