Revision 7a03ad62
Added by Andreas Müller about 3 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddDnaSampleHandler.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
@Override |
20 | 20 |
protected boolean isAllowed(Object derivative) { |
21 |
if(derivative instanceof FieldUnit || (derivative instanceof DerivedUnit
|
|
22 |
&& ((DerivedUnit) derivative).getRecordBasis().equals(SpecimenOrObservationType.PreservedSpecimen))
|
|
23 |
|| (derivative instanceof DnaSample && ((DnaSample)derivative).getRecordBasis()==SpecimenOrObservationType.TissueSample)){
|
|
21 |
if(derivative instanceof FieldUnit |
|
22 |
|| (derivative instanceof DerivedUnit
|
|
23 |
&& allowsDnaSample(((DerivedUnit)derivative).getRecordBasis()) )){
|
|
24 | 24 |
return true; |
25 | 25 |
} |
26 | 26 |
return false; |
27 | 27 |
} |
28 | 28 |
|
29 |
private boolean allowsDnaSample(SpecimenOrObservationType recordBasis) { |
|
30 |
return recordBasis.isPreservedSpecimen() && !recordBasis.equals(SpecimenOrObservationType.DnaSample); |
|
31 |
} |
|
32 |
|
|
29 | 33 |
@Override |
30 | 34 |
protected DerivedUnit createDerivative() { |
31 | 35 |
DnaSample dnaSample = DnaSample.NewInstance(); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/AddMediaSpecimenHandler.java | ||
---|---|---|
34 | 34 |
} |
35 | 35 |
|
36 | 36 |
private boolean allowsImageDerivate(SpecimenOrObservationType recordBasis) { |
37 |
//only from media it does not make much sense to create a media derivative again (though theoretically possible) |
|
37 |
//only from media and human observations it does not make much sense to create a media derivative again (though theoretically possible)
|
|
38 | 38 |
return !(recordBasis.isMedia() && recordBasis.equals(SpecimenOrObservationType.HumanObservation)); |
39 | 39 |
} |
40 | 40 |
|
Also available in: Unified diff
ref #9443 broaden the usecases when dnasample can be added to field or derived unit