added a readme file
authorn.hoffmann <n.hoffmann@localhost>
Tue, 23 Nov 2010 13:24:01 +0000 (13:24 +0000)
committern.hoffmann <n.hoffmann@localhost>
Tue, 23 Nov 2010 13:24:01 +0000 (13:24 +0000)
72 files changed:
.gitattributes
README.txt [new file with mode: 0644]
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLineDisplay.java
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorSortMenuProvider.java
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/ReferenceCreator.java
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorInputTypeValues.java
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java
taxeditor-cdmlib/META-INF/MANIFEST.MF
taxeditor-cdmlib/build.properties
taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar [deleted file]
taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar [new file with mode: 0644]
taxeditor-editor/plugin.xml
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/dialogs/filteredSelection/FilteredClassificationSelectionDialog.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/dialogs/filteredSelection/FilteredReferenceSelectionDialog.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/dialogs/filteredSelection/FilteredTaxonNodeSelectionDialog.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputFactory.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/newWizard/ExternalReferenceServiceWizardPage.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/newWizard/NewReferenceWizard.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java [moved from taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/AddDescriptionHandler.java with 97% similarity]
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java [moved from taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteDescriptionHandler.java with 97% similarity]
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/detail/DetailsViewer.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/CdmFormFactory.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/ImageElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/LanguageStringWithLabelElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/selection/ClassificationSelectionElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/selection/EditFromSelectionWizard.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/selection/ReferenceSelectionElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/classification/ClassificationDetailElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/classification/ClassificationDetailSection.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/classification/ClassificationWizardPage.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/classification/TaxonNodeDetailElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/description/DescriptionSourceElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/description/DescriptionSourceSection.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/name/ProtologueElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/occurrence/DerivedUnitBaseDetailElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/NomenclaturalReferenceDetailElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailElement.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailSection.java
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceWizardPage.java [moved from taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseWizardPage.java with 89% similarity]
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/ImageFileElement.java
taxeditor-navigation/plugin.xml
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/handler/EditHandler.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/ClassificationContentProvider.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/ClassificationLabelProvider.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/EmptyRoot.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/Root.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodePropertyTester.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/wizard/ClassificationWizard.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/wizard/ClassificationWizardPage.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/wizard/NewTaxonNodeWizard.java
taxeditor-navigation/src/main/java/eu/etaxonomy/taxeditor/wizard/NewTaxonNodeWizardPage.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ExportHandler.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ImportHandler.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/FeatureNodeContainer.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/newWizards/NewReferenceWizard.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteConceptRelationOperation.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteMisapplicationOperation.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTreeNodeOperation.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditClassificationOperation.java [moved from taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditTaxonomicTreeOperation.java with 88% similarity]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/SaveClassificationOperation.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/parser/MatchStrategyConfigurator.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/matching/ReferenceMatchingPreference.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
taxeditor-store/src/test/java/eu/etaxonomy/taxeditor/store/operations/MoveTaxonOperationTest.java

index 641224c..b38f835 100644 (file)
@@ -1,5 +1,6 @@
 * text=auto !eol
 /LICENSE.txt -text
+/README.txt -text
 /pom.xml -text
 src/changes/changes.xml -text
 src/site/apt/download.apt -text
@@ -214,7 +215,7 @@ taxeditor-cdmlib/lib/mail-1.4src.zip -text
 taxeditor-cdmlib/lib/msbase-2000.3.jar -text
 taxeditor-cdmlib/lib/mssqlserver-2000.3.jar -text
 taxeditor-cdmlib/lib/msutil-2000.3.jar -text
-taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar -text
+taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar -text
 taxeditor-cdmlib/lib/odfdom-0.8-javadoc.zip -text
 taxeditor-cdmlib/lib/odfdom-0.8-sources.zip -text
 taxeditor-cdmlib/lib/odfdom-0.8.jar -text
@@ -426,9 +427,9 @@ taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/AbstractSplita
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveLabelProvider.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java -text
-taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/AddDescriptionHandler.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java -text
-taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteDescriptionHandler.java -text
+taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java -text
+taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DescriptionsMenuPropertyTester.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/detail/CdmSectionPart.java -text
@@ -620,7 +621,7 @@ taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/Nomencla
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/NomenclaturalReferenceDetailSection.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailElement.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailSection.java -text
-taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseWizardPage.java -text
+taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceWizardPage.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractMediaRepresentationPartElement.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractOriginalSourceElement.java -text
 taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractReferencedEntityElement.java -text
