Print Publisher runs outside of conversations; Fixes a bug with empty selections...
authorn.hoffmann <n.hoffmann@localhost>
Thu, 26 May 2011 16:53:16 +0000 (16:53 +0000)
committern.hoffmann <n.hoffmann@localhost>
Thu, 26 May 2011 16:53:16 +0000 (16:53 +0000)
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/AbstractPublishWizard.java
eu.etaxonomy.taxeditor.printpublisher/src/main/java/eu/etaxonomy/taxeditor/printpublisher/wizard/SelectFeatureTreeWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/menu/AbstractMenuPreferences.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/ImageElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaElement.java

index 30d3e0cbc761e8532752f6850db69e976c397059..fb9406e0389f3ed57b2765d582c512e7807f3c40 100644 (file)
@@ -84,7 +84,10 @@ public abstract class AbstractPublishWizard extends Wizard implements IExportWiz
                                        getConfigurator().setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
                                        
                                        if(getConfigurator().isLocal()){
                                        getConfigurator().setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
                                        
                                        if(getConfigurator().isLocal()){
-                                               conversation= CdmStore.createConversation();
+                                               conversation = CdmStore.createConversation();
+                                               // we want to enforce that the session is closed and nothing is 
+                                               // instantiated beneath the regular cdmlib-remote object boundaries 
+                                               conversation.commit(false);
                                        }
                                        
                                        Publisher.publish(getConfigurator());
                                        }
                                        
                                        Publisher.publish(getConfigurator());
index 7fa7f6c83a583ba0031084fabaea3d92f773c5fe..a3e29484f4d6d57905ec40a799cf35fe9f81f725 100644 (file)
@@ -121,7 +121,12 @@ public class SelectFeatureTreeWizardPage extends AbstractPublishWizardPage
        public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                
        public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                
-               setPageComplete(selection.size() == 1);
+               if(selection.isEmpty()){
+                       return;
+               }
+               
+               setPageComplete(true);
+               
                
                Element featureTreeElement = (Element) selection.getFirstElement();
                        
                
                Element featureTreeElement = (Element) selection.getFirstElement();
                        
index f57000631b4527cdb3bc8a23ee512d3d5e08b019..c9fb62deedeccc80bb4910a2ee4f55fff2674621 100644 (file)
@@ -51,7 +51,6 @@ import org.eclipse.ui.themes.IThemeManager;
 
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
@@ -740,6 +739,12 @@ public abstract class AbstractUtility {
                getLog4JLogger(source).warn(message);
                log(status);
        }
                getLog4JLogger(source).warn(message);
                log(status);
        }
+       
+       public static void warn(Class source, Throwable t) {
+               IStatus status = new Status(IStatus.WARNING, getPluginId(), t.getMessage(), t);
+               getLog4JLogger(source).warn(t);
+               log(status);
+       }
 
        /**
         * <p>
 
        /**
         * <p>
index 9865a902d918fb86609aab00323c790113811650..75e164d7352187a75bcbb33c31cdefefba1348fd 100644 (file)
@@ -43,7 +43,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.wizard.VocabularyTermWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.preference.wizard.VocabularyTermWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
-import eu.etaxonomy.taxeditor.store.TermStore;
 
 /**
  * <p>Abstract AbstractMenuPreferences class.</p>
 
 /**
  * <p>Abstract AbstractMenuPreferences class.</p>
index 948f064e8c3f89ef1c8e52af81d5f0e8c1fd5d14..b3ff73fd460475205f68d2716749ef4805148c2f 100644 (file)
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.GC;
@@ -26,6 +27,7 @@ import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
 import eu.etaxonomy.cdm.common.UriUtils;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 
 import eu.etaxonomy.cdm.common.UriUtils;
@@ -154,7 +156,7 @@ public class ImageElement extends AbstractCdmFormElement implements PaintListene
                                        }
                                        monitor.done();                                 
                                }catch (Exception e) {
                                        }
                                        monitor.done();                                 
                                }catch (Exception e) {
-                                       StoreUtil.errorDialog("Could not load image", getClass(), e.getMessage()  + ": " + imageUri , e);
+                                       StoreUtil.warn(getClass(), e);
                                } 
                        }                                       
                };
                                } 
                        }                                       
                };
index e473b32bfabcadbb5f20296293191fdd2fa9d8a5..7fd2f8c70b8115845bfc68498194e983f9edf630 100644 (file)
@@ -14,6 +14,7 @@ import eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.EntityDetailType;
 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
+import eu.etaxonomy.taxeditor.ui.forms.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.forms.LanguageStringWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.forms.LanguageStringWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;