reintegrated model changes from branch 3.3-MC-SNAPSHOT
authorCherian Mathew <c.mathew@bgbm.org>
Wed, 25 Sep 2013 14:07:04 +0000 (14:07 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Wed, 25 Sep 2013 14:07:04 +0000 (14:07 +0000)
148 files changed:
.gitattributes
eu.etaxonomy.taxeditor.application/plugin.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/IEntityCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/handler/NewObjectHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/operation/AddDerivedUnitFacadeMediaOperation.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/AgentCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/GroupCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/NameCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/OccurrenceCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/ReferenceCreator.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/UserCreator.java
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditorDataChangeBehaviour.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/SwapSynonymAndAcceptedHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaContentProvider.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesLabelProvider.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/MoveTaxonOperationTest.java
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/SwapSynonymAndAcceptedOperationTest.java
eu.etaxonomy.taxeditor.help/html/gettingstarted/creating_multiple_datasources.html
eu.etaxonomy.taxeditor.help/html/gettingstarted/show_hide_options_of_drop-down_menus.html
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/ClassificationLabelProvider.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/SynonymLabelProvider.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDataChangeBehavior.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeContentProvider.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapterAssistant.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CopyHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/CopyOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/MoveTaxonOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/operation/CreateTaxonNode.java
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateDefinedTermHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateTermVocabularyHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermEditorHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermMenu.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/AbstractDefinedTermEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/DefinedTermEditorInputFactory.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ExtensionTypeEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/FeatureEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/MarkerTypeEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ModifierEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaLevelEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/StateEditorInput.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateDefinedTermOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateTermVocabularyOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreeContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/FeatureNodeContainer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NomenclaturalCodeHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewFieldObservationWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/AbstractPersistentPostOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/PreservationMethodMenuPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/StageMenuPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/SearchManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmEnumSelectionDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/DerivedUnitSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FieldObservationSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/GrantedAuthoritySelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/OriginalSourceTypeSelectionDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationTypeSelectionDialog.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/GatheringEventUnitElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/IEntityElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MinMaxTextSection.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/NumberWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PartialElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DerivedUnitElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescribedSpecimenSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionSourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ModifierElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ModifierSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StateDataSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/IndividualsAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/ScopeRestrictionSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/ImageFileElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationPartElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SpecimenTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SpecimenCollectionDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/IdentifiableSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/RightsElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor.store/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml
eu.etaxonomy.taxeditor.store/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet.xml

index f19d32bc91c8270ac9e12d41db628d8c69e15061..cadffbe930bd4d86374874229f36fa0b1d294250 100644 (file)
@@ -1060,6 +1060,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/UsageTe
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermBasePropertyTester.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermContentProvider.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermLabelProvider.java -text
@@ -1068,16 +1069,8 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/defined
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateTermVocabularyHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermEditorHandler.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermMenu.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/AbstractDefinedTermEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/DefinedTermEditorInputFactory.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ExtensionTypeEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/FeatureEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/MarkerTypeEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ModifierEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaLevelEditorInput.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/StateEditorInput.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateDefinedTermOperation.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateTermVocabularyOperation.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java -text
@@ -1232,6 +1225,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/EnumC
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/LoginDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/UriDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmEnumSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AgentSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ClassificationSelectionDialog.java -text
@@ -1246,10 +1240,12 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/sele
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NameSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NamedAreaSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorTeamSelectionDialog.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/OriginalSourceTypeSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PersonSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/PolytomousKeySelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/ReferenceSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SpecimenOrObservationTypeSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonBaseSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TeamSelectionDialog.java -text
@@ -1263,6 +1259,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/Cdm
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmPropertyChangeEvent.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CheckboxElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/DateDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/GatheringEventUnitElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ICdmFormElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/IEnableableFormElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/IEntityElement.java -text
@@ -1279,6 +1276,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/Key
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LabelElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LanguageStringWithLabelElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/LayoutConstants.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MinMaxTextSection.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/NumberWithLabelElement.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PartialElement.java -text
index 61f897c866ce4cf0eb0288cb8a0558c4db4eddd5..92ca4981ba913769d30dbb4756289aa40acca357 100644 (file)
             id="eu.etaxonomy.taxeditor.application.perspective.polytomous"\r
             name="Polytomous Key">\r
       </perspective>\r
-       <perspective\r
+      <!-- FIXME:3.3MC -->\r
+       <!--perspective\r
             class="eu.etaxonomy.taxeditor.perspective.Uses"\r
             id="eu.etaxonomy.taxeditor.application.perspective.uses"\r
             name="Uses">\r
-      </perspective>\r
+      </perspective-->\r
      \r
    </extension>\r
    <!--extension\r
index dd461e780bf7c76c185069310cbb05b019a5cfd1..90653125629cf16939dc2d07deb0a7de5837a20a 100644 (file)
@@ -24,9 +24,12 @@ import org.eclipse.ui.texteditor.IDocumentProvider;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
  * A list-based editor, where each line in the editor's document is associated with a domain object.
@@ -148,18 +151,38 @@ public class AnnotatedLineEditor extends TextEditor implements IConversationEnab
         */
        public LineAnnotation createAnnotatedLineNewObject(Object key, String titleCache) {
                
+               
+
                // Create new object
                Object entity = ((AnnotatedLineDocumentProvider) getDocumentProvider()).
                                                        getEntityCreator(getEditorInput()).createEntity(key, titleCache);
-
+               // checks if the creator also saves the entity (in a different conversation), in which case 
+               // we need to bind back this editors conversation
+               // we also need to reload the entity because the conversation used to
+               // to create / save the entity may have been closed
+               if(entity != null && ((AnnotatedLineDocumentProvider) getDocumentProvider()).getEntityCreator(getEditorInput()).savesEntity()) {                
+                       getConversationHolder().bind();
+                       Object object = CdmStore.getService(IOccurrenceService.class).load(((CdmBase)entity).getUuid());                        
+                       entity = HibernateProxyHelper.deproxy(object);                  
+               }
+               
+               if(entity == null) {
+                       return null;
+               }
                LineAnnotation annotation = createAnnotatedLine(entity);
                if (annotation != null) {
                        annotation.markAsNew(true);
                }
+
                return annotation;
                
        }
        
+         @Override
+         public boolean isDirty() {
+               return super.isDirty();           
+         }
+       
        /**
         * Creates an annotated line at the end of the document. The annotation contains the entity.
         *
index 0ea3e38e49c11f7dc6646c9627f9f091d19a8267..40572208fa7f1fa71fe76137f86aff6fb8c0f662 100644 (file)
@@ -49,4 +49,13 @@ public interface IEntityCreator<T> {
         * @return a {@link java.util.Map} object.
         */
        Map<Object, String> getKeyLabelPairs();
+       
+       /**
+        * Return a flag indicating whether this creator also saves the entities
+        *
+        * @return true or false
+        */
+       boolean savesEntity();
+       
+
 }
index 43b4b8e5e7a98a08c931a041bbbfb1db740bdf32..99c5640973d74eb0edc512a2f10bce06f87dc816 100644 (file)
@@ -44,13 +44,8 @@ public class NewObjectHandler extends AbstractHandler {
                        
                        Object key = ((Event)event.getTrigger()).data;
                        if (key != null) {
-                               
-                               
-                               String text = ((Event)event.getTrigger()).text;
-                               InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), "Create " + text, "Enter new " + text, "", null);
-                               if (dialog.open() != Window.CANCEL) {
-                                       ((AnnotatedLineEditor) editor).createAnnotatedLineNewObject(key, dialog.getValue());
-                               }
+
+                               ((AnnotatedLineEditor) editor).createAnnotatedLineNewObject(key, "Untitled");
                                
                        } else {
                                ((AnnotatedLineEditor) editor).createAnnotatedLineNewObject();
index 60535de12ff220caf42a405cc792dbf448bfd1d4..cf09eda13ffeb7456c33c8083f8a648d47317747 100644 (file)
@@ -26,6 +26,7 @@ import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
 import org.eclipse.ui.handlers.IHandlerService;
 
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
@@ -83,6 +84,11 @@ public class DynamicNewObjectMenu extends CompoundContributionItem {
                                }
                        }                               
                });
+               
+               //FIXME:3.3MC Need corresponding Details Viewer section for FieldUnit
+               if(key == SpecimenOrObservationType.FieldUnit){
+                       menuItem.setEnabled(false);
+               }
        }
        
        /**
index fe74a3d1374b31f246eeed0522c00970c58057f9..a1b78438cf11e50af7cb2975550a6443f6d4c9c5 100644 (file)
@@ -21,7 +21,7 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
 import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
@@ -55,10 +55,10 @@ public abstract class AbstractAddDerivedUnitFacadeMediaHandler extends AbstractH
                        
                        if(selection instanceof IStructuredSelection){
                                Object element = ((IStructuredSelection) selection).getFirstElement();
-                               if(element instanceof DerivedUnitBase){
+                               if(element instanceof DerivedUnit){
                                        
                                        try{
-                                               AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnitBase) element, getMode(), postOperationEnabled);
+                                               AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnit) element, getMode(), postOperationEnabled);
                                                BulkEditorUtil.executeOperation(operation);
                                        } catch (NotDefinedException e) {
                                                BulkEditorUtil.warn(getClass(), "Command name not set.");
index 179f2a5f58054e37cf175f97dd4d778ec0fdd438..5b5e8e2137b773c8da3819ddd6369c70f2b50fde 100644 (file)
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.SpecimenDescription;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -36,7 +36,7 @@ public class AddDerivedUnitFacadeMediaOperation extends
        public static final int DERIVED_UNIT_MEDIA = 0;
        public static final int FIELD_OBJECT_MEDIA = 1;
        
-       private DerivedUnitBase derivedUnit;
+       private DerivedUnit derivedUnit;
        private int mode;
        
        /**
@@ -44,7 +44,7 @@ public class AddDerivedUnitFacadeMediaOperation extends
         * @param undoContext
         * @param postOperationEnabled
         */
-       public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, DerivedUnitBase derivedUnit,
+       public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, DerivedUnit derivedUnit,
                        int mode, IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, postOperationEnabled);
                
index 3281cc226ac32a6d5f57c68dc932176117f794cf..015b24a287550061d5c71dc282a414b3c2d7ca47 100644 (file)
@@ -76,4 +76,10 @@ public class AgentCreator implements IEntityCreator<AgentBase> {
                result.put(Person.class, "Author");
                return result;
        }
+
+       @Override
+       public boolean savesEntity() {
+               // TODO Auto-generated method stub
+               return false;
+       }
 }
index e5f2deb9a17a7b577707f132412dd15d56b98005..86dbde2e5d6a73e404ef0cb026f8200ddf258f5e 100644 (file)
@@ -49,4 +49,10 @@ public class GroupCreator implements IEntityCreator<Group> {
                return result;
        }
 
+       @Override
+       public boolean savesEntity() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
 }
index 12fe3a4e3ae52e6c3e42100870410ae1a58512d3..776b223ea4a1d2359240f4f3d0e5be28686a3ad6 100644 (file)
@@ -62,4 +62,10 @@ public class NameCreator implements IEntityCreator<TaxonNameBase> {
                }
                return result;
        }
+
+       @Override
+       public boolean savesEntity() {
+               // TODO Auto-generated method stub
+               return false;
+       }
 }
index f77a675bc0c71ebd83e36af3b87852c448fdd79c..db3d60f776b4b2015942532c7880ad0f99f78f6d 100644 (file)
 
 package eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator;
 
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.TreeMap;
 
 import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.wizard.WizardDialog;
 
-import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
-import eu.etaxonomy.cdm.model.occurrence.Fossil;
-import eu.etaxonomy.cdm.model.occurrence.LivingBeing;
-import eu.etaxonomy.cdm.model.occurrence.Observation;
-import eu.etaxonomy.cdm.model.occurrence.Specimen;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
 
 /**
  * <p>
@@ -42,33 +43,25 @@ public class OccurrenceCreator implements
        /** {@inheritDoc} */
        @Override
        public SpecimenOrObservationBase createEntity(String text) {
-               return createEntity(Specimen.class, text);
+
+               return createEntity(DerivedUnit.class, text);
        }
 
        /** {@inheritDoc} */
        @Override
        public SpecimenOrObservationBase createEntity(Object key, String text) {
+               
                SpecimenOrObservationBase specimenOrObservation = null;
+               NewDerivedUnitBaseWizard wizard = new NewDerivedUnitBaseWizard((SpecimenOrObservationType)key);
+               wizard.init(null, null);
+               if(wizard.getEntity() != null) {
+                       WizardDialog dialog = new WizardDialog(BulkEditorUtil.getShell(), wizard);
+                       int status = dialog.open();
 
-               if (FieldObservation.class.equals((key))) {
-                       specimenOrObservation = FieldObservation.NewInstance();
-               } else if (DerivedUnit.class.equals((key))) {
-                       specimenOrObservation = DerivedUnit.NewInstance();
-               } else if (LivingBeing.class.equals((key))) {
-                       specimenOrObservation = LivingBeing.NewInstance();
-               } else if (Observation.class.equals((key))) {
-                       specimenOrObservation = Observation.NewInstance();
-               } else if (Specimen.class.equals((key))) {
-                       specimenOrObservation = Specimen.NewInstance();
-               } else if (DnaSample.class.equals((key))) {
-                       specimenOrObservation = DnaSample.NewInstance();
-               } else if (Fossil.class.equals((key))) {
-                       specimenOrObservation = Fossil.NewInstance();
-               }
-
-               if (specimenOrObservation != null) {
-                       specimenOrObservation.setTitleCache(text, true);
-               }
+                       if (status == IStatus.OK) {
+                               specimenOrObservation = wizard.getEntity();                                                             
+                       }
+               } 
                return specimenOrObservation;
        }
 
@@ -81,21 +74,27 @@ public class OccurrenceCreator implements
         */
        @Override
        public Map<Object, String> getKeyLabelPairs() {
-               Map<Object, String> result = new HashMap<Object, String>();
-
-               result.put(Specimen.class, "Specimen");
-               result.put(Observation.class, "Observation");
-               result.put(LivingBeing.class, "Living Being");
-               result.put(Fossil.class, "Fossil");
-               result.put(DerivedUnit.class, "Derived Unit");
-
-               // Omitted at the moment see #2266
-               // result.put(DnaSample.class, "Dna Sample");
+               Comparator<Object> comparator = new Comparator<Object>() {
+                         public int compare(Object o1, Object o2) {
+                           String key1 = ((SpecimenOrObservationType)o1).getKey();
+                           String key2 = ((SpecimenOrObservationType)o2).getKey();
+                           return key1.compareTo(key2);
+                         }
+                       };
+               Map<Object, String> result = new TreeMap<Object, String>(comparator);
 
-               // Omitted see #2266
-               // result.put(FieldObservation.class, "Field Observation");
-               // result.put(Observation.class, "Observation");
+               for(SpecimenOrObservationType sooType : SpecimenOrObservationType.values()) {                           
+                       result.put(sooType, sooType.getMessage());                              
+               }
 
                return result;
        }
+
+       @Override
+       public boolean savesEntity() {
+               // TODO Auto-generated method stub
+               return true;
+       }
+       
+
 }
index cee07a26469407b4bb0c9ea7760a3e2808baeeaf..92d94ee4ad882a651d6865e834d96bf1db54cd16 100644 (file)
@@ -115,4 +115,10 @@ public class ReferenceCreator implements IEntityCreator<Reference> {
                }
                return result;
        }
+
+       @Override
+       public boolean savesEntity() {
+               // TODO Auto-generated method stub
+               return false;
+       }
 }
index 2d8750ab3d184eefd2847389ddeb2f3c597af435..d092ce03a6be1020437b9f9765c7f09f948ca03d 100644 (file)
@@ -61,4 +61,10 @@ public class UserCreator  implements IEntityCreator<User>{
                return result;
        }
 
+       @Override
+       public boolean savesEntity() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
 }
index 9d8630de02850d3b5c639955532155d4a62b292c..e333dba506bd10bfe8adf99b46c8a46057b420f3 100644 (file)
        <classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.3-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.3-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.3-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.2.4-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.4-SNAPSHOT-sources.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.2.4-SNAPSHOT.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.2.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
index 9fb167cc8644ced846238dee40784f7341832719..4cf488ee33f1a17bac6e7badc2adfac6cf54f75d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
index 25f118068392d39fda76feea6c855dfb3633db17..f131a431cbf20a8f2194c84912950bd3e0a6485b 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index df7875ca6d99b8a571f90d0ba61dd54934d3e66a..a951ef9030fb6dfa797c384340a67361a46f2350 100644 (file)
@@ -26,8 +26,8 @@ import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
index d9c202c9974a8198d26fb9e0218558caca3f2dce..aa6dc659c686e2e0156a52e880c56f8c10557cfd 100644 (file)
@@ -17,8 +17,8 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
 import eu.etaxonomy.taxeditor.model.IDataChangeBehavior;
 
