Preferences have used legacy preference classes to this point - checkin before attemp...
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor / src / eu / etaxonomy / taxeditor / TaxEditorPlugin.java
index d3eed93b9a3a0a9f43bc93da6a82fb15503298f0..49688bb85c6cdfbd48d0d64b595e057c537d5852 100644 (file)
@@ -55,6 +55,7 @@ import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.cdm.model.common.init.TermNotFoundException;\r
+import eu.etaxonomy.cdm.model.description.Feature;\r
 import eu.etaxonomy.cdm.model.name.BotanicalName;\r
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;\r
 import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;\r
@@ -67,6 +68,14 @@ import eu.etaxonomy.taxeditor.navigation.TaxonomicTreeView;
 \r
 /**\r
  * The class controlling the plug-in life cycle.\r
+ * </p>\r
+ * <ul>\r
+ *     <li>Initializes datastore as necessary.</li>\r
+ *     <li>Initializes default preferences.</li>\r
+ *     <li>Gateway to CDM service layer.</li>\r
+ *     <li>Stores taxa for application session.</li>\r
+ *     <li>Stores registries for colors, fonts, images.</li>\r
+ * </ul>\r
  * \r
  * @author p.ciardelli\r
  * @created 15.05.2008\r
@@ -242,7 +251,7 @@ public class TaxEditorPlugin extends AbstractUIPlugin {
                                 \r
                                 // Is this the problem?\r
                                 cdmApp = CdmApplicationController\r
-                                       .NewInstance(ds, dbSchemaValidation);\r
+                                               .NewInstance(ds, dbSchemaValidation);\r
  \r
                                 \r
 //                             cdmApp = CdmApplicationController\r
@@ -284,7 +293,7 @@ public class TaxEditorPlugin extends AbstractUIPlugin {
                }\r
                return taxonService;\r
        }\r
-\r
+       \r
        private INameService nameService;\r
 \r
        public INameService getNameService() {\r
@@ -455,11 +464,24 @@ public class TaxEditorPlugin extends AbstractUIPlugin {
        /***************************************************************************\r
         * PREFERENCES\r
         **************************************************************************/\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)\r
+        */\r
        protected void initializeDefaultPreferences(IPreferenceStore store) {\r
                // Platform.getPreferencesService().getBoolean(qualifier, key,\r
                // defaultValue, contexts)\r
                store.setDefault(ITaxEditorConstants.CODE_PREFERENCE,\r
                                ITaxEditorConstants.DEFAULT_CODE_PREFERENCE);\r
+               \r
+               // Set preferences to display all features\r
+               TermVocabulary<Feature> features = descriptionService.getDefaultFeatureVocabulary();\r
+               for (Feature feature : features) {\r
+                       String preferenceKey = ITaxEditorConstants.FEATURE_PREFERENCE \r
+                               . concat(".")\r
+                               . concat(feature.getUuid().toString());\r
+                       store.setDefault(preferenceKey, true);\r
+               }\r
+               \r
        }\r
 \r
        /***************************************************************************\r