Revision 7d892339
Added by Patrick Plitzner about 10 years ago
- fixed event handling by creating and linking the missing elements
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadGeneralDetailElement.java | ||
---|---|---|
125 | 125 |
getEntity().getMaterialOrMethod().setDefinedMaterialOrMethod(comboMaterialOrMethod.getSelection()); |
126 | 126 |
} |
127 | 127 |
else if(eventSource==numberReadLength){ |
128 |
getEditedSequence().setLength(numberReadLength.getInteger());
|
|
128 |
addEditedSequence().setLength(numberReadLength.getInteger());
|
|
129 | 129 |
} |
130 | 130 |
else if(eventSource==textEditedSequence){ |
131 |
getEditedSequence().setString(textEditedSequence.getText());
|
|
131 |
addEditedSequence().setString(textEditedSequence.getText());
|
|
132 | 132 |
} |
133 | 133 |
else if(eventSource==textPrimerName){ |
134 |
getPrimer().setLabel(textPrimerName.getText());
|
|
134 |
addPrimer().setLabel(textPrimerName.getText());
|
|
135 | 135 |
} |
136 | 136 |
else if(eventSource==textPrimerSequence){ |
137 |
Sequence sequence = getPrimer().getSequence();
|
|
137 |
Sequence sequence = addPrimer().getSequence();
|
|
138 | 138 |
if(sequence==null){ |
139 | 139 |
sequence = Sequence.NewInstance(""); |
140 | 140 |
} |
141 | 141 |
sequence.setSequenceString(textPrimerSequence.getText()); |
142 | 142 |
} |
143 | 143 |
else if(eventSource==selectionReference){ |
144 |
getPrimer().setPublishedIn(selectionReference.getSelection());
|
|
144 |
addPrimer().setPublishedIn(selectionReference.getSelection());
|
|
145 | 145 |
} |
146 | 146 |
} |
147 | 147 |
|
148 |
/** |
|
149 |
* @return |
|
150 |
*/ |
|
151 |
private SequenceString getEditedSequence() { |
|
148 |
private SequenceString addEditedSequence() { |
|
152 | 149 |
SequenceString sequence = getEntity().getSequence(); |
153 | 150 |
if(sequence==null){ |
154 | 151 |
sequence = SequenceString.NewInstance(); |
152 |
getEntity().setSequence(sequence); |
|
155 | 153 |
} |
156 | 154 |
return sequence; |
157 | 155 |
} |
158 | 156 |
|
159 |
private Primer getPrimer(){
|
|
157 |
private Primer addPrimer(){
|
|
160 | 158 |
Primer primer = getEntity().getPrimer(); |
161 | 159 |
if(primer==null){ |
162 | 160 |
primer = Primer.NewInstance(""); |
161 |
getEntity().setPrimer(primer); |
|
163 | 162 |
} |
164 | 163 |
return primer; |
165 | 164 |
} |
Also available in: Unified diff