Revision 97e308a9
Added by Andreas Müller almost 3 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaContentProvider.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.editor.view.media; |
11 | 10 |
|
12 | 11 |
import java.util.HashSet; |
... | ... | |
52 | 51 |
MessagingUtils.error(getClass(), "Taxon is null", null); //$NON-NLS-1$ |
53 | 52 |
return NO_CHILDREN; |
54 | 53 |
} |
55 |
HashSet<DescriptionBase<?>> imageGalleries = new HashSet<>();
|
|
54 |
Set<DescriptionBase<?>> imageGalleries = new HashSet<>(); |
|
56 | 55 |
for(DescriptionBase<?> description : taxon.getDescriptions()){ |
57 | 56 |
if(description.isImageGallery()){ |
58 | 57 |
imageGalleries.add(description); |
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/e4/AlignmentEditorE4.java | ||
---|---|---|
11 | 11 |
import java.io.File; |
12 | 12 |
import java.io.IOException; |
13 | 13 |
import java.io.InputStream; |
14 |
|
|
15 | 14 |
import java.util.ArrayList; |
16 | 15 |
import java.util.Collection; |
17 | 16 |
import java.util.Collections; |
... | ... | |
85 | 84 |
import info.bioinfweb.libralign.pherogram.provider.ReverseComplementPherogramProvider; |
86 | 85 |
import info.bioinfweb.tic.SWTComponentFactory; |
87 | 86 |
|
88 |
|
|
89 |
|
|
90 | 87 |
/** |
91 | 88 |
* Editor component to edit a contig alignment used to combine different overlapping pherograms from Sanger sequencing to |
92 | 89 |
* a consensus sequence. |
... | ... | |
138 | 135 |
|
139 | 136 |
|
140 | 137 |
private MultipleAlignmentsContainer alignmentsContainer = null; |
141 |
private final Map<String, SingleReadAlignment> cdmMap = new TreeMap<String, SingleReadAlignment>(); //TODO Move this to ContigSequenceDataProvider |
|
142 |
|
|
138 |
private final Map<String, SingleReadAlignment> cdmMap = new TreeMap<>(); //TODO Move this to ContigSequenceDataProvider |
|
143 | 139 |
|
144 | 140 |
@Inject |
145 | 141 |
private MDirtyable dirty; |
... | ... | |
150 | 146 |
public AlignmentEditorE4() { |
151 | 147 |
} |
152 | 148 |
|
153 |
|
|
154 | 149 |
private void refreshToolbarElement(String id) { |
155 | 150 |
ICommandService commandService = |
156 | 151 |
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class); |
... | ... | |
159 | 154 |
} |
160 | 155 |
} |
161 | 156 |
|
162 |
|
|
163 | 157 |
private void registerEditSettingListener(MultipleAlignmentsContainer container) { |
164 | 158 |
container.getEditSettings().addListener(new EditSettingsListener() { |
165 | 159 |
@Override |
... | ... | |
179 | 173 |
}); |
180 | 174 |
} |
181 | 175 |
|
182 |
|
|
183 | 176 |
private AlignmentArea createIndexArea(MultipleAlignmentsContainer container, AlignmentArea labeledArea) { |
184 | 177 |
AlignmentArea result = new AlignmentArea(container); |
185 | 178 |
result.setAllowVerticalScrolling(false); |
... | ... | |
187 | 180 |
return result; |
188 | 181 |
} |
189 | 182 |
|
190 |
|
|
191 | 183 |
private AlignmentArea createEditableAlignmentArea(MultipleAlignmentsContainer container, boolean allowVerticalScrolling) { |
192 | 184 |
AlignmentArea result = new AlignmentArea(container); |
193 | 185 |
result.setAllowVerticalScrolling(allowVerticalScrolling); |
... | ... | |
201 | 193 |
return result; |
202 | 194 |
} |
203 | 195 |
|
204 |
|
|
205 | 196 |
private AlignmentArea createConsensusHintArea(MultipleAlignmentsContainer container, |
206 | 197 |
AlignmentArea labeledArea) { |
207 | 198 |
|
... | ... | |
212 | 203 |
return result; |
213 | 204 |
} |
214 | 205 |
|
215 |
|
|
216 | 206 |
private MultipleAlignmentsContainer getAlignmentsContainer() { |
217 | 207 |
if (alignmentsContainer == null) { |
218 | 208 |
alignmentsContainer = new MultipleAlignmentsContainer(); |
... | ... | |
266 | 256 |
} |
267 | 257 |
} |
268 | 258 |
|
269 |
|
|
270 | 259 |
/** |
271 | 260 |
* Checks whether the specified alignment area or one of its subcomponents currently has the |
272 | 261 |
* focus. |
... | ... | |
280 | 269 |
return SWTUtils.childHasFocus((Composite)area.getToolkitComponent()); |
281 | 270 |
} |
282 | 271 |
|
283 |
|
|
284 | 272 |
public boolean hasPherogram(String sequenceID) { |
285 | 273 |
return getReadsArea().getDataAreas().getSequenceAreas(sequenceID).size() > PHEROGRAM_AREA_INDEX; |
286 | 274 |
} |
287 | 275 |
|
288 |
|
|
289 | 276 |
public PherogramArea getPherogramArea(String sequenceID) { |
290 | 277 |
if (hasPherogram(sequenceID)) { |
291 | 278 |
return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(PHEROGRAM_AREA_INDEX); |
... | ... | |
295 | 282 |
} |
296 | 283 |
} |
297 | 284 |
|
298 |
|
|
299 | 285 |
private ConsensusSequenceArea getConsensusHintDataArea() { |
300 | 286 |
return (ConsensusSequenceArea)getAlignmentsContainer().getAlignmentAreas(). |
301 | 287 |
get(CONSENSUS_HINT_AREA_INDEX).getDataAreas().getBottomAreas(). |
302 | 288 |
get(CONSENSUS_DATA_AREA_INDEX); |
303 | 289 |
} |
304 | 290 |
|
305 |
|
|
306 | 291 |
@Deprecated //TODO Remove as soon as testing period is over |
307 | 292 |
private void createTestContents() { |
308 | 293 |
// Just for testing: |
... | ... | |
326 | 311 |
} |
327 | 312 |
} |
328 | 313 |
|
329 |
|
|
330 |
private void readCDMData(Sequence sequenceNode) { |
|
314 |
private void readCdmData(Sequence sequenceNode) { |
|
331 | 315 |
//TODO If called from somewhere else than createPartControl() the editorInput needs to be checked and previous contents need to be cleared (or updated). |
332 | 316 |
|
333 | 317 |
// Add reads: |
... | ... | |
358 | 342 |
//TODO Can the consensus sequence also be null? / Should it be created here, if nothing is in the DB? |
359 | 343 |
} |
360 | 344 |
|
361 |
|
|
362 | 345 |
@PostConstruct |
363 | 346 |
public void createPartControl(Composite parent) { |
364 | 347 |
if (CdmStore.isActive()){ |
... | ... | |
488 | 471 |
if(sequenceNode!=null && sequenceNode.getId()!=0){ |
489 | 472 |
sequenceNode = CdmStore.getService(ISequenceService.class).load(sequenceNode.getUuid()); |
490 | 473 |
} |
491 |
readCDMData(sequenceNode);
|
|
474 |
readCdmData(sequenceNode);
|
|
492 | 475 |
} |
493 | 476 |
else { |
494 | 477 |
createTestContents(); // This case will removed after the test phase and an exception should probably be thrown. |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java | ||
---|---|---|
104 | 104 |
import eu.etaxonomy.cdm.model.media.MediaRepresentation; |
105 | 105 |
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart; |
106 | 106 |
import eu.etaxonomy.cdm.model.media.Rights; |
107 |
import eu.etaxonomy.cdm.model.molecular.DnaSample; |
|
108 | 107 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
109 | 108 |
import eu.etaxonomy.cdm.model.name.NameRelationshipType; |
110 | 109 |
import eu.etaxonomy.cdm.model.name.NameTypeDesignation; |
... | ... | |
3095 | 3094 |
// } |
3096 | 3095 |
} else if (entity instanceof Identifier) { |
3097 | 3096 |
if(parentElement instanceof AbstractSampleDesignationDetailSection){ |
3098 |
element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
|
|
3097 |
element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier) entity, removeListener, backgroundColor, style); |
|
3099 | 3098 |
} |
3100 | 3099 |
else{ |
3101 | 3100 |
element = new IdentifierElement(this, parentElement, (Identifier) entity, removeListener, style); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractDeterminationEventDetailSection.java | ||
---|---|---|
22 | 22 |
* |
23 | 23 |
* @author n.hoffmann |
24 | 24 |
* @created Oct 13, 2010 |
25 |
* @version 1.0 |
|
26 | 25 |
*/ |
27 | 26 |
public abstract class AbstractDeterminationEventDetailSection extends |
28 | 27 |
AbstractEntityCollectionSection<DerivedUnitFacade, DeterminationEvent> { |
29 | 28 |
|
30 |
/** |
|
31 |
* @param formFactory |
|
32 |
* @param conversation |
|
33 |
* @param parentElement |
|
34 |
* @param title |
|
35 |
* @param style |
|
36 |
*/ |
|
37 | 29 |
public AbstractDeterminationEventDetailSection(CdmFormFactory formFactory, |
38 | 30 |
ConversationHolder conversation, ICdmFormElement parentElement, |
39 | 31 |
String title, int style) { |
40 | 32 |
super(formFactory, conversation, parentElement, title, style); |
41 | 33 |
} |
42 | 34 |
|
43 |
/* (non-Javadoc) |
|
44 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement() |
|
45 |
*/ |
|
46 |
/** {@inheritDoc} */ |
|
47 | 35 |
@Override |
48 | 36 |
public DeterminationEvent createNewElement() { |
49 | 37 |
DeterminationEvent instance = DeterminationEvent.NewInstance(); |
... | ... | |
56 | 44 |
return instance; |
57 | 45 |
} |
58 | 46 |
|
59 |
/* (non-Javadoc) |
|
60 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity) |
|
61 |
*/ |
|
62 |
/** {@inheritDoc} */ |
|
63 | 47 |
@Override |
64 | 48 |
public void addElement(DeterminationEvent determination) { |
65 | 49 |
getEntity().addDetermination(determination); |
66 | 50 |
} |
67 | 51 |
|
68 |
/* (non-Javadoc) |
|
69 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity) |
|
70 |
*/ |
|
71 |
/** {@inheritDoc} */ |
|
72 | 52 |
@Override |
73 | 53 |
public void removeElement(DeterminationEvent determination) { |
74 | 54 |
getEntity().removeDetermination(determination); |
75 | 55 |
} |
76 | 56 |
|
77 |
/* (non-Javadoc) |
|
78 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString() |
|
79 |
*/ |
|
80 |
/** {@inheritDoc} */ |
|
81 | 57 |
@Override |
82 | 58 |
public String getEmptyString() { |
83 | 59 |
return "No determinations yet."; |
84 | 60 |
} |
85 |
|
|
86 |
} |
|
61 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CurrentDeterminationDetailSection.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence; |
11 | 10 |
|
12 | 11 |
import java.util.Arrays; |
... | ... | |
36 | 35 |
public class CurrentDeterminationDetailSection extends |
37 | 36 |
AbstractDeterminationEventDetailSection { |
38 | 37 |
|
39 |
/** |
|
40 |
* @param formFactory |
|
41 |
* @param conversation |
|
42 |
* @param parentElement |
|
43 |
* @param style |
|
44 |
*/ |
|
45 | 38 |
public CurrentDeterminationDetailSection(CdmFormFactory formFactory, |
46 | 39 |
ConversationHolder conversation, ICdmFormElement parentElement, |
47 | 40 |
int style) { |
... | ... | |
105 | 98 |
return newElement; |
106 | 99 |
} |
107 | 100 |
|
108 |
/** {@inheritDoc} */ |
|
109 | 101 |
@Override |
110 | 102 |
protected String getTooltipString() { |
111 | 103 |
return "Create new current determination event"; |
112 | 104 |
} |
113 | 105 |
|
114 |
/** |
|
115 |
* {@inheritDoc} |
|
116 |
*/ |
|
117 | 106 |
@Override |
118 | 107 |
public DeterminationEvent addExisting() { |
119 | 108 |
return null; |
120 | 109 |
} |
121 | 110 |
|
122 |
/** |
|
123 |
* {@inheritDoc} |
|
124 |
*/ |
|
125 | 111 |
@Override |
126 | 112 |
public boolean allowAddExisting() { |
127 | 113 |
return false; |
128 | 114 |
} |
129 |
|
|
130 |
} |
|
115 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence; |
11 | 10 |
|
12 | 11 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
... | ... | |
19 | 18 |
/** |
20 | 19 |
* @author n.hoffmann |
21 | 20 |
* @created May 11, 2011 |
22 |
* @version 1.0 |
|
23 | 21 |
*/ |
24 | 22 |
public class DeterminationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> { |
25 | 23 |
|
... | ... | |
27 | 25 |
|
28 | 26 |
private DeterminationHistoryDetailSection section_determinationHistory; |
29 | 27 |
|
30 |
/** |
|
31 |
* @param formFactory |
|
32 |
* @param formElement |
|
33 |
*/ |
|
34 | 28 |
public DeterminationDetailElement(CdmFormFactory formFactory, |
35 | 29 |
ICdmFormElement formElement) { |
36 | 30 |
super(formFactory, formElement); |
37 | 31 |
} |
38 | 32 |
|
39 |
/* (non-Javadoc) |
|
40 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int) |
|
41 |
*/ |
|
42 | 33 |
@Override |
43 | 34 |
protected void createControls(ICdmFormElement formElement, |
44 | 35 |
DerivedUnitFacade entity, int style) { |
... | ... | |
53 | 44 |
|
54 | 45 |
} |
55 | 46 |
|
56 |
/* (non-Javadoc) |
|
57 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object) |
|
58 |
*/ |
|
59 | 47 |
@Override |
60 | 48 |
public void handleEvent(Object eventSource) { |
61 | 49 |
if(eventSource == section_currentDetermination){ |
62 | 50 |
section_determinationHistory.refresh(); |
63 | 51 |
} |
64 | 52 |
} |
65 |
|
|
66 |
} |
|
53 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence; |
11 | 10 |
|
12 | 11 |
import org.eclipse.jface.viewers.ISelectionProvider; |
... | ... | |
21 | 20 |
/** |
22 | 21 |
* @author n.hoffmann |
23 | 22 |
* @created May 11, 2011 |
24 |
* @version 1.0 |
|
25 | 23 |
*/ |
26 | 24 |
public class DeterminationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection { |
27 | 25 |
|
28 |
/** |
|
29 |
* @param formFactory |
|
30 |
* @param conversation |
|
31 |
* @param parentElement |
|
32 |
* @param selectionProvider |
|
33 |
* @param style |
|
34 |
*/ |
|
35 | 26 |
public DeterminationDetailSection(CdmFormFactory formFactory, |
36 | 27 |
ConversationHolder conversation, ICdmFormElement parentElement, |
37 | 28 |
ISelectionProvider selectionProvider, int style) { |
38 | 29 |
super(formFactory, conversation, parentElement, selectionProvider, style); |
39 | 30 |
} |
40 | 31 |
|
41 |
/* (non-Javadoc) |
|
42 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading() |
|
43 |
*/ |
|
44 | 32 |
@Override |
45 | 33 |
public String getHeading() { |
46 | 34 |
String sectionTitle = "Determinations"; |
47 | 35 |
if(getEntity()!=null && getEntity().getDeterminations().size()>0){ |
48 |
return sectionTitle+" +";
|
|
36 |
return sectionTitle+" +"; |
|
49 | 37 |
} |
50 | 38 |
return sectionTitle; |
51 | 39 |
} |
52 | 40 |
|
53 |
/* (non-Javadoc) |
|
54 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int) |
|
55 |
*/ |
|
56 | 41 |
@Override |
57 | 42 |
protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) { |
58 | 43 |
return formFactory.createDeterminationDetailElement(parentElement); |
59 | 44 |
} |
60 |
|
|
61 |
} |
|
45 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationHistoryDetailSection.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence; |
11 | 10 |
|
12 | 11 |
import java.util.Collection; |
... | ... | |
26 | 25 |
public class DeterminationHistoryDetailSection extends |
27 | 26 |
AbstractDeterminationEventDetailSection { |
28 | 27 |
|
29 |
/** |
|
30 |
* @param formFactory |
|
31 |
* @param conversation |
|
32 |
* @param parentElement |
|
33 |
* @param style |
|
34 |
*/ |
|
35 | 28 |
public DeterminationHistoryDetailSection(CdmFormFactory formFactory, |
36 | 29 |
ConversationHolder conversation, ICdmFormElement parentElement, |
37 | 30 |
int style) { |
... | ... | |
53 | 46 |
internalUpdateSection(false); |
54 | 47 |
} |
55 | 48 |
|
56 |
/** {@inheritDoc} */ |
|
57 | 49 |
@Override |
58 | 50 |
protected String getTooltipString() { |
59 | 51 |
return "Add a determination event to the history"; |
60 | 52 |
} |
61 | 53 |
|
62 |
/** |
|
63 |
* {@inheritDoc} |
|
64 |
*/ |
|
65 | 54 |
@Override |
66 | 55 |
public DeterminationEvent addExisting() { |
67 | 56 |
return null; |
68 | 57 |
} |
69 | 58 |
|
70 |
/** |
|
71 |
* {@inheritDoc} |
|
72 |
*/ |
|
73 | 59 |
@Override |
74 | 60 |
public boolean allowAddExisting() { |
75 | 61 |
return false; |
76 | 62 |
} |
77 |
|
|
78 |
} |
|
63 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/CurrentSampleDesignationDetailSection.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna; |
11 | 10 |
|
12 | 11 |
import java.util.Collection; |
... | ... | |
22 | 21 |
import eu.etaxonomy.taxeditor.view.search.derivative.DerivateLabelProvider; |
23 | 22 |
|
24 | 23 |
/** |
25 |
* |
|
26 | 24 |
* @author pplitzner |
27 | 25 |
* @date Oct 16, 2014 |
28 |
* |
|
29 | 26 |
*/ |
30 | 27 |
public class CurrentSampleDesignationDetailSection extends AbstractSampleDesignationDetailSection { |
31 | 28 |
|
... | ... | |
56 | 53 |
return new DefaultCdmBaseComparator<>(); |
57 | 54 |
} |
58 | 55 |
|
59 |
/** {@inheritDoc} */ |
|
60 | 56 |
@Override |
61 | 57 |
protected String getTooltipString() { |
62 | 58 |
return "Create new current sample designation"; |
63 | 59 |
} |
64 | 60 |
|
65 |
/** {@inheritDoc} */ |
|
66 | 61 |
@Override |
67 | 62 |
public void addElement(Identifier sampleDesignation) { |
68 | 63 |
//The current sample designation is always the first one found. |
... | ... | |
71 | 66 |
getEntity().addIdentifier(0, sampleDesignation); |
72 | 67 |
} |
73 | 68 |
|
74 |
/** |
|
75 |
* {@inheritDoc} |
|
76 |
*/ |
|
77 | 69 |
@Override |
78 | 70 |
public Identifier addExisting() { |
79 | 71 |
return null; |
80 | 72 |
} |
81 | 73 |
|
82 |
/** |
|
83 |
* {@inheritDoc} |
|
84 |
*/ |
|
85 | 74 |
@Override |
86 | 75 |
public boolean allowAddExisting() { |
87 | 76 |
return false; |
88 | 77 |
} |
89 |
|
|
90 |
} |
|
78 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailElement.java | ||
---|---|---|
84 | 84 |
} |
85 | 85 |
else if(eventSource==dateQualityCheck.getController()){ |
86 | 86 |
DateTime dateTime = dateQualityCheck.getController().getDateTime(); |
87 |
|
|
88 | 87 |
dnaQuality.setQualityCheckDate(dateTime); |
89 | 88 |
} |
90 | 89 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailSection.java | ||
---|---|---|
20 | 20 |
/** |
21 | 21 |
* @author pplitzner |
22 | 22 |
* @date 05.03.2014 |
23 |
* |
|
24 | 23 |
*/ |
25 | 24 |
public class DnaQualityDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> { |
26 | 25 |
|
27 |
/** |
|
28 |
* @param formFactory |
|
29 |
* @param conversation |
|
30 |
* @param parentElement |
|
31 |
* @param selectionProvider |
|
32 |
* @param style |
|
33 |
*/ |
|
34 | 26 |
public DnaQualityDetailSection(CdmFormFactory formFactory, |
35 | 27 |
ConversationHolder conversation, ICdmFormElement parentElement, |
36 | 28 |
ISelectionProvider selectionProvider, int style) { |
37 | 29 |
super(formFactory, conversation, parentElement, selectionProvider, style); |
38 | 30 |
} |
39 | 31 |
|
40 |
|
|
41 |
/* (non-Javadoc) |
|
42 |
* @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading() |
|
43 |
*/ |
|
44 | 32 |
@Override |
45 | 33 |
public String getHeading() { |
46 | 34 |
return "DNA Quality"; |
47 | 35 |
} |
48 | 36 |
|
49 |
/* (non-Javadoc) |
|
50 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int) |
|
51 |
*/ |
|
52 | 37 |
@Override |
53 | 38 |
protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) { |
54 | 39 |
return formFactory.createDnaQualityDetailElement(parentElement); |
55 | 40 |
} |
56 |
} |
|
41 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationDetailElement.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna; |
11 | 10 |
|
12 | 11 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
... | ... | |
26 | 25 |
/** |
27 | 26 |
* @author pplitzner |
28 | 27 |
* @date 16.12.2013 |
29 |
* |
|
30 | 28 |
*/ |
31 | 29 |
public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> { |
32 | 30 |
|
... | ... | |
36 | 34 |
private NumberWithLabelElement numberPreservationTemperature; |
37 | 35 |
private TextWithLabelElement txtMaterialOrMethods; |
38 | 36 |
|
39 |
/** |
|
40 |
* @param formFactory |
|
41 |
* @param formElement |
|
42 |
*/ |
|
43 | 37 |
public DnaSamplePreparationPreservationDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) { |
44 | 38 |
super(formFactory, formElement); |
45 | 39 |
} |
46 | 40 |
|
47 |
/* |
|
48 |
* (non-Javadoc) |
|
49 |
* |
|
50 |
* @see |
|
51 |
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls |
|
52 |
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int) |
|
53 |
*/ |
|
54 | 41 |
@Override |
55 | 42 |
protected void createControls(ICdmFormElement formElement, DerivedUnitFacade facade, int style) { |
56 | 43 |
Institution institution = null; |
... | ... | |
81 | 68 |
|
82 | 69 |
} |
83 | 70 |
|
84 |
/* |
|
85 |
* (non-Javadoc) |
|
86 |
* |
|
87 |
* @see |
|
88 |
* eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java |
|
89 |
* .lang.Object) |
|
90 |
*/ |
|
91 | 71 |
@Override |
92 | 72 |
public void handleEvent(Object eventSource) { |
93 | 73 |
DnaSample entity = (DnaSample)getEntity().innerDerivedUnit(); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationSection.java | ||
---|---|---|
20 | 20 |
/** |
21 | 21 |
* @author pplitzner |
22 | 22 |
* @date 12.12.2013 |
23 |
* |
|
24 | 23 |
*/ |
25 | 24 |
public class DnaSamplePreparationPreservationSection extends AbstractCdmDetailSection<DerivedUnitFacade> { |
26 | 25 |
|
... | ... | |
30 | 29 |
super(formFactory, conversation, parentElement, selectionProvider, style); |
31 | 30 |
} |
32 | 31 |
|
33 |
|
|
34 | 32 |
@Override |
35 | 33 |
public String getHeading() { |
36 | 34 |
return "Preparation/Preservation"; |
... | ... | |
40 | 38 |
protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) { |
41 | 39 |
return formFactory.createDnaSamplePreparationPreservationDetailElement(parentElement); |
42 | 40 |
} |
43 |
} |
|
41 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailSection.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna; |
11 | 10 |
|
12 | 11 |
import org.eclipse.jface.viewers.ISelectionProvider; |
... | ... | |
21 | 20 |
/** |
22 | 21 |
* @author n.hoffmann |
23 | 22 |
* @created May 11, 2011 |
24 |
* @version 1.0 |
|
25 | 23 |
*/ |
26 | 24 |
public class SampleDesignationDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> { |
27 | 25 |
|
28 |
/** |
|
29 |
* @param formFactory |
|
30 |
* @param conversation |
|
31 |
* @param parentElement |
|
32 |
* @param selectionProvider |
|
33 |
* @param style |
|
34 |
*/ |
|
35 | 26 |
public SampleDesignationDetailSection(CdmFormFactory formFactory, |
36 | 27 |
ConversationHolder conversation, ICdmFormElement parentElement, |
37 | 28 |
ISelectionProvider selectionProvider, int style) { |
38 | 29 |
super(formFactory, conversation, parentElement, selectionProvider, style); |
39 | 30 |
} |
40 | 31 |
|
41 |
/* (non-Javadoc) |
|
42 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading() |
|
43 |
*/ |
|
44 | 32 |
@Override |
45 | 33 |
public String getHeading() { |
46 | 34 |
return "Sample Designations"; |
... | ... | |
52 | 40 |
setTextClient(createToolbar()); |
53 | 41 |
} |
54 | 42 |
|
55 |
/* (non-Javadoc) |
|
56 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int) |
|
57 |
*/ |
|
58 | 43 |
@Override |
59 | 44 |
protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) { |
60 | 45 |
return formFactory.createSampleDesignationDetailElement(parentElement); |
61 | 46 |
} |
62 |
|
|
63 |
} |
|
47 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationHistoryDetailSection.java | ||
---|---|---|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna; |
11 | 10 |
|
12 | 11 |
import java.util.Collection; |
... | ... | |
24 | 23 |
/** |
25 | 24 |
* @author n.hoffmann |
26 | 25 |
* @created May 11, 2011 |
27 |
* @version 1.0 |
|
28 | 26 |
*/ |
29 | 27 |
public class SampleDesignationHistoryDetailSection extends AbstractSampleDesignationDetailSection { |
30 | 28 |
|
31 |
/** |
|
32 |
* @param formFactory |
|
33 |
* @param conversation |
|
34 |
* @param parentElement |
|
35 |
* @param style |
|
36 |
*/ |
|
37 | 29 |
public SampleDesignationHistoryDetailSection(CdmFormFactory formFactory, |
38 | 30 |
ConversationHolder conversation, ICdmFormElement parentElement, |
39 | 31 |
int style) { |
40 | 32 |
super(formFactory, conversation, parentElement, "Sample Designation History", style); |
41 | 33 |
} |
42 | 34 |
|
43 |
/* (non-Javadoc) |
|
44 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object) |
|
45 |
*/ |
|
46 | 35 |
@Override |
47 | 36 |
public Collection<Identifier> getCollection(IdentifiableEntity<?> entity) { |
48 | 37 |
LinkedList<Identifier> sampleDesignations = new LinkedList<>(); |
... | ... | |
67 | 56 |
internalUpdateSection(false); |
68 | 57 |
} |
69 | 58 |
|
70 |
|
|
71 |
/* (non-Javadoc) |
|
72 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString() |
|
73 |
*/ |
|
74 |
/** {@inheritDoc} */ |
|
75 | 59 |
@Override |
76 | 60 |
protected String getTooltipString() { |
77 | 61 |
return "Add a sample designation to the history"; |
78 | 62 |
} |
79 | 63 |
|
80 |
/* (non-Javadoc) |
|
81 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity) |
|
82 |
*/ |
|
83 |
/** {@inheritDoc} */ |
|
84 | 64 |
@Override |
85 | 65 |
public void addElement(Identifier sampleDesignation) { |
86 | 66 |
//The current sample designation is always the first one found. |
... | ... | |
91 | 71 |
getEntity().addIdentifier(indexOfCurrentSampleDesignation+1, sampleDesignation); |
92 | 72 |
} |
93 | 73 |
|
94 |
/** |
|
95 |
* {@inheritDoc} |
|
96 |
*/ |
|
97 | 74 |
@Override |
98 | 75 |
public Identifier addExisting() { |
99 | 76 |
return null; |
100 | 77 |
} |
101 | 78 |
|
102 |
/** |
|
103 |
* {@inheritDoc} |
|
104 |
*/ |
|
105 | 79 |
@Override |
106 | 80 |
public boolean allowAddExisting() { |
107 | 81 |
return false; |
108 | 82 |
} |
109 |
|
|
110 |
} |
|
83 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java | ||
---|---|---|
74 | 74 |
if(entity.getPreservation()!=null){ |
75 | 75 |
preservationMedium = entity.getPreservation().getMedium(); |
76 | 76 |
} |
77 |
selectionInstitution = formFactory.createSelectionElement(Institution.class, //getConversationHolder(),
|
|
77 |
selectionInstitution = formFactory.createSelectionElement(Institution.class, |
|
78 | 78 |
formElement, "Institution", institution, EntitySelectionElement.ALL, style); |
79 |
selectionStaff = formFactory.createSelectionElement(AgentBase.class, //getConversationHolder(),
|
|
79 |
selectionStaff = formFactory.createSelectionElement(AgentBase.class, |
|
80 | 80 |
formElement, "Staff", staff, EntitySelectionElement.ALL,style); |
81 | 81 |
datePreparation = formFactory.createTimePeriodElement(formElement, "Preparation date", preparationDate, style); |
82 | 82 |
comboPreservationMedium = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation medium", preservationMedium, style); |
83 |
selectionCollection = formFactory.createSelectionElement(Collection.class, //getConversationHolder(),
|
|
83 |
selectionCollection = formFactory.createSelectionElement(Collection.class, |
|
84 | 84 |
formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style); |
85 | 85 |
textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style); |
86 | 86 |
textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java | ||
---|---|---|
239 | 239 |
} |
240 | 240 |
destroySections(); |
241 | 241 |
if (input instanceof TaxonBase) { |
242 |
if(((TaxonBase) input).getName()==null){ |
|
242 |
if(((TaxonBase<?>) input).getName()==null){
|
|
243 | 243 |
createEmptySection(Messages.DetailsViewerE4_TAXON_HAS_NO_NAME, rootElement); |
244 | 244 |
} |
245 | 245 |
else{ |
... | ... | |
346 | 346 |
else if(facade.getType()==SpecimenOrObservationType.DnaSample){ |
347 | 347 |
|
348 | 348 |
if(facade.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType.TissueSample){ |
349 |
//this case seems to be very unlikely as innerDerivedUnit has almost always the same type |
|
349 | 350 |
createTissueSampleSection(rootElement); |
350 | 351 |
} |
351 | 352 |
else if(facade.innerDerivedUnit().getRecordBasis()==SpecimenOrObservationType.DnaSample){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/derivative/DerivateLabelProvider.java | ||
---|---|---|
261 | 261 |
else if(derivate instanceof DnaSample |
262 | 262 |
&& ((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){ |
263 | 263 |
DnaSample dnaSample = (DnaSample)derivate; |
264 |
if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
|
|
265 |
Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
|
|
264 |
if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
|
|
265 |
Identifier currentSampleDesignation = getCurrentSampleDesignation(dnaSample); |
|
266 | 266 |
if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){ |
267 | 267 |
label += currentSampleDesignation.getIdentifier()+separator; |
268 | 268 |
} |
... | ... | |
307 | 307 |
if(derivedUnit.getKindOfUnit()!=null){ |
308 | 308 |
label += derivedUnit.getKindOfUnit()+separator; |
309 | 309 |
} |
310 |
Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(derivedUnit);
|
|
310 |
Identifier currentSampleDesignation = getCurrentSampleDesignation(derivedUnit); |
|
311 | 311 |
if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){ |
312 | 312 |
label += currentSampleDesignation.getIdentifier() + separator; |
313 | 313 |
} |
... | ... | |
319 | 319 |
//Sequence |
320 | 320 |
else if(derivate instanceof Sequence){ |
321 | 321 |
Sequence sequence = (Sequence)derivate; |
322 |
Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
|
|
322 |
Identifier currentSampleDesignation = getCurrentSampleDesignation(sequence); |
|
323 | 323 |
if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){ |
324 | 324 |
label += currentSampleDesignation.getIdentifier()+separator; |
325 | 325 |
} |
... | ... | |
333 | 333 |
SingleRead singleRead = (SingleRead)derivate; |
334 | 334 |
if(parentNode!=null && parentNode.getValue() instanceof Sequence){ |
335 | 335 |
Sequence sequence = (Sequence) parentNode.getValue(); |
336 |
Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
|
|
336 |
Identifier currentSampleDesignation = getCurrentSampleDesignation(sequence); |
|
337 | 337 |
if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){ |
338 | 338 |
label = currentSampleDesignation.getIdentifier()+separator; |
339 | 339 |
} |
... | ... | |
434 | 434 |
return ImageResources.getImage(ImageResources.DEFAULT_DERIVATIVE); |
435 | 435 |
} |
436 | 436 |
|
437 |
public static Identifier<DnaSample> getCurrentSampleDesignation(CdmBase entity) {
|
|
437 |
public static Identifier getCurrentSampleDesignation(CdmBase entity) { |
|
438 | 438 |
if(entity.isInstanceOf(DnaSample.class)){ |
439 | 439 |
DnaSample dnaSample = HibernateProxyHelper.deproxy(entity, DnaSample.class); |
440 |
for (Identifier<DnaSample> identifier : dnaSample.getIdentifiers()) {
|
|
440 |
for (Identifier identifier : dnaSample.getIdentifiers()) { |
|
441 | 441 |
if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){ |
442 | 442 |
//first sample designation is the current |
443 | 443 |
return identifier; |
Also available in: Unified diff
cleanup and remove generics from Identifier class