ref #6913 Remove IEditorInput dependency from checklist editor input
authorPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 26 Oct 2017 08:42:28 +0000 (10:42 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 26 Oct 2017 08:42:28 +0000 (10:42 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java

index 8a597bcb7df814359d58840eb27ad5c0ea35f7c1..93f59f35b5321deb6add9521aaafe625df56e1b6 100644 (file)
@@ -13,11 +13,8 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IPersistable;
-import org.eclipse.ui.IPersistableElement;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
@@ -36,7 +33,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 25.04.2014
  *
  */
-public class ChecklistEditorInput extends CdmEntitySessionInput implements IEditorInput, IPersistable {
+public class ChecklistEditorInput extends CdmEntitySessionInput implements IPersistable {
 
     /**
      * The selected classification
@@ -97,40 +94,10 @@ public class ChecklistEditorInput extends CdmEntitySessionInput implements IEdit
 
 
 
-    /* (non-Javadoc)
-     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-     */
-    @Override
-    public Object getAdapter(Class adapter) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#exists()
-     */
-    @Override
-    public boolean exists() {
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
-     */
-    @Override
-    public ImageDescriptor getImageDescriptor() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
     public List<Taxon> getTaxa() {
                return taxa;
        }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getName()
-     */
-    @Override
     public String getName() {
         if(taxonNode != null && taxonNode.getTaxon()!=null){
             return taxonNode.getTaxon().getName().getTitleCache();
@@ -139,21 +106,6 @@ public class ChecklistEditorInput extends CdmEntitySessionInput implements IEdit
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getPersistable()
-     */
-    @Override
-    public IPersistableElement getPersistable() {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IEditorInput#getToolTipText()
-     */
-    @Override
-    public String getToolTipText() {
-        return classification.getTitleCache();
-    }
 
     /**
      * @return the taxonNode
index 3092315e2a76ed63584c22038f7863f158ca2f90..e24d291a59e93cf8886078fac9c12b7c134c8976 100755 (executable)
@@ -51,7 +51,6 @@ import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.ToolBar;
 import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
 
@@ -673,13 +672,12 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
 
     }
 
-    public void init(IEditorInput input) {
-        if (input instanceof ChecklistEditorInput) {
-            checklistEditorInput = (ChecklistEditorInput) input;
-            thisPart.setLabel(DISTRIBUTION_EDITOR+": " + checklistEditorInput.getName());
-            conversation = checklistEditorInput.getConversation();
-            conversation.registerForDataStoreChanges(this);
-        }
+    public void init(ChecklistEditorInput input) {
+        checklistEditorInput = input;
+        thisPart.setLabel(DISTRIBUTION_EDITOR+": " + checklistEditorInput.getName());
+        conversation = checklistEditorInput.getConversation();
+        conversation.registerForDataStoreChanges(this);
+
         //propagate selection
         selectionChangedListener = (event -> selService.setSelection(
                DistributionEditorHelper.getDistributionForColumn(event)));