@@ -1006,7 +1007,7 @@ taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteNameRelati
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteSynonymOperation.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTaxonDescriptionOperation.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTreeNodeOperation.java -text
-taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditTaxonomicTreeOperation.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditClassificationOperation.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditUserOperation.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/IPostOperationEnabled.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/MoveMediaInListOperation.java -text
diff --git a/README.txt b/README.txt
new file mode 100644 (file)
index 0000000..daab69a
--- /dev/null
@@ -0,0 +1 @@
+For more information please see http://wp5.e-taxonomy.eu/taxeditor
index 95923f0..91bfb3d 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.Marker;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -90,8 +90,8 @@ public class BulkEditorLineDisplay implements ILineDisplayStrategy {
         */
        /** {@inheritDoc} */
        public String getSupplementalText(Object entity) {
-               if (entity instanceof ReferenceBase) {
-                       ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(entity);
+               if (entity instanceof Reference) {
+                       Reference reference = (Reference) HibernateProxyHelper.deproxy(entity);
                        // Nobody seems to like displaying the date
 //                     TimePeriod datePublished = ((StrictReferenceBase) reference).getDatePublished();
 //                                             
@@ -134,8 +134,8 @@ public class BulkEditorLineDisplay implements ILineDisplayStrategy {
         */
        /** {@inheritDoc} */
        public void setText(String text, Object entity) {
-               if (entity instanceof ReferenceBase) {
-                       ((ReferenceBase) entity).setTitleCache(text);                   
+               if (entity instanceof Reference) {
+                       ((Reference) entity).setTitleCache(text);                       
                }
        }
 
@@ -173,7 +173,7 @@ public class BulkEditorLineDisplay implements ILineDisplayStrategy {
         */
        /** {@inheritDoc} */
        public String getEmptyCacheMessage(Object entity) {
-               if (entity instanceof ReferenceBase) {
+               if (entity instanceof Reference) {
                        return "No reference title cache";
                }
                if (entity instanceof TaxonNameBase) {
@@ -190,8 +190,8 @@ public class BulkEditorLineDisplay implements ILineDisplayStrategy {
         */
        /** {@inheritDoc} */
        public boolean isEntityCacheEmpty(Object entity) {
-               if (entity instanceof ReferenceBase) {
-                       String text = ((ReferenceBase) entity).getTitleCache();
+               if (entity instanceof Reference) {
+                       String text = ((Reference) entity).getTitleCache();
                        return (text == null || text.equals(""));
                }
                if (entity instanceof TaxonNameBase) {
index df933bd..a82012d 100644 (file)
@@ -19,7 +19,7 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.IEditorInput;
 
 import eu.etaxonomy.cdm.model.common.TimePeriod;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IdentifiableEntityComparator;
 import eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput;
 
@@ -73,8 +73,8 @@ public class BulkEditorSortMenuProvider implements IBulkEditorSortMenuProvider {
                 * @return
                 */
                private String getYearString(Object o) {
-                       TimePeriod datePublished = o == null || !(o instanceof ReferenceBase) ? 
-                                       null : ((ReferenceBase) o).getDatePublished(); 
+                       TimePeriod datePublished = o == null || !(o instanceof Reference) ? 
+                                       null : ((Reference) o).getDatePublished(); 
                        return datePublished == null? null : datePublished.toString();
                }
                
index c0390de..32a56c6 100644 (file)
@@ -15,23 +15,9 @@ import java.util.Map;
 
 import org.apache.log4j.Logger;
 
-import eu.etaxonomy.cdm.model.reference.Article;
-import eu.etaxonomy.cdm.model.reference.Book;
-import eu.etaxonomy.cdm.model.reference.BookSection;
-import eu.etaxonomy.cdm.model.reference.CdDvd;
-import eu.etaxonomy.cdm.model.reference.Database;
-import eu.etaxonomy.cdm.model.reference.Generic;
-import eu.etaxonomy.cdm.model.reference.InProceedings;
-import eu.etaxonomy.cdm.model.reference.Journal;
-import eu.etaxonomy.cdm.model.reference.Patent;
-import eu.etaxonomy.cdm.model.reference.PersonalCommunication;
-import eu.etaxonomy.cdm.model.reference.PrintSeries;
-import eu.etaxonomy.cdm.model.reference.Proceedings;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.reference.ReferenceType;
-import eu.etaxonomy.cdm.model.reference.Report;
-import eu.etaxonomy.cdm.model.reference.Thesis;
-import eu.etaxonomy.cdm.model.reference.WebPage;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 
 /**
@@ -41,7 +27,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
  * @created 07.07.2009
  * @version 1.0
  */
-public class ReferenceCreator implements IEntityCreator<ReferenceBase> {
+public class ReferenceCreator implements IEntityCreator<Reference> {
        private static final Logger logger = Logger
                        .getLogger(ReferenceCreator.class);
 
@@ -49,69 +35,69 @@ public class ReferenceCreator implements IEntityCreator<ReferenceBase> {
         * @see eu.etaxonomy.taxeditor.bulkeditor.IEntityCreator#createEntity(java.lang.String)
         */
        /** {@inheritDoc} */
-       public ReferenceBase createEntity(String text) {
-               return createEntity(Generic.class, text);
+       public Reference createEntity(String text) {
+               return createEntity(Reference.class, text);
        }
 
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
         */
        /** {@inheritDoc} */
-       public ReferenceBase createEntity(Object key, String text) {
-               ReferenceBase reference = null;
+       public Reference createEntity(Object key, String text) {
+               Reference reference = null;
                
                // TODO replace w more generic method when cdmlib matures accordingly
                if  (ReferenceType.Article.getMessage().equals(key)) {
-                       reference = Article.NewInstance();
+                       reference = ReferenceFactory.newArticle();
                }
                if  (ReferenceType.Book.getMessage().equals(key)) {
-                       reference = Book.NewInstance();
+                       reference = ReferenceFactory.newBook();
                }
                if  (ReferenceType.BookSection.getMessage().equals(key)) {
-                       reference = BookSection.NewInstance();
+                       reference = ReferenceFactory.newBookSection();
                }
                if  (ReferenceType.CdDvd.getMessage().equals(key)) {
-                       reference = CdDvd.NewInstance();
+                       reference = ReferenceFactory.newCdDvd();
                }
                if  (ReferenceType.Database.getMessage().equals(key)) {
-                       reference = Database.NewInstance();
+                       reference = ReferenceFactory.newDatabase();
                }
                if  (ReferenceType.Generic.getMessage().equals(key)) {
-                       reference = Generic.NewInstance();
+                       reference = ReferenceFactory.newGeneric();
                }
                if  (ReferenceType.InProceedings.getMessage().equals(key)) {
-                       reference = InProceedings.NewInstance();
+                       reference = ReferenceFactory.newInProceedings();
                }
                if  (ReferenceType.Journal.getMessage().equals(key)) {
-                       reference = Journal.NewInstance();
+                       reference = ReferenceFactory.newJournal();
                }
                if  (ReferenceType.Map.getMessage().equals(key)) {
-                       reference = eu.etaxonomy.cdm.model.reference.Map.NewInstance();
+                       reference = ReferenceFactory.newMap();
                }
                if  (ReferenceType.Patent.getMessage().equals(key)) {
-                       reference = Patent.NewInstance();
+                       reference = ReferenceFactory.newPatent();
                }
                if  (ReferenceType.PersonalCommunication.getMessage().equals(key)) {
-                       reference = PersonalCommunication.NewInstance();
+                       reference = ReferenceFactory.newPersonalCommunication();
                }
                if  (ReferenceType.PrintSeries.getMessage().equals(key)) {
-                       reference = PrintSeries.NewInstance();
+                       reference = ReferenceFactory.newPrintSeries();
                }
                if  (ReferenceType.Proceedings.getMessage().equals(key)) {
-                       reference = Proceedings.NewInstance();
+                       reference = ReferenceFactory.newProceedings();
                }
                if  (ReferenceType.Report.getMessage().equals(key)) {
-                       reference = Report.NewInstance();
+                       reference = ReferenceFactory.newReport();
                }
                if  (ReferenceType.Thesis.getMessage().equals(key)) {
-                       reference = Thesis.NewInstance();
+                       reference = ReferenceFactory.newThesis();
                }
                if  (ReferenceType.WebPage.getMessage().equals(key)) {
-                       reference = WebPage.NewInstance();
+                       reference = ReferenceFactory.newWebPage();
                }
                if (reference == null) {
                        logger.warn("Reference type " + key + " not found. Creating reference with default type.");
-                       reference = Generic.NewInstance();
+                       reference = ReferenceFactory.newGeneric();
                }
                reference.setTitleCache(text);
                return reference;
index 82ecf15..cb69b1c 100644 (file)
@@ -20,7 +20,7 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AgentEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput;
@@ -64,7 +64,7 @@ public class BulkEditorInputTypeValues implements IParameterValues {
                }
                
                public static BulkEditorInputType getByType(Class clazz){
-                       if (ReferenceBase.class.isAssignableFrom(clazz)) {
+                       if (Reference.class.isAssignableFrom(clazz)) {
                                return REFERENCE;
                        }
                        else if (TaxonNameBase.class.isAssignableFrom(clazz)) {
index 5f9a487..09f8ad0 100644 (file)
@@ -24,7 +24,7 @@ import org.eclipse.ui.IPersistableElement;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.merge.MergeException;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IdentifiableEntityComparator;
@@ -259,9 +259,9 @@ public abstract class AbstractBulkEditorInput<T> extends PropertyChangeSupport i
        /** {@inheritDoc} */
        public boolean merge(Object entity, Object mergeTarget) {
                logger.info("Merge "  + entity + " into " + mergeTarget);
-               if (entity instanceof ReferenceBase) {
+               if (entity instanceof Reference) {
                        try {
-                               CdmStore.getCommonService().merge((ReferenceBase) mergeTarget, (ReferenceBase) entity, null);
+                               CdmStore.getCommonService().merge((Reference) mergeTarget, (Reference) entity, null);
                        } catch (MergeException e) {
                                logger.error("Problems merging objects", e);
                        }
index c89359a..2ec3aae 100644 (file)
@@ -15,7 +15,7 @@ import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created 25.06.2009
  * @version 1.0
  */
-public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase> {
+public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
 
        /**
         * 
@@ -122,18 +122,18 @@ public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase>
 
        /** {@inheritDoc} */
        @Override
-       public ReferenceBase loadEntity(UUID entityUuid) {
+       public Reference loadEntity(UUID entityUuid) {
                List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"}); 
                return CdmStore.getReferenceService().load(entityUuid, propertyPaths);
        }
 
        /** {@inheritDoc} */
        public boolean delete(Object entity) {
-               return CdmStore.getReferenceService().delete((ReferenceBase) entity) != null;
+               return CdmStore.getReferenceService().delete((Reference) entity) != null;
        }
 
        /** {@inheritDoc} */
        public boolean save(Object entity) {
-               return CdmStore.getReferenceService().saveOrUpdate((ReferenceBase) entity) != null;
+               return CdmStore.getReferenceService().saveOrUpdate((Reference) entity) != null;
        }
 }
index 8497bd0..37f39ca 100644 (file)
@@ -61,7 +61,7 @@ Bundle-ClassPath: lib/activation-1.1.jar,
  lib/msbase-2000.3.jar,
  lib/mssqlserver-2000.3.jar,
  lib/msutil-2000.3.jar,
- lib/mysql-connector-java-3.1.14-bin.jar,
+ lib/mysql-connector-java-5.0.5.jar,
  lib/odfdom-0.8.jar,
  lib/opencsv-1.8.jar,
  lib/org.apache.commons.codec-1.3.0.jar,
@@ -105,14 +105,14 @@ Bundle-ClassPath: lib/activation-1.1.jar,
  lib/org.springframework.web.servlet-3.0.4.RELEASE.jar,
  lib/dozer-5.3.0.jar,
  lib/google-api-translate-java-0.92.jar,
- lib/cdmlib-commons-2.5.jar,
- lib/cdmlib-ext-2.5.jar,
- lib/cdmlib-io-2.5.jar,
- lib/cdmlib-model-2.5.jar,
- lib/cdmlib-persistence-2.5.jar,
- lib/cdmlib-print-2.5.jar,
- lib/cdmlib-remote-2.5.jar,
- lib/cdmlib-services-2.5.jar
+ lib/cdmlib-commons-3.0.jar,
+ lib/cdmlib-ext-3.0.jar,
+ lib/cdmlib-io-3.0.jar,
+ lib/cdmlib-model-3.0.jar,
+ lib/cdmlib-persistence-3.0.jar,
+ lib/cdmlib-print-3.0.jar,
+ lib/cdmlib-remote-3.0.jar,
+ lib/cdmlib-services-3.0.jar
 Export-Package: com.google.api,
  com.google.api.detect,
  com.google.api.translate,
index 7490d77..296b3ce 100644 (file)
@@ -1,13 +1,14 @@
 bin.includes = META-INF/,\\r
                lib/,\\r
-               lib/cdmlib-commons-2.5.jar,\\r
-               lib/cdmlib-ext-2.5.jar,\\r
-               lib/cdmlib-io-2.5.jar,\\r
-               lib/cdmlib-model-2.5.jar,\\r
-               lib/cdmlib-persistence-2.5.jar,\\r
-               lib/cdmlib-print-2.5.jar,\\r
-               lib/cdmlib-remote-2.5.jar,\\r
-               lib/cdmlib-services-2.5.jar\r
+               lib/cdmlib-commons-3.0.jar,\\r
+               lib/cdmlib-ext-3.0.jar,\\r
+               lib/cdmlib-io-3.0.jar,\\r
+               lib/cdmlib-model-3.0.jar,\\r
+               lib/cdmlib-persistence-3.0.jar,\\r
+               lib/cdmlib-print-3.0.jar,\\r
+               lib/cdmlib-remote-3.0.jar,\\r
+               lib/cdmlib-services-3.0.jar,\\r
+               lib/mysql-connector-java-5.0.5.jar\r
 jars.compile.order = cdmLibrary.jar\r
 src.includes = lib/\r
 jre.compilation.profile = J2SE-1.6\r
diff --git a/taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar b/taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar
deleted file mode 100644 (file)
index cd27e23..0000000
Binary files a/taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar and /dev/null differ
diff --git a/taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar b/taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar
new file mode 100644 (file)
index 0000000..af8ec67
Binary files /dev/null and b/taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar differ
index f1a4bd8..3ac0282 100644 (file)
       <extension
             point="org.eclipse.ui.handlers">
          <handler
-               class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteDescriptionHandler"
+               class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
                commandId="org.eclipse.ui.edit.delete">
             <activeWhen>
                <reference
                name="Create Description Element">
          </command>
          <command
-               defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.AddDescriptionHandler"
+               defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler"
                id="eu.etaxonomy.taxeditor.description.commands.adddescription"
                name="New Description">
          </command>
index 1771214..b4e6f36 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0
  */
 public class FilteredClassificationSelectionDialog extends
-               AbstractFilteredCdmResourceSelectionDialog<TaxonomicTree> {
+               AbstractFilteredCdmResourceSelectionDialog<Classification> {
                
        /**
         * <p>select</p>
@@ -38,7 +38,7 @@ public class FilteredClassificationSelectionDialog extends
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
-       public static TaxonomicTree select(Shell shell, ConversationHolder conversation) {
+       public static Classification select(Shell shell, ConversationHolder conversation) {
                FilteredClassificationSelectionDialog dialog = new FilteredClassificationSelectionDialog(shell, conversation,
                                "Choose a Classification", false, "", null);
                return getSelectionFromDialog(dialog);
@@ -55,7 +55,7 @@ public class FilteredClassificationSelectionDialog extends
         * @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
        protected FilteredClassificationSelectionDialog(Shell shell, ConversationHolder conversation, String title,
-                       boolean multi, String settings, TaxonomicTree classification) {
+                       boolean multi, String settings, Classification classification) {
                super(shell, conversation, title, multi, settings, classification);
        }
        
@@ -74,8 +74,8 @@ public class FilteredClassificationSelectionDialog extends
         */
        /** {@inheritDoc} */
        @Override
-       protected TaxonomicTree getPersistentObject(UUID cdmUuid) {
-               return CdmStore.getTaxonTreeService().getTaxonomicTreeByUuid(cdmUuid);
+       protected Classification getPersistentObject(UUID cdmUuid) {
+               return CdmStore.getClassificationService().getClassificationByUuid(cdmUuid);
        }
 
        /* (non-Javadoc)
@@ -84,7 +84,7 @@ public class FilteredClassificationSelectionDialog extends
        /** {@inheritDoc} */
        @Override
        protected void initModel() {
-               model = CdmStore.getTaxonTreeService().getUuidAndTitleCache();
+               model = CdmStore.getClassificationService().getUuidAndTitleCache();
        }
 
        /** {@inheritDoc} */
index d0c7aac..2e0e3f4 100644 (file)
@@ -15,7 +15,7 @@ import java.util.UUID;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceBaseDefaultCacheStrategy;
 import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.editor.newWizard.NewReferenceWizard;
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created 04.06.2009
  * @version 1.0
  */
-public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<ReferenceBase> {
+public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<Reference> {
        
        /**
         * <p>select</p>
@@ -38,9 +38,9 @@ public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourc
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
         */
-       public static ReferenceBase select(Shell shell, ConversationHolder conversation, ReferenceBase reference) {
+       public static Reference select(Shell shell, ConversationHolder conversation, Reference reference) {
                FilteredReferenceSelectionDialog dialog = new FilteredReferenceSelectionDialog(shell, conversation,
-                               "Choose a reference", false, (ReferenceBase) reference);
+                               "Choose a reference", false, (Reference) reference);
                return getSelectionFromDialog(dialog);
        }
 
@@ -54,7 +54,7 @@ public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourc
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param multi a boolean.
         */
-       protected FilteredReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, ReferenceBase reference) {
+       protected FilteredReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, Reference reference) {
                super(shell, conversation, title, multi, FilteredReferenceSelectionDialog.class.getCanonicalName(), null);
        }
        
@@ -64,7 +64,7 @@ public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourc
         */
        /** {@inheritDoc} */
        @Override
-       protected ReferenceBase getPersistentObject(UUID cdmUuid) {
+       protected Reference getPersistentObject(UUID cdmUuid) {
                return CdmStore.getReferenceService().load(cdmUuid);
        }
 
@@ -80,7 +80,7 @@ public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourc
 
        /** {@inheritDoc} */
        @Override
-       protected String getTitle(ReferenceBase cdmObject) {
+       protected String getTitle(Reference cdmObject) {
                if(cdmObject.getAuthorTeam() == null){
                        return super.getTitle(cdmObject);
                }else{
index 64f4cd9..6c241de 100644 (file)
@@ -19,8 +19,8 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -54,9 +54,9 @@ public class FilteredTaxonNodeSelectionDialog extends AbstractFilteredCdmResourc
 
        private Combo classificationSelectionCombo;
 
-       private List<TaxonomicTree> classifications;
+       private List<Classification> classifications;
        
-       private TaxonomicTree selectedClassification;
+       private Classification selectedClassification;
        
 
        /**
@@ -107,7 +107,7 @@ public class FilteredTaxonNodeSelectionDialog extends AbstractFilteredCdmResourc
                classificationSelectionCombo = new Combo(classificationSelection, SWT.BORDER | SWT.READ_ONLY);
                classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
                
-               for(TaxonomicTree tree : classifications){
+               for(Classification tree : classifications){
                        classificationSelectionCombo.add(tree.getName().getText(), classifications.indexOf(tree));
                }
                
@@ -132,7 +132,7 @@ public class FilteredTaxonNodeSelectionDialog extends AbstractFilteredCdmResourc
        /** {@inheritDoc} */
        @Override
        protected TaxonNode getPersistentObject(UUID uuid) {
-               return CdmStore.getTaxonTreeService().getTaxonNodeByUuid(uuid);
+               return CdmStore.getClassificationService().getTaxonNodeByUuid(uuid);
        }
 
        /* (non-Javadoc)
@@ -146,11 +146,11 @@ public class FilteredTaxonNodeSelectionDialog extends AbstractFilteredCdmResourc
                
                
                if(classifications == null){
-                       classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+                       classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
                        selectedClassification = classifications.iterator().next();
                }
                
-               model = CdmStore.getTaxonTreeService().getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByTaxonomicTree(selectedClassification);
+               model = CdmStore.getClassificationService().getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(selectedClassification);
        }
 
        /** {@inheritDoc} */
index 33d8af4..7bf0379 100644 (file)
@@ -181,7 +181,7 @@ public class TaxonEditorInput implements IEditorInput, IConversationEnabled, IPe
        ConversationHolder conversation = CdmStore.createConversation();
                
                TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
-               ITreeNode parentNode = CdmStore.getTaxonTreeService().getTreeNodeByUuid(parentNodeUuid);
+               ITreeNode parentNode = CdmStore.getClassificationService().getTreeNodeByUuid(parentNodeUuid);
                
                Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference());
                TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference(), null);
index dcea534..33a8a73 100644 (file)
@@ -49,7 +49,7 @@ public class TaxonEditorInputFactory implements IElementFactory {
         if(! CdmStore.isActive()){
                return null;
         }
-        if (taxonNodeUuid == null || CdmStore.getTaxonTreeService().getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
+        if (taxonNodeUuid == null || CdmStore.getClassificationService().getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
                EditorUtil.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid);
                return null;
         }
index 3c21e26..5abbf09 100644 (file)
@@ -32,7 +32,7 @@ import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.ext.ipni.IIpniService;
 import eu.etaxonomy.cdm.ext.ipni.IpniService;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -50,7 +50,7 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
                        .getLogger(ExternalReferenceServiceWizardPage.class);
        private ConversationHolder conversation;
        private CdmFormFactory formFactory;
-       private ReferenceBase entity;
+       private Reference entity;
        private Composite control;
        private ListViewer viewer;
        
@@ -65,7 +65,7 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
         */
-       protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, ReferenceBase entity) {
+       protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) {
                super("ExternalReferenceServiceWizardPage");
                this.formFactory = formFactory;
                this.entity = entity;
@@ -118,8 +118,8 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
                viewer.setLabelProvider(new LabelProvider(){
                        @Override
                        public String getText(Object element) {
-                               if(element instanceof ReferenceBase){
-                                       return ((ReferenceBase) element).getTitleCache();
+                               if(element instanceof Reference){
+                                       return ((Reference) element).getTitleCache();
                                }
                                return "Element is not a reference";
                        }
@@ -134,7 +134,7 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
        @Override
        public void widgetSelected(SelectionEvent e) {
                String query = text_query.getText();
-               List<ReferenceBase> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null);
+               List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null);
                viewer.setInput(publications);
        }
 
@@ -147,7 +147,7 @@ public class ExternalReferenceServiceWizardPage extends WizardPage implements Se
        public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
                
-               ReferenceBase selectedReference = (ReferenceBase) selection.getFirstElement();
+               Reference selectedReference = (Reference) selection.getFirstElement();
                if(selectedReference != null){
                        ((AbstractNewEntityWizard) getWizard()).setEntity(selectedReference);
                }
index 01ffbf7..c44e617 100644 (file)
@@ -10,9 +10,9 @@
 
 package eu.etaxonomy.taxeditor.editor.newWizard;
 
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
-import eu.etaxonomy.taxeditor.section.reference.ReferenceBaseWizardPage;
+import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -22,22 +22,22 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public class NewReferenceWizard extends AbstractNewEntityWizard<ReferenceBase> {
+public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
        
-       private ReferenceBaseWizardPage referenceBasePage;
+       private ReferenceWizardPage referencePage;
        
        /** {@inheritDoc} */
        @Override
        public void addPages() {
                // TODO disabling external service wizard page for now
 //             addPage(new ExternalReferenceServiceWizardPage(formFactory, getConversationHolder(), entity));
-               referenceBasePage = new ReferenceBaseWizardPage(formFactory, getConversationHolder(), entity);
-               addPage(referenceBasePage);
+               referencePage = new ReferenceWizardPage(formFactory, getConversationHolder(), entity);
+               addPage(referencePage);
        }
 
        /** {@inheritDoc} */
        @Override
-       protected ReferenceBase createNewEntity() {
+       protected Reference createNewEntity() {
                return ReferenceFactory.newGeneric();
        }
 
@@ -49,8 +49,8 @@ public class NewReferenceWizard extends AbstractNewEntityWizard<ReferenceBase> {
 
        /** {@inheritDoc} */
        @Override
-       public void setEntity(ReferenceBase entity) {
+       public void setEntity(Reference entity) {
                super.setEntity(entity);
-               referenceBasePage.getDetailElement().setEntity(entity);
+               referencePage.getDetailElement().setEntity(entity);
        }
 }
index 71a1eff..67a543b 100644 (file)
@@ -6,7 +6,6 @@ package eu.etaxonomy.taxeditor.editor.view.descriptive;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.ITreeContentProvider;
index 84e7ac6..c5232c2 100644 (file)
@@ -194,39 +194,44 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
        public boolean postOperation(CdmBase objectAffectedByOperation) {
                boolean result = super.postOperation(objectAffectedByOperation);
                
-               if(objectAffectedByOperation != null){
-                       
-                       if(objectAffectedByOperation instanceof DescriptionElementBase){
-                               DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation;
-                               FeatureNodeContainer container = getFeatureNodeContainerForDescriptionElement(descriptionElement);
-                               viewer.expandToLevel(container, 1);
-                       }
-                       
-                       StructuredSelection selection = new StructuredSelection(objectAffectedByOperation);
-                       viewer.setSelection(selection, true);
-               }
+//             if(objectAffectedByOperation != null){
+//                     
+//                     if(objectAffectedByOperation instanceof DescriptionElementBase){
+//                             DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation;
+//                             FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription());
+//                             FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement);
+////                           viewer.refresh(featureNodeContainer, true);
+//                             viewer.expandToLevel(featureNodeContainer, 1);
+//                     }
+//                     
+//                     StructuredSelection selection = new StructuredSelection(objectAffectedByOperation);
+//                     viewer.setSelection(selection, true);
+//             }else{
+////                   viewer.refresh();
+//             }
 
                return result;
        }
-       
-       /**
-        * 
-        * @param descriptionElement
-        * @return
-        */
-       private FeatureNodeContainer getFeatureNodeContainerForDescriptionElement(
-                       DescriptionElementBase descriptionElement) {
-               FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription());         
-               FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.getFeatureNodeContainerForDescriptionElement(descriptionElement);
-               return featureNodeContainer;
-       }
 
        /** {@inheritDoc} */
        @Override
        public void changed(Object object) {
-//             viewer.refresh(true);
-//             viewer.update(object, null);
-               viewer.refresh(object, true);
+               if(object instanceof DescriptionElementBase){
+                       DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
+                       FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription());
+                       FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement);
+                       viewer.refresh(featureNodeContainer, true);
+                       viewer.expandToLevel(featureNodeContainer, 1);
+                       
+               }else{
+                       viewer.refresh(true);
+               }
+               
+               if(object != null){
+                       StructuredSelection selection = new StructuredSelection(object);
+                       viewer.setSelection(selection, true);
+               }
+
                super.changed(object);
        }
 
@@ -33,7 +33,7 @@ import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled;
  * @created 11.08.2009
  * @version 1.0
  */
-public class AddDescriptionHandler extends AbstractHandler {
+public class CreateDescriptionHandler extends AbstractHandler {
        private static final Logger logger = Logger
                        .getLogger(CreateDescriptionElementHandler.class);
 
@@ -43,9 +43,9 @@ import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled;
  * @created Jun 22, 2010
  * @version 1.0
  */
-public class DeleteDescriptionHandler extends AbstractHandler {
+public class DeleteHandler extends AbstractHandler {
        private static final Logger logger = Logger
-                       .getLogger(DeleteDescriptionHandler.class);
+                       .getLogger(DeleteHandler.class);
 
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
index c843a45..4f90236 100644 (file)
@@ -24,7 +24,7 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
@@ -107,7 +107,7 @@ public class DetailsViewer extends AbstractCdmDataViewer {
                                createNameSections(rootElement);
                                currentViewPart = VIEW_PART.NAME;
                        }
-               }else if(getInput() instanceof ReferenceBase){
+               }else if(getInput() instanceof Reference){
                        if(currentViewPart != VIEW_PART.REFEERENCE){
                                createReferenceSections(rootElement);
                                currentViewPart = VIEW_PART.REFEERENCE;
index 1b32a03..acf04ca 100644 (file)
@@ -30,7 +30,6 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.IFormColors;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
@@ -108,10 +107,10 @@ import eu.etaxonomy.cdm.model.occurrence.DeterminationModifier;
 import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
 import eu.etaxonomy.cdm.model.occurrence.Specimen;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.forms.selection.AbstractSelectionElement;
@@ -1594,8 +1593,8 @@ public class CdmFormFactory extends FormToolkit{
                else if(entity instanceof Modifier){
                        element = new ModifierElement(this, parentElement, (Modifier) entity, removeListener, style);
                }
-               else if(entity instanceof ReferenceBase){
-                       element = new DescriptionSourceElement(this, parentElement, (ReferenceBase) entity, removeListener, style);
+               else if(entity instanceof Reference){
+                       element = new DescriptionSourceElement(this, parentElement, (Reference) entity, removeListener, style);
                }
                else if(entity instanceof NameTypeDesignation){
                        element = new NameTypeDesignationElement(this, parentElement, (NameTypeDesignation) entity, removeListener, style);
@@ -1684,7 +1683,7 @@ public class CdmFormFactory extends FormToolkit{
                        element = new NameSelectionElement(this, conversation, parentElement, labelString, (TaxonNameBase) entity, style);
                        break;
                case REFERENCE:
-                       element = new ReferenceSelectionElement(this, conversation, parentElement, labelString, (ReferenceBase) entity, style);
+                       element = new ReferenceSelectionElement(this, conversation, parentElement, labelString, (Reference) entity, style);
                        break;
                case TAXON_BASE:
                        element = new TaxonBaseSelectionElement(this, conversation, parentElement, labelString, (TaxonBase) entity, style);
@@ -1699,7 +1698,7 @@ public class CdmFormFactory extends FormToolkit{
                        element = new FeatureTreeSelectionElement(this, conversation, parentElement, labelString, (FeatureTree) entity, style);
                        break;
                case CLASSIFICATION:
-                       element = new ClassificationSelectionElement(this, conversation, parentElement, labelString, (TaxonomicTree) entity, style);
+                       element = new ClassificationSelectionElement(this, conversation, parentElement, labelString, (Classification) entity, style);
                        break;
                case TAXON_NODE:
                        element = new TaxonNodeSelectionElement(this, conversation, parentElement, labelString, (TaxonNode) entity, style);
index 2a4f379..ab1de7d 100644 (file)
@@ -13,13 +13,8 @@ package eu.etaxonomy.taxeditor.forms;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
 
-import org.apache.http.HttpEntity;
 import org.apache.http.HttpException;
-import org.apache.http.HttpResponse;
-import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -46,8 +41,6 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
  */
 public class ImageElement extends AbstractCdmFormElement implements PaintListener, ControlListener{
 
-       private static final Logger logger = Logger.getLogger(ImageElement.class);
-       
        private URI imageUri;
        private Image image;
        private Rectangle imageMaxBounds;
@@ -93,8 +86,6 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
        public void setImageUri(URI uri) {
                this.imageUri = uri;
                
-               logger.warn("Setting image uri" + imageUri);
-               
                if(imageUri != null){
                        
                        final Display display = Display.getCurrent();
@@ -109,16 +100,15 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                                display.asyncExec(new Runnable(){
                                                        @Override
                                                        public void run() {
-//                                                             EditorUtil.reflowDetailsViewer();
-                                                               getLayoutComposite().layout();
+                                                               EditorUtil.reflowDetailsViewer();
+//                                                             getLayoutComposite().layout();
                                                        }
                                                });
                                                return Status.OK_STATUS;
                                        }catch (IOException e) {
-                                               logger.error("Error reading image", e);
+                                               EditorUtil.error(getClass(), e);
                                        } catch (HttpException e) {
-                                               // TODO Auto-generated catch block
-                                               e.printStackTrace();
+                                               EditorUtil.error(getClass(), e);
                                        } 
                                        return Status.CANCEL_STATUS;
                                }                                       
@@ -185,6 +175,6 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
        /** {@inheritDoc} */
        @Override
        public void controlResized(ControlEvent e) {
-//             EditorUtil.reflowDetailsViewer();
+               EditorUtil.reflowDetailsViewer();
        }
 }
index b05a0a1..36e07db 100644 (file)
@@ -13,7 +13,6 @@ package eu.etaxonomy.taxeditor.forms;
 import org.eclipse.swt.events.ModifyEvent;
 
 import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 
 /**
  * <p>LanguageStringWithLabelElement class.</p>
@@ -91,11 +90,6 @@ public class LanguageStringWithLabelElement extends TextWithLabelElement {
         */
        public void setLanguageString(LanguageString languageString) {
                this.languageString = languageString;
-               if(languageString != null)      {
-                       super.setText(languageString.getText());
-               }else{
-                       super.setText("");
-                       EditorUtil.warn(getClass(), "LanguageString is null. This should not be the case.");
-               }
+               super.setText(languageString != null ? languageString.getText() : "");
        }
 }
index 4e1727c..eadc5db 100644 (file)
@@ -13,7 +13,7 @@ package eu.etaxonomy.taxeditor.forms.selection;
 import org.eclipse.swt.events.SelectionEvent;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredClassificationSelectionDialog;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
@@ -25,7 +25,7 @@ import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
  * @created Sep 27, 2010
  * @version 1.0
  */
-public class ClassificationSelectionElement extends AbstractSelectionElement<TaxonomicTree> {
+public class ClassificationSelectionElement extends AbstractSelectionElement<Classification> {
 
        /**
         * <p>Constructor for ClassificationSelectionElement.</p>
@@ -39,7 +39,7 @@ public class ClassificationSelectionElement extends AbstractSelectionElement<Tax
         */
        public ClassificationSelectionElement(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
-                       String labelString, TaxonomicTree entity, int style) {
+                       String labelString, Classification entity, int style) {
                super(formFactory, conversation, parentElement, labelString, entity,
                                false, false, true, style);
        }
@@ -50,7 +50,7 @@ public class ClassificationSelectionElement extends AbstractSelectionElement<Tax
        /** {@inheritDoc} */
        @Override
        public void widgetSelected(SelectionEvent e) {
-               TaxonomicTree newSelection = FilteredClassificationSelectionDialog.select(getShell(), getConversationHolder());
+               Classification newSelection = FilteredClassificationSelectionDialog.select(getShell(), getConversationHolder());
                setSelectionInternal(newSelection);
        }
 
index 69658fd..b8a1a25 100644 (file)
@@ -10,7 +10,6 @@
 
 package eu.etaxonomy.taxeditor.forms.selection;
 
-import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.jface.wizard.WizardDialog;
@@ -23,7 +22,7 @@ import eu.etaxonomy.cdm.model.agent.Team;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
@@ -31,7 +30,7 @@ import eu.etaxonomy.taxeditor.section.agent.PersonWizardPage;
 import eu.etaxonomy.taxeditor.section.agent.TeamWizardPage;
 import eu.etaxonomy.taxeditor.section.name.NonViralNameWizardPage;
 import eu.etaxonomy.taxeditor.section.occurrence.DerivedUnitFacadeWizardPage;
-import eu.etaxonomy.taxeditor.section.reference.ReferenceBaseWizardPage;
+import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage;
 
 /**
  * <p>EditFromSelectionWizard class.</p>
@@ -64,8 +63,8 @@ public class EditFromSelectionWizard extends Wizard implements SelectionListener
                CdmFormFactory formFactory = selectionElement.getFormFactory();
                IdentifiableEntity entity = (IdentifiableEntity) HibernateProxyHelper.deproxy(selectionElement.getEntity());
                
-               if(entity instanceof ReferenceBase){
-                       page = new ReferenceBaseWizardPage(formFactory, selectionElement.getConversationHolder(), (ReferenceBase) entity);
+               if(entity instanceof Reference){
+                       page = new ReferenceWizardPage(formFactory, selectionElement.getConversationHolder(), (Reference) entity);
                }
                else if(entity instanceof Team){
                        page = new TeamWizardPage(formFactory, selectionElement.getConversationHolder(), (Team) entity);
index a9bf03c..4ca1cbd 100644 (file)
@@ -6,7 +6,7 @@ package eu.etaxonomy.taxeditor.forms.selection;
 import org.eclipse.swt.events.SelectionEvent;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredReferenceSelectionDialog;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
@@ -18,7 +18,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author n.hofmann
  * @version $Id: $
  */
-public class ReferenceSelectionElement extends AbstractSelectionElement<ReferenceBase>{
+public class ReferenceSelectionElement extends AbstractSelectionElement<Reference>{
 
        /**
         * <p>Constructor for ReferenceSelectionElement.</p>
@@ -31,7 +31,7 @@ public class ReferenceSelectionElement extends AbstractSelectionElement<Referenc
         * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
         */
        public ReferenceSelectionElement(CdmFormFactory toolkit, ConversationHolder conversation, ICdmFormElement parentElement, String labelString,
-                       ReferenceBase selection, int style) {
+                       Reference selection, int style) {
                super(toolkit, conversation, parentElement, labelString, selection, true, true, true, style);
        }
 
@@ -40,9 +40,9 @@ public class ReferenceSelectionElement extends AbstractSelectionElement<Referenc
         */
        /** {@inheritDoc} */
        public void widgetSelected(SelectionEvent e) {
-               ReferenceBase newSelection = FilteredReferenceSelectionDialog.select(getShell(), getConversationHolder(), entity);
+               Reference newSelection = FilteredReferenceSelectionDialog.select(getShell(), getConversationHolder(), entity);
                
-               ReferenceBase freshlyLoadedSelection = null;
+               Reference freshlyLoadedSelection = null;
                if(newSelection != null)
                        freshlyLoadedSelection = CdmStore.getReferenceService().load(newSelection.getUuid());
                
index 3b280b2..46fc3dd 100644 (file)
@@ -13,9 +13,8 @@ package eu.etaxonomy.taxeditor.section.classification;
 import org.apache.log4j.Logger;
 import org.eclipse.swt.SWT;
 
-import eu.etaxonomy.cdm.model.common.IAnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
@@ -31,7 +30,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Sep 27, 2010
  * @version 1.0
  */
-public class ClassificationDetailElement extends AbstractCdmDetailElement<TaxonomicTree> {
+public class ClassificationDetailElement extends AbstractCdmDetailElement<Classification> {
 
 
        private static final Logger logger = Logger
@@ -60,7 +59,7 @@ public class ClassificationDetailElement extends AbstractCdmDetailElement<Taxono
        /** {@inheritDoc} */
        @Override
        protected void createControls(ICdmFormElement formElement,
-                       TaxonomicTree entity, int style) {
+                       Classification entity, int style) {
                text_treeLabel = formFactory.createTextWithLabelElement(formElement, "Label", entity != null ? entity.getTitleCache() : null, SWT.NULL);
                selection_reference = (ReferenceSelectionElement) formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), formElement, "Reference", entity != null ? entity.getReference() : null, SWT.NULL);
                text_microReference = formFactory.createTextWithLabelElement(formElement, "Reference Detail", entity != null ? entity.getMicroReference() : null, SWT.NULL);
index dbd9771..1110072 100644 (file)
@@ -14,7 +14,7 @@ import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.ISelectionProvider;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
@@ -27,7 +27,7 @@ import eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection;
  * @created Sep 27, 2010
  * @version 1.0
  */
-public class ClassificationDetailSection extends AbstractCdmDetailSection<TaxonomicTree> {
+public class ClassificationDetailSection extends AbstractCdmDetailSection<Classification> {
        
 
        private static final Logger logger = Logger
index 6ff8caf..afa8d7c 100644 (file)
@@ -15,7 +15,7 @@ import org.apache.log4j.Logger;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
  * @created 23.06.2009
  * @version 1.0
  */
-public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<TaxonomicTree>{
+public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<Classification>{
        private static final Logger logger = Logger
                        .getLogger(ClassificationWizardPage.class);
        
@@ -39,7 +39,7 @@ public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<Taxono
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param entity a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
-       public ClassificationWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, TaxonomicTree entity){
+       public ClassificationWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Classification entity){
                super(formFactory, conversation, entity);
                setTitle("Classification");
        }
@@ -61,7 +61,7 @@ public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<Taxono
         *
         * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
-       public TaxonomicTree getClassification() {
+       public Classification getClassification() {
                return getDetailElement().getEntity();
        }
 }
index 3e28f09..f6381d1 100644 (file)
 
 package eu.etaxonomy.taxeditor.section.classification;
 
-import org.apache.log4j.Logger;
-
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
 import eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent;
@@ -26,8 +23,8 @@ import eu.etaxonomy.taxeditor.forms.CheckboxElement;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.forms.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.forms.selection.ClassificationSelectionElement;
-import eu.etaxonomy.taxeditor.forms.selection.TaxonNodeSelectionElement;
 import eu.etaxonomy.taxeditor.forms.selection.TaxonBaseSelectionElement;
+import eu.etaxonomy.taxeditor.forms.selection.TaxonNodeSelectionElement;
 import eu.etaxonomy.taxeditor.parser.ParseHandler;
 import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
 
@@ -40,12 +37,9 @@ import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
  */
 public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode> {
 
-       private static final Logger logger = Logger
-                       .getLogger(TaxonNodeDetailElement.class);
-       
        private ClassificationSelectionElement selection_classification;
        
-       private TaxonomicTree classification;
+       private Classification classification;
        
        private TaxonNodeSelectionElement selection_parentTaxonNode;
        
@@ -124,7 +118,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode>
         *
         * @return the classification
         */
-       public TaxonomicTree getClassification() {
+       public Classification getClassification() {
                return classification;
        }
 
@@ -158,7 +152,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode>
        /**
         * @param classification the classification to set
         */
-       private void setClassification(TaxonomicTree classification) {
+       private void setClassification(Classification classification) {
                this.classification = classification;
                setParentTreeNode(classification);
        }
@@ -169,11 +163,11 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode>
        private void setParentTreeNode(ITreeNode parentTreeNode) {
                this.parentTreeNode = parentTreeNode;
 
-               if(parentTreeNode instanceof TaxonomicTree){
+               if(parentTreeNode instanceof Classification){
                        selection_parentTaxonNode.setEntity(null);
                }
                else if(parentTreeNode instanceof TaxonNode){
-                       classification = ((TaxonNode) parentTreeNode).getTaxonomicTree();
+                       classification = ((TaxonNode) parentTreeNode).getClassification();
                        selection_classification.setEntity(classification);
                        selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode);
                }               
@@ -188,10 +182,10 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode>
        
        private void setTaxon(String taxonNameString){
                TaxonNameBase taxonName = ParseHandler.quickParse(taxonNameString);
-               ReferenceBase secundum = null;
+               Reference secundum = null;
                if(getParentTreeNode() != null){
-                       if(getParentElement() instanceof TaxonomicTree){
-                               secundum = ((TaxonomicTree) getParentTreeNode()).getReference();
+                       if(getParentElement() instanceof Classification){
+                               secundum = ((Classification) getParentTreeNode()).getReference();
                        }
                        else if(getParentTreeNode() instanceof TaxonNode){
                                secundum = ((TaxonNode) getParentTreeNode()).getTaxon().getSec();
index 394fa29..a4efaec 100644 (file)
@@ -13,11 +13,11 @@ package eu.etaxonomy.taxeditor.section.description;
 import org.apache.log4j.Logger;
 import org.eclipse.swt.events.SelectionListener;
 
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.forms.AbstractFormSection;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
+import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.forms.selection.ReferenceSelectionElement;
 import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement;
 
@@ -28,7 +28,7 @@ import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement;
  * @created Mar 18, 2010
  * @version 1.0
  */
-public class DescriptionSourceElement extends AbstractEntityCollectionElement<ReferenceBase> {
+public class DescriptionSourceElement extends AbstractEntityCollectionElement<Reference> {
 
 
        private static final Logger logger = Logger
@@ -45,7 +45,7 @@ public class DescriptionSourceElement extends AbstractEntityCollectionElement<Re
         * @param style a int.
         */
        public DescriptionSourceElement(CdmFormFactory cdmFormFactory,
-                       AbstractFormSection formElement, ReferenceBase element,
+                       AbstractFormSection formElement, Reference element,
                        SelectionListener removeListener, int style) {
                super(cdmFormFactory, formElement, element, removeListener, null, style);
                // TODO Auto-generated constructor stub
@@ -59,7 +59,7 @@ public class DescriptionSourceElement extends AbstractEntityCollectionElement<Re
 
        /** {@inheritDoc} */
        @Override
-       public void setEntity(ReferenceBase element) {
+       public void setEntity(Reference element) {
                selection_descriptionSource.setEntity(element);
        }
 
index 9c824ca..4f2d8b8 100644 (file)
@@ -12,11 +12,9 @@ package eu.etaxonomy.taxeditor.section.description;
 
 import java.util.Collection;
 
-import org.apache.log4j.Logger;
-
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
@@ -30,9 +28,7 @@ import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection;
  * @version 1.0
  */
 public class DescriptionSourceSection extends
-               AbstractEntityCollectionSection<DescriptionBase, ReferenceBase>{
-       private static final Logger logger = Logger
-                       .getLogger(DescriptionSourceSection.class);
+               AbstractEntityCollectionSection<DescriptionBase, Reference>{
        
        /**
         * <p>Constructor for DescriptionSourceSection.</p>
@@ -51,19 +47,19 @@ public class DescriptionSourceSection extends
 
        /** {@inheritDoc} */
        @Override
-       public void addElement(ReferenceBase element) {
+       public void addElement(Reference element) {
                getEntity().addDescriptionSource(element);
        }
 
        /** {@inheritDoc} */
        @Override
-       public ReferenceBase createNewElement() {
+       public Reference createNewElement() {
                return new ReferenceFactory().newGeneric();
        }
 
        /** {@inheritDoc} */
        @Override
-       public Collection<ReferenceBase> getCollection(DescriptionBase entity) {
+       public Collection<Reference> getCollection(DescriptionBase entity) {
                return entity.getDescriptionSources();
        }
 
@@ -81,7 +77,7 @@ public class DescriptionSourceSection extends
 
        /** {@inheritDoc} */
        @Override
-       public void removeElement(ReferenceBase element) {
+       public void removeElement(Reference element) {
                getEntity().removeDescriptionSource(element);
        }
 }
index b08d433..6bdf5f4 100644 (file)
 
 package eu.etaxonomy.taxeditor.section.name;
 
+import java.net.URI;
+import java.net.URISyntaxException;
+
 import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.forms.AbstractFormSection;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
@@ -89,7 +93,7 @@ public class ProtologueElement extends AbstractEntityCollectionElement<Descripti
                
                mediaRepresentationPart = mediaRepresentation.getParts().iterator().next();
                                
-               protologueUriText.setText(mediaRepresentationPart.getUri());
+               protologueUriText.setText(mediaRepresentationPart.getUri().toString());
        }
        
        /* (non-Javadoc)
@@ -112,7 +116,11 @@ public class ProtologueElement extends AbstractEntityCollectionElement<Descripti
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == protologueUriText){
-                       mediaRepresentationPart.setUri(protologueUriText.getText());
+                       try {
+                               mediaRepresentationPart.setUri(new URI(protologueUriText.getText()));
+                       } catch (URISyntaxException e) {
+                               EditorUtil.warningDialog("Could not parse URI", getClass(), e.getMessage());
+                       }
                }       
        }
 }
index dd2f2b0..6f1c276 100644 (file)
@@ -92,7 +92,12 @@ public class DerivedUnitBaseDetailElement extends AbstractCdmDetailElement<Deriv
                
                text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", facade.getBarcode(), style);
                
-               text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", facade.getExsiccatum(), style);              
+               try {
+                       text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", facade.getExsiccatum(), style);
+               } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+                       // we ignore this
+                       EditorUtil.info(e.getMessage());
+               }               
                // source
                selection_collection = (CollectionSelectionElement) formFactory.createSelectionElement(SelectionType.COLLECTION, getConversationHolder(), formElement, "Collection", facade.getCollection(), style);
                
index 19852c8..40728cd 100644 (file)
@@ -14,11 +14,11 @@ import org.apache.log4j.Logger;
 
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
+import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.forms.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
 import eu.etaxonomy.taxeditor.forms.selection.ReferenceSelectionElement;
 import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
 
@@ -55,7 +55,7 @@ public class NomenclaturalReferenceDetailElement extends
        protected void createControls(ICdmFormElement formElement, TaxonNameBase entity, int style) {
                selection_nomenclaturalReference = (ReferenceSelectionElement) 
                                formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(),
-                                               formElement, "Reference", (ReferenceBase) entity.getNomenclaturalReference(), style);
+                                               formElement, "Reference", (Reference) entity.getNomenclaturalReference(), style);
                text_referenceDetail = formFactory.createTextWithLabelElement(formElement, "Reference Detail", entity.getNomenclaturalMicroReference(), style);
        }
        
index 1febf17..4082aaf 100644 (file)
@@ -19,8 +19,7 @@ import org.eclipse.swt.SWT;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Institution;
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.cdm.model.reference.Generic;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
 import eu.etaxonomy.cdm.model.reference.ReferenceType;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
@@ -46,7 +45,7 @@ import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
  * @created Mar 2, 2010
  * @version 1.0
  */
-public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<ReferenceBase> implements IErrorIntolerableElement, IExceptionHandler {
+public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Reference> implements IErrorIntolerableElement, IExceptionHandler {
        
        // property holder
        private ToggleableTextElement toggleable_cache;
@@ -66,7 +65,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
        private TextWithLabelElement text_uri;
        private AbstractSelectionElement<AgentBase> selection_authorTeam;
        private TimePeriodElement element_timePeriod;
-       private AbstractSelectionElement<ReferenceBase> selection_inReference;
+       private AbstractSelectionElement<Reference> selection_inReference;
        private AbstractSelectionElement<Institution> selection_institution;
        private ReferenceTypeComboElement combo_referenceType;
 
@@ -91,7 +90,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
         */
        /** {@inheritDoc} */
        @Override
-       protected void createControls(ICdmFormElement formElement, ReferenceBase entity, int style) {
+       protected void createControls(ICdmFormElement formElement, Reference entity, int style) {
                toggleable_cache = formFactory.createToggleableTextField(formElement, "Reference Cache", entity.getTitleCache(), entity.isProtectedTitleCache(), style);
                
                combo_referenceType = (ReferenceTypeComboElement) formFactory.createEnumComboElement(EnumComboType.REFERENCETYPE, formElement, style);
@@ -157,7 +156,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
         * @param listener
         * @param style
         */
-       private void createGenericControls(ICdmFormElement element, ReferenceBase reference, int style){
+       private void createGenericControls(ICdmFormElement element, Reference reference, int style){
                //editor
                text_editor = formFactory.createTextWithLabelElement(element, "Editor", reference.getEditor(), style);
                
@@ -180,7 +179,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
         * @param listener
         * @param style
         */
-       private void createPublicationControls(ICdmFormElement element, ReferenceType referenceType, ReferenceBase reference, int style){
+       private void createPublicationControls(ICdmFormElement element, ReferenceType referenceType, Reference reference, int style){
 
                // placePublished
                text_placePublished = formFactory.createTextWithLabelElement(element, "Place Published", reference.getPlacePublished(), style);
@@ -216,7 +215,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
         * @param reference 
         * @param style
         */
-       private void createSectionControls(ICdmFormElement element, ReferenceBase reference, int style){
+       private void createSectionControls(ICdmFormElement element, Reference reference, int style){
                
                // in reference
                if(reference.getType() == ReferenceType.BookSection || reference.getType() == ReferenceType.InProceedings){
@@ -240,7 +239,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
         * @param reference 
         * @param style
         */
-       private void createVolumeControls(ICdmFormElement element, ReferenceBase reference, int style){
+       private void createVolumeControls(ICdmFormElement element, Reference reference, int style){
                if(reference.getType() == ReferenceType.Article){
                        selection_inReference = formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), element, "Journal", reference.getInReference(), style);
                }
@@ -258,9 +257,9 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
         * @param reference 
         * @param style
         */
-       private void createPrintedUnitControls(ICdmFormElement element, ReferenceType referenceType, ReferenceBase reference, int style){
+       private void createPrintedUnitControls(ICdmFormElement element, ReferenceType referenceType, Reference reference, int style){
                // in series
-               selection_inSeries = (ReferenceSelectionElement) formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), element, "In Series", (ReferenceBase) reference.getInSeries(), style);
+               selection_inSeries = (ReferenceSelectionElement) formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), element, "In Series", (Reference) reference.getInSeries(), style);
                
                //editor
                text_editor = formFactory.createTextWithLabelElement(element, "Editor", reference.getEditor(), style);
@@ -278,7 +277,7 @@ public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Referen
        }
        
        private void createUriAndAbstract(ICdmFormElement element,
-                       ReferenceBase reference, int style) {
+                       Reference reference, int style) {
                // uri
                text_uri = formFactory.createTextWithLabelElement(element, "URI", reference.getUri(), style);
                // abstract
index 79c1cd0..2f34e7a 100644 (file)
@@ -16,12 +16,12 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.section.ITaxonDetailSection;
 
@@ -32,7 +32,7 @@ import eu.etaxonomy.taxeditor.section.ITaxonDetailSection;
  * @created 05.06.2009
  * @version 1.0
  */
-public class ReferenceBaseDetailSection extends AbstractCdmDetailSection<ReferenceBase> implements ITaxonDetailSection{
+public class ReferenceBaseDetailSection extends AbstractCdmDetailSection<Reference> implements ITaxonDetailSection{
 
 
        private static final Logger logger = Logger
@@ -61,7 +61,7 @@ public class ReferenceBaseDetailSection extends AbstractCdmDetailSection<Referen
        public void setTaxon(TaxonBase entity) {
                NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
                
-               ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+               Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
                
                setEntity(reference);
        }
@@ -13,7 +13,7 @@ package eu.etaxonomy.taxeditor.section.reference;
 import org.eclipse.swt.SWT;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public class ReferenceBaseWizardPage extends AbstractCdmEntityWizardPage<ReferenceBase> implements IExceptionHandler{
+public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference> implements IExceptionHandler{
 
        /**
         * <p>Constructor for ReferenceBaseWizardPage.</p>
@@ -38,7 +38,7 @@ public class ReferenceBaseWizardPage extends AbstractCdmEntityWizardPage<Referen
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
         */
-       public ReferenceBaseWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, ReferenceBase entity) {
+       public ReferenceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) {
                super(formFactory, conversation, entity);
                setTitle("Reference");
        }
index 6069ea5..4507b9e 100644 (file)
@@ -15,7 +15,6 @@ import java.net.URI;
 import java.net.URISyntaxException;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
 import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.common.mediaMetaData.ImageMetaData;
@@ -24,10 +23,9 @@ import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.forms.AbstractFormSection;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
-import eu.etaxonomy.taxeditor.forms.BrowserElement;
 import eu.etaxonomy.taxeditor.forms.ImageElement;
-import eu.etaxonomy.taxeditor.forms.NumberWithLabelElement;
 import eu.etaxonomy.taxeditor.forms.KeyValueViewerElement;
+import eu.etaxonomy.taxeditor.forms.NumberWithLabelElement;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -41,7 +39,6 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
 
        private NumberWithLabelElement text_height;
        private NumberWithLabelElement text_width;
-       private BrowserElement element_browser;
        private KeyValueViewerElement element_keyValue;
        private ImageElement element_image;
        
@@ -69,7 +66,6 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
                text_height.setEnabled(false);
                text_width = formFactory.createIntegerTextWithLabelElement(formElement, "Width", null, style);
                text_width.setEnabled(false);
-//             element_browser = formFactory.createBrowserElement(formElement, null, style);
                element_image = formFactory.createImageElement(formElement, null, style);
                
                element_keyValue = formFactory.createKeyValueViewerElement(formElement, "Key", "Value", null);
@@ -79,24 +75,25 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
        @Override
        public void setEntity(ImageFile entity) {
                this.entity = entity;
-               text_uri.setText(entity.getUri());
+               if(entity.getUri() != null){
+                       text_uri.setText(entity.getUri().toString());
+               }               
                if(entity.getSize() != null){
                        text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize()));
                }
                text_height.setInteger(entity.getHeight());
                text_width.setInteger(entity.getWidth());
-               
+
                showImage(entity.getUri());
        }
        
-       private void showImage(String uriString){
-               if(uriString == null){
+       private void showImage(URI uri){
+               if(uri == null){
                        return;
                }
                try {
-                       URI imageUri = new URI(uriString);
                        
-                       Integer size = CdmStore.getMediaService().getImageSize(imageUri, 10000);
+                       Integer size = CdmStore.getMediaService().getImageSize(uri, 10000);
                        
                        if(size != null){
                                text_size.setText(FileUtils.byteCountToDisplaySize(size));
@@ -107,7 +104,7 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
                        ImageMetaData imageInfo;
                        try {
                                
-                               imageInfo = CdmStore.getMediaService().getImageInfo(imageUri, 10000);
+                               imageInfo = CdmStore.getMediaService().getImageInfo(uri, 10000);
                                        
                                text_height.setInteger(imageInfo.getHeight());
                                getEntity().setHeight(imageInfo.getHeight());
@@ -116,15 +113,12 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
                                getEntity().setWidth(imageInfo.getWidth());
                                element_keyValue.setInput(imageInfo.getMetaData());
                                
-//                             element_browser.setImageUri(imageUri);
-                               element_image.setImageUri(imageUri);
+                               element_image.setImageUri(uri);
                                
                        } catch (IOException e) {
                                EditorUtil.error(getClass(), e);
                        }
-               } catch (URISyntaxException e) {
-                       EditorUtil.info("Image Uri is not valid");
-               } catch (Exception e) {
+               }  catch (Exception e) {
                        EditorUtil.error(getClass(), "Image could not be shown: ", e);
                }
        }
@@ -137,7 +131,11 @@ public class ImageFileElement extends AbstractMediaRepresentationPartElement<Ima
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == text_uri){
-                       getEntity().setUri(text_uri.getText());
+                       try {
+                               getEntity().setUri(new URI(text_uri.getText()));
+                       } catch (URISyntaxException e) {
+                               EditorUtil.warningDialog("Could not parse URI", getClass(), e.getMessage());
+                       }
                        showImage(getEntity().getUri());
                }
        }
index 4e40eaf..7123a8f 100644 (file)
          point="org.eclipse.ui.navigator.navigatorContent">
       <navigatorContent
             contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationContentProvider"
-            id="eu.etaxonomy.taxeditor.navigation.taxonomictreecontent"
+            id="eu.etaxonomy.taxeditor.navigation.classificationContent"
             labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationLabelProvider"
-            name="Taxonomic Tree">
+            name="Classification">
          <triggerPoints>
             <instanceof
                   value="eu.etaxonomy.taxeditor.navigation.navigator.Root">
       </navigatorContent>
       <navigatorContent
             contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeContentProvider"
-            id="eu.etaxonomy.taxeditor.navigation.taxoncontent"
+            id="eu.etaxonomy.taxeditor.navigation.taxonNodeContent"
             labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeLabelProvider"
-            name="Taxon">
+            name="TaxonNode">
          <triggerPoints>
             <or>
                <instanceof
       <navigatorContent
             activeByDefault="false"
             contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymContentProvider"
-            id="eu.etaxonomy.taxeditor.navigation.synonymcontent"
+            id="eu.etaxonomy.taxeditor.navigation.synonymContent"
             labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymLabelProvider"
             name="Synonyms (experimental)"
             priority="highest">
       <viewerContentBinding viewerId="eu.etaxonomy.taxeditor.navigation.navigator">
          <includes>
             <contentExtension
-                  pattern="eu.etaxonomy.taxeditor.navigation.taxonomictreecontent">
+                  pattern="eu.etaxonomy.taxeditor.navigation.classificationContent">
             </contentExtension>
-            <contentExtension pattern="eu.etaxonomy.taxeditor.navigation.taxoncontent"/>
+            <contentExtension pattern="eu.etaxonomy.taxeditor.navigation.taxonNodeContent"/>
             <contentExtension pattern="eu.etaxonomy.taxeditor.navigation.taxonlinkhelper"/>
             <contentExtension
-                  pattern="eu.etaxonomy.taxeditor.navigation.synonymcontent">
+                  pattern="eu.etaxonomy.taxeditor.navigation.synonymContent">
             </contentExtension>
          </includes>
       </viewerContentBinding>
index 2cc7270..957e42a 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.wizard.ClassificationWizard;
 
@@ -49,8 +49,8 @@ public class EditHandler extends AbstractHandler implements IHandler{
                if(selection instanceof StructuredSelection){
                        final StructuredSelection structuredSelection = (StructuredSelection) selection;
                        
-                       if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof TaxonomicTree){
-                               ClassificationWizard classificationWizard = new ClassificationWizard((TaxonomicTree) structuredSelection.getFirstElement());
+                       if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof Classification){
+                               ClassificationWizard classificationWizard = new ClassificationWizard((Classification) structuredSelection.getFirstElement());
                                
                                WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), classificationWizard);
                                dialog.open();
index 5a5afa4..ea6b996 100644 (file)
@@ -14,6 +14,8 @@ import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
+import eu.etaxonomy.cdm.model.taxon.Classification;
+
 /**
  * <p>ClassificationContentProvider class.</p>
  *
@@ -32,7 +34,10 @@ public class ClassificationContentProvider implements ITreeContentProvider {
        public Object[] getChildren(Object parentElement) {
                if (parentElement instanceof Root) {
                        return ((Root) parentElement).getParentBeans().toArray();
+               }else if(parentElement instanceof Classification){
+                       return ((Classification) parentElement).getChildNodes().toArray();
                }
+               
 
                return new Object[0];
        }
index 287dad6..76f8bc0 100644 (file)
@@ -12,13 +12,13 @@ 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;
 
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 
 /**
  * <p>ClassificationLabelProvider class.</p>
@@ -47,8 +47,8 @@ implements ILabelProvider, IDescriptionProvider, IStyledLabelProvider {
        /** {@inheritDoc} */
        @Override
        public String getText(Object element) {
-               if(element instanceof TaxonomicTree){
-                       String text = ((TaxonomicTree) element).getName().getText();
+               if(element instanceof Classification){
+                       String text = ((Classification) element).getName().getText();
                        return text != null ? text : "Unnamed Taxonomic Tree";
                }
                return new String();
@@ -59,8 +59,8 @@ implements ILabelProvider, IDescriptionProvider, IStyledLabelProvider {
         */
        /** {@inheritDoc} */
        public String getDescription(Object anElement) {
-               if (anElement instanceof TaxonomicTree) {
-                       return "Taxonomic Tree: " +  ((TaxonomicTree) anElement).getTitleCache(); //$NON-NLS-1$
+               if (anElement instanceof Classification) {
+                       return "Taxonomic Tree: " +  ((Classification) anElement).getTitleCache(); //$NON-NLS-1$
                }
                return null;
        }
index d8c7d01..7618d3c 100644 (file)
@@ -13,7 +13,7 @@ package eu.etaxonomy.taxeditor.navigation.navigator;
 import java.util.ArrayList;
 import java.util.List;
 
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 
 /**
  * <p>EmptyRoot class.</p>
@@ -36,8 +36,8 @@ public class EmptyRoot extends Root {
         *
         * @return a {@link java.util.List} object.
         */
-       public List<TaxonomicTree> getParentBeans() {
-               return new ArrayList<TaxonomicTree>();
+       public List<Classification> getParentBeans() {
+               return new ArrayList<Classification>();
        }
        
 }
index fffd953..ffbb5b8 100644 (file)
@@ -20,7 +20,7 @@ import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IPersistableElement;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -50,12 +50,12 @@ public class Root extends PlatformObject implements IAdaptable, IPersistableElem
         *
         * @return a {@link java.util.List} object.
         */
-       public List<TaxonomicTree> getParentBeans() {
-               List<TaxonomicTree> classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+       public List<Classification> getParentBeans() {
+               List<Classification> classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
                
                if(classifications.size() == 0){
                        CdmStore.createDefaultClassification(conversation);
-                       classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+                       classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
                }
                
                return classifications; 
index 5cf1a06..4941133 100644 (file)
@@ -188,10 +188,10 @@ public class TaxonNavigator extends CommonNavigator implements IPostOperationEna
                if(string.length() == 0) return null; 
                
                for (String uuid : string.split(" ")) {
-                       CdmBase cdmBaseObject = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(UUID.fromString(uuid));
+                       CdmBase cdmBaseObject = CdmStore.getClassificationService().getTaxonNodeByUuid(UUID.fromString(uuid));
                        if (cdmBaseObject == null) {
                                // is this a tree uuid?
-                               cdmBaseObject = CdmStore.getTaxonTreeService().getTaxonomicTreeByUuid(UUID.fromString(uuid));
+                               cdmBaseObject = CdmStore.getClassificationService().getClassificationByUuid(UUID.fromString(uuid));
                                
                                if(cdmBaseObject == null) return null;
                        }
index f688d63..a2199b4 100644 (file)
@@ -9,9 +9,9 @@ package eu.etaxonomy.taxeditor.navigation.navigator;
 
 import org.eclipse.core.expressions.PropertyTester;
 
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 public class TaxonNodePropertyTester extends PropertyTester {
        
        private static final Object HAS_SYNONYMS = "hasSynonyms";
@@ -27,8 +27,8 @@ public class TaxonNodePropertyTester extends PropertyTester {
                        }
                }
 
-               if (receiver instanceof TaxonomicTree && HAS_TAXA.equals(property)) {
-                       TaxonomicTree taxononomicTree = (TaxonomicTree) receiver;
+               if (receiver instanceof Classification && HAS_TAXA.equals(property)) {
+                       Classification taxononomicTree = (Classification) receiver;
                        return taxononomicTree.getChildNodes().size() > 0;
                }
                
index 06da0a5..beebcc7 100644 (file)
@@ -19,7 +19,7 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
@@ -42,7 +42,7 @@ public class ClassificationWizard extends Wizard implements INewWizard, IPostOpe
 
        private ClassificationWizardPage page;
        
-       private TaxonomicTree classification;
+       private Classification classification;
 
        private ConversationHolder conversation;
        
@@ -59,10 +59,10 @@ public class ClassificationWizard extends Wizard implements INewWizard, IPostOpe
         *
         * @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
-       public ClassificationWizard(TaxonomicTree classification){
+       public ClassificationWizard(Classification classification){
                this();
                setWindowTitle("Edit Entity");
-               this.classification = CdmStore.getTaxonTreeService().load(classification.getUuid());
+               this.classification = CdmStore.getClassificationService().load(classification.getUuid());
        }
        
        /* (non-Javadoc)
index 394e565..2abc41d 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
@@ -42,7 +42,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class ClassificationWizardPage extends WizardPage implements IPropertyChangeListener, IConversationEnabled {
        private static final Logger logger = Logger
                        .getLogger(ClassificationWizardPage.class);
-       private TaxonomicTree classification;
+       private Classification classification;
        
        private ConversationHolder conversation;
        private CdmFormFactory formFactory;
@@ -57,7 +57,7 @@ public class ClassificationWizardPage extends WizardPage implements IPropertyCha
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         * @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
-       protected ClassificationWizardPage(ConversationHolder conversation, TaxonomicTree classification){
+       protected ClassificationWizardPage(ConversationHolder conversation, Classification classification){
                super("Classification");
                this.setTitle("Classification");
                this.setDescription(classification == null ? "Create a new Classification." : "Edit Classification.");
@@ -97,7 +97,7 @@ public class ClassificationWizardPage extends WizardPage implements IPropertyCha
 
        private void initialize() {
                if(classification == null){
-                       classification = TaxonomicTree.NewInstance(null, null, CdmStore.getDefaultLanguage());
+                       classification = Classification.NewInstance(null, null, CdmStore.getDefaultLanguage());
                }
        }
        
@@ -141,7 +141,7 @@ public class ClassificationWizardPage extends WizardPage implements IPropertyCha
         *
         * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
         */
-       public TaxonomicTree getClassification() {
+       public Classification getClassification() {
                return classification;
        }
 
index c911b0c..2c962df 100644 (file)
@@ -12,9 +12,9 @@ import org.eclipse.ui.IWorkbench;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
@@ -73,8 +73,8 @@ public class NewTaxonNodeWizard extends Wizard implements INewWizard, IPostOpera
                        if(selectedObject instanceof ITreeNode){
                                ITreeNode treeNode = (ITreeNode) selectedObject;
                                
-                               if(treeNode instanceof TaxonomicTree){
-                                       return CdmStore.getTaxonTreeService().load(treeNode.getUuid());
+                               if(treeNode instanceof Classification){
+                                       return CdmStore.getClassificationService().load(treeNode.getUuid());
                                }
                                else if(treeNode instanceof TaxonNode){
                                        return CdmStore.getTaxonNodeService().load(treeNode.getUuid());
index 817f1fd..555b5b6 100644 (file)
@@ -21,13 +21,13 @@ import org.eclipse.swt.widgets.Display;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
@@ -57,7 +57,7 @@ public class NewTaxonNodeWizardPage extends WizardPage implements IPropertyChang
        private CdmFormFactory formFactory;
        private NameSelectionElement selection_reuseExistingName;
        private ITreeNode parentTreeNode;
-       private TaxonomicTree classification;
+       private Classification classification;
        private Taxon taxon;
        private boolean openInEditor = true;
        private ConversationHolder conversation;
@@ -164,7 +164,7 @@ public class NewTaxonNodeWizardPage extends WizardPage implements IPropertyChang
        /**
         * @param classification the classification to set
         */
-       private void setClassification(TaxonomicTree classification) {
+       private void setClassification(Classification classification) {
                this.classification = classification;
                setParentTreeNode(classification);
        }
@@ -180,13 +180,13 @@ public class NewTaxonNodeWizardPage extends WizardPage implements IPropertyChang
                
                this.parentTreeNode = parentTreeNode;
 
-               if(parentTreeNode instanceof TaxonomicTree){
-                       classification = (TaxonomicTree) parentTreeNode;
+               if(parentTreeNode instanceof Classification){
+                       classification = (Classification) parentTreeNode;
                        selection_classification.setEntity(classification);
                        selection_parentTaxonNode.setEntity(null);
                }
                else if(parentTreeNode instanceof TaxonNode){
-                       classification = ((TaxonNode) parentTreeNode).getTaxonomicTree();
+                       classification = ((TaxonNode) parentTreeNode).getClassification();
                        selection_classification.setEntity(classification);
                        selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode);
                }               
@@ -206,10 +206,10 @@ public class NewTaxonNodeWizardPage extends WizardPage implements IPropertyChang
        }               
                
        private void setTaxon(TaxonNameBase taxonName){
-               ReferenceBase secundum = null;
+               Reference secundum = null;
                if(getParentTreeNode() != null){
-                       if(getParentTreeNode() instanceof TaxonomicTree){
-                               secundum = ((TaxonomicTree) getParentTreeNode()).getReference();
+                       if(getParentTreeNode() instanceof Classification){
+                               secundum = ((Classification) getParentTreeNode()).getReference();
                        }
                        else if(getParentTreeNode() instanceof TaxonNode){
                                secundum = ((TaxonNode) getParentTreeNode()).getTaxon().getSec();
index e127bd4..df9826b 100644 (file)
@@ -10,7 +10,6 @@
 
 package eu.etaxonomy.taxeditor.io;
 
-import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -36,9 +35,7 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class ExportHandler extends AbstractIOHandler<IExportConfigurator>{
-       private static final Logger logger = Logger
-                       .getLogger(ExportHandler.class);
-
+       
        /**
         * 
         * @param applicationController
@@ -88,7 +85,7 @@ public class ExportHandler extends AbstractIOHandler<IExportConfigurator>{
                                monitor.worked(10);
                                
                                CdmDefaultExport<IExportConfigurator> exporter = new CdmDefaultExport<IExportConfigurator>();
-                               configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
+                               configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateSubMonitor(monitor, 80));
                                exporter.setCdmAppController(applicationController);
                                monitor.worked(10);
                                
index a51db5c..ab6abcb 100644 (file)
@@ -10,7 +10,6 @@
 
 package eu.etaxonomy.taxeditor.io;
 
-import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -42,9 +41,6 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  */
 public class ImportHandler extends AbstractIOHandler<IImportConfigurator> {
 
-       private static final Logger logger = Logger
-                       .getLogger(ImportHandler.class);
-       
        /**
         * @param applicationController
         */
@@ -79,7 +75,7 @@ public class ImportHandler extends AbstractIOHandler<IImportConfigurator> {
                        @Override
                        protected IStatus run(IProgressMonitor monitor) {
                                monitor.beginTask("Importing data", 100);
-                               configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
+                               configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateSubMonitor(monitor, 70));
                                
                                monitor.worked(10);
                                
index aab14cb..6839dff 100644 (file)
@@ -254,7 +254,7 @@ public abstract class AbstractUtility {
 
                        public void run() {
                                MessageDialog.openWarning(getShell(), title, message);
-                               warn(AbstractUtility.class, message);
+                               warn(source.getClass(), message);
                        }
                });
        }
@@ -273,7 +273,7 @@ public abstract class AbstractUtility {
 
                        public void run() {
                                MessageDialog.openError(getShell(), title, message);
-                               error(AbstractUtility.class, message, t);
+                               error(source.getClass(), message, t);
                        }
                });
        }
index 675550c..b6fb999 100644 (file)
@@ -190,6 +190,14 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
                }
        }
 
+       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.
         *
@@ -222,6 +230,39 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
        }
        
        /**
+        * @param descriptionElement
+        * @return
+        */
+       public FeatureNodeContainer processDescriptionElement(
+                       DescriptionElementBase descriptionElement) {
+               FeatureNodeContainer container = getFeatureNodeContainerForDescriptionElement(descriptionElement);
+               if(container != null){
+                       container.removeDescriptionElement(descriptionElement);
+               }else{
+                       container = getFeatureNodeContainerByFeature(descriptionElement.getFeature());
+                       if(container != null){
+                               container.addDescriptionElement(descriptionElement);
+                       }
+               }
+               return container;
+       }
+
+       /**
+        * @param feature
+        * @return
+        */
+       public FeatureNodeContainer getFeatureNodeContainerByFeature(Feature feature) {         
+               List<FeatureNodeContainer> leafs = getLeafs();
+               
+               for(FeatureNodeContainer container : leafs){
+                       if(container.getFeature().equals(feature)){
+                               return container;
+                       }
+               }
+               return null;
+       }
+       
+       /**
         * <p>getFeatureNodeContainerForDescriptionElement</p>
         *
         * @param descriptionElement a {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase} object.
@@ -407,4 +448,5 @@ public class FeatureNodeContainer implements IAnnotatableEntity{
        /** {@inheritDoc} */
        @Override
        public void removeMarker(Marker marker) {}
+
 }
index 91b6d82..b580502 100644 (file)
@@ -8,7 +8,7 @@ import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
 
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 
 /**
  * <p>NewReferenceWizard class.</p>
@@ -63,7 +63,7 @@ public class NewReferenceWizard extends Wizard implements INewWizard{
         *
         * @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
         */
-       public ReferenceBase getReference(){
+       public Reference getReference(){
                return null;
        }
 
index 504c3f3..a246b29 100644 (file)
@@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
@@ -38,7 +38,7 @@ public class DeleteConceptRelationOperation extends AbstractPostOperation {
        
        private Taxon relatedTaxon;
        private TaxonRelationshipType relationshipType;
-       private ReferenceBase<?> citation;
+       private Reference<?> citation;
        private String microcitation;
        private TaxonRelationship taxonRelationship;    
 
index fbf6e36..b3c9bc1 100644 (file)
@@ -15,7 +15,7 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
@@ -31,7 +31,7 @@ public class DeleteMisapplicationOperation extends AbstractPostOperation {
        
        private Taxon misapplication;
 
-       private ReferenceBase<?> citation;
+       private Reference<?> citation;
 
        private String microcitation;
 
index 1efb5c1..0e631df 100644 (file)
@@ -19,9 +19,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
@@ -68,13 +68,13 @@ public class DeleteTreeNodeOperation extends AbstractPersistentPostOperation{
         for (ITreeNode treeNode : treeNodes){
                        if(treeNode instanceof TaxonNode){
                                ((TaxonNode) treeNode).delete();
-                       }else if(treeNode instanceof TaxonomicTree){
-                               TaxonomicTree taxonomicTree = (TaxonomicTree) treeNode;
+                       }else if(treeNode instanceof Classification){
+                               Classification taxonomicTree = (Classification) treeNode;
                                if(taxonomicTree.hasChildNodes()){
                                        StoreUtil.warningDialog("Tree is not empty", this, "It is not possible to delete a Taxonomic Tree that " +
                                                        "is not empty. Please delete included taxa first");
                                }else{
-                                       CdmStore.getTaxonTreeService().delete(taxonomicTree);
+                                       CdmStore.getClassificationService().delete(taxonomicTree);
                                }
                        }
                }
@@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -27,8 +27,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @created Jul 12, 2010
  * @version 1.0
  */
-public class EditTaxonomicTreeOperation extends AbstractPersistentPostOperation {
-       private TaxonomicTree classification;
+public class EditClassificationOperation extends AbstractPersistentPostOperation {
+       private Classification classification;
 
        /**
         * <p>Constructor for EditTaxonomicTreeOperation.</p>
@@ -39,7 +39,7 @@ public class EditTaxonomicTreeOperation extends AbstractPersistentPostOperation
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operations.IPostOperationEnabled} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public EditTaxonomicTreeOperation(String label, IUndoContext undoContext, TaxonomicTree classification,
+       public EditClassificationOperation(String label, IUndoContext undoContext, Classification classification,
                        IPostOperationEnabled postOperationEnabled,
                        IConversationEnabled conversationEnabled) {
                super(label, undoContext, postOperationEnabled, conversationEnabled);
@@ -56,7 +56,7 @@ public class EditTaxonomicTreeOperation extends AbstractPersistentPostOperation
                        throws ExecutionException {
                bind();
                
-               CdmStore.getTaxonTreeService().save(classification);
+               CdmStore.getClassificationService().save(classification);
                
                monitor.worked(40);
 
index 76c72b8..5cb7a55 100644 (file)
@@ -17,9 +17,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -31,7 +31,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class SaveClassificationOperation extends AbstractPersistentPostOperation {
 
-       private TaxonomicTree classification;
+       private Classification classification;
        
        /**
         * <p>Constructor for SaveClassificationOperation.</p>
@@ -42,7 +42,7 @@ public class SaveClassificationOperation extends AbstractPersistentPostOperation
         * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operations.IPostOperationEnabled} object.
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
-       public SaveClassificationOperation(String label, IUndoContext undoContext, TaxonomicTree classification,
+       public SaveClassificationOperation(String label, IUndoContext undoContext, Classification classification,
                        IPostOperationEnabled postOperationEnabled,
                        IConversationEnabled conversationEnabled) {
                super(label, undoContext, postOperationEnabled, conversationEnabled);
@@ -62,12 +62,12 @@ public class SaveClassificationOperation extends AbstractPersistentPostOperation
                monitor.worked(20);
                
                if(classification.getReference() == null){
-                       ReferenceBase reference = ReferenceFactory.newGeneric();
+                       Reference reference = ReferenceFactory.newGeneric();
                        reference.setTitleCache(classification.getTitleCache());
                        classification.setReference(reference);
                }
                
-               CdmStore.getTaxonTreeService().saveOrUpdate(classification);
+               CdmStore.getClassificationService().saveOrUpdate(classification);
                
                monitor.worked(40);
 
index f462fa0..b0f1b1e 100644 (file)
@@ -12,7 +12,7 @@ package eu.etaxonomy.taxeditor.parser;
 
 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.cdm.strategy.match.MatchMode;
@@ -95,7 +95,7 @@ public class MatchStrategyConfigurator {
         * @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
         */
        public static IMatchStrategy getDefaultReferenceMatchStrategy() throws MatchException{
-               IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(ReferenceBase.class);
+               IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(Reference.class);
                
                strategy.setMatchMode("title", MatchMode.EQUAL);
                strategy.setMatchMode("inReference", MatchMode.IGNORE);
index 4793605..783f0aa 100644 (file)
@@ -14,7 +14,7 @@ import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
@@ -236,10 +236,10 @@ public class ParseHandler{
         * @param name The name to resolve duplicates for.
         */
        private void resolveDuplicateInReferences(NonViralName name) {
-               ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+               Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
                
                if(duplicateInReferences.size() > 0){
-                       ReferenceBase inReference = (ReferenceBase) duplicateInReferences.iterator().next();
+                       Reference inReference = (Reference) duplicateInReferences.iterator().next();
                        reference.setInReference(inReference);
                        StoreUtil.warn(this.getClass(), reference.generateTitle());
                        // FIXME TODO resolve multiple duplications. We use first match for a start
@@ -255,7 +255,7 @@ public class ParseHandler{
                
                if(duplicateCombinationAuthorTeams.size() > 0){
                        name.setCombinationAuthorTeam(duplicateCombinationAuthorTeams.iterator().next());
-                       ReferenceBase reference = (ReferenceBase) name.getNomenclaturalReference();
+                       Reference reference = (Reference) name.getNomenclaturalReference();
                        if(reference != null){
                                reference.setAuthorTeam(duplicateCombinationAuthorTeams.iterator().next());
                        }
@@ -297,7 +297,7 @@ public class ParseHandler{
                
                // check if the reference has an inreference and also check if the inReference already exists 
                if(nomenclaturalReference != null){
-                       ReferenceBase inReference = ((ReferenceBase)nomenclaturalReference).getInReference();
+                       Reference inReference = ((Reference)nomenclaturalReference).getInReference();
                        if(inReference != null){
                                doResolveInReferences = true;
                                duplicateInReferences = findMatchingNomenclaturalReference(inReference);
index 2c48238..b6b5af2 100644 (file)
@@ -12,7 +12,7 @@ package eu.etaxonomy.taxeditor.preference.matching;
 
 import org.eclipse.ui.IWorkbench;
 
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
 import eu.etaxonomy.cdm.strategy.match.MatchException;
 import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
@@ -25,14 +25,14 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @created Jan 22, 2010
  * @version 1.0
  */
-public class ReferenceMatchingPreference extends AbstractMatchingPreferences<ReferenceBase> {
+public class ReferenceMatchingPreference extends AbstractMatchingPreferences<Reference> {
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
         */
        /** {@inheritDoc} */
        public void init(IWorkbench workbench) {
-               clazz = ReferenceBase.class;
+               clazz = Reference.class;
                
                try {
                        matchStrategy = MatchStrategyConfigurator.ReferenceMatchStrategy();
index 2c8c12d..8febbc0 100644 (file)
@@ -26,6 +26,7 @@ import org.springframework.security.authentication.ProviderManager;
 import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ICollectionService;
 import eu.etaxonomy.cdm.api.service.ICommonService;
 import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
@@ -37,7 +38,6 @@ import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.api.service.ITaxonTreeService;
 import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IUserService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
@@ -55,8 +55,8 @@ import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.datasource.view.CdmDataSourceViewPart;
 import eu.etaxonomy.taxeditor.io.ExportHandler;
@@ -404,7 +404,7 @@ public class CdmStore{
         *
         * @return a {@link eu.etaxonomy.cdm.api.service.ITaxonTreeService} object.
         */
-       public static ITaxonTreeService getTaxonTreeService() { return getCurrentApplicationController().getTaxonTreeService();}
+       public static IClassificationService getClassificationService() { return getCurrentApplicationController().getClassificationService();}
        
        /**
         * <p>getTaxonNodeService</p>
@@ -555,7 +555,7 @@ public class CdmStore{
         * @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
         * @return a {@link java.util.List} object.
         */
-       public static List<ReferenceBase> findReferences(IIdentifiableEntityServiceConfigurator configurator){
+       public static List<Reference> findReferences(IIdentifiableEntityServiceConfigurator configurator){
                // TODO we want to use IIdentifiableEntityServiceConfigurator for all find methods
                // unfortunately this is not consistently implemented in the library.
                // FIXME use proper method once it is implemented in the library
@@ -740,8 +740,8 @@ public class CdmStore{
         * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
         */
        public static void createDefaultClassification(ConversationHolder conversation){
-               TaxonomicTree defaultClassification = TaxonomicTree.NewInstance("My Classification");
-               getTaxonTreeService().saveOrUpdate(defaultClassification);
+               Classification defaultClassification = Classification.NewInstance("My Classification");
+               getClassificationService().saveOrUpdate(defaultClassification);
                conversation.commit(true);
        }
 }
index cab4e68..d011931 100644 (file)
@@ -15,9 +15,9 @@ import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
 
 /**
  * @author n.hoffmann
@@ -28,7 +28,7 @@ public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTest {
 
        private static Taxon oldParentTaxon;
        private static Taxon newParentTaxon;
-       private static TaxonomicTree tree;
+       private static Classification tree;
        private static TaxonNode oldParentTaxonNode;
        private static TaxonNode newParentTaxonNode;
        private static TaxonNode taxonNode;
@@ -47,7 +47,7 @@ public class MoveTaxonOperationTest extends AbstractTaxeditorOperationTest {
                oldParentTaxon = Taxon.NewInstance(null, null);
                newParentTaxon = Taxon.NewInstance(null, null);
                
-               tree = TaxonomicTree.NewInstance(null);
+               tree = Classification.NewInstance(null);
                oldParentTaxonNode = tree.addChildTaxon(oldParentTaxon, null, null, null);
                newParentTaxonNode = tree.addChildTaxon(newParentTaxon, null, null, null);