.
authorp.ciardelli <p.ciardelli@localhost>
Fri, 12 Jun 2009 11:56:28 +0000 (11:56 +0000)
committerp.ciardelli <p.ciardelli@localhost>
Fri, 12 Jun 2009 11:56:28 +0000 (11:56 +0000)
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputFactory.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/DescriptionUtil.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/store/StoreUtil.java

index f8bd22a3fab9210cb856ea17f5c565e47a0e64e2..48e92ffa1bce34c7411e223c7ecef06a80cc131a 100644 (file)
@@ -17,7 +17,9 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.ui.IElementFactory;\r
 import org.eclipse.ui.IMemento;\r
 \r
+import eu.etaxonomy.taxeditor.model.TaxonUtil;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.StoreUtil;\r
 \r
 \r
 /**\r
@@ -49,6 +51,7 @@ public class TaxonEditorInputFactory implements IElementFactory {
         if (uuid == null) {\r
                        return null;\r
                }\r
+//        StoreUtil.checktaxonExists(UUID.fromString(uuid));\r
         if (CdmStore.getTaxonService().getTaxonByUuid(UUID.fromString(uuid)) == null) {\r
                logger.warn("Couldn't find taxon with UUID " + uuid);\r
                return null;\r
index d0ed8ab37e23aabfa98ca25ef30ec73dcff1c17d..9ecd389b6f1260aed0b7ce04a2c4b44ace3cfa73 100644 (file)
@@ -13,7 +13,6 @@ package eu.etaxonomy.taxeditor.model;
 import org.eclipse.jface.resource.ColorRegistry;
 import org.eclipse.jface.resource.FontRegistry;
 import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.themes.ITheme;
 import org.eclipse.ui.themes.IThemeManager;
@@ -41,12 +40,7 @@ public abstract class AbstractUtility {
        }
        
        public static boolean closeAll() {
-               for (IEditorReference reference : getActivePage().getEditorReferences()) {
-                       if (!getActivePage().closeEditor(reference.getEditor(false), true)) {
-                               return false;
-                       }
-               }
-               return true;
+               return getActivePage().closeAllEditors(true);
        }
 
        public static ITheme getCurrentTheme(){
index 389f167ca18f021aa517c3295ab6001a186d72d3..79b8fb69eef4bb904c9196f9636cdb75ce5e61c7 100644 (file)
@@ -78,6 +78,7 @@ public class DescriptionUtil {
                }\r
                if(element instanceof Distribution){\r
                        logger.warn("trying to set cache on distribution, don't know what to do at the moment.");\r
+                       return;\r
                }\r
                logger.warn("No matching subclass found for DescriptionElementBase object, 'cache' not set.");\r
        }\r
index 30653cda9e5d32eb6019c2fcd449d6ae512051cd..4cc13b0ad2a7002b54c6363d74ffc12479642c0f 100644 (file)
@@ -10,6 +10,8 @@
 
 package eu.etaxonomy.taxeditor.store;
 
+import java.util.UUID;
+
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 /**
@@ -17,4 +19,11 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
  * @created 11.05.2009
  * @version 1.0
  */
-public class StoreUtil extends AbstractUtility {}
+public class StoreUtil extends AbstractUtility {
+
+       public static void checktaxonExists(UUID fromString) {
+//        if (CdmStore.getTaxonService().getTaxonByUuid(UUID.fromString(uuid)) == null) {
+//             logger.warn("Couldn't find taxon with UUID " + uuid);
+//             return null;
+//        }
+       }}