OpenAlignmentEditorHandler marked as deprecated.
authorb.stoever <b.stoever@localhost>
Mon, 23 Mar 2015 18:03:02 +0000 (18:03 +0000)
committerb.stoever <b.stoever@localhost>
Mon, 23 Mar 2015 18:03:02 +0000 (18:03 +0000)
equals() and hashCode() added to AlignmentEditorInput.
Minor changes.

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditSequenceHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditorHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java

index d6aa37d47058bdd72e0741344e099961dc90eea8..dc41cf1ffa47c945cf94477b70aa630c00c7aadd 100644 (file)
@@ -1,11 +1,6 @@
 package eu.etaxonomy.taxeditor.editor.handler;
 
 
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
index 1daba07c24fbabea5540ba19ec788eb0b89df189..4350fa29ca7e990dc63881aecf7f13cd8c04a3e3 100644 (file)
@@ -28,6 +28,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  * @author pplitzner
  * @date 04.08.2014
  */
+@Deprecated
 public class OpenAlignmentEditorHandler extends AbstractHandler {
     /* (non-Javadoc)
      * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
index e0025ccad17d9b01fbb6613bf5004697a60e83fc..b1537e9b3775cc09722a2252bfbea470d4f962f2 100644 (file)
@@ -279,7 +279,7 @@ public class AlignmentEditor extends EditorPart {
                                readCDMData();
                        }
                        else {
-                               createTestContents();  //TODO What to do here instead in the final version?
+                               createTestContents();  // This case will removed after the test phase and an exception should probably be thrown.
                        }
                }
                else {
index 1664a0895fee2f8c17cc36bbcb2462b4e395240e..9d6201d20164b432dbedb322ccbe87a4e4bedb6f 100644 (file)
@@ -102,4 +102,32 @@ public class AlignmentEditorInput implements IEditorInput {
        public Sequence getSequenceNode() {
                return sequenceNode;
        }
+
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result
+                               + ((sequenceNode == null) ? 0 : sequenceNode.hashCode());
+               return result;
+       }
+
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AlignmentEditorInput other = (AlignmentEditorInput) obj;
+               if (sequenceNode == null) {
+                       if (other.sequenceNode != null)
+                               return false;
+               } else if (!sequenceNode.equals(other.sequenceNode))
+                       return false;
+               return true;
+       }
 }