REvert caching of cdm formatter
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / AbstractCdmEditorViewPart.java
index d024fb139b0dc79f1c09729e200da1369a202a04..854481faa09dd6aeace3ee90351cf49d075073a9 100644 (file)
@@ -11,7 +11,7 @@ import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 
 /**
  * <p>
@@ -46,13 +46,10 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
             this.selection = selection;
         }
 
-        /* (non-Javadoc)
-         * @see java.lang.Runnable#run()
-         */
         @Override
         public void run() {
             try{
-                internal_selectionChanged(part, selection);
+                selectionChanged_internal(part, selection);
             }
             finally{
                 isInDelay = false;
@@ -76,12 +73,16 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
      * @param part The workbench part that has issued the selection change
      * @param selection the new selection
      */
-    protected abstract void internal_selectionChanged(IWorkbenchPart part, ISelection selection);
+    protected abstract void selectionChanged_internal(IWorkbenchPart part, ISelection selection);
 
     /** {@inheritDoc} */
     @Override
     public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-        if(delaySelection==null){
+       /*to avoid widget is disposed exceptions
+        if(getViewer().getControl().isDisposed()){
+            return;
+        }*/
+       if(delaySelection==null){
             delaySelection = new DelaySelection(part, selection);
         }
         delaySelection.setPart(part);
@@ -91,14 +92,9 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
             Display.getCurrent().asyncExec(delaySelection);
         }
     }
+    
+    
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org
-     * .eclipse.swt.widgets.Composite)
-     */
     /** {@inheritDoc} */
     @Override
     public void createPartControl(Composite parent) {
@@ -135,8 +131,8 @@ public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart {
             ((AbstractCdmViewPart) part).changed(object);
         } else {
             IEditorPart editor = getEditor();
-            if (editor != null && editor instanceof IDirtyMarkableSelectionProvider) {
-                ((IDirtyMarkableSelectionProvider) editor).changed(object);
+            if (editor != null && editor instanceof IDirtyMarkable) {
+                ((IDirtyMarkable) editor).changed(object);
             }
         }
     }