Basically fixes #2282. I will create new tickets for still open issues.
[taxeditor.git] / taxeditor-bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / command / BulkEditorInputTypeValues.java
index cb69b1cfa11c40aca59b77027809fab16c0e5749..5a7fa09083e9f1d6d0c74f9cdc729891fa9c3184 100644 (file)
@@ -17,16 +17,20 @@ import org.eclipse.core.commands.IParameterValues;
 import org.eclipse.ui.IEditorInput;
 
 import eu.etaxonomy.cdm.model.agent.AgentBase;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.common.User;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AgentEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.NameRelationshipEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
 import eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.UserEditorInput;
 
 /**
  * <p>BulkEditorInputTypeValues class.</p>
@@ -41,8 +45,11 @@ public class BulkEditorInputTypeValues implements IParameterValues {
                REFERENCE("Reference", ReferenceEditorInput.ID),
                NAME("Name", NameEditorInput.ID),
                AGENT("Authors and Author Teams", AgentEditorInput.ID),
-               OCCURRENCE("Specimen or Observations", OccurrenceEditorInput.ID), 
-               NAME_RELATIONSHIP("Name Relationship", NameRelationshipEditorInput.ID);
+               OCCURRENCE("Specimens or Observations", OccurrenceEditorInput.ID), 
+               NAME_RELATIONSHIP("Name Relationship", NameRelationshipEditorInput.ID),
+               USER("User", UserEditorInput.ID), 
+               GROUP("Group", GroupEditorInput.ID);
+               
                
                public String id;
                public String label;
@@ -79,6 +86,12 @@ public class BulkEditorInputTypeValues implements IParameterValues {
                        else if (NameRelationship.class.isAssignableFrom(clazz)){
                                return NAME_RELATIONSHIP;
                        }
+                       else if (Group.class.isAssignableFrom(clazz)){
+                               return GROUP;
+                       }
+                       else if (User.class.isAssignableFrom(clazz)){
+                               return USER;
+                       }
                        return null;
                }
                
@@ -98,6 +111,12 @@ public class BulkEditorInputTypeValues implements IParameterValues {
                        else if (input instanceof NameRelationshipEditorInput) {
                                return NAME_RELATIONSHIP;
                        }
+                       else if(input instanceof UserEditorInput){
+                               return USER;
+                       }
+                       else if(input instanceof GroupEditorInput){
+                               return GROUP;
+                       }
                        return null;
                }
                
@@ -113,8 +132,12 @@ public class BulkEditorInputTypeValues implements IParameterValues {
                                return new OccurrenceEditorInput();
                        case NAME_RELATIONSHIP:
                                return new NameRelationshipEditorInput();
+                       case USER:
+                               return new UserEditorInput();
+                       case GROUP:
+                               return new GroupEditorInput();
                        default:
-                               return null;
+                               throw new IllegalStateException("No input class for the given input type defined.");
                        }
                }
        }