+
// $Id$
/**
- * Copyright (C) 2007 EDIT
+ * Copyright (C) 2011 EDIT
* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
*
package eu.etaxonomy.taxeditor.view.detail;
import java.util.Set;
-import java.util.UUID;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
-import eu.etaxonomy.cdm.model.description.TextData;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
/** {@inheritDoc} */
@Override
protected void showParts() {
+ // FIXME (CM) : Need to clean out this code.
+ // Too much type checking to decide which detail view to display.
+ // Need to build in a mechanism where navigators / editors are 'aware'
+ // of the corresponding detail viewer.
if (getInput() instanceof TaxonBase) {
createTaxonSections(rootElement);
} else if (getInput() instanceof DescriptionBase) {
Set<Marker> descriptionMarkers = ((DescriptionBase) getInput()).getMarkers();
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
+ MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
if (marker.getMarkerType().equals(useMarkertype)) {
}
} else if (getInput() instanceof DescriptionElementBase) {
Set<Marker> descriptionMarkers = ((DescriptionElementBase) getInput()).getInDescription().getMarkers();
- MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
+ MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
Boolean isUseDescription = false;
for (Marker marker : descriptionMarkers) {
if (marker.getMarkerType().equals(useMarkertype)) {
fireSelectionChanged(selectionChangedEvent);
}
+ /**
+ * createTaxonSections(RootElement parent)
+ * @param parent
+ */
private void createTaxonSections(RootElement parent) {
destroySections();
addPart(parsingMessagesSection);
}
+ /**
+ * createNameSections
+ * @param parent
+ */
private void createNameSections(RootElement parent) {
destroySections();
NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
addPart(nameRelationshipSection);
}
+ /**
+ * createReferenceSections
+ * @param parent
+ */
private void createReferenceSections(RootElement parent) {
destroySections();
addPart(referenceDetailSection);
}
+ /**
+ * createTeamOrPersonBaseDetailSection
+ * @param parent
+ */
private void createTeamOrPersonBaseDetailSection(RootElement parent) {
destroySections();
TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection) formFactory
addPart(teamOrPersonBaseDetailSection);
}
+ /**
+ * createTeamDetailSection
+ * @param parent
+ */
private void createTeamDetailSection(RootElement parent) {
destroySections();
TeamDetailSection teamDetailSection = (TeamDetailSection) formFactory
addPart(teamDetailSection);
}
-
+
+ /**
+ * createPersonDetailSection
+ * @param parent
+ */
private void createPersonDetailSection(RootElement parent) {
destroySections();
PersonDetailSection personDetailSection = (PersonDetailSection) formFactory
addPart(personDetailSection);
}
+ /**
+ * createDescriptionElementSection
+ * @param parent
+ */
private void createDescriptionElementSection(RootElement parent) {
destroySections();
addPart(descriptionElementMediaSection);
}
+ /**
+ * createDescriptionSection
+ * @param parent
+ */
private void createDescriptionSection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
addPart(scopeSection);
}
+ /**
+ * Creates the use Description section
+ * @param parent
+ */
private void createUseDescriptionSection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
addPart(descriptionDetailSection);
}
+
+ /**
+ * createMediaElementSection
+ * @param parent
+ */
private void createMediaElementSection(RootElement parent) {
destroySections();
addPart(mediaDetailSection);
}
+ /**
+ * createDerivedUnitBaseElementSection
+ * @param parent
+ */
private void createDerivedUnitBaseElementSection(RootElement parent) {
destroySections();
addPart(taxonomicScopeSection);
}
+ /**
+ * createPolytomousKeyNodeSection
+ * @param parent
+ */
private void createPolytomousKeyNodeSection(RootElement parent) {
destroySections();
- PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
- .createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE,
- getConversationHolder(), parent, this, Section.TWISTIE
- | Section.EXPANDED);
+ PolytomousKeyDetailSection polytomousKeyDetailSection = (PolytomousKeyDetailSection) formFactory
+ .createCdmDetailSection(DetailType.POLYTOMOUS_KEY,
+ getConversationHolder(), parent, this, Section.TWISTIE
+ | Section.COMPACT);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ PolytomousKeyNodeDetailSection polytomousKeyNodeDetailSection = (PolytomousKeyNodeDetailSection) formFactory
+ .createCdmDetailSection(DetailType.POLYTOMOUS_KEY_NODE,
+ getConversationHolder(), parent, this, Section.TWISTIE
+ | Section.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ GeographicalScopeDetailSection geographicalScopeDetailSection = (GeographicalScopeDetailSection) formFactory
+ .createEntityDetailSection(EntityDetailType.GEOGRAPHICAL_SCOPE,
+ getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+ ScopeRestrictionSection scopeRestrictionSection = (ScopeRestrictionSection) formFactory
+ .createEntityDetailSection(EntityDetailType.SCOPE_RESTRICTION,
+ getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ TaxonomicScopeSection taxonomicScopeSection = (TaxonomicScopeSection) formFactory
+ .createEntityDetailSection(EntityDetailType.TAXONOMIC_SCOPE,
+ getConversationHolder(), parent, Section.TWISTIE | Section.COMPACT);
+
+ addPart(polytomousKeyDetailSection);
+ addPart(geographicalScopeDetailSection);
+ addPart(scopeRestrictionSection);
+ addPart(taxonomicScopeSection);
addPart(polytomousKeyNodeDetailSection);
}
+ /**
+ * 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(termVocabularyDetailSection);
}
+ /**
+ * createDefinedTermSection
+ * @param parent
+ */
private void createDefinedTermSection(RootElement parent) {
destroySections();