Fixes #1436
authorn.hoffmann <n.hoffmann@localhost>
Wed, 3 Feb 2010 16:34:11 +0000 (16:34 +0000)
committern.hoffmann <n.hoffmann@localhost>
Wed, 3 Feb 2010 16:34:11 +0000 (16:34 +0000)
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/internal/TaxeditorStorePlugin.java

index f5a36ecbfaa1fef43113fcbe1732bfea59b9863d..bca5e83ffacdc12f1419e96ba2cbb075bab01c76 100644 (file)
@@ -18,7 +18,6 @@ import org.apache.log4j.Logger;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.ScrolledComposite;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
@@ -88,7 +87,7 @@ public class GenericConfiguratorWizardPage extends WizardPage {
                
 //             scrolledComposite.setContent(composite);
                
-               setControl(parent);
+               setControl(composite);
        }
        
        private void createCheckbox(Composite parent, Method method, final IIoConfigurator configurator){
index 6ed0becc18dd74e4a120b4c66a8f7eef4d21aff3..0f5b45f20286ac78708a2599d36322921f4b129e 100644 (file)
@@ -71,7 +71,7 @@ public class PreferencesUtil {
        public static final String EDIT_MARKER_TYPE_PREFIX = "editMarkerType";\r
        \r
        public static final String MATCH_STRATEGY_PREFIX = "matchStrategy.";\r
-               \r
+       \r
        /**\r
         * \r
         * @return\r
@@ -317,7 +317,7 @@ public class PreferencesUtil {
         */\r
        public static ITaxonServiceConfigurator getSearchConfigurator() {\r
                ITaxonServiceConfigurator configurator = initializeSearchConfigurator();\r
-\r
+               \r
                configurator.setDoTaxa(getPreferenceStore().getBoolean(TAXON_SERVICE_CONFIGURATOR_TAXA));\r
                configurator.setDoSynonyms(getPreferenceStore().getBoolean(TAXON_SERVICE_CONFIGURATOR_SYNONYMS));\r
                configurator.setDoNamesWithoutTaxa(getPreferenceStore().getBoolean(TAXON_SERVICE_CONFIGURATOR_NAMES));\r
@@ -372,4 +372,12 @@ public class PreferencesUtil {
        public static void firePreferencesChanged(Class clazz) {\r
                getPreferenceStore().firePropertyChangeEvent(PREFERRED_TERMS_CHANGE, null, clazz);\r
        }\r
+\r
+       /**\r
+        * Set default values for preferences\r
+        */\r
+       public static void setDefaults() {\r
+               getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_TAXA, true);\r
+               getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS, true);\r
+       }\r
 }\r
index b6a12847602013215c73fde1f5204f312f4325c7..e47bb1d485ae30e687f19f44e1bcd32ad57d8d12 100644 (file)
@@ -132,7 +132,6 @@ public class CdmStore{
                                        }
                                }
                        }
-                       
                        return instance;
                } catch (DataSourceNotFoundException e) {
                        StoreUtil.errorDialog("Chosen Datasource is not available", "Could not connect to the chosen " +
index 71534d68916e503e322445b30f2d0c71d8018582..440e334ed0dd01bc09cb6d452eb1ac4a1c84b971 100644 (file)
@@ -6,6 +6,8 @@ import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
 /**
  * The activator class controls the plug-in life cycle
  */
@@ -32,6 +34,9 @@ public class TaxeditorStorePlugin extends AbstractUIPlugin {
        public void start(BundleContext context) throws Exception {
                super.start(context);
                plugin = this;
+
+               PreferencesUtil.setDefaults();
+               
                logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
        }