index 6db78f03df6db3863012bada0fca6d41e774b62c..6a295e64e9a9763f8d9f779ea4d814aab2523b6c 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -25,7 +25,7 @@ import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
@@ -37,6 +37,7 @@ import eu.etaxonomy.taxeditor.model.DataChangeBridge;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
+
 /**
  * <p>TaxonEditorInput class.</p>
  *
@@ -47,20 +48,20 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPersistableElement {
 
        private ConversationHolder conversation;
-       
+
        private TaxonNode taxonNode;
 
        private TaxonEditorInputDataChangeBehaviour dataChangeBehavior;
-       
+
        private TaxonBase initiallySelectedTaxonBase;
-       
+
        private TaxonEditorInput(TaxonNode taxonNode, ConversationHolder conversation){
                this.conversation = conversation;
                this.taxonNode = taxonNode;
        }
-       
 
-       
+
+
        /**
         * <p>NewInstance</p>
         *
@@ -76,26 +77,26 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                        throw e;
                }
        }
-       
+
     /**
-     * 
+     *
      * @param taxonNodeUuid
      * @param conversation
      * @return
      */
     private static TaxonEditorInput NewInstance(UUID taxonNodeUuid, ConversationHolder conversation){
-       
-       
+
+
        TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, null);
-               
+
                if(taxonNode == null){
                        EditorUtil.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
                        return null;
-               }       
-               
+               }
+
        return new TaxonEditorInput(taxonNode, conversation);
     }
-    
+
     /**
      * <p>NewInstanceFromTaxonBase</p>
      *
@@ -104,20 +105,20 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
      */
     public static TaxonEditorInput NewInstanceFromTaxonBase(UUID taxonBaseUuid){
        ConversationHolder conversation = CdmStore.createConversation();
-       
+
        TaxonEditorInput input = null;
-       
+
        TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
        if(taxonBase.isOrphaned()) {
                EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
        }
        else if(taxonBase.isInstanceOf(Taxon.class)){
                Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
-               
+
                if (taxon.isMisapplication()){
                        // TODO get accepted taxon
                        EditorUtil.info("trying to open Mispplied Name ");
-                       
+
                        Set<Taxon> acceptedTaxa = new HashSet<Taxon>();
                        Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon();
                        for(TaxonRelationship relation : relations){
@@ -126,22 +127,22 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                                }
                        }
                        input =  getInputForMultipleTaxa(conversation, acceptedTaxa);
-                       
+
                }else{
                        input = getInputForMultipleNodes(conversation, taxon.getTaxonNodes());
                }
        }else if(taxonBase instanceof Synonym){
                Synonym synonym = (Synonym) taxonBase;
-               
+
                Set<Taxon> taxa = synonym.getAcceptedTaxa();
                input = getInputForMultipleTaxa(conversation, taxa);
        }
-       
+
        input.setInitiallySelectedTaxonBase(taxonBase);
-       
+
        return input;
     }
-    
+
        private static TaxonEditorInput getInputForMultipleNodes(ConversationHolder conversation, Set<TaxonNode> taxonNodes){
        if(taxonNodes.size() == 1){
                TaxonNode taxonNode = taxonNodes.iterator().next();
@@ -149,7 +150,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        }else if(taxonNodes.size() > 1){
                        TaxonNode taxonNode = ChooseFromMultipleTaxonNodesDialog.choose(taxonNodes);
                        if(taxonNode != null){
-                               return NewInstance(taxonNode.getUuid(), conversation);                  
+                               return NewInstance(taxonNode.getUuid(), conversation);
                        }
                }else if(taxonNodes.size() == 0){
                        // this is an undesired state
@@ -157,7 +158,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                }
        return null;
     }
-    
+
     private static TaxonEditorInput getInputForMultipleTaxa(ConversationHolder conversation, Set<Taxon> taxa){
        if(taxa.size() == 1){
                Taxon taxon = taxa.iterator().next();
@@ -176,7 +177,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                }
        return null;
     }
-    
+
     /**
      * <p>NewEmptyInstance</p>
      *
@@ -185,19 +186,19 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
      */
     public static TaxonEditorInput NewEmptyInstance(UUID parentNodeUuid){
        ConversationHolder conversation = CdmStore.createConversation();
-               
+
                TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
-               ITreeNode parentNode = CdmStore.getService(IClassificationService.class).getTreeNodeByUuid(parentNodeUuid);
-               
+               ITaxonTreeNode parentNode = CdmStore.getService(IClassificationService.class).getTreeNodeByUuid(parentNodeUuid);
+
                Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference());
-               TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference(), null);
-               
+               TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference());
+
                // add the new taxon to the editors persistence context
                UUID newTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).save(newTaxonNode);
-               
+
                return new TaxonEditorInput(newTaxonNode, conversation);
     }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.IEditorInput#exists()
         */
@@ -206,7 +207,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a boolean.
         */
