From: n.hoffmann Date: Mon, 29 Jun 2009 14:03:03 +0000 (+0000) Subject: finalizing preferred refactoring X-Git-Tag: rcp.ss-first-working-version~825 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/4022137c3f8bfbbd8c88aad4bb91685565e83fe9 finalizing preferred refactoring --- diff --git a/.gitattributes b/.gitattributes index 2070ec57e..53811ccee 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1072,6 +1072,8 @@ taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/NomenclaturalCod taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/NomenclaturalStatusTypeMenuPreferences.java -text taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java -text taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/RankMenuPreferences.java -text +taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenTypeDesignationStatusMenuPreferences.java -text +taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonRelationshipTypeMenuPreferences.java -text taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonomicPreferences.java -text taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/wizards/FeatureWizard.java -text taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/wizards/FeatureWizardEditPage.java -text diff --git a/taxeditor-store/plugin.xml b/taxeditor-store/plugin.xml index 8d2044070..c515e0b34 100644 --- a/taxeditor-store/plugin.xml +++ b/taxeditor-store/plugin.xml @@ -3,6 +3,28 @@ + + + + + + + + - - - - + category="eu.etaxonomy.taxeditor.preferences.taxonomic" + class="eu.etaxonomy.taxeditor.preference.TaxonRelationshipTypeMenuPreferences" + id="taxeditor-store.page1" + name="Taxon Realationship Type"> + category="eu.etaxonomy.taxeditor.preferences.taxonomic" + class="eu.etaxonomy.taxeditor.preference.SpecimenTypeDesignationStatusMenuPreferences" + id="eu.etaxonomy.taxeditor.preferences.specimenTypeDesignationStatus" + name="Specimen Type Designation Status"> exten * @return */ public boolean doImportInternal(final IImportConfigurator configurator){ - importer = new CdmDefaultImport(); - Job importJob = new Job("Import"){ - @Override - protected IStatus run(IProgressMonitor monitor) { - return importer.invoke(configurator) ? Status.OK_STATUS : Status.CANCEL_STATUS; - } - }; + if(configurator == null){ + throw new IllegalArgumentException("Configuration may not be null"); + } - importJob.schedule(); + importer = new CdmDefaultImport(); +// +// Job importJob = new Job("Import"){ +// @Override +// protected IStatus run(IProgressMonitor monitor) { +// return importer.invoke(configurator) ? Status.OK_STATUS : Status.CANCEL_STATUS; +// } +// }; +// +// importJob.schedule(); - return true; + importer.setCdmAppController(configurator.getCdmAppController()); + + return importer.invoke(configurator); } /* (non-Javadoc) diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelImportWizard.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelImportWizard.java index 7f5b3d025..e18ab472f 100644 --- a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelImportWizard.java +++ b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelImportWizard.java @@ -16,8 +16,10 @@ import org.eclipse.ui.IWorkbench; import eu.etaxonomy.cdm.database.ICdmDataSource; import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator; +import eu.etaxonomy.cdm.io.common.Source; import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository; import eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceTypeSelectionWizardPage; +import eu.etaxonomy.taxeditor.store.CdmStore; /** * @author n.hoffmann @@ -54,11 +56,22 @@ public class BerlinModelImportWizard extends AbstractImportWizardList containing user preferred Feature terms */ + public static List getPreferredSpecimenTypeDesignationStatus() { return getPreferredTerms(VocabularyStore.getSpecimenTypeDesignationStatus());} + + /** @return a List containing user preferred Feature terms */ + public static List getPreferredTaxonRelationshipTypes() { return getPreferredTerms(VocabularyStore.getTaxonRelationshipTypes());} + /** @return a List containing user preferred Feature terms */ public static List getPreferredFeatures() { return getPreferredTerms(VocabularyStore.getFeatures());} diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenTypeDesignationStatusMenuPreferences.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenTypeDesignationStatusMenuPreferences.java new file mode 100644 index 000000000..737955ec1 --- /dev/null +++ b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/SpecimenTypeDesignationStatusMenuPreferences.java @@ -0,0 +1,34 @@ +// $Id$ +/** +* Copyright (C) 2007 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ + +package eu.etaxonomy.taxeditor.preference; + +import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; +import eu.etaxonomy.taxeditor.store.VocabularyStore; + +/** + * @author n.hoffmann + * @created 25.06.2009 + * @version 1.0 + */ +public class SpecimenTypeDesignationStatusMenuPreferences extends + AbstractMenuPreferences { + /** + * @param initialVocabulary + * @param title + * @param description + */ + public SpecimenTypeDesignationStatusMenuPreferences() { + super(VocabularyStore.getSpecimenTypeDesignationStatus(), + "Specimen Type Designation Status Preferences", + "Configure specimen type desigantion status"); + } + +} diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonRelationshipTypeMenuPreferences.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonRelationshipTypeMenuPreferences.java new file mode 100644 index 000000000..6cc7adf9f --- /dev/null +++ b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/TaxonRelationshipTypeMenuPreferences.java @@ -0,0 +1,35 @@ +// $Id$ +/** +* Copyright (C) 2007 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ + +package eu.etaxonomy.taxeditor.preference; + +import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; +import eu.etaxonomy.taxeditor.store.VocabularyStore; + +/** + * @author n.hoffmann + * @created 25.06.2009 + * @version 1.0 + */ +public class TaxonRelationshipTypeMenuPreferences extends + AbstractMenuPreferences { + + /** + * @param initialVocabulary + * @param title + * @param description + */ + public TaxonRelationshipTypeMenuPreferences() { + super(VocabularyStore.getTaxonRelationshipTypes(), + "Taxon Relationship Type Preferences", + "Configure taxon relationship types"); + } + +} diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/VocabularyStore.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/VocabularyStore.java index fd81cac29..8baa4657f 100644 --- a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/VocabularyStore.java +++ b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/VocabularyStore.java @@ -13,8 +13,6 @@ package eu.etaxonomy.taxeditor.store; import java.util.Set; import java.util.SortedSet; -import org.apache.log4j.Logger; - import eu.etaxonomy.cdm.api.application.CdmApplicationController; import eu.etaxonomy.cdm.api.service.ITermService; import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; @@ -42,8 +40,7 @@ import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; * @version 1.0 */ public class VocabularyStore { - private static final Logger logger = Logger.getLogger(VocabularyStore.class); - + /** * The singleton instance */ @@ -82,6 +79,8 @@ public class VocabularyStore { /** * * @return + * + * @deprecated handle via preferences */ public static SortedSet getConceptRelationshipTypes() { SortedSet conceptRelationshipTypes = getTaxonRelationshipTypes(); diff --git a/taxeditor-store/src/test/java/eu/etaxonomy/taxeditor/store/CdmStoreTest.java b/taxeditor-store/src/test/java/eu/etaxonomy/taxeditor/store/CdmStoreTest.java index 101de028d..6701db67e 100644 --- a/taxeditor-store/src/test/java/eu/etaxonomy/taxeditor/store/CdmStoreTest.java +++ b/taxeditor-store/src/test/java/eu/etaxonomy/taxeditor/store/CdmStoreTest.java @@ -69,7 +69,7 @@ public class CdmStoreTest /*extends CdmIntegrationTest */{ @Ignore public void testGetConceptRelationshipTypes(){ conversation.bind(); - Set conceptRelationshipTypes = VocabularyStore.getConceptRelationshipTypes(); + Set conceptRelationshipTypes = VocabularyStore.getTaxonRelationshipTypes(); Assert.assertNotNull(conceptRelationshipTypes); } }