import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
import eu.etaxonomy.taxeditor.ui.section.agent.TeamDetailSection;
import eu.etaxonomy.taxeditor.ui.section.agent.TeamOrPersonBaseDetailSection;
import eu.etaxonomy.taxeditor.ui.section.common.ReferencedEntityDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.description.DescribedSpecimenSection;
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailSection;
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementMediaSection;
import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyNodeDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.OriginalLabelDataSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.association.DerivedUnitTypeDesignationSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.association.TaxonAssociationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSamplePreparationPreservationSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailSection;
import eu.etaxonomy.taxeditor.ui.section.supplemental.RightsSection;
+import eu.etaxonomy.taxeditor.ui.section.supplemental.identifier.DerivedUnitFacadeIdentifierSection;
import eu.etaxonomy.taxeditor.ui.section.taxon.ParsingMessagesSection;
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonBaseDetailSection;
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
public class DetailsViewer extends AbstractCdmDataViewer {
private ISelection selection;
-
- /**
- * <p>
- * Constructor for DetailsViewer.
- * </p>
- *
- * @param parent
- * a {@link org.eclipse.swt.widgets.Composite} object.
- * @param viewPart
- * a {@link eu.etaxonomy.taxeditor.view.AbstractCdmViewPart}
- * object.
- */
+
public DetailsViewer(Composite parent, AbstractCdmViewPart viewPart) {
super(parent, viewPart);
}
destroySections();
if (input instanceof TaxonBase) {
- createTaxonSections(rootElement);
+ if(((TaxonBase) input).getName()==null){
+ createEmptySection(rootElement);
+ }
+ else{
+ createTaxonSections(rootElement);
+ }
} else if (input instanceof NonViralName) {
createNameSections(rootElement);
}
else{
Set<Marker> descriptionMarkers = ((DescriptionBase<?>) input).getMarkers();
-
+
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
}
} else if (input instanceof DescriptionElementBase) {
Set<Marker> descriptionMarkers = ((DescriptionElementBase) input).getInDescription().getMarkers();
-
+
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
if (marker.getMarkerType()!= null && marker.getMarkerType().getUuid().equals(UsageTermCollection.uuidUseMarkerType)) {
}
- /**
- * @param rootElement
- */
private void createEmptySection(RootElement parent) {
destroySections();
addPart(emptySection);
}
- /**
- * @param rootElement
- */
private void createGroupSection(RootElement parent) {
destroySections();
addPart(grantedAuthorityDetailSection);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.Viewer#getSelection()
- */
/** {@inheritDoc} */
@Override
public ISelection getSelection() {
}
}
- /**
- * createTaxonSections(RootElement parent)
- *
- * @param parent
- */
private void createTaxonSections(RootElement parent) {
destroySections();
ParsingMessagesSection parsingMessagesSection = formFactory.createParsingMessagesSection(getConversationHolder(), parent, this,
ExpandableComposite.EXPANDED | ExpandableComposite.EXPANDED);
+ if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
+ TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- TaxonBaseDetailSection taxonBaseDetailSection = formFactory.createTaxonBaseDetailSection(getConversationHolder(), parent, this,
- ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
- ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
- ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ addPart(taxonBaseDetailSection);
+ }
+ NonViralNameDetailSection nonViralNameSection = formFactory
+ .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
+ NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
- ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+ ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ addPart(nomenclaturalStatusSection);
+ addPart(referenceDetailSection);
+ }
//TODO RL
- if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+ if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL) && !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION)){
ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
addPart(nameRelationshipSection);
}
-
addPart(parsingMessagesSection);
- addPart(taxonBaseDetailSection);
+
addPart(nonViralNameSection);
- addPart(nomenclaturalStatusSection);
- addPart(referenceDetailSection);
+
}
- /**
- * createNameSections
- *
- * @param parent
- */
private void createNameSections(RootElement parent) {
destroySections();
- NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(getConversationHolder(), parent, this,
- ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ NonViralNameDetailSection nonViralNameSection = formFactory.createNonViralNameDetailSection(
+ getConversationHolder(), parent, this, false, ExpandableComposite.TWISTIE
+ | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
}
}
- /**
- * createReferenceSections
- *
- * @param parent
- */
private void createReferenceSections(RootElement parent) {
destroySections();
addPart(referenceDetailSection);
}
- /**
- * createTeamOrPersonBaseDetailSection
- *
- * @param parent
- */
private void createTeamOrPersonBaseDetailSection(RootElement parent) {
destroySections();
TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = formFactory.createTeamOrPersonBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(teamOrPersonBaseDetailSection);
}
- /**
- * createTeamDetailSection
- *
- * @param parent
- */
private void createTeamDetailSection(RootElement parent) {
destroySections();
TeamDetailSection teamDetailSection = formFactory.createTeamDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(teamDetailSection);
}
- /**
- * createPersonDetailSection
- *
- * @param parent
- */
private void createPersonDetailSection(RootElement parent) {
destroySections();
PersonDetailSection personDetailSection = formFactory.createPersonDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(personDetailSection);
}
- /**
- * createDescriptionElementSection
- *
- * @param parent
- */
private void createDescriptionElementSection(RootElement parent) {
destroySections();
addPart(descriptionElementMediaSection);
}
- /**
- * createDescriptionSection
- *
- * @param parent
- */
private void createDescriptionSection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
-
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+// DescribedSpecimenSection describedSpecimenSection = formFactory.createDescribedSpecimenSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+//
+// formFactory.createHorizontalSeparator(parent, SWT.BORDER);
// DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
// .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
addPart(descriptionDetailSection);
addPart(naturalLanguageSection);
- addPart(describedSpecimenSection);
+// addPart(describedSpecimenSection);
// addPart(descriptionSourceSection);
addPart(scopeSection);
}
- /**
- * createDescriptionSection
- *
- * @param parent
- */
private void createSpecimenDescriptionSection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(descriptionDetailSection);
}
- /**
- * Creates the use Description section
- *
- * @param parent
- */
private void createUseDescriptionSection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
}
-
- /**
- * @param rootElement
- */
private void createImageGallerySection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = formFactory.createDescriptionDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(descriptionDetailSection);
}
- /**
- * createMediaElementSection
- *
- * @param parent
- */
-
private void createMediaElementSection(RootElement parent) {
destroySections();
addPart(mediaDetailSection);
}
- /**
- * createDerivedUnitBaseElementSection
- *
- * @param parent
- */
private void createDerivedUnitBaseElementSection(RootElement parent) {
destroySections();
DerivedUnitBaseDetailSection derivedUnitBaseDetailSection = formFactory.createDerivedUnitBaseDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(derivedUnitBaseDetailSection);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- OriginalLabelDataSection originalLabelDataSection = formFactory.createOriginalLabelDataSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
- addPart(originalLabelDataSection);
-
//for editors working with facades
if(AbstractUtility.getActivePart() instanceof IDerivedUnitFacadePart){
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
FieldUnitDetailSection fieldUnitDetailSection = formFactory.createFieldUnitDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
addPart(fieldUnitDetailSection);
}
+ else{
+ if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+ addPart(taxonAssociationDetailSection);
+ }
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ DerivedUnitFacadeIdentifierSection identifierDetailSection = formFactory.createDerivedUnitFacadeIdentifierSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+ addPart(identifierDetailSection);
+ }
if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
DeterminationDetailSection determinationDetailSection = formFactory.createDeterminationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
addPart(determinationDetailSection);
}
- if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_TAXON_ASSOCIATIONS)){
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
- TaxonAssociationDetailSection taxonAssociationDetailSection = formFactory.createTaxonAssociationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- addPart(taxonAssociationDetailSection);
- }
-
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ DerivedUnitTypeDesignationSection derivedUnitTypeDesignationSection = formFactory.createDerivedUnitTypeDesignationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
+ addPart(derivedUnitTypeDesignationSection);
+
}
private void createFieldUnitSection(RootElement parent) {
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ DnaSamplePreparationPreservationSection preparationPreservationSection = formFactory.createDnaSamplePreparationPreservationSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
addPart(section);
+ addPart(preparationPreservationSection);
addPart(qualitySection);
addPart(sampleDesignationDetailSection);
}
}
-
-
- /**
- * @param rootElement
- */
private void createFeatureDistributionSection(RootElement parent) {
destroySections();
addPart(featureDistributionSection);
}
- /**
- * createPolytomousKeyNodeSection
- *
- * @param parent
- */
private void createPolytomousKeyNodeSection(RootElement parent) {
destroySections();
- PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
+ PolytomousKeyDetailSection polytomousKeyDetailSection = formFactory.createPolytomousKeyDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE);
formFactory.createHorizontalSeparator(parent, SWT.BORDER);
PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = formFactory.createPolytomousKeyNodeDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
- formFactory.createHorizontalSeparator(parent, SWT.BORDER);
-
- TaxonomicScopeSection taxonomicScopeSection = formFactory.createTaxonomicScopeSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT);
-
addPart(polytomousKeyDetailSection);
addPart(polytomousKeyNodeDetailSection);
- addPart(taxonomicScopeSection);
}
- /**
- * create the UseRecordSection
- *
- * @param parent
- */
private void createUseRecordSection(RootElement parent) {
destroySections();
}
- /**
- * createUserSection
- *
- * @param parent
- */
private void createUserSection(RootElement parent) {
destroySections();
addPart(groupByUserDetailSection);
}
- /**
- * createTaxonRelationshipSection
- *
- * @param parent
- */
private void createTaxonRelationshipSection(RootElement parent) {
destroySections();
addPart(referencedEntityBaseDetailSection);
}
- /**
- * @param rootElement
- */
private void createTermVocabularySection(RootElement parent) {
destroySections();
addPart(termVocabularyDetailSection);
}
- /**
- * createDefinedTermSection
- *
- * @param parent
- */
private void createDefinedTermSection(RootElement parent) {
destroySections();
addPart(definedTermDetailSection);
}
+ @Override
+ public void update(CdmDataChangeMap arg0) {
+
+ }
+
}