-       public boolean exists() {
+       @Override
+    public boolean exists() {
                return taxonNode != null;
        }
 
@@ -218,7 +220,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a {@link org.eclipse.jface.resource.ImageDescriptor} object.
         */
-       public ImageDescriptor getImageDescriptor() {
+       @Override
+    public ImageDescriptor getImageDescriptor() {
                return null;
        }
 
@@ -230,7 +233,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getName() {
+       @Override
+    public String getName() {
                if(getTaxon() == null){
                        return null;
                }
@@ -239,7 +243,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
                        return "New taxon";
                } else {
                        return name.getTitleCache();
-               }       
+               }
        }
 
        /* (non-Javadoc)
@@ -250,7 +254,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a {@link org.eclipse.ui.IPersistableElement} object.
         */
-       public IPersistableElement getPersistable() {
+       @Override
+    public IPersistableElement getPersistable() {
 //             if(CdmStore.isActive()){
 //                     TaxonNode test = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid());
 //                     boolean isPersistable = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(taxonNode.getUuid()) != null;
@@ -269,7 +274,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getToolTipText() {
+       @Override
+    public String getToolTipText() {
                return getName();
        }
 
@@ -277,27 +283,29 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
         */
        /** {@inheritDoc} */
-       public Object getAdapter(Class adapter) {
+       @Override
+    public Object getAdapter(Class adapter) {
 
                if (adapter == Taxon.class) {
                        return taxonNode.getTaxon();
                }
-               
+
                if (adapter == TaxonNode.class) {
                        return taxonNode;
                }
-               
+
                return null;
        }
-       
+
        /**
         * {@inheritDoc}
         *
         * Overrides equals to ensure that a taxon can only be edited by
         * one editor at a time.
         */
-       public boolean equals(Object obj) {
-               if (TaxonEditorInput.class.equals(obj.getClass()) 
+       @Override
+    public boolean equals(Object obj) {
+               if (TaxonEditorInput.class.equals(obj.getClass())
                                && getTaxon() != null
                                && getTaxon().equals(((TaxonEditorInput) obj).getTaxon())){
                        if(((TaxonEditorInput) obj).getInitiallySelectedTaxonBase() != null){
@@ -316,7 +324,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        public Taxon getTaxon(){
                return taxonNode.getTaxon();
        }
-       
+
        /**
         * <p>Getter for the field <code>taxonNode</code>.</p>
         *
@@ -325,7 +333,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        public TaxonNode getTaxonNode() {
                return taxonNode;
        }
-       
+
        /*
         * (non-Javadoc)
         * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
@@ -335,7 +343,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         */
-       public ConversationHolder getConversationHolder() {
+       @Override
+    public ConversationHolder getConversationHolder() {
                return conversation;
        }
 
@@ -344,11 +353,12 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
         */
        /** {@inheritDoc} */
-       public void update(CdmDataChangeMap events) {
+       @Override
+    public void update(CdmDataChangeMap events) {
                if(dataChangeBehavior == null){
                        dataChangeBehavior = new TaxonEditorInputDataChangeBehaviour(this);
                }
-               
+
                DataChangeBridge.handleDataChange(events, dataChangeBehavior);
        }
 
@@ -360,7 +370,8 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         *
         * @return a {@link java.lang.String} object.
         */
-       public String getFactoryId() {
+       @Override
+    public String getFactoryId() {
                return TaxonEditorInputFactory.getFactoryId();
        }
 
@@ -368,11 +379,12 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
         * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
         */
        /** {@inheritDoc} */
-       public void saveState(IMemento memento) {
+       @Override
+    public void saveState(IMemento memento) {
                TaxonEditorInputFactory.saveState(memento, this);
        }
 
-    
+
     /**
      * <p>Setter for the field <code>initiallySelectedTaxonBase</code>.</p>
      *
@@ -390,7 +402,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        public TaxonBase getInitiallySelectedTaxonBase() {
                return initiallySelectedTaxonBase;
        }
-       
+
        @Override
        public String toString() {
                return String.format("%s[%s]", this.getClass().getSimpleName(), getTaxon());
index b4dafb7e7374874d2f83fd4509c3893e446600f8..a12ebd3bff02dd4eb79fba7479f888adce284649 100644 (file)
@@ -18,12 +18,12 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.cdm.model.description.Feature;\r
 import eu.etaxonomy.cdm.model.description.FeatureNode;\r
 import eu.etaxonomy.cdm.model.description.FeatureTree;\r
-import eu.etaxonomy.cdm.model.description.Modifier;\r
 import eu.etaxonomy.cdm.model.description.State;\r
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
@@ -122,21 +122,34 @@ public class UseObjectManager extends ContextListenerAdapter{
 \r
 \r
        private void createHumanGroupVocabulary(IProgressMonitor monitor,ConversationHolder conversation) {\r
-               TermVocabulary<Modifier> humanGroupVocabulary =  (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
+               TermVocabulary<DefinedTerm> humanGroupVocabulary =  (TermVocabulary<DefinedTerm>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
                if (humanGroupVocabulary == null){\r
                        monitor.subTask("create human group vocabulary");\r
                        URI termSourceUri = null;\r
                        try {\r
-                               termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
+                               termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+                       humanGroupVocabulary = null;\r
                        humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
-                       Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newDummyModifier = null;\r
                        newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
-                       Modifier newSubDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newSubDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newSubDummyModifier = null;\r
                        newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
+                       //FIXME:3.3MC----\r
+                       \r
                        newDummyModifier.addIncludes(newSubDummyModifier);\r
                        humanGroupVocabulary.addTerm(newDummyModifier);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
@@ -146,20 +159,28 @@ public class UseObjectManager extends ContextListenerAdapter{
 \r
 \r
        private void createPlantVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<Modifier> plantPartVocabulary =  (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
+               TermVocabulary<DefinedTerm> plantPartVocabulary =  (TermVocabulary<DefinedTerm>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
                if (plantPartVocabulary == null){\r
                        monitor.subTask("create plant part vocabulary");\r
                        URI termSourceUri = null;\r
                        try {\r
-                               termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
+                               termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+                       //FIXME:3.3MC----\r
+                       //plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+                       plantPartVocabulary = null;\r
                        plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
-                       Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newDummyModifier = null;\r
                        newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
                        plantPartVocabulary.addTerm(newDummyModifier);\r
+                       //FIXME:3.3MC----\r
+                       \r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
                        conversation.commit(true);\r
                }\r
@@ -167,19 +188,26 @@ public class UseObjectManager extends ContextListenerAdapter{
 \r
 \r
        private void createCountryVocabulary(IProgressMonitor monitor, ConversationHolder conversation) {\r
-               TermVocabulary<Modifier> countryVocabulary =  (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
+               TermVocabulary<DefinedTerm> countryVocabulary =  (TermVocabulary<DefinedTerm>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
                if (countryVocabulary == null){\r
                        monitor.subTask("create country vocabulary");\r
                        URI termSourceUri = null;\r
                        try {\r
-                               termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
+                               termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");\r
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+                       //FIXME:3.3MC----\r
+                       //countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+                       countryVocabulary = null;\r
                        countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
-                       Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       //FIXME:3.3MC----\r
+                       \r
+                       //FIXME:3.3MC----\r
+                       //DefinedTerm newDummyModifier = DefinedTerm.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+                       DefinedTerm newDummyModifier = null;\r
                        newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
+                       //FIXME:3.3MC----\r
                        countryVocabulary.addTerm(newDummyModifier);\r
                        CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
                        conversation.commit(true);\r
@@ -197,8 +225,11 @@ public class UseObjectManager extends ContextListenerAdapter{
                        } catch (URISyntaxException e) {\r
                                e.printStackTrace();\r
                        }\r
-                       stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+                       //FIXME:3.3MC----\r
+                       //stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+                       stateVocabulary = null;\r
                        stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
+                       //FIXME:3.3MC----\r
                        State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
                        newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
                        State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
index 648e35a6aa197b55afbec8f72d96caa9cd9073da..0f7cadb8a79e08dba1229f1a37409b61cf432619 100644 (file)
@@ -43,8 +43,10 @@ public class TaxeditorEditorPlugin extends AbstractUIPlugin {
                EditorStateManager stateManager = new EditorStateManager();
                CdmStore.getContextManager().addContextListener(stateManager);
                
-               UseObjectManager useManager = new UseObjectManager();
-               CdmStore.getContextManager().addContextListener(useManager);
+               //FIXME:3.3MC----
+               //UseObjectManager useManager = new UseObjectManager();
+               //CdmStore.getContextManager().addContextListener(useManager);
+               //FIXME:3.3MC----
                
                plugin = this;
                logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
index 0e1e3be37fcb3a017cbd72e6d1f7f82cd0081bde..492e597fb1621aacefb488728c06fe5aacbdbc36 100644 (file)
@@ -23,13 +23,11 @@ import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTarget;
 import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
index 507d44cf7748c8ee5f137be80c1983f156a40819..55c685bdfbc2213e4ddf4c10c1d312453b9e3036 100644 (file)
@@ -18,14 +18,11 @@ import org.eclipse.core.commands.IHandler;
 import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.editor.FormEditor;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.operation.SwapSynonymAndAcceptedOperation;
index fa39cab531a7475977055a068e3e35e49c88d1bb..5d8b351fdddda8a63fd5f34e275d05c4dabe0ce2 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.IStatus;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
@@ -36,37 +36,37 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPostOperation {
-       
+
        private Taxon newTaxon;
        private Synonym synonym;
-       private ITreeNode parentNode;
+       private ITaxonTreeNode parentNode;
 
        private TaxonNode newNode;
 
        private Synonym[] synonymsInHomotypicalGroup;
-       
+
        /**
         * <p>Constructor for ChangeSynonymToAcceptedTaxonOperation.</p>
         *
         * @param label a {@link java.lang.String} object.
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
-        * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITreeNode} object.
+        * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param synonym a {@link eu.etaxonomy.cdm.model.taxon.Synonym} object.
         * @param synonymsInHomotypicalGroup an array of {@link eu.etaxonomy.cdm.model.taxon.Synonym} objects.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public ChangeSynonymToAcceptedTaxonOperation(String label, IUndoContext undoContext,
-                       Taxon taxon, ITreeNode parentNode, Synonym synonym, Synonym[] synonymsInHomotypicalGroup, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
+                       Taxon taxon, ITaxonTreeNode parentNode, Synonym synonym, Synonym[] synonymsInHomotypicalGroup, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
                super(label, undoContext, postOperationEnabled, conversationEnabled);
 
                this.taxon = taxon;
                this.parentNode = parentNode;
-               this.synonym = synonym; 
+               this.synonym = synonym;
                this.synonymsInHomotypicalGroup = synonymsInHomotypicalGroup;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
@@ -74,7 +74,7 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                try {
                        newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, taxon, true, true, null, null);
                } catch (HomotypicalGroupChangeException e) {
@@ -82,17 +82,17 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
                        return postExecute(null);
                }
                monitor.worked(20);
-               
+
                synonym.setSec(null);
-               newNode = parentNode.addChildTaxon(newTaxon, null, null, null);
-               
+               newNode = parentNode.addChildTaxon(newTaxon, null, null);
+
                if(synonymsInHomotypicalGroup != null){
                        Taxon taxon = newNode.getTaxon();
                        for (Synonym synonym : synonymsInHomotypicalGroup){
                                taxon.addHomotypicSynonym(synonym, null, null);
                        }
                }
-               
+
                monitor.worked(40);
 
                return postExecute(newNode);
@@ -115,10 +115,10 @@ public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPos
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                // TODO implement - biggest problem is that any window open for new taxon must be closed first
                StoreUtil.warn(this.getClass(), "Not yet implemented");
-               
+
                return postExecute(taxon);
        }
 
index 766c5cf8dfc0ab60daf4f42c4364afb0be16f5a2..0c10b9ad7df145bd2f37f166c3d583d5a79120d6 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -31,7 +31,6 @@ import eu.etaxonomy.cdm.model.description.FeatureNode;
 import eu.etaxonomy.cdm.model.description.FeatureTree;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
-import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateDescriptionElementOperation;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -42,7 +41,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * <p>
  * DynamicFeatureMenu class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created 17.04.2009
  * @version 1.0
@@ -56,7 +55,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
         */
@@ -65,7 +64,8 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
        protected IContributionItem[] getContributionItems() {
 
                return new IContributionItem[] { new ContributionItem() {
-                       public void fill(Menu menu, int index) {
+                       @Override
+            public void fill(Menu menu, int index) {
 
                                ISelection selection = selectionService
                                                .getSelection(DescriptiveViewPart.ID);
@@ -90,7 +90,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                                                createMenuItem(menu, featureNode.getFeature());
 
                                                // add possible children to the menu
-                                               for (FeatureNode childNode : featureNode.getChildren()) {
+                                               for (FeatureNode childNode : featureNode.getChildNodes()) {
                                                        createMenuItem(menu, childNode.getFeature());
                                                }
                                        } else if (selectedElement instanceof DescriptionElementBase) {
@@ -111,10 +111,12 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                menuItem.setText(deproxiedFeature.getLabel());
                menuItem.addSelectionListener(new SelectionListener() {
 
-                       public void widgetDefaultSelected(SelectionEvent e) {
+                       @Override
+            public void widgetDefaultSelected(SelectionEvent e) {
                        }
 
-                       public void widgetSelected(SelectionEvent ev) {
+                       @Override
+            public void widgetSelected(SelectionEvent ev) {
                                Event event = new Event();
                                event.data = deproxiedFeature;
                                try {
@@ -130,10 +132,10 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
 
        /**
         * Retrieves the feature tree associated with the given description
-        * 
+        *
         * TODO as of now this is always the same thing because feature trees may
         * not be associated to descriptions yet.
-        * 
+        *
         * @param description
         * @return
         */
index 94643dbcc4486a519126626debeae623b8940e35..bddcfbfea2434d6489214201d86b576d7ba571e0 100644 (file)
@@ -25,7 +25,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.media.Media;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
@@ -63,9 +63,9 @@ public class MediaContentProvider implements ITreeContentProvider{
                                return getImages((DescriptionBase) parentElement).toArray();
                        } 
                }
-               else if (parentElement instanceof DerivedUnitBase){
+               else if (parentElement instanceof DerivedUnit){
                        try {
-                               DerivedUnitFacade facade = DerivedUnitFacade.NewInstance((DerivedUnitBase) parentElement);
+                               DerivedUnitFacade facade = DerivedUnitFacade.NewInstance((DerivedUnit) parentElement);
                
                                // TODO at the moment we always create image galleries because the facade is like so.
                                // this should definitely change and we want to use normal getters and setters here
index 234dfb2388d52dcfa47db2197aebc4545839a062..a18a10293bd6517d38003be5af1a29763df8bca7 100644 (file)
@@ -7,22 +7,12 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
-import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
-import eu.etaxonomy.cdm.model.description.TextData;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
index 1858c850ad2477f3a44a36d8cbdea413e1f41ad6..6f85e52026102d7a92f78b23e5c5f204effb231b 100644 (file)
@@ -15,11 +15,11 @@ import org.eclipse.jface.viewers.ColumnLabelProvider;
 import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;\r
 import org.eclipse.jface.viewers.StyledString;\r
 \r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.Language;\r
 import eu.etaxonomy.cdm.model.common.LanguageString;\r
 import eu.etaxonomy.cdm.model.description.CategoricalData;\r
 import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
-import eu.etaxonomy.cdm.model.description.Modifier;\r
 import eu.etaxonomy.cdm.model.description.StateData;\r
 import eu.etaxonomy.cdm.model.description.TextData;\r
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;\r
@@ -49,9 +49,9 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                        }\r
                }\r
                else if (element instanceof CategoricalData) {\r
-                       if (!((CategoricalData) element).getStates().isEmpty()) {\r
+                       if (!((CategoricalData) element).getStateData().isEmpty()) {\r
                                boolean isUseCategoryAbsent = true;\r
-                               for (StateData statedata : ((CategoricalData) element).getStates()) {\r
+                               for (StateData statedata : ((CategoricalData) element).getStateData()) {\r
                                        if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useCategoryVocabularyLabel)) {\r
                                                text = text + statedata.getState().getTitleCache() + ";";\r
                                                isUseCategoryAbsent = false;\r
@@ -62,7 +62,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                }\r
                                \r
                                boolean isUseSubCategoryAbsent = true;\r
-                               for (StateData statedata : ((CategoricalData) element).getStates()) {\r
+                               for (StateData statedata : ((CategoricalData) element).getStateData()) {\r
                                        if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel)) {\r
                                                text = text + statedata.getState().getTitleCache() + ";";\r
                                                isUseSubCategoryAbsent = false;\r
@@ -76,13 +76,13 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                text = text + UsageTermCollection.notAvailableLabel + ";" + UsageTermCollection.notAvailableLabel + ";";\r
                        }\r
                        if (!((CategoricalData) element).getModifiers().isEmpty()) {\r
-                               for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+                               for (DefinedTerm modifier: ((CategoricalData) element).getModifiers()){\r
                                        modifier.getPartOf();\r
                                        modifier.getVocabulary();\r
                                }\r
                                \r
                                boolean isPlantPartAbsent = true;\r
-                               for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+                               for (DefinedTerm modifier: ((CategoricalData) element).getModifiers()){\r
                                        if(GetVocabularyType(modifier, UsageTermCollection.plantPartLabel)) {\r
                                                text = text +  modifier.getTitleCache()+ ";";\r
                                                isPlantPartAbsent = false;\r
@@ -94,7 +94,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                }\r
                                \r
                                boolean isHumanGroupAbsent = true;\r
-                               for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+                               for (DefinedTerm modifier: ((CategoricalData) element).getModifiers()){\r
                                        if(GetVocabularyType(modifier, UsageTermCollection.humanGroupLabel)) {\r
                                                text = text +  modifier.getTitleCache()+ ";";\r
                                                isHumanGroupAbsent = false;\r
@@ -105,7 +105,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                }\r
                                \r
                                boolean isEthnicGroupAbsent = true;\r
-                               for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+                               for (DefinedTerm modifier: ((CategoricalData) element).getModifiers()){\r
                                        if(GetVocabularyType(modifier, UsageTermCollection.ethnicGroupLabel)) {\r
                                                text = text +  modifier.getTitleCache()+ ";";\r
                                                isEthnicGroupAbsent = false;\r
@@ -116,7 +116,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
                                }\r
                                \r
                                boolean isCountryAbsent = true;\r
-                               for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+                               for (DefinedTerm modifier: ((CategoricalData) element).getModifiers()){\r
                                        if(GetVocabularyType(modifier, UsageTermCollection.countryLabel)) {\r
                                                text = text +  modifier.getTitleCache()+ ";";\r
                                                isCountryAbsent = false;\r
@@ -164,7 +164,7 @@ public class UsesLabelProvider extends ColumnLabelProvider implements
         * @param vocabularyExpected\r
         * @return\r
         */\r
-       private boolean GetVocabularyType(Modifier term, String vocabularyExpected) {\r
+       private boolean GetVocabularyType(DefinedTerm term, String vocabularyExpected) {\r
                if ((term.getPartOf() != null)  && (term.getPartOf().getTitleCache().equals(vocabularyExpected))) {\r
                        return true;\r
                }\r
index f3dae1afbf4e3ea4c650d881cccbd12c5e3c4e7f..c30009bd6b0f4a63eeb0754e7aac43b3d5e796ca 100644 (file)
@@ -49,10 +49,10 @@ public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTestBase {
                newParentTaxon = Taxon.NewInstance(null, null);
                
                tree = Classification.NewInstance(null);
-               oldParentTaxonNode = tree.addChildTaxon(oldParentTaxon, null, null, null);
-               newParentTaxonNode = tree.addChildTaxon(newParentTaxon, null, null, null);
+               oldParentTaxonNode = tree.addChildTaxon(oldParentTaxon, null, null);
+               newParentTaxonNode = tree.addChildTaxon(newParentTaxon, null, null);
                
-               taxonNode = oldParentTaxonNode.addChildTaxon(taxon, null, null, null);
+               taxonNode = oldParentTaxonNode.addChildTaxon(taxon, null, null);
                
                operation = null;//new MoveTaxonOperation("Move Taxon To Different Parent", undoContext, taxonNode, newParentTaxonNode, postOperation);
        }
index 7f4d1d4859ed626314fb8b7a94bcd21dee04b8e5..37065b5d6f3d18f4f03e85ee7e2f88142703b0db 100644 (file)
@@ -107,7 +107,7 @@ public class SwapSynonymAndAcceptedOperationTest extends AbstractTaxeditorOperat
                
                // Create a concept relation
                concept = Taxon.NewInstance(NonViralName.NewInstance(null), null);
-               conceptRelationshipType = new TaxonRelationshipType();
+               conceptRelationshipType = TaxonRelationshipType.CONGRUENT_TO();
                concept.addTaxonRelation(taxon, conceptRelationshipType, null, null);   
                
                // Create a description
index e0c76546294c5a6edd5adf077bbbed549d5ac7e2..ed033aadb46e9ad81645dae6134b4c5d669b91d9 100644 (file)
@@ -34,7 +34,7 @@ The <strong>"Create New Datasource"</strong> panel will appear.
                The <strong>"Enter credentials for embedded H2 database"</strong> pop-up box will open.
        </li>
        <li>Enter a Database name (for example the name of a user or a taxonomic group).</li>
-       <li>Select <strong>ICBN</strong> or <strong>ICZN</strong> as appropriate.</li>
+       <li>Select <strong>ICNAFP</strong> or <strong>ICZN</strong> as appropriate.</li>
        <li>Click <strong>Finish</strong>.</li>
        <p><img src="../img/2_10f.jpg" alt="" /></p> 
 </ol>
@@ -45,4 +45,4 @@ The <strong>"Create New Datasource"</strong> panel will appear.
 <p>The new Datasource will appear in the Datasource panel: <p><img src="../img/2_10g.jpg" alt="" /></p></p> 
  
 <p>The process to create new datasources can be repeated as many times as desired.</p>
\ No newline at end of file
index 95549cea6c18387aaba29fad712188f3cea00b8e..5a03b8094930e45fa2bf88467d3a9627aadeeeed 100644 (file)
@@ -25,7 +25,7 @@
                                        <li><strong>Matching:</strong> Experimental feature, not yet fully functional.</li>
                                        <li><strong>Taxonomic:</strong> Name Relationships Type: for example "misspelling for", "basionym for".</li>
                                        <li><strong>Name Type Designation Status:</strong> for example "monotypy", "present designation"</li>
-                                       <li><strong>Nomenclatural Code:</strong> ICBN or ICZN.</li>
+                                       <li><strong>Nomenclatural Code:</strong> ICNAFP or ICZN.</li>
                                        <li><strong>Nomenclatural Status Type:</strong> for example "invalid", "conserved".</li>
                                        <li><strong>Ranks:</strong> for example "cultivar", "tribe".</li>
                                        <li><strong>Specimen Type Designation Status:</strong> for example "epitype", "holotype".</li>
index 7d16f19040578474510ab27b9b4278d33e2539e6..76f8bc0ab6ce1065f2ef26f27f0fff02f36c81a2 100644 (file)
@@ -18,8 +18,6 @@ import org.eclipse.jface.viewers.StyledString;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.navigator.IDescriptionProvider;
 
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 
 /**
index de5a605955ee26b148694a98058d20a4b2ee277b..158423da0154ce0701d6049670909d4b8721e17b 100644 (file)
@@ -12,9 +12,9 @@ package eu.etaxonomy.taxeditor.navigation.navigator;
 
 import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.StyledString;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.ui.navigator.IDescriptionProvider;
 
index b50082362db6064b6c07a36c6fe6086879e14e24..9816d777b3cc18df0912e5718a9b2c1d8bbf955a 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,7 +21,7 @@ import org.eclipse.ui.IEditorPart;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
@@ -38,13 +38,13 @@ import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
  * @created 01.04.2009
  * @version 1.0
  */
-public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviour implements 
+public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviour implements
                IDataChangeBehavior {
 
        private TaxonNavigator source;
 
        private Set<CdmBase> staleObjects;
-       
+
        /**
         * <p>Constructor for TaxonNavigatorDataChangeBehavior.</p>
         *
@@ -53,7 +53,7 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
        public TaxonNavigatorDataChangeBehavior(TaxonNavigator taxonNavigator) {
                source = taxonNavigator;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.store.model.IDataChangeBehavior#isRelevant(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
         */
@@ -64,22 +64,22 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
         * @return a boolean.
         */
        public boolean isRelevant(CdmDataChangeMap events) {
-               
+
                // TODO react only on insert/update/delete of taxon and synonym objects
                // and on update of name objects
                boolean relevant = false;
                staleObjects = new HashSet<CdmBase>();
-               
+
                for(CdmDataChangeEvent event : events.getAllEvents()){
                        EventType eventType = event.getEventType();
                        CdmBase eventEntity = event.getEntity();
-                       
+
                        // all tree node changes are relevant
-                       if((eventType == EventType.INSERT || eventType == EventType.DELETE || eventType == EventType.UPDATE) 
-                                       && event.getEntity() instanceof ITreeNode){
+                       if((eventType == EventType.INSERT || eventType == EventType.DELETE || eventType == EventType.UPDATE)
+                                       && event.getEntity() instanceof ITaxonTreeNode){
                                return true;
                        }
-                       
+
                        // name updates of the accepted taxon of open editors are relevant
                        if(eventType == EventType.UPDATE){
                                TaxonNameBase name = null;
@@ -90,17 +90,17 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                                }else{
                                        continue;
                                }
-                               
+
                                Set<IEditorPart> openEditors = NavigationUtil.getOpenEditors();
                                for(IEditorPart editor : openEditors){
-                                       
+
                                        if(name.equals(((TaxonEditorInput) editor.getEditorInput()).getTaxon().getName())){
                                                return true;
                                        }
                                }
                        }
-                       
-                       
+
+
 //                     if(eventType == EventType.UPDATE){
 //                             relevant = true;
 //                             CdmBase entity = event.getEntity();
@@ -111,9 +111,9 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
 //                             }
 //                     }
                }
-               
+
                return false;
-               
+
                // @deprecated
                // react on everything except load
 //             if(events.sizeByEventType(EventType.INSERT) > 0){
@@ -131,25 +131,27 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
         * @see eu.etaxonomy.taxeditor.store.model.IDataChangeBehavior#reactOnDataChange(java.lang.Object, eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
         */
        /** {@inheritDoc} */
-       public void reactOnDataChange(CdmDataChangeMap events) {
+       @Override
+    public void reactOnDataChange(CdmDataChangeMap events) {
                if(isRelevant(events)){
 
                        final Display display = Display.getCurrent();
                        Job job = new Job("Updating Taxon Navigator") {
-                               
+
                                @Override
                                protected IStatus run(IProgressMonitor monitor) {
                                        monitor.beginTask("Updating Taxon Navigator", 3);
                                        monitor.worked(1);
-                                       
+
                                        // clear the session completely
                                        monitor.subTask("Clearing Taxon Navigators session");
                                        display.asyncExec(new Runnable() {
-                                                public void run() {
+                                                @Override
+                        public void run() {
                                                         source.getConversationHolder().clear();
                                                 }
-                                       });                                     
-                                       // FIXME completely clearing the session is a brute force approach. 
+                                       });
+                                       // FIXME completely clearing the session is a brute force approach.
                                        // It would be much more elegant to clear only those elements that have been changed.
                                        // I could not get that to work but we should consider workin on this because we might
                                        // run into serious performance issues, especially when it comes to large trees
@@ -157,26 +159,27 @@ public class TaxonNavigatorDataChangeBehavior extends AbstractDataChangeBehaviou
                                        // at least, we moved this to a job so it can run in a background thred
                                        // seems to improve the situation but not sure if final solution
                                        monitor.worked(1);
-                                       
+
                                        monitor.subTask("Refreshing viewer");
-                                       
+
                                        display.asyncExec(new Runnable() {
-                                           public void run() {
+                                           @Override
+                        public void run() {
                                                source.refresh();
                                            }
                                        });
-                                       
-                                       
-                                       
+
+
+
                                        monitor.worked(1);
                                        monitor.done();
                                        return Status.OK_STATUS;
                                }
                        };
-                       
+
                        job.setPriority(Job.SHORT);
                        job.schedule();
-                       
+
                }
        }
 }
index 7819132c18c671174cd9eb9a8e2f677b56fbcbeb..c7a431daf0b0df9e1c6b47149300112a9fe82d91 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -15,7 +15,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 
 /**
@@ -30,29 +30,32 @@ public class TaxonNodeContentProvider implements ITreeContentProvider {
                        .getLogger(TaxonNodeContentProvider.class);
 
        private static final Object[] NO_CHILDREN = new Object[0];
-       
+
        /** {@inheritDoc} */
-       public Object[] getChildren(Object parentElement) {
-               Object[] children = null;               
-               
-               if(parentElement instanceof ITreeNode){
-                       ITreeNode treeNode = (ITreeNode) HibernateProxyHelper.deproxy(parentElement);
+       @Override
+    public Object[] getChildren(Object parentElement) {
+               Object[] children = null;
+
+               if(parentElement instanceof ITaxonTreeNode){
+                   ITaxonTreeNode treeNode = (ITaxonTreeNode) HibernateProxyHelper.deproxy(parentElement);
                        children = treeNode.getChildNodes().toArray();
                }
-               
+
                return children != null ? children : NO_CHILDREN;
        }
 
        /** {@inheritDoc} */
-       public Object getParent(Object element) {
+       @Override
+    public Object getParent(Object element) {
                if(element instanceof TaxonNode){
                        return ((TaxonNode) element).getParent();
-               }               
+               }
                return null;
        }
 
        /** {@inheritDoc} */
-       public boolean hasChildren(Object element) {
+       @Override
+    public boolean hasChildren(Object element) {
                if(element instanceof TaxonNode){
                        return ((TaxonNode) element).getCountChildren() > 0;
                }
@@ -60,17 +63,20 @@ public class TaxonNodeContentProvider implements ITreeContentProvider {
        }
 
        /** {@inheritDoc} */
-       public Object[] getElements(Object inputElement) {
+       @Override
+    public Object[] getElements(Object inputElement) {
                return this.getChildren(inputElement);
        }
 
        /**
         * <p>dispose</p>
         */
-       public void dispose() {
+       @Override
+    public void dispose() {
        }
 
        /** {@inheritDoc} */
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+       @Override
+    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
 }
index 7774c2c1eebeff4086c797b983bc926214b95948..d4b243b01ccd37d1e83ac032d969e248ebc95704 100644 (file)
 
 package eu.etaxonomy.taxeditor.navigation.navigator;
 
-import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.StyledString;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 import org.eclipse.jface.viewers.StyledString.Styler;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.TextStyle;
 import org.eclipse.ui.navigator.IDescriptionProvider;
@@ -27,7 +25,6 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
 import eu.etaxonomy.taxeditor.security.RequiredPermissions;
index b0d7bb74f6297ecd44fbb02f2b186383790cc739..dd7c51520345b8bd71e85b361868f3619841d82e 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -28,7 +28,7 @@ import org.eclipse.ui.navigator.CommonDropAdapter;
 import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
@@ -48,7 +48,7 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
 
        /** Constant <code>ID="eu.etaxonomy.taxeditor.navigation.navig"{trunked}</code> */
        public static final String ID = "eu.etaxonomy.taxeditor.navigation.navigator.dropassistant"; //$NON-NLS-1$
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.navigator.CommonDropAdapterAssistant#handleDrop(org.eclipse.ui.navigator.CommonDropAdapter, org.eclipse.swt.dnd.DropTargetEvent, java.lang.Object)
         */
@@ -56,25 +56,26 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
        @Override
        public IStatus handleDrop(CommonDropAdapter dropAdapter,
                        DropTargetEvent dropTargetEvent, Object target) {
-                       
-               if (target instanceof ITreeNode) {
+
+               if (target instanceof ITaxonTreeNode) {
                        Set<TaxonNode> taxonNodes = getSelectedTaxa();
-                       ITreeNode targetTreeNode = (ITreeNode) target;
-                       if(taxonNodes != null)
-                               return moveTaxon(taxonNodes, targetTreeNode);
+                       ITaxonTreeNode targetTreeNode = (ITaxonTreeNode) target;
+                       if(taxonNodes != null) {
+                return moveTaxon(taxonNodes, targetTreeNode);
+            }
                }
-                                                       
+
                return Status.CANCEL_STATUS;
        }
-       
+
        private Set<TaxonNode> getSelectedTaxa(){
-               HashSet<TaxonNode> taxonNodes = new HashSet<TaxonNode>();               
-               
+               HashSet<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
+
                ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
                if (selection instanceof TreeSelection) {
-               
+
                        Iterator selectionIterator = ((TreeSelection) selection).iterator();
-                               
+
                        while (selectionIterator.hasNext()){
                                Object object = selectionIterator.next();
                                if(object instanceof TaxonNode){
@@ -92,8 +93,8 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
        /** {@inheritDoc} */
        @Override
        public IStatus validateDrop(Object target, int operation,
-                       TransferData transferType) {    
-               if (target instanceof ITreeNode) {
+                       TransferData transferType) {
+               if (target instanceof ITaxonTreeNode) {
                        // do not allow to drop onto itself
                        for(TaxonNode taxonNode : getSelectedTaxa()){
                                if (taxonNode.equals(target)) {
@@ -101,53 +102,53 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                }
                        }
                        return Status.OK_STATUS;
-               }               
+               }
                return Status.CANCEL_STATUS;
        }
-       
+
 
        /**
         * @param childTaxonNode
         * @param parentTaxon
         * @return
         */
-       private IStatus moveTaxon(Set<TaxonNode> taxonNodes, ITreeNode targetITreeNode) {
-               
+       private IStatus moveTaxon(Set<TaxonNode> taxonNodes, ITaxonTreeNode targetITaxonTreeNode) {
+
                TaxonNavigator taxonNavigator;
                taxonNavigator = (TaxonNavigator) NavigationUtil.showView(TaxonNavigator.ID);
-               
-               if(targetITreeNode instanceof TaxonNode){
-               
-                       TaxonNode targetTaxonNode = (TaxonNode) targetITreeNode;
-                       
+
+               if(targetITaxonTreeNode instanceof TaxonNode){
+
+                       TaxonNode targetTaxonNode = (TaxonNode) targetITaxonTreeNode;
+
 //                     for(TaxonNode taxonNode : taxonNodes){
 //                             if (taxonNode.equals(targetTaxonNode)) {
 //                                     return Status.CANCEL_STATUS;
 //                             }
 //                     }
-                       
+
                        // Make sure parent taxon does not have unsaved changes
                        if (NavigationUtil.isDirty(targetTaxonNode)){
                                MessageDialog.openWarning(NavigationUtil.getShell(), "Unsaved Parent Taxon", "There are unsaved " +
                                "changes in the parent taxon. Pleas save first.");
                                return Status.CANCEL_STATUS;
                        }
-                       
-                       
+
+
                        // Make sure parentTaxon is not the drop target
 //                     if (!childTaxonNode.isTopmostNode() && childTaxonNode.getParent().equals(targetTaxonNode)){
 //                             return Status.CANCEL_STATUS;
 //                     }
-                       
+
                        // Make sure taxon is not being dropped onto itself
 //                     if (childTaxonNode.equals(targetTaxonNode)) {
 //                             return Status.CANCEL_STATUS;
 //                     }
-                       
-                       
 
-               }       
-               
+
+
+               }
+
                IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
                if (workspaceUndoContext == null) {
                        logger.error("Workspace undo context is null. DND operation cancelled");
@@ -155,10 +156,10 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                }
 
                AbstractPostOperation operation = new MoveTaxonOperation
-                               ("Move Taxon", workspaceUndoContext, taxonNodes, targetITreeNode, this, taxonNavigator);
-               NavigationUtil.executeOperation(operation);     
-               
-               logger.info("Moved taxa to new parent " + targetITreeNode);
+                               ("Move Taxon", workspaceUndoContext, taxonNodes, targetITaxonTreeNode, this, taxonNavigator);
+               NavigationUtil.executeOperation(operation);
+
+               logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                return Status.OK_STATUS;
        }
 
@@ -166,7 +167,8 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
         * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
         */
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
                return true;
        }
 
@@ -175,7 +177,8 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                // TODO Auto-generated method stub
                return false;
        }
index aaf3e6de801c5d5a80c213a35638177da51725b0..7e0b59b635f615afae34a332deb3f4b465b5f330 100644 (file)
@@ -9,8 +9,6 @@
 */\r
 package eu.etaxonomy.taxeditor.navigation.navigator.handler;\r
 \r
-import java.util.Iterator;\r
-\r
 import org.eclipse.core.commands.AbstractHandler;\r
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.core.commands.ExecutionException;\r
@@ -20,11 +18,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
-import eu.etaxonomy.cdm.model.common.TermBase;\r
-import eu.etaxonomy.cdm.model.taxon.Taxon;\r
-import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
-import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;\r
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;\r
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.CopyOperation;\r
index 86ed939b6b85cb6cd286eaed0706a8e671025d51..a1a4425b55e1db569150557e442d51257c639d67 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,7 +29,7 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
@@ -50,57 +50,59 @@ public class DeleteHandler extends AbstractHandler implements IHandler{
        private TaxonNavigator taxonNavigator;
 
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
                activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
-               
+
                taxonNavigator = NavigationUtil.showNavigator();
-                               
+
                TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
-               
+
                String plural = selection.size() > 1 ? "s" : "";
                // Prompt user for confirmation
                if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to delete the selected node" + plural +"?")){
                        return null;
                }
-               
+
                Iterator selectionIterator = selection.iterator();
-               Set<ITreeNode> treeNodes = new HashSet<ITreeNode>();
-               
+               Set<ITaxonTreeNode> treeNodes = new HashSet<ITaxonTreeNode>();
+
                while (selectionIterator.hasNext()){
                        Object object = selectionIterator.next();
-                       if(object instanceof ITreeNode)
-                               treeNodes.add((ITreeNode) object);
+                       if(object instanceof ITaxonTreeNode) {
+                treeNodes.add((ITaxonTreeNode) object);
+            }
                }
-                       
+
                AbstractPostOperation operation = null;
                try {
                        operation = new DeleteOperation(
-                                       event.getCommand().getName(), NavigationUtil.getUndoContext(), 
+                                       event.getCommand().getName(), NavigationUtil.getUndoContext(),
                                        treeNodes, taxonNavigator, taxonNavigator);
-                       
+
                        IStatus status = NavigationUtil.executeOperation(operation);
-                       
-                       
+
+
                        // FIXME is there a better place for this code?
                        if (status == Status.OK_STATUS){
-                               for (ITreeNode treeNode : treeNodes){
+                               for (ITaxonTreeNode treeNode : treeNodes){
                                        if(treeNode instanceof TaxonNode) {
                                                closeObsoleteEditor((TaxonNode) treeNode);
                                        }
                                }
                        }
-               
+
                } catch (NotDefinedException e) {
                        NavigationUtil.warn(getClass(), "Command name not set");
                }
                return null;
        }
-       
+
        private void closeObsoleteEditor(TaxonNode taxonNode){
                for (IEditorReference ref : activePage.getEditorReferences()) {
                        try {
-                               IEditorInput input = ref.getEditorInput(); 
+                               IEditorInput input = ref.getEditorInput();
                                if (input instanceof TaxonEditorInput) {
                                        TaxonNode node = ((TaxonEditorInput) input).getTaxonNode();
                                        if (taxonNode.equals(node)) {
index a514c8ce339608310f34f22bc31b311248a52be3..25c8632a12dfa92dbc5e765b22677961b4ef9cf0 100644 (file)
@@ -11,11 +11,6 @@ package eu.etaxonomy.taxeditor.navigation.navigator.operation;
 \r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
-\r
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
-\r
 import org.eclipse.core.runtime.IAdaptable;\r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
@@ -23,6 +18,10 @@ import org.eclipse.swt.dnd.Clipboard;
 import org.eclipse.swt.dnd.TextTransfer;\r
 import org.eclipse.swt.dnd.Transfer;\r
 \r
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+\r
 \r
 /**\r
  * @author l.morris\r
index 381dbf6b1fa04a46bc33a0f47e83104c7210bfdf..eab39d5f0d4ed09b2e123eb755a6bc313c7d8f69 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,7 +21,7 @@ import org.eclipse.core.runtime.IStatus;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -36,10 +36,10 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class DeleteOperation extends AbstractPersistentPostOperation{
-       
-       private Set<ITreeNode> treeNodes;
 
-       
+       private Set<ITaxonTreeNode> treeNodes;
+
+
        /**
         * <p>Constructor for DeleteTreeNodeOperation.</p>
         *
@@ -50,14 +50,14 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
         * @param treeNodes a {@link java.util.Set} object.
         */
        public DeleteOperation(String label, IUndoContext undoContext,
-                       Set<ITreeNode> treeNodes,
+                       Set<ITaxonTreeNode> treeNodes,
                        IPostOperationEnabled postOperationEnabled,
                        IConversationEnabled conversationEnabled) {
                super(label, undoContext, postOperationEnabled, conversationEnabled);
                this.treeNodes = treeNodes;
        }
 
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
@@ -68,7 +68,7 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
 
                bind();
                monitor.worked(20);
-        for (ITreeNode treeNode : treeNodes){
+        for (ITaxonTreeNode treeNode : treeNodes){
                        if(treeNode instanceof TaxonNode){
                                ((TaxonNode) treeNode).delete();
                        }else if(treeNode instanceof Classification){
index 6bf1a5deb460e829737a2e5d53fed52ad04ee70e..87df0560eeb31d7313dc83b478ea83196c7c670e 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -21,7 +21,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.IllegalAncestryException;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
@@ -36,16 +36,16 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class MoveTaxonOperation extends AbstractPersistentPostOperation {
-       
+
        /**
         * A reference to the new taxonomical parent.
         */
-       private ITreeNode newParentTreeNode;
+       private ITaxonTreeNode newParentTreeNode;
        /**
         * A reference to the former taxonomical parents
         */
-       private Map<TaxonNode, ITreeNode> oldParentTreeNodes;
-       
+       private Map<TaxonNode, ITaxonTreeNode> oldParentTreeNodes;
+
        private Set<TaxonNode> taxonNodes;
 
        /**
@@ -54,25 +54,25 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
         * @param label a {@link java.lang.String} object.
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param taxonNodes a {@link java.util.Set} object.
-        * @param newParentTreeNode a {@link eu.etaxonomy.cdm.model.taxon.ITreeNode} object.
+        * @param newParentTreeNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public MoveTaxonOperation(String label, IUndoContext undoContext,
-                       Set<TaxonNode> taxonNodes, ITreeNode newParentTreeNode, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
+                       Set<TaxonNode> taxonNodes, ITaxonTreeNode newParentTreeNode, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled) {
                super(label, undoContext, postOperationEnabled, conversationEnabled);
 
                this.taxonNodes = taxonNodes;
-               
+
                this.newParentTreeNode = newParentTreeNode;
-               
-               // Save old parent ITreeNodes for undo
-               oldParentTreeNodes = new HashMap<TaxonNode, ITreeNode>();
+
+               // Save old parent ITaxonTreeNodes for undo
+               oldParentTreeNodes = new HashMap<TaxonNode, ITaxonTreeNode>();
                for(TaxonNode taxonNode : taxonNodes){
                        this.oldParentTreeNodes.put(taxonNode, taxonNode.getParent());
                }
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
@@ -82,12 +82,11 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
                        throws ExecutionException {
                bind();
                monitor.worked(20);
-               
+
                try {
                        for (TaxonNode taxonNode : taxonNodes){
-                               TaxonNode newTaxonNode = newParentTreeNode.addChildNode(taxonNode, 
-                                               newParentTreeNode.getReference(), newParentTreeNode.getMicroReference(), 
-                                               taxonNode.getSynonymToBeUsed());
+                               TaxonNode newTaxonNode = newParentTreeNode.addChildNode(taxonNode,
+                                               newParentTreeNode.getReference(), newParentTreeNode.getMicroReference());
                                taxonNodes.add(newTaxonNode);
                                monitor.worked(2);
                        }
@@ -95,7 +94,7 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
                        StoreUtil.warningDialog("Illegal ancestry", this, e.getMessage());
                }
                monitor.worked(40);
-               
+
                return postExecute(null);
        }
 
@@ -117,9 +116,9 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
                StoreUtil.warn(this.getClass(), "Not implemented yet.");
-               
-               // iterate over oldParentTreeNodes, delete each TaxonNode from its actual parent and add to its former parent           
-               
+
+               // iterate over oldParentTreeNodes, delete each TaxonNode from its actual parent and add to its former parent
+
                return Status.OK_STATUS;
        }
 }
index 3ae83c87f0de4d181344c62d10041351c660d707..98915188d46aafba3974f227add2b43d0c12f2c1 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -20,7 +20,7 @@ import org.eclipse.core.runtime.Status;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
@@ -38,11 +38,11 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */
 @Deprecated // we do not undo creation of elements
 public class CreateTaxonNode extends AbstractPersistentPostOperation {
-       
+
        private Taxon newTaxon;
-       
+
        private TaxonNode childTaxonNode;
-       
+
        /**
         * Add a name to a taxonomic tree
         *
@@ -50,17 +50,17 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITreeNode} object.
+        * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public CreateTaxonNode(String label, IUndoContext undoContext,
-                       ITreeNode parentNode, TaxonNameBase<?, ?> name, IPostOperationEnabled postOperationEnabled,
+               ITaxonTreeNode parentNode, TaxonNameBase<?, ?> name, IPostOperationEnabled postOperationEnabled,
                        IConversationEnabled conversationEnabled) {
                super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled);
-               
+
                newTaxon = Taxon.NewInstance(name, null);
        }
-       
+
        /**
         * Add a taxon to a taxonomic tree
         *
@@ -68,14 +68,14 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
         * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
         * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
-        * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITreeNode} object.
+        * @param parentNode a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public CreateTaxonNode(String label, IUndoContext undoContext,
-                       ITreeNode parentNode, Taxon taxon, IPostOperationEnabled postOperationEnabled,
+               ITaxonTreeNode parentNode, Taxon taxon, IPostOperationEnabled postOperationEnabled,
                        IConversationEnabled conversationEnabled) {
                super(label, undoContext, parentNode, postOperationEnabled, conversationEnabled);
-               
+
                this.newTaxon = taxon;
        }
 
@@ -92,17 +92,17 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
                        // add the taxon
                        bind();
                        monitor.worked(20);
-                       childTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference(), null);
-               
+                       childTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference());
+
                        monitor.worked(40);
 
                        CdmStore.getService(ITaxonNodeService.class).saveOrUpdate(childTaxonNode);
-                       
+
                        return postExecute(childTaxonNode);
                }catch(Exception e){
                        NavigationUtil.errorDialog("Could not create taxon node", getClass(), e.getLocalizedMessage(), e);
                        return Status.CANCEL_STATUS;
-               }               
+               }
        }
 
        /* (non-Javadoc)
@@ -122,7 +122,7 @@ public class CreateTaxonNode extends AbstractPersistentPostOperation {
        @Override
        public IStatus undo(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-               
+
                StoreUtil.warn(this.getClass(), "Not yet implemented.");
                return null;
        }
index b65b0454705689df814e6990ca59d1dfea6252a7..0f385a5af4379ea0d8e7284f951117b331af9ada 100644 (file)
                </visibleWhen>
             </command>
          </menu>
-         <menu
-               id="eu.etaxonomy.taxeditor.store.definedTermEditorMenu"
-               label="Term Editor">
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="Named Area"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.location.NamedArea">
-               </parameter>
-            </command>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="Named Area Level"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.location.NamedAreaLevel">
-               </parameter>
-            </command>
-            <separator
-                  name="eu.etaxonomy.taxeditor.store.definedTermEditorMenu.separator2"
-                  visible="true">
-            </separator>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="Extension Type"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.common.ExtensionType">
-               </parameter>
-            </command>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="Marker Type"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.common.MarkerType">
-               </parameter>
-            </command>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="State"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.description.State">
-               </parameter>
-            </command>
-            <separator
-                  name="eu.etaxonomy.taxeditor.store.definedTermEditorMenu.separator3"
-                  visible="true">
-            </separator>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="Feature"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.description.Feature">
-               </parameter>
-            </command>
-            <command
-                  commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
-                  label="Modifier"
-                  style="push">
-               <parameter
-                     name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
-                     value="eu.etaxonomy.cdm.model.description.Modifier">
-               </parameter>
-            </command>
-         </menu>
+      </menuContribution>
+      <menuContribution
+            class="eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermMenuFactory"
+            locationURI="menu:org.eclipse.ui.main.menu.window?before=eu.etaxonomy.taxeditor.application.windowMenu.last">
       </menuContribution>
       <menuContribution
             locationURI="menu:org.eclipse.ui.main.menu.file?after=eu.etaxonomy.taxeditor.application.filemenu.io">
                name="inputType"
                optional="true">
          </commandParameter>
+         <commandParameter
+               id="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid"
+               name="inputType"
+               optional="true">
+         </commandParameter>
       </command>
    </extension>
    <extension
index 31a3165bad00362490bcc77ec870ce7d0a65563f..059990f6bebca7972e9720a438545c7e14e8e9a6 100644 (file)
@@ -41,9 +41,11 @@ import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
 import eu.etaxonomy.cdm.model.common.CdmBase;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
+import eu.etaxonomy.cdm.model.common.TermType;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput;\r
+import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
@@ -64,7 +66,8 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        protected ConversationHolder conversation;\r
        private ISelectionService selectionService;\r
        private boolean dirty;\r
-       Set<TermVocabulary<? extends DefinedTermBase>> inMemoryVocabularies = new HashSet<TermVocabulary<? extends DefinedTermBase>>();\r
+\r
+\r
 \r
        private int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;\r
        /**\r
@@ -95,10 +98,9 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
                        Transfer[] transfers = new Transfer[] { TermTransfer.getInstance() };\r
                        viewer.addDragSupport(dndOperations, transfers, new DefinedTermDragListener(viewer));\r
                        viewer.addDropSupport(dndOperations, transfers, new DefinedTermDropAdapter(this));\r
-\r
-                                       \r
-                       initialiseVocabularies();               \r
-                       viewer.setInput(inMemoryVocabularies);\r
+                                                                       \r
+                       getDefinedTermEditorInput().initialiseVocabularies();\r
+                       viewer.setInput(getDefinedTermEditorInput().getVocabularies());\r
                                                \r
                        getSite().setSelectionProvider(viewer);\r
                        \r
@@ -110,28 +112,13 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
                }\r
        \r
        \r
-       protected void initialiseVocabularies() {\r
-               inMemoryVocabularies.clear();\r
-               //List<TermVocabulary> vocabularies = CdmStore.getService(IVocabularyService.class).list(null, null, null, null, null);\r
 \r
-//             for (TermVocabulary vocabulary : vocabularies){\r
-//                     if(vocabulary.getTerms().isEmpty()){\r
-//                             inMemoryVocabularies.add(vocabulary);\r
-//                     }\r
-//             }\r
-\r
-               \r
-               List<TermVocabulary<? extends DefinedTermBase>> termVocabularies = CdmStore.getService(IVocabularyService.class).listByTermClass(getDefinedTermEditorInput().getTermClass(), true, true, null, null, null, null);\r
-               \r
-               \r
-               inMemoryVocabularies.addAll(termVocabularies);\r
-       }\r
        \r
        /**\r
         * \r
         */\r
-       public AbstractDefinedTermEditorInput getDefinedTermEditorInput() {\r
-               return (AbstractDefinedTermEditorInput) getEditorInput();\r
+       public TermEditorInput getDefinedTermEditorInput() {\r
+               return (TermEditorInput) getEditorInput();\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -139,24 +126,9 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
         */\r
        @Override\r
        public boolean postOperation(CdmBase objectAffectedByOperation) {\r
-\r
-               if(objectAffectedByOperation instanceof DefinedTermBase){\r
-                       viewer.refresh();\r
-               } else if (objectAffectedByOperation instanceof TermVocabulary){\r
-//                     if (inMemoryVocabularies.contains(objectAffectedByOperation)){\r
-//                             inMemoryVocabularies.remove((TermVocabulary) objectAffectedByOperation);\r
-//                     }else{\r
-//                             inMemoryVocabularies.add((TermVocabulary) objectAffectedByOperation);\r
-//                             DetailsViewPart view = (DetailsViewPart) StoreUtil.getView(DetailsViewPart.ID, true);\r
-//                             view.setFocus();\r
-//                     }\r
                        \r
-//                     viewer.setInput(inMemoryVocabularies);\r
-                       viewer.refresh();\r
-                       \r
-               }\r
-               \r
                \r
+               viewer.refresh();               \r
                \r
                if(objectAffectedByOperation != null){\r
                        viewer.setSelection(new StructuredSelection(objectAffectedByOperation));\r
@@ -185,7 +157,7 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
        public void doSave(IProgressMonitor monitor) {\r
                getConversationHolder().commit();\r
                setDirty(false);\r
-               initialiseVocabularies();\r
+               getDefinedTermEditorInput().initialiseVocabularies();\r
        }\r
        \r
 \r
@@ -259,12 +231,6 @@ public class DefinedTermEditor extends EditorPart implements IConversationEnable
                return viewer;\r
        }\r
 \r
-       /**\r
-        * @return \r
-        * \r
-        */\r
-       public Set<TermVocabulary<? extends DefinedTermBase>> getInMemoryVocabularies() {\r
-               return inMemoryVocabularies;\r
-       }\r
+\r
 \r
 }
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenuFactory.java
new file mode 100644 (file)
index 0000000..07365ca
--- /dev/null
@@ -0,0 +1,157 @@
+// $Id$
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.editor.definedterm;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+import org.eclipse.ui.menus.ExtensionContributionFactory;
+import org.eclipse.ui.menus.IContributionRoot;
+import org.eclipse.ui.services.IServiceLocator;
+
+import eu.etaxonomy.cdm.model.common.TermType;
+
+/**
+ * Menu factory used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
+ * for term types which when clicked open the defined term editor for the chosen term type
+ * 
+ * @author c.mathew
+ * @date 18 Jul 2013
+ *
+ */
+
+public class DefinedTermMenuFactory extends ExtensionContributionFactory {     
+       
+       @Override
+       public void createContributionItems(IServiceLocator serviceLocator,
+                       IContributionRoot additions) {
+               
+               MenuManager dtMenuManager = 
+                               new MenuManager("Term Editor","eu.etaxonomy.taxeditor.store.definedTermEditorMenu"); 
+               
+               dtMenuManager.setVisible(true);
+        
+               additions.addContributionItem(dtMenuManager, null);
+               List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
+               Collections.sort(ttList,new SortByTermTypeMessage());
+        for (TermType tt : ttList)
+        {
+               // if term type has a parent, do not add it
+               // it will be added in the recursive call
+               if(tt.getKindOf() == null) {
+                       IContributionItem ici = addChildTermsToMenuManager(tt, serviceLocator);                 
+                       if(ici != null) {                                                       
+                               dtMenuManager.add(ici);
+                       }
+               }
+        }                                     
+       }
+       
+       private IContributionItem addChildTermsToMenuManager(TermType termType, IServiceLocator serviceLocator) {
+       
+               Set<TermType> children = termType.getGeneralizationOf();
+               // term type has no children, so create menu item
+               if(children.isEmpty()) {                        
+                       return createMenuItem(termType, serviceLocator);
+               }
+               // term type has children, so create sub menu           
+               MenuManager dtMenuManager = 
+                               new MenuManager(termType.getMessage(),"eu.etaxonomy.taxeditor.store." + termType.getKey() + "Menu"); 
+               dtMenuManager.setVisible(true);
+               dtMenuManager.add(createDefaultMenuItem(termType, serviceLocator));
+               
+               Separator sep = new Separator();
+               dtMenuManager.add(sep);
+               // add child items to the sub menu
+               for(TermType tt : children) {                   
+                       IContributionItem item = addChildTermsToMenuManager(tt,serviceLocator);
+                       if(item != null) {                              
+                               dtMenuManager.add(item);
+                       }                                       
+               }               
+               return dtMenuManager;
+               
+       }
+       
+       private CommandContributionItem createMenuItem(TermType termType, IServiceLocator serviceLocator) {
+               
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
+                               termType.getUuid().toString());         
+               
+        CommandContributionItemParameter p = new CommandContributionItemParameter(
+                serviceLocator, 
+                "",
+                "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
+                params,
+                null,
+                null,
+                null,
+                termType.getMessage(),
+                "",
+                "",                
+                SWT.PUSH,
+                "",
+                true);
+   
+        CommandContributionItem item = new CommandContributionItem(p);   
+        return item;
+               
+       }
+       
+       private CommandContributionItem createDefaultMenuItem(TermType termType, IServiceLocator serviceLocator) {
+               
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
+                               termType.getUuid().toString());         
+               
+        CommandContributionItemParameter p = new CommandContributionItemParameter(
+                serviceLocator, 
+                "",
+                "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
+                params,
+                null,
+                null,
+                null,
+                "Other " + termType.getMessage() + "s",
+                "",
+                "",                
+                SWT.PUSH,
+                "",
+                true);
+        
+        
+   
+        CommandContributionItem item = new CommandContributionItem(p);   
+        return item;
+               
+       }
+       
+       private class SortByTermTypeMessage implements Comparator<TermType> {
+           public int compare(TermType t1, TermType t2) {
+               return t1.getMessage().compareTo(t2.getMessage());
+           }
+       }
+       
+
+}
index 3b6241ace7c44b78aa0f0001e401e442dd18f35c..e7ca0c28d174320d12426ac6b0604bb7371f557a 100644 (file)
@@ -17,7 +17,9 @@ import java.util.SortedSet;
 import org.eclipse.jface.viewers.ITreeContentProvider;\r
 import org.eclipse.jface.viewers.Viewer;\r
 \r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
+import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
@@ -54,7 +56,7 @@ public class TermContentProvider implements ITreeContentProvider {
        \r
                Collection<TermVocabulary> inputElements = (Collection<TermVocabulary>) inputElement;\r
                return inputElements.toArray();\r
-               //return null;\r
+\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -63,8 +65,8 @@ public class TermContentProvider implements ITreeContentProvider {
        @Override\r
        public Object[] getChildren(Object parentElement) {\r
                \r
-               if(parentElement instanceof TermVocabulary){\r
-                       return getTopLevelElements((TermVocabulary) parentElement);\r
+               if(parentElement instanceof TermVocabulary){                    \r
+                       return getTopLevelElements((TermVocabulary)parentElement);\r
                } else if (parentElement instanceof DefinedTermBase) {\r
                        return ((DefinedTermBase) parentElement).getIncludes().toArray();\r
                }\r
@@ -86,10 +88,8 @@ public class TermContentProvider implements ITreeContentProvider {
                for (DefinedTermBase term : terms){\r
                         if (term.getPartOf() == null){\r
                                 topLevelTerms.add(term);\r
-                        }\r
-                               \r
-               }\r
-        \r
+                        }                              \r
+               }        \r
                return topLevelTerms.toArray();\r
        }\r
 \r
@@ -98,27 +98,25 @@ public class TermContentProvider implements ITreeContentProvider {
         */\r
        @Override\r
        public Object getParent(Object element) {\r
-               \r
+\r
                if(element instanceof DefinedTermBase){\r
-                       \r
-                       DefinedTermBase definedTerm = (DefinedTermBase)element;\r
-                       if (definedTerm.getPartOf() == null) {\r
-                               return definedTerm.getVocabulary();\r
+                       DefinedTermBase definedTermBase = (DefinedTermBase)element;\r
+                       if (definedTermBase.getPartOf() == null) {\r
+                               return definedTermBase.getVocabulary();\r
                        } else {\r
-                               return definedTerm.getPartOf();\r
-                       }\r
-               }       \r
+                               return definedTermBase.getPartOf();\r
+                       }                       \r
+               }\r
                return null;\r
+\r
        }\r
 \r
        /* (non-Javadoc)\r
         * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)\r
         */\r
        @Override\r
-       public boolean hasChildren(Object element) {\r
-               \r
-               if (getChildren(element) != null){\r
-                       \r
+       public boolean hasChildren(Object element) {            \r
+               if (getChildren(element) != null){                      \r
                        return getChildren(element).length > 0;\r
                }\r
                return false;\r
index ea647af18f22761b7eb5338c3cb1219b9a4fd9ca..7e3e8f9eb53b7493b5683dda0c8ec5de9fbf1919 100644 (file)
 package eu.etaxonomy.taxeditor.editor.definedterm;\r
 \r
 import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;\r
+import org.eclipse.jface.viewers.StyledString.Styler;\r
 import org.eclipse.jface.viewers.LabelProvider;\r
+import org.eclipse.jface.viewers.StyledCellLabelProvider;\r
 import org.eclipse.jface.viewers.StyledString;\r
+import org.eclipse.jface.viewers.ViewerCell;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.custom.StyleRange;\r
+import org.eclipse.swt.graphics.Color;\r
+import org.eclipse.swt.graphics.TextStyle;\r
+import org.eclipse.swt.widgets.Display;\r
 \r
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;\r
 \r
 /**\r
  * @author l.morris\r
  * @date 9 Dec 2011\r
  *\r
  */\r
-public class TermLabelProvider extends LabelProvider implements\r
-               IStyledLabelProvider {\r
+public class TermLabelProvider extends StyledCellLabelProvider {\r
 \r
+       private static Color vocColor = Display.getCurrent().getSystemColor(\r
+                       SWT.COLOR_BLUE);\r
+       private Styler vocStyler;\r
        /* (non-Javadoc)\r
         * @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider#getStyledText(java.lang.Object)\r
         */\r
+       \r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see\r
+        * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.\r
+        * jface.viewers.ViewerCell)\r
+        */\r
        @Override\r
+       public void update(ViewerCell cell) {\r
+               Object element = cell.getElement();\r
+               int columnIndex = cell.getColumnIndex();\r
+\r
+               String text = getText(element);                                 \r
+               cell.setText(text);\r
+               \r
+               if (element instanceof TermVocabulary) {                \r
+                       StyledString styledString = new StyledString(text, getVocabularyStyler());\r
+                       StyleRange[] styleRanges;\r
+                       styleRanges = styledString.getStyleRanges();\r
+                       cell.setStyleRanges(styleRanges);\r
+               } \r
+               super.update(cell);\r
+       }\r
+       \r
        public StyledString getStyledText(Object element) {\r
                \r
+               if(element instanceof TermVocabulary){\r
+                       new StyledString(getText(element), getVocabularyStyler());\r
+               }\r
                return  new StyledString(getText(element), StyledString.QUALIFIER_STYLER);\r
        }\r
        \r
        /* (non-Javadoc)\r
         * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)\r
         */\r
-       @Override\r
+       \r
        public String getText(Object element) {\r
                \r
                if (element instanceof TermBase){\r
-                       return ((TermBase)element).getLabel();\r
+                       return ((TermBase)element).getTitleCache();\r
                } \r
-               return super.getText(element);\r
+               //FIXME : must throw an exception here\r
+               return element.toString();\r
+       }\r
+       \r
+       private Styler getVocabularyStyler() {\r
+               if (vocStyler == null) {\r
+                       vocStyler = new Styler() {\r
+                               @Override\r
+                               public void applyStyles(TextStyle textStyle) {\r
+                                       textStyle.foreground = vocColor;\r
+                               }\r
+                       };\r
+               }\r
+               return vocStyler;\r
        }\r
 \r
 }\r
index 24a8462c58f184f64af74fe1935fd208b6025636..d60d40a78386439a93c6566578fa6ac12734cb57 100644 (file)
@@ -14,10 +14,13 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.IHandler;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
+import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateDefinedTermOperation;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
@@ -43,22 +46,32 @@ public class CreateDefinedTermHandler extends AbstractHandler implements IHandle
                IPostOperationEnabled editor = (IPostOperationEnabled) HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
-               IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
-                               .getCurrentSelection(event);\r
+               if (editor instanceof DefinedTermEditor){\r
+                       DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
+                       IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
+                                       .getCurrentSelection(event);\r
+                       if (selection.getFirstElement() instanceof TermBase) {\r
+                               try {\r
+                                       String label = event.getCommand().getName();\r
+                                       IUndoContext undoContext = StoreUtil.getUndoContext();\r
 \r
-               TermBase selectedElement = (TermBase) selection.getFirstElement();\r
+                                       TermBase termBase = (TermBase) selection.getFirstElement();\r
 \r
-               try {\r
-                       AbstractPostOperation operation = new CreateDefinedTermOperation(\r
-                                       event.getCommand().getName(), StoreUtil.getUndoContext(),\r
-                                       selectedElement, editor);\r
-                       StoreUtil.executeOperation(operation);\r
+                                       AbstractPostOperation operation = \r
+                                                       new CreateDefinedTermOperation(label, \r
+                                                                       undoContext, \r
+                                                                       termBase, \r
+                                                                       dfe.getDefinedTermEditorInput(),\r
+                                                                       editor);\r
+                                       StoreUtil.executeOperation(operation);\r
 \r
-               } catch (NotDefinedException e) {\r
-                       StoreUtil.error(getClass(), e);\r
+                               } catch (NotDefinedException e) {\r
+                                       StoreUtil.error(getClass(), e);\r
+                               }\r
+                       }\r
                }\r
 \r
                return null;\r
        }\r
 \r
-}\r
+       }\r
index 3ad89be9e31811192ceecedff4f25eae226b8668..fb7e01f3939295bd74c84a7c6822c183b48bb6d8 100644 (file)
@@ -14,12 +14,13 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.IHandler;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
-import eu.etaxonomy.cdm.model.common.TermBase;\r
+import eu.etaxonomy.cdm.model.common.TermType;\r
+import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
-import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateDefinedTermOperation;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateTermVocabularyOperation;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
@@ -41,20 +42,24 @@ public class CreateTermVocabularyHandler extends AbstractHandler implements
                IPostOperationEnabled editor = (IPostOperationEnabled) HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
-               if (! (editor instanceof DefinedTermEditor)){\r
-                       return null;\r
-               }\r
-               \r
-               try {\r
-                       AbstractPostOperation operation = new CreateTermVocabularyOperation(\r
-                                       event.getCommand().getName(), StoreUtil.getUndoContext(), (DefinedTermEditor) editor);\r
-                       StoreUtil.executeOperation(operation);\r
-\r
-               } catch (NotDefinedException e) {\r
-                       StoreUtil.error(getClass(), e);\r
-               }\r
+               if (editor instanceof DefinedTermEditor){\r
+                       DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
+\r
+                       try {\r
+                               String label = event.getCommand().getName();\r
+                               IUndoContext undoContext = StoreUtil.getUndoContext();\r
 \r
+                               AbstractPostOperation operation = \r
+                                               new CreateTermVocabularyOperation(label, \r
+                                                               undoContext, \r
+                                                               dfe.getDefinedTermEditorInput(), \r
+                                                               (DefinedTermEditor) editor);\r
+                               StoreUtil.executeOperation(operation);\r
+\r
+                       } catch (NotDefinedException e) {\r
+                               StoreUtil.error(getClass(), e);\r
+                       }                       \r
+               }\r
                return null;\r
        }\r
-\r
 }\r
index ec008ea411a61d69c2052f76032e185574ecfa3b..40bc987fa695fad7c7623a35f7b99f9864718761 100644 (file)
@@ -15,9 +15,11 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.common.NotDefinedException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.jface.viewers.IStructuredSelection;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
@@ -41,26 +43,35 @@ public class DeleteTermBaseHandler extends AbstractHandler {
                DefinedTermEditor editor = (DefinedTermEditor) HandlerUtil\r
                                .getActiveEditor(event);\r
 \r
-               IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
-                               .getCurrentSelection(event);\r
+               if (editor instanceof DefinedTermEditor){\r
+                       DefinedTermEditor dfe = (DefinedTermEditor) editor;\r
+                       try {\r
+                               String label = event.getCommand().getName();\r
+                               IUndoContext undoContext = StoreUtil.getUndoContext();\r
 \r
-               Iterator<TermBase> selectionIterator = selection.iterator();\r
+                               IStructuredSelection selection = (IStructuredSelection) HandlerUtil\r
+                                               .getCurrentSelection(event);\r
 \r
-               while (selectionIterator.hasNext()){\r
-                       \r
-                       TermBase term = selectionIterator.next();\r
-                       \r
-                       try {\r
-                               AbstractPostOperation operation = new DeleteTermBaseOperation(\r
-                                               event.getCommand().getName(), StoreUtil.getUndoContext(),\r
-                                               term, editor);\r
-                               StoreUtil.executeOperation(operation);\r
-       \r
+                               Iterator<TermBase> selectionIterator = selection.iterator();\r
+\r
+                               while (selectionIterator.hasNext()){\r
+\r
+                                       TermBase term = selectionIterator.next();\r
+\r
+\r
+                                       AbstractPostOperation operation = \r
+                                                       new DeleteTermBaseOperation(label, \r
+                                                                       undoContext,\r
+                                                                       term,\r
+                                                                       dfe.getDefinedTermEditorInput(), \r
+                                                                       editor);\r
+                                       StoreUtil.executeOperation(operation);\r
+\r
+                               }       \r
                        } catch (NotDefinedException e) {\r
                                StoreUtil.error(getClass(), e);\r
                        }\r
                }\r
-\r
                return null;\r
        }\r
 \r
index 393a3e648303327957a7d9cd814afdee8005cbed..1e71fd6bbb2d400ee3c8aa3091139b81d0c7aaf2 100644 (file)
@@ -1,19 +1,16 @@
 package eu.etaxonomy.taxeditor.editor.definedterm.handler;\r
+import java.util.UUID;\r
+\r
 import org.eclipse.core.commands.AbstractHandler;\r
 import org.eclipse.core.commands.ExecutionEvent;\r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.IHandler;\r
-import org.eclipse.core.commands.IParameter;\r
-import org.eclipse.core.commands.common.NotDefinedException;\r
 import org.eclipse.ui.IWorkbenchPage;\r
 import org.eclipse.ui.PartInitException;\r
-import org.eclipse.ui.handlers.HandlerUtil;\r
-import org.eclipse.ui.handlers.ShowViewHandler;\r
 \r
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
-import eu.etaxonomy.cdm.model.location.NamedArea;\r
+import eu.etaxonomy.cdm.model.common.TermType;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
-import eu.etaxonomy.taxeditor.editor.definedterm.input.DefinedTermEditorInputFactory;\r
+import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
 // $Id$\r
@@ -31,28 +28,22 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @date 8 Dec 2011\r
  *\r
  */\r
-public class OpenDefinedTermEditorHandler extends AbstractHandler implements\r
-               IHandler {\r
+public class OpenDefinedTermEditorHandler extends AbstractHandler implements IHandler {\r
 \r
        /* (non-Javadoc)\r
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)\r
         */\r
        @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
-               \r
+\r
+               String termTypeUuid = event.getParameter("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid");\r
+               IWorkbenchPage activePage = StoreUtil.getActivePage();\r
                try {\r
-                       String parameter = event.getParameter("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter");\r
-                       Class<? extends DefinedTermBase> clazz = (Class<? extends DefinedTermBase>) Class.forName(parameter);\r
-               \r
-                       IWorkbenchPage activePage = StoreUtil.getActivePage();\r
-                       try {\r
-                               activePage.openEditor(DefinedTermEditorInputFactory.NewInstance(clazz), DefinedTermEditor.ID);\r
-                       } catch (PartInitException e) {\r
-                               StoreUtil.error(getClass(), e);\r
-                       }\r
-               } catch (ClassNotFoundException e) {\r
+                       activePage.openEditor(new TermEditorInput(TermType.getByUuid(UUID.fromString(termTypeUuid))), DefinedTermEditor.ID);\r
+               } catch (PartInitException e) {\r
                        StoreUtil.error(getClass(), e);\r
                }\r
+\r
                return null;\r
        }\r
 \r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermMenu.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermMenu.java
deleted file mode 100644 (file)
index 5d6e797..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.handler;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.eclipse.jface.action.IContributionItem;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.ui.PlatformUI;\r
-import org.eclipse.ui.actions.CompoundContributionItem;\r
-import org.eclipse.ui.menus.CommandContributionItem;\r
-import org.eclipse.ui.menus.CommandContributionItemParameter;\r
-\r
-/**\r
- * @author l.morris\r
- * @date 4 Jan 2012\r
- *\r
- */\r
-public class OpenDefinedTermMenu extends CompoundContributionItem {\r
-\r
-       /**\r
-        * \r
-        */\r
-       public OpenDefinedTermMenu() {\r
-               // TODO Auto-generated constructor stub\r
-       }\r
-\r
-       /**\r
-        * @param id\r
-        */\r
-       public OpenDefinedTermMenu(String id) {\r
-               super(id);\r
-               // TODO Auto-generated constructor stub\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()\r
-        */\r
-       @Override\r
-       protected IContributionItem[] getContributionItems() {\r
-               // TODO Auto-generated method stub\r
-               return null;\r
-       }\r
-       \r
-       /**\r
-        * @param key\r
-        * @param object\r
-        * @return\r
-        */\r
-       private IContributionItem createContributionItem(String label,\r
-                       String inputType) {\r
-               CommandContributionItemParameter parameter = new CommandContributionItemParameter(\r
-                               PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null,\r
-                               "eu.etaxonomy.taxeditor.store.definedterm.menu.open", SWT.NONE);\r
-\r
-               parameter.label = label;\r
-\r
-               Map parameters = new HashMap();\r
-               parameters.put("eu.etaxonomy.taxeditor.store.definedterm.menu.open", inputType);\r
-               parameter.parameters = parameters;\r
-\r
-               return new CommandContributionItem(parameter);\r
-       }\r
-\r
-}\r
index 49cc3d43439a5f9b2ca839211631dcac8e7e4d23..c18d397be4a1c70b74517e0f507cec3ad804c39c 100644 (file)
@@ -59,13 +59,7 @@ public abstract class AbstractDefinedTermEditorInput<T extends DefinedTermBase>
        /**\r
         * @return\r
         */\r
-       public abstract List<String> getTermClasses();\r
-       \r
-       public abstract T createTermInstance();\r
-       \r
-       public Class<? extends DefinedTermBase> getTermClass() {\r
-               \r
-               return createTermInstance().getClass();\r
-       }\r
+       public abstract List<String> getTermClasses();          \r
 \r
+       \r
 }
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/DefinedTermEditorInputFactory.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/DefinedTermEditorInputFactory.java
deleted file mode 100644 (file)
index cdb5b68..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.input;\r
-\r
-import org.eclipse.ui.IEditorInput;\r
-\r
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
-import eu.etaxonomy.cdm.model.common.ExtensionType;\r
-import eu.etaxonomy.cdm.model.common.MarkerType;\r
-import eu.etaxonomy.cdm.model.description.Feature;\r
-import eu.etaxonomy.cdm.model.description.Modifier;\r
-import eu.etaxonomy.cdm.model.description.State;\r
-import eu.etaxonomy.cdm.model.location.NamedArea;\r
-import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
-\r
-/**\r
- * @author l.morris\r
- * @date 3 Jan 2012\r
- *\r
- */\r
-public class DefinedTermEditorInputFactory {\r
-\r
-//     public static final String NamedArea = "eu.etaxonomy.taxeditor.editor.namedArea";\r
-\r
-       /**\r
-        * @param clazz\r
-        * @return\r
-        */\r
-       public static IEditorInput NewInstance(Class<? extends DefinedTermBase> clazz) {\r
-               if(clazz == NamedArea.class){\r
-                       return new NamedAreaEditorInput();\r
-               } \r
-               if (clazz == NamedAreaLevel.class){\r
-                       return new NamedAreaLevelEditorInput();\r
-               }\r
-               if (clazz == ExtensionType.class){\r
-                       return new ExtensionTypeEditorInput();\r
-               }\r
-               if (clazz == MarkerType.class){\r
-                       return new MarkerTypeEditorInput();\r
-               }\r
-               if (clazz == Feature.class){\r
-                       return new FeatureEditorInput();\r
-               }\r
-               if (clazz == State.class){\r
-                       return new StateEditorInput();\r
-               }\r
-               if (clazz == Modifier.class){\r
-                       return new ModifierEditorInput();\r
-               }\r
-               \r
-               return null;\r
-       }\r
-\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ExtensionTypeEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ExtensionTypeEditorInput.java
deleted file mode 100644 (file)
index 49d597a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.input;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.model.common.ExtensionType;\r
-\r
-/**\r
- * @author l.morris\r
- * @date 6 Jan 2012\r
- *\r
- */\r
-public class ExtensionTypeEditorInput extends AbstractDefinedTermEditorInput<ExtensionType> {\r
-       \r
-       private List<String> termClasses = Arrays.asList(new String[]{\r
-                       ExtensionType.class.getName()\r
-       });\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.IEditorInput#getName()\r
-        */\r
-       @Override\r
-       public String getName() {\r
-               return "Extension Type";\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#getTermClasses()\r
-        */\r
-       @Override\r
-       public List<String> getTermClasses() {\r
-               return termClasses;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#createTermInstance()\r
-        */\r
-       @Override\r
-       public ExtensionType createTermInstance() {\r
-               return ExtensionType.NewInstance();\r
-       }\r
-\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/FeatureEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/FeatureEditorInput.java
deleted file mode 100644 (file)
index da4c4d8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.input;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.model.description.Feature;\r
-/**\r
- * @author l.morris\r
- * @date 11 Jan 2012\r
- *\r
- */\r
-public class FeatureEditorInput extends AbstractDefinedTermEditorInput<Feature> {\r
-\r
-       private List<String> termClasses = Arrays.asList(new String[]{\r
-                       Feature.class.getName()\r
-       });\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.IEditorInput#getName()\r
-        */\r
-       @Override\r
-       public String getName() {\r
-               return "Feature";\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#getTermClasses()\r
-        */\r
-       @Override\r
-       public List<String> getTermClasses() {\r
-               return termClasses;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#createTermInstance()\r
-        */\r
-       @Override\r
-       public Feature createTermInstance() {\r
-               return Feature.NewInstance();\r
-       }\r
-\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/MarkerTypeEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/MarkerTypeEditorInput.java
deleted file mode 100644 (file)
index 5bc6cb5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.input;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.model.common.MarkerType;\r
-\r
-/**\r
- * @author l.morris\r
- * @date 6 Jan 2012\r
- *\r
- */\r
-public class MarkerTypeEditorInput extends AbstractDefinedTermEditorInput<MarkerType> {\r
-       \r
-       private List<String> termClasses = Arrays.asList(new String[]{\r
-                       MarkerType.class.getName()\r
-       });\r
-\r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.IEditorInput#getName()\r
-        */\r
-       @Override\r
-       public String getName() {\r
-               return "Marker Type";\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#getTermClasses()\r
-        */\r
-       @Override\r
-       public List<String> getTermClasses() {\r
-               return termClasses;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#createTermInstance()\r
-        */\r
-       @Override\r
-       public MarkerType createTermInstance() {\r
-               return new MarkerType();\r
-       }\r
-       \r
-       \r
-\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ModifierEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/ModifierEditorInput.java
deleted file mode 100644 (file)
index da3b772..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.definedterm.input;
-
-import java.util.Arrays;
-import java.util.List;
-
-import eu.etaxonomy.cdm.model.description.Modifier;
-
-
-/**
- * @author n.hoffmann
- * @date Jan 24, 2012
- *
- */
-public class ModifierEditorInput extends AbstractDefinedTermEditorInput<Modifier> {
-
-       private List<String> termClasses = Arrays.asList(new String[]{
-                       Modifier.class.getName()
-       });
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getName()
-        */
-       @Override
-       public String getName() {
-               return "Modifier";
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#getTermClasses()
-        */
-       @Override
-       public List<String> getTermClasses() {
-               return termClasses;
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#createTermInstance()
-        */
-       @Override
-       public Modifier createTermInstance() {
-               return Modifier.NewInstance();
-       }
-
-}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaEditorInput.java
deleted file mode 100644 (file)
index 2b9a529..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.input;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.model.location.Continent;\r
-import eu.etaxonomy.cdm.model.location.NamedArea;\r
-import eu.etaxonomy.cdm.model.location.TdwgArea;\r
-import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;\r
-\r
-/**\r
- * @author l.morris\r
- * @date 8 Dec 2011\r
- *\r
- */\r
-public class NamedAreaEditorInput extends AbstractDefinedTermEditorInput<NamedArea> {\r
-\r
-       private List<String> termClasses = Arrays.asList(new String[]{\r
-                       NamedArea.class.getName(), \r
-                       TdwgArea.class.getName(),\r
-                       WaterbodyOrCountry.class.getName(),\r
-                       Continent.class.getName()\r
-       });\r
-       \r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.IEditorInput#getName()\r
-        */\r
-       @Override\r
-       public String getName() {\r
-               return "Named Area";\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#getTermClasses()\r
-        */\r
-       @Override\r
-       public List<String> getTermClasses() {\r
-               return termClasses;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#createTermInstance()\r
-        */\r
-       @Override\r
-       public NamedArea createTermInstance() {\r
-                return NamedArea.NewInstance();\r
-       }\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaLevelEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/NamedAreaLevelEditorInput.java
deleted file mode 100644 (file)
index a379239..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.editor.definedterm.input;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
-\r
-/**\r
- * @author l.morris\r
- * @date 4 Jan 2012\r
- *\r
- */\r
-public class NamedAreaLevelEditorInput extends AbstractDefinedTermEditorInput<NamedAreaLevel> {\r
-\r
-       \r
-       private List<String> termClasses = Arrays.asList(new String[]{\r
-                       NamedAreaLevel.class.getName()\r
-       });\r
-       \r
-       /* (non-Javadoc)\r
-        * @see org.eclipse.ui.IEditorInput#getName()\r
-        */\r
-       @Override\r
-       public String getName() {\r
-               return "Named Area Level";\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#getTermClasses()\r
-        */\r
-       @Override\r
-       public List<String> getTermClasses() {\r
-               return termClasses;\r
-       }\r
-\r
-       /* (non-Javadoc)\r
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.AbstractDefinedTermEditorInput#createTermInstance()\r
-        */\r
-       @Override\r
-       public NamedAreaLevel createTermInstance() {\r
-               return NamedAreaLevel.NewInstance();\r
-       }\r
-\r
-}\r
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/StateEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/StateEditorInput.java
deleted file mode 100644 (file)
index 609dfe0..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.definedterm.input;
-
-import java.util.Arrays;
-import java.util.List;
-
-import eu.etaxonomy.cdm.model.description.State;
-
-/**
- * @author n.hoffmann
- * @date Jan 24, 2012
- *
- */
-public class StateEditorInput extends AbstractDefinedTermEditorInput<State> {
-
-       private List<String> termClasses = Arrays.asList(new String[]{
-                       State.class.getName()
-       });
-       
-       /* (non-Javadoc)
-        * @see org.eclipse.ui.IEditorInput#getName()
-        */
-       @Override
-       public String getName() {
-               return "State";
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#getTermClasses()
-        */
-       @Override
-       public List<String> getTermClasses() {
-               return termClasses;
-       }
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#createTermInstance()
-        */
-       @Override
-       public State createTermInstance() {
-               return State.NewInstance();
-       }
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/input/TermEditorInput.java
new file mode 100644 (file)
index 0000000..aef64fe
--- /dev/null
@@ -0,0 +1,76 @@
+// $Id$
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy 
+* http://www.e-taxonomy.eu
+* 
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.definedterm.input;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+
+
+/**
+ * @author n.hoffmann
+ * @date Jan 24, 2012
+ *
+ */
+public class TermEditorInput extends AbstractDefinedTermEditorInput<DefinedTerm> {
+
+       private TermType termType;
+       private Set<TermVocabulary<DefinedTermBase>> vocabularies;
+       private List<String> termClasses = Arrays.asList(new String[]{
+                       DefinedTerm.class.getName()
+       });
+       
+       public TermEditorInput(TermType termType) {
+               this.termType = termType;
+               vocabularies = new HashSet<TermVocabulary<DefinedTermBase>>();
+               initialiseVocabularies();
+       }
+       /* (non-Javadoc)
+        * @see org.eclipse.ui.IEditorInput#getName()
+        */
+       @Override
+       public String getName() {
+               return termType.getMessage();
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput#getTermClasses()
+        */
+       @Override
+       public List<String> getTermClasses() {
+               return termClasses;
+       }
+       
+       public TermType getTermType() {
+               return termType;
+       }
+       
+       public void initialiseVocabularies() {
+               if(vocabularies != null) {
+                       vocabularies.clear();
+               } 
+               List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(termType);
+               vocabularies.addAll(vocs);                      
+       }
+       
+       public Set<TermVocabulary<DefinedTermBase>> getVocabularies() {
+               return vocabularies;
+       }
+
+}
\ No newline at end of file
index cc2512f0dff4e0f6a76be72b1a25092368c4df6a..7677096e1ec1dc2fa291fc8bd4a85ca4704f39e2 100644 (file)
@@ -14,17 +14,15 @@ import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;\r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.core.runtime.IStatus;\r
-import org.eclipse.ui.IEditorInput;\r
+import org.eclipse.core.runtime.Status;\r
 \r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
-import eu.etaxonomy.cdm.model.location.NamedArea;\r
-import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
-import eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput;\r
-import eu.etaxonomy.taxeditor.editor.definedterm.input.NamedAreaEditorInput;\r
+import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
 /**\r
  * @author l.morris\r
@@ -36,7 +34,7 @@ public class CreateDefinedTermOperation extends AbstractPostOperation {
        \r
 \r
        private TermBase parentTermBase;\r
-       private AbstractDefinedTermEditorInput editorInput; \r
+       private TermEditorInput definedTermInput;\r
 \r
        /**\r
         * @param label\r
@@ -44,10 +42,13 @@ public class CreateDefinedTermOperation extends AbstractPostOperation {
         * @param postOperationEnabled\r
         */\r
        public CreateDefinedTermOperation(String label,\r
-                       IUndoContext undoContext, TermBase termBase, IPostOperationEnabled postOperationEnabled) {\r
+                       IUndoContext undoContext, \r
+                       TermBase termBase,\r
+                       TermEditorInput definedTermInput,\r
+                       IPostOperationEnabled postOperationEnabled) {\r
                super(label, undoContext, postOperationEnabled);\r
                this.parentTermBase = termBase;\r
-               editorInput = ((DefinedTermEditor)postOperationEnabled).getDefinedTermEditorInput();\r
+               this.definedTermInput = definedTermInput;\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -57,16 +58,22 @@ public class CreateDefinedTermOperation extends AbstractPostOperation {
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
                \r
-               DefinedTermBase newTerm = editorInput.createTermInstance();                             \r
-               \r
-               newTerm.setLabel("Untitled");\r
+               DefinedTermBase newTerm = definedTermInput.getTermType().getEmptyDefinedTermBase();\r
+               if (newTerm == null) {\r
+                       IStatus status = \r
+                                       new Status(IStatus.CANCEL, \r
+                                                       StoreUtil.getPluginId(), \r
+                                                       "Creation of term corresponding to type '" + definedTermInput.getTermType().getMessage() + "' is not yet supported");\r
+                       StoreUtil.warningDialog("Cannot create term", newTerm, status);\r
+                       return status;\r
+               }\r
                \r
                if (parentTermBase instanceof TermVocabulary){\r
                        TermVocabulary vocabulary = (TermVocabulary) parentTermBase;\r
                        vocabulary.addTerm(newTerm);\r
                } else if (parentTermBase instanceof DefinedTermBase) {\r
-                       DefinedTermBase parent = (DefinedTermBase) parentTermBase;\r
-                       parent.addIncludes(newTerm);\r
+                       DefinedTermBase parent = (DefinedTermBase) parentTermBase;                      \r
+                       parent.addIncludes(newTerm);                    \r
                        TermVocabulary vocabulary = parent.getVocabulary();\r
                        vocabulary.addTerm(newTerm);\r
                }\r
index a8950ee64d0b32f2a338cb765653652b195fbe4e..cad587c2b0fc97115a231414322731d1d0fbf797 100644 (file)
@@ -9,6 +9,8 @@
 */\r
 package eu.etaxonomy.taxeditor.editor.definedterm.operation;\r
 \r
+import java.net.URI;\r
+\r
 import org.eclipse.core.commands.ExecutionException;\r
 import org.eclipse.core.commands.operations.IUndoContext;\r
 import org.eclipse.core.runtime.IAdaptable;\r
@@ -16,10 +18,14 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;\r
 \r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;\r
+import eu.etaxonomy.cdm.model.common.TermType;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
+import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
 /**\r
@@ -29,17 +35,19 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */\r
 public class CreateTermVocabularyOperation extends AbstractPostOperation {\r
 \r
-       private DefinedTermEditor definedTermEditor;\r
-\r
+       private TermEditorInput definedEditorInput;\r
+       \r
        /**\r
         * @param label\r
         * @param undoContext\r
         * @param postOperationEnabled\r
         */\r
        public CreateTermVocabularyOperation(String label,\r
-                       IUndoContext undoContext, DefinedTermEditor definedTermEditor) {\r
-               super(label, undoContext, definedTermEditor);\r
-               this.definedTermEditor = definedTermEditor;\r
+                       IUndoContext undoContext, \r
+                       TermEditorInput definedEditorInput, \r
+                       IPostOperationEnabled postOperationEnabled) {\r
+               super(label, undoContext, postOperationEnabled);\r
+               this.definedEditorInput = definedEditorInput;\r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -48,10 +56,16 @@ public class CreateTermVocabularyOperation extends AbstractPostOperation {
        @Override\r
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
                        throws ExecutionException {\r
-\r
-               TermVocabulary termVocabulary = OrderedTermVocabulary.NewInstance(null, "Untitled", null, null);\r
+       \r
+               TermVocabulary termVocabulary = \r
+                                       TermVocabulary.NewInstance(definedEditorInput.getTermType(),\r
+                                               null, \r
+                                               "Untitled", \r
+                                               null, \r
+                                               null);          \r
+               \r
                CdmStore.getService(IVocabularyService.class).save(termVocabulary);\r
-               definedTermEditor.getInMemoryVocabularies().add(termVocabulary);\r
+               definedEditorInput.getVocabularies().add(termVocabulary);\r
                \r
                return postExecute(termVocabulary);\r
        }\r
index 7ce678596023257ecbc9a33514990097f6c92c0b..c5bbd9c4ec4a1f9319e4fcc8b8fd0377eb325fe7 100644 (file)
@@ -18,11 +18,14 @@ import org.eclipse.core.runtime.Status;
 \r
 import eu.etaxonomy.cdm.api.service.ITermService;\r
 import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.TermBase;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
+import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
@@ -33,6 +36,7 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */\r
 public class DeleteTermBaseOperation extends AbstractPostOperation {\r
 \r
+       private TermEditorInput definedEditorInput;\r
        private TermBase termBase;\r
        private DefinedTermEditor definedTermEditor;\r
        /**\r
@@ -40,11 +44,14 @@ public class DeleteTermBaseOperation extends AbstractPostOperation {
         * @param undoContext\r
         * @param postOperationEnabled\r
         */\r
-       public DeleteTermBaseOperation(String label, IUndoContext undoContext, TermBase termBase,\r
-                       DefinedTermEditor definedTermEditor) {\r
-               super(label, undoContext, definedTermEditor);\r
+       public DeleteTermBaseOperation(String label, \r
+                       IUndoContext undoContext, \r
+                       TermBase termBase,\r
+                       TermEditorInput definedEditorInput,\r
+                       IPostOperationEnabled postOperationEnabled) {\r
+               super(label, undoContext, postOperationEnabled);\r
                this.termBase = termBase;\r
-               this.definedTermEditor = definedTermEditor;\r
+               this.definedEditorInput = definedEditorInput;           \r
        }\r
 \r
        /* (non-Javadoc)\r
@@ -57,25 +64,39 @@ public class DeleteTermBaseOperation extends AbstractPostOperation {
                \r
                \r
                if (termBase instanceof TermVocabulary) {\r
+                       if (((TermVocabulary)termBase).getCreatedBy() == null) {\r
+                               IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system vocabulary");\r
+                               StoreUtil.warningDialog("Cannot delete vocabulary", termBase, status);\r
+                               return status;\r
+                       }\r
                        \r
                        if (!((TermVocabulary)termBase).getTerms().isEmpty()) {\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "Delete all terms from this vocaulary before deleting the vocabulary.");\r
                                StoreUtil.warningDialog("Vocabulary not empty", termBase, status);\r
                                return status;\r
-                       }\r
-                       definedTermEditor.getInMemoryVocabularies().remove(termBase); \r
+                       }                       \r
+\r
+                       definedEditorInput.getVocabularies().remove((TermVocabulary)termBase); \r
                        CdmStore.getService(IVocabularyService.class).delete((TermVocabulary)termBase);\r
                        \r
+                       \r
                } else if (termBase instanceof DefinedTermBase) {\r
                        \r
                        \r
                        DefinedTermBase definedTermBase = (DefinedTermBase) termBase;\r
+                       \r
+                       if (((DefinedTermBase)termBase).getCreatedBy() == null) {\r
+                               IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This is a CDM system defined term");\r
+                               StoreUtil.warningDialog("Cannot delete defined term", termBase, status);\r
+                               return status;\r
+                       }\r
                        if(!definedTermBase.getIncludes().isEmpty()){\r
                                IStatus status = new Status(IStatus.CANCEL, StoreUtil.getPluginId(), "This term includes other terms. Please delete the included terms before deleting this term.");                            \r
                                StoreUtil.warningDialog("Term has included terms", termBase, status);\r
                                return status;\r
                        } \r
                                                \r
+\r
                        DefinedTermBase partOf = definedTermBase.getPartOf();\r
                        if(partOf != null){\r
                                partOf.removeIncludes(definedTermBase);\r
index a8278c654fc451051195f3c706b4cab7fe137e44..02875a7be3c52d923c398f1d2e9b982c9201d46a 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -61,7 +61,7 @@ public class FeatureTreeContentProvider implements ITreeContentProvider {
                        List<FeatureNode> children = ((FeatureTree) parentElement).getRootChildren();
                        return children.toArray();
                }else if(parentElement instanceof FeatureNode){
-                       List<FeatureNode> children = ((FeatureNode) parentElement).getChildren();
+                       List<FeatureNode> children = ((FeatureNode) parentElement).getChildNodes();
                        return children.toArray();
                }else if(parentElement instanceof List){
                        return ((List) parentElement).toArray();
index a95f420f0d9e51db7eb4495daec89fa5800bb5d4..c2975144f35b7012631f9300aacc0a7890a0ac6b 100644 (file)
@@ -1,17 +1,21 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.net.URI;
 
+import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
@@ -28,9 +32,11 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigurator> {
 
+    private static final Logger logger = Logger.getLogger(AbcdImportWizard.class);
+
        private Abcd206ImportConfigurator configurator;
        private ImportFromFileDataSourceWizardPage dataSourcePage;
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
         */
@@ -47,23 +53,29 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
        @Override
        public boolean performFinish() {
                URI source = dataSourcePage.getUri();
-               configurator.setSource(source);
+               try {
+            configurator.setSource(new FileInputStream(new File(source)));
+        } catch (FileNotFoundException e) {
+            logger.error("File not found!", e);
+            return false;
+        }
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-               
+
                CdmStore.getImportManager().run(configurator);
                return true;
-               
+
        }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                super.init(workbench, selection);
                configurator =  CdmStore.getImportManager().AbcdConfigurator();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
         */
@@ -71,7 +83,7 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
        @Override
        public void addPages() {
                super.addPages();
-               
+
                dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
                addPage(dataSourcePage);
        }
index 3072f460e780d09b9192018d6021e66136bce989..308d27587fd5277578bd2ac18c39862e718ce562 100644 (file)
@@ -49,7 +49,6 @@ import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
 import org.eclipse.ui.themes.ITheme;
 import org.eclipse.ui.themes.IThemeManager;
 
-import eu.etaxonomy.cdm.model.common.TermBase;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
index 328f57a227ff68de1d8e68e25783ffa19dfac312..1fc1cfd18f7aabb93f571d1deb53c7c7e0f859f0 100644 (file)
@@ -19,7 +19,6 @@ import eu.etaxonomy.cdm.api.service.DefaultCategoricalDescriptionBuilder;
 import eu.etaxonomy.cdm.api.service.DefaultQuantitativeDescriptionBuilder;
 import eu.etaxonomy.cdm.api.service.DescriptionBuilder;
 import eu.etaxonomy.cdm.common.CdmUtils;
-import eu.etaxonomy.cdm.model.common.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.ISourceable;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
@@ -33,6 +32,7 @@ import eu.etaxonomy.cdm.model.description.CategoricalData;
 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
index 900665e9e54e599c08c09e78cc862039c3863490..ce88d1cbc473a87d87bbc713427f5b12d65a5ef7 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -35,11 +35,11 @@ import eu.etaxonomy.cdm.model.description.TaxonDescription;
  * @version 1.0
  */
 public class FeatureNodeContainer{
-       
-       
-       
+
+
+
        private FeatureNodeContainer parent;
-       
+
 
 
        private FeatureNode featureNode;
@@ -48,35 +48,35 @@ public class FeatureNodeContainer{
 
        private FeatureNodeContainerTree containerTree;
 
-       
+
        /**
         * @param description
         */
        protected FeatureNodeContainer(FeatureNodeContainerTree containerTree) {
-               this.containerTree = containerTree; 
+               this.containerTree = containerTree;
                this.containerTree.addContainer(this);
        }
-       
-       
+
+
        /**
-        * Recursively traverse a branch of a feature tree and check if there are 
-        * 
+        * Recursively traverse a branch of a feature tree and check if there are
+        *
         * @param featureNode
-        * @param description 
+        * @param description
         * @return
         */
        protected void findLeaves(FeatureNode featureNode) {
                if(featureNode.isLeaf()){
                        buildLeaf(featureNode);
                }else{
-                       for(FeatureNode childNode : featureNode.getChildren()){
+                       for(FeatureNode childNode : featureNode.getChildNodes()){
                                findLeaves(childNode);
                        }
                }
        }
-       
+
        /**
-        * 
+        *
         * @param featureNode
         * @param description
         * @return
@@ -85,12 +85,12 @@ public class FeatureNodeContainer{
                if(featureNode.getFeature() == null){
                        throw new IllegalArgumentException("The given feature node does not have a feature.");
                }
-               
+
                Feature feature = (Feature) HibernateProxyHelper.deproxy(featureNode.getFeature());
-               
+
                // get feature node container for the given feature
                FeatureNodeContainer container = containerTree.getFeatureNodeContainer(feature);
-               
+
                // get description elements for the given feature
                List<DescriptionElementBase> elements = containerTree.getDescriptionsElementsForFeature(feature);
                // no description elements, so we should also remove the feature node container
@@ -108,12 +108,12 @@ public class FeatureNodeContainer{
                                container.buildBranch();
                        }
                        // add description elements to the feature node container
-                       container.setDescriptionElements(elements);             
+                       container.setDescriptionElements(elements);
                }
        }
-       
+
        /**
-        * 
+        *
         */
        private void remove() {
                if(getParent() != null){
@@ -134,15 +134,15 @@ public class FeatureNodeContainer{
 
 
        /**
-        * Recursively 
-        * 
+        * Recursively
+        *
         * @param featureNodeMap
         * @return
         */
-       private void buildBranch(){     
+       private void buildBranch(){
                if(getParent() == null){
                        FeatureNode parentFeatureNode = getFeatureNode().getParent();
-                       
+
                        if(parentFeatureNode.isRoot()){
                                containerTree.getRoot().addChild(this);
                        }else{
@@ -151,15 +151,15 @@ public class FeatureNodeContainer{
                                        parentContainer = new FeatureNodeContainer(containerTree);
                                        parentContainer.setFeatureNode(parentFeatureNode);
                                }
-                               
+
                                parentContainer.addChild(this);
-                               
+
                                parentContainer.buildBranch();
-                               
+
                        }
                }
        }
-       
+
        /**
         * <p>Getter for the field <code>children</code>.</p>
         *
@@ -182,7 +182,7 @@ public class FeatureNodeContainer{
                        throw new IllegalStateException("Container may not have a description element set when setting children.");
                }
        }
-       
+
        /**
         * Adds a child container to the list of this containers children
         *
@@ -201,11 +201,11 @@ public class FeatureNodeContainer{
        public void addDescriptionElement(DescriptionElementBase descriptionElement){
                descriptionElements.add(descriptionElement);
        }
-       
+
        public void removeDescriptionElement(DescriptionElementBase descriptionElement){
                descriptionElements.remove(descriptionElement);
        }
-       
+
        /**
         * If {@link #isLeaf()} is true, i.e. this container should have elements, returns the list of description elements.
         *
@@ -225,7 +225,7 @@ public class FeatureNodeContainer{
        public List<DescriptionElementBase> getDescriptionElementsForEntireBranch(){
                return getDescriptionElementsRecursively(new ArrayList<DescriptionElementBase>());
        }
-       
+
        private List<DescriptionElementBase> getDescriptionElementsRecursively(List<DescriptionElementBase> descriptionElements){
                if(isLeaf()){
                        descriptionElements.addAll(getDescriptionElements());
@@ -236,20 +236,20 @@ public class FeatureNodeContainer{
                }
                return descriptionElements;
        }
-       
+
        protected List<FeatureNodeContainer> getLeafs(){
                List<FeatureNodeContainer> leafs = new ArrayList<FeatureNodeContainer>();
-               
+
                if(isLeaf()){
                        leafs.add(this);
                }else{
                        for(FeatureNodeContainer container : getChildren()){
                                leafs.addAll(container.getLeafs());
-                       }                       
+                       }
                }
                return leafs;
        }
-       
+
        /**
         * Set the description element
         *
@@ -263,7 +263,7 @@ public class FeatureNodeContainer{
                        throw new IllegalStateException("Container may not contain child container when adding description elements.");
                }
        }
-       
+
        /**
         * If the container is a leaf, it will hold a description element and no child containers
         *
@@ -272,7 +272,7 @@ public class FeatureNodeContainer{
        public boolean isLeaf(){
                return ! descriptionElements.isEmpty() && children.isEmpty();
        }
-       
+
        /**
         * <p>Setter for the field <code>featureNode</code>.</p>
         *
@@ -290,7 +290,7 @@ public class FeatureNodeContainer{
        public FeatureNode getFeatureNode() {
                return featureNode;
        }
-       
+
        /**
         * <p>getFeature</p>
         *
@@ -311,14 +311,14 @@ public class FeatureNodeContainer{
        public DescriptionBase getDescription(){
                return containerTree.getDescription();
        }
-       
+
        public FeatureNodeContainerTree getContainerTree(){
                return containerTree;
        }
 
 
        /**
-        * 
+        *
         */
        public void clear() {
                children.clear();
index f06ac99b7cfa65d205f249851831312c6a907d91..86c47a77f12ffd13f05e5983ed39275d367276e5 100644 (file)
@@ -21,7 +21,6 @@ import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.swt.graphics.Image;
 
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
index 0930a3bdf80e834f863c0ff1e14a93d75531a09f..2bfcb79393531922391a697c7bd95ed96566b01b 100644 (file)
@@ -55,7 +55,7 @@ public class NomenclaturalCodeHelper {
         * @return
         */
        private static boolean isSupported(NomenclaturalCode code) {
-               if (code.equals(NomenclaturalCode.ICBN) || code.equals(NomenclaturalCode.ICZN)) {
+               if (code.equals(NomenclaturalCode.ICNAFP ) || code.equals(NomenclaturalCode.ICZN)) {
                        return true;
                } else {
                        return false;
@@ -73,8 +73,8 @@ public class NomenclaturalCodeHelper {
                if (code.equals(NomenclaturalCode.ICNB)) {
                        return "International Code of Nomenclature of Bacteria (ICNB)";
                }
-               if (code.equals(NomenclaturalCode.ICBN)) {
-                       return "International Code of Botanical Nomenclature (ICBN)";
+               if (code.equals(NomenclaturalCode.ICNAFP )) {
+                       return "International Code of Botanical Nomenclature (ICNAFP )";
                }
                if (code.equals(NomenclaturalCode.ICNCP)) {
                        return "International Code of Cultivated Plants (ICNCP)";
@@ -94,6 +94,6 @@ public class NomenclaturalCodeHelper {
         * @return a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode} object.
         */
        public static NomenclaturalCode getDefaultCode() {
-               return NomenclaturalCode.ICBN;
+               return NomenclaturalCode.ICNAFP ;
        }
 }
index d132f0544eb0b3beb48ff8a99753768ec1dd666d..90e1b3e78ae41ac0f532aeea0299bac24f14ca62 100644 (file)
@@ -13,10 +13,16 @@ package eu.etaxonomy.taxeditor.newWizard;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.cdm.model.occurrence.Specimen;
+import eu.etaxonomy.cdm.model.common.OriginalSourceType;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.OriginalSourceTypeSelectionDialog;
+import eu.etaxonomy.taxeditor.ui.dialog.selection.SpecimenOrObservationTypeSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseWizardPage;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldObservationWizardPage;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
@@ -29,8 +35,17 @@ import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralWizardPage;
  * @created Jun 16, 2010
  * @version 1.0
  */
-public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUnitBase> {
+public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUnit> {
+       private SpecimenOrObservationType specOrObsType = null;
        
+       public NewDerivedUnitBaseWizard() {
+               super();        
+       }
+       
+       public NewDerivedUnitBaseWizard(SpecimenOrObservationType specOrObsType) {
+               super();
+               this.specOrObsType = specOrObsType;
+       }
        /** {@inheritDoc} */
        @Override
        public void addPages() {
@@ -38,6 +53,7 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUni
                addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), getFacade()));
                addPage(new FieldObservationWizardPage(formFactory, getConversationHolder(), getFacade()));
                addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), getFacade()));
+               
        }
        
        /**
@@ -45,11 +61,14 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUni
         */
        private DerivedUnitFacade getFacade() {
                try {
-                       return DerivedUnitFacade.NewInstance(getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+                       if(getEntity() != null) {
+                               return DerivedUnitFacade.NewInstance(getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+                       }
                } catch (DerivedUnitFacadeNotSupportedException e) {
                        // w should never get here
                        throw new IllegalStateException();
                }
+               return null;
        }
 
        /* (non-Javadoc)
@@ -57,11 +76,18 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUni
         */
        /** {@inheritDoc} */
        @Override
-       protected DerivedUnitBase createNewEntity() {
-               // TODO we do want to create different derivates of DerivedUnitBase but go with specimen for testing 
-               // at the moment
-               // FIXME add wizard page that handles the selection of derived unit type
-               return Specimen.NewInstance();
+       protected DerivedUnit createNewEntity() {               
+               if(specOrObsType == null) {
+                       return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
+               } else {                        
+                       if(SpecimenOrObservationType.Media.equals(specOrObsType) || 
+                                       ((((SpecimenOrObservationType)specOrObsType).getKindOf() != null) &&
+                                       ((SpecimenOrObservationType)specOrObsType).getKindOf().equals(SpecimenOrObservationType.Media))) {
+                               return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
+                       } else {
+                               return DerivedUnit.NewInstance((SpecimenOrObservationType)specOrObsType);
+                       }                                               
+               }
        }
 
        /* (non-Javadoc)
index 925aead2a171bf33a16efd6bd1a18ad22050cf27..4ceb80fd3d7e3a71ef67c1773cf1b051ae84e17a 100644 (file)
@@ -11,7 +11,7 @@
 package eu.etaxonomy.taxeditor.newWizard;
 
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -21,14 +21,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Jun 17, 2010
  * @version 1.0
  */
-public class NewFieldObservationWizard extends AbstractNewEntityWizard<FieldObservation> {
+public class NewFieldObservationWizard extends AbstractNewEntityWizard<FieldUnit> {
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
         */
        /** {@inheritDoc} */
        @Override
-       protected FieldObservation createNewEntity() {
+       protected FieldUnit createNewEntity() {
                return null;
        }
 
index 351583132eafee6b037247bd7d4057f580d0a01d..d14e60819095bb07201120674d8c3be2daae0fe1 100644 (file)
 package eu.etaxonomy.taxeditor.newWizard;
 
 import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
-import eu.etaxonomy.cdm.api.service.IGroupService;
 import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.group.GroupDetailWizardPage;
 
 /**
  * @author a.kohlbecker
index 9ab033f49d32d61679c873dd9ec5d0cc357084e5..6e6ec088643f8ea272f1983d83a6d03f7ecac373 100644 (file)
@@ -38,7 +38,7 @@ public class NewNonViralNameWizard extends AbstractNewEntityWizard<NonViralName>
        @Override
        protected NonViralName createNewEntity() {
                NomenclaturalCode code = PreferencesUtil.getPreferredNomenclaturalCode();
-               if(code.equals(NomenclaturalCode.ICBN)){
+               if(code.equals(NomenclaturalCode.ICNAFP )){
                        return BotanicalName.NewInstance(null);
                }else if(code.equals(NomenclaturalCode.ICZN)){
                        return ZoologicalName.NewInstance(null);
index f0e65cbd5134ab5f0ac512e08deb4e2c2c07da35..194bc3c7a66cc560dd971e896e9b39c094a462e4 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
@@ -10,7 +10,7 @@ import org.apache.commons.lang.StringUtils;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.model.taxon.Classification;
-import eu.etaxonomy.cdm.model.taxon.ITreeNode;
+import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -24,7 +24,7 @@ import eu.etaxonomy.taxeditor.ui.section.classification.TaxonNodeWizardPage;
  * @created Sep 15, 2009
  * @version 1.0
  */
-public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
+public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITaxonTreeNode>{
 
        private TaxonNodeWizardPage taxonNodePage;
        private boolean openEmptyEditor;
@@ -35,17 +35,17 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
                taxonNodePage = new TaxonNodeWizardPage(formFactory, getConversationHolder(), getEntity());
                addPage(taxonNodePage);
        }
-       
+
        @Override
        protected void saveEntity() {
                if(taxonNodePage.getTaxon() == null || StringUtils.isEmpty(taxonNodePage.getTaxon().getName().getFullTitleCache())){
                        openEmptyEditor = true;
                }else{
                        getConversationHolder().bind();
-                       ITreeNode parent = getParentTreeNode();
+                       ITaxonTreeNode parent = getParentTreeNode();
                        Taxon taxon = taxonNodePage.getTaxon();
                        try{
-                               TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference(), null);
+                               TaxonNode taxonNode = parent.addChildTaxon(taxon, parent.getReference(), parent.getMicroReference());
                                generatedTaxonNodeUuid = CdmStore.getService(ITaxonNodeService.class).saveOrUpdate(taxonNode);
                        }catch(IllegalArgumentException e){
                                StoreUtil.warningDialog("Taxon already exists in classfication", getClass(), e.getMessage());
@@ -54,12 +54,12 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
        }
 
        @Override
-       protected ITreeNode createNewEntity() {         
+       protected ITaxonTreeNode createNewEntity() {
                if(getSelection() != null){
                        Object selectedObject = getSelection().getFirstElement();
-                       if(selectedObject instanceof ITreeNode){
-                               ITreeNode treeNode = (ITreeNode) selectedObject;
-                               
+                       if(selectedObject instanceof ITaxonTreeNode){
+                           ITaxonTreeNode treeNode = (ITaxonTreeNode) selectedObject;
+
                                if(treeNode instanceof Classification){
                                        return CdmStore.getService(IClassificationService.class).load(treeNode.getUuid());
                                }
@@ -68,10 +68,10 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
                                }
                        }
                }
-               
+
                return null;
        }
-       
+
        /**
         * <p>openInEditor</p>
         *
@@ -80,7 +80,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
        public boolean openInEditor(){
                return taxonNodePage.openInEditor();
        }
-       
+
        /**
         * <p>openEmpty</p>
         *
@@ -89,7 +89,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
        public boolean openEmpty(){
                return openInEditor() && openEmptyEditor;
        }
-       
+
        /**
         * <p>getTaxonNode</p>
         *
@@ -97,12 +97,12 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITreeNode>{
         */
        public TaxonNode getTaxonNode(){
                if(generatedTaxonNodeUuid != null){
-                       return CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);                       
+                       return CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);
                }
                return null;
        }
-       
-       public ITreeNode getParentTreeNode(){
+