eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/SetMergeTargetHandler.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputTypeValues.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputType.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/GroupEditorInput.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java -text
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameRelationshipEditorInput.java -text
package eu.etaxonomy.taxeditor.bulkeditor;
-import org.apache.log4j.Logger;
import org.eclipse.core.commands.operations.IOperationHistory;
import org.eclipse.core.commands.operations.IUndoContext;
import org.eclipse.core.runtime.Assert;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
+import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import org.eclipse.ui.menus.CommandContributionItemParameter;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
+import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
/**
* <p>DeleteObjectContributionItem class.</p>
import java.util.Map;
import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.Separator;
import org.eclipse.swt.SWT;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CompoundContributionItem;
import org.eclipse.ui.menus.CommandContributionItemParameter;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues;
+import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
/**
* <p>
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
- Map inputTypeValues = (new BulkEditorInputTypeValues())
- .getParameterValues();
- for (Object key : inputTypeValues.keySet()) {
- contributionItems.add(createContributionItem((String) key,
- (String) inputTypeValues.get(key)));
- }
+ contributionItems.add(BulkEditorInputType.AGENT.createContributionItem());
+ contributionItems.add(BulkEditorInputType.REFERENCE.createContributionItem());
+ contributionItems.add(new Separator("test"));
+ contributionItems.add(BulkEditorInputType.NAME.createContributionItem());
+ contributionItems.add(BulkEditorInputType.NAME_RELATIONSHIP.createContributionItem());
+ contributionItems.add(new Separator("test"));
+ contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem());
+ contributionItems.add(new Separator("test"));
+ contributionItems.add(BulkEditorInputType.USER.createContributionItem());
+ contributionItems.add(BulkEditorInputType.GROUP.createContributionItem());
return contributionItems
.toArray(new IContributionItem[contributionItems.size()]);
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
+import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
/**
* <p>OpenBulkEditorHandler class.</p>
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.AgentCreator;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
import eu.etaxonomy.taxeditor.store.CdmStore;
--- /dev/null
+package eu.etaxonomy.taxeditor.bulkeditor.input;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+
+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.IBulkEditorConstants;
+
+public enum BulkEditorInputType {
+ AGENT("Authors and Author Teams", AgentEditorInput.ID),
+ REFERENCE("Reference", ReferenceEditorInput.ID),
+ NAME("Name", NameEditorInput.ID),
+ NAME_RELATIONSHIP("Name Relationship", NameRelationshipEditorInput.ID),
+ OCCURRENCE("Specimens and Observations", OccurrenceEditorInput.ID),
+ USER("User", UserEditorInput.ID),
+ GROUP("Group", GroupEditorInput.ID);
+
+ public String id;
+ public String label;
+
+ BulkEditorInputType(String label, String id) {
+ this.id = id;
+ this.label = label;
+ }
+
+ public IContributionItem createContributionItem(){
+ return createContributionItem(label, id);
+ }
+
+ /**
+ * @param key
+ * @param object
+ * @return
+ */
+ private IContributionItem createContributionItem(String label,
+ String inputType) {
+ CommandContributionItemParameter parameter = new CommandContributionItemParameter(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null,
+ IBulkEditorConstants.DYNAMIC_OPEN_MENU_ID, SWT.NONE);
+
+ parameter.label = label;
+
+ Map parameters = new HashMap();
+ parameters.put(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID, inputType);
+ parameter.parameters = parameters;
+
+ return new CommandContributionItem(parameter);
+ }
+
+ public static BulkEditorInputType getById(String id) {
+
+ for (BulkEditorInputType type : values()) {
+ if (id.equals(type.id)) {
+ return type;
+ }
+ }
+
+ return null;
+ }
+
+ public static BulkEditorInputType getByType(Class clazz) {
+ if (Reference.class.isAssignableFrom(clazz)) {
+ return REFERENCE;
+ } else if (TaxonNameBase.class.isAssignableFrom(clazz)) {
+ return NAME;
+ } else if (AgentBase.class.isAssignableFrom(clazz)) {
+ return AGENT;
+ } else if (SpecimenOrObservationBase.class.isAssignableFrom(clazz)) {
+ return OCCURRENCE;
+ } 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;
+ }
+
+ public static BulkEditorInputType getByInput(IEditorInput input) {
+ if (input instanceof ReferenceEditorInput) {
+ return REFERENCE;
+ } else if (input instanceof NameEditorInput) {
+ return NAME;
+ } else if (input instanceof AgentEditorInput) {
+ return AGENT;
+ } else if (input instanceof OccurrenceEditorInput) {
+ return OCCURRENCE;
+ } else if (input instanceof NameRelationshipEditorInput) {
+ return NAME_RELATIONSHIP;
+ } else if (input instanceof UserEditorInput) {
+ return USER;
+ } else if (input instanceof GroupEditorInput) {
+ return GROUP;
+ }
+ return null;
+ }
+
+ public static AbstractBulkEditorInput getInput(
+ BulkEditorInputType inputType) {
+ switch (inputType) {
+ case REFERENCE:
+ return new ReferenceEditorInput();
+ case NAME:
+ return new NameEditorInput();
+ case AGENT:
+ return new AgentEditorInput();
+ case OCCURRENCE:
+ return new OccurrenceEditorInput();
+ case NAME_RELATIONSHIP:
+ return new NameRelationshipEditorInput();
+ case USER:
+ return new UserEditorInput();
+ case GROUP:
+ return new GroupEditorInput();
+ default:
+ throw new IllegalStateException(
+ "No input class for the given input type defined.");
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-// $Id$
-/**
- * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-
-package eu.etaxonomy.taxeditor.bulkeditor.input;
-
-import java.util.HashMap;
-import java.util.Map;
-
-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;
-
-/**
- * <p>
- * BulkEditorInputTypeValues class.
- * </p>
- *
- * @author p.ciardelli
- * @created 20.08.2009
- * @version 1.0
- */
-public class BulkEditorInputTypeValues implements IParameterValues {
-
- public enum BulkEditorInputType {
- REFERENCE("Reference", ReferenceEditorInput.ID), NAME("Name",
- NameEditorInput.ID), AGENT("Authors and Author Teams",
- AgentEditorInput.ID), OCCURRENCE("Specimens and Observations",
- OccurrenceEditorInput.ID), NAME_RELATIONSHIP(
- "Name Relationship", NameRelationshipEditorInput.ID), USER(
- "User", UserEditorInput.ID), GROUP("Group", GroupEditorInput.ID);
-
- public String id;
- public String label;
-
- BulkEditorInputType(String label, String id) {
- this.id = id;
- this.label = label;
- }
-
- public static BulkEditorInputType getById(String id) {
-
- for (BulkEditorInputType type : values()) {
- if (id.equals(type.id)) {
- return type;
- }
- }
-
- return null;
- }
-
- public static BulkEditorInputType getByType(Class clazz) {
- if (Reference.class.isAssignableFrom(clazz)) {
- return REFERENCE;
- } else if (TaxonNameBase.class.isAssignableFrom(clazz)) {
- return NAME;
- } else if (AgentBase.class.isAssignableFrom(clazz)) {
- return AGENT;
- } else if (SpecimenOrObservationBase.class.isAssignableFrom(clazz)) {
- return OCCURRENCE;
- } 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;
- }
-
- public static BulkEditorInputType getByInput(IEditorInput input) {
- if (input instanceof ReferenceEditorInput) {
- return REFERENCE;
- } else if (input instanceof NameEditorInput) {
- return NAME;
- } else if (input instanceof AgentEditorInput) {
- return AGENT;
- } else if (input instanceof OccurrenceEditorInput) {
- return OCCURRENCE;
- } else if (input instanceof NameRelationshipEditorInput) {
- return NAME_RELATIONSHIP;
- } else if (input instanceof UserEditorInput) {
- return USER;
- } else if (input instanceof GroupEditorInput) {
- return GROUP;
- }
- return null;
- }
-
- public static AbstractBulkEditorInput getInput(
- BulkEditorInputType inputType) {
- switch (inputType) {
- case REFERENCE:
- return new ReferenceEditorInput();
- case NAME:
- return new NameEditorInput();
- case AGENT:
- return new AgentEditorInput();
- case OCCURRENCE:
- return new OccurrenceEditorInput();
- case NAME_RELATIONSHIP:
- return new NameRelationshipEditorInput();
- case USER:
- return new UserEditorInput();
- case GROUP:
- return new GroupEditorInput();
- default:
- throw new IllegalStateException(
- "No input class for the given input type defined.");
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.commands.IParameterValues#getParameterValues()
- */
- /**
- * <p>
- * getParameterValues
- * </p>
- *
- * @return a {@link java.util.Map} object.
- */
- @Override
- public Map getParameterValues() {
- final Map values = new HashMap();
-
- // TODO user role determines which editor inputs are returned
- for (BulkEditorInputType inputType : BulkEditorInputType.values()) {
- values.put(inputType.label, inputType.id);
- }
-
- return values;
- }
-}
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.GroupCreator;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.NameCreator;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
import eu.etaxonomy.taxeditor.store.CdmStore;
package eu.etaxonomy.taxeditor.bulkeditor.input;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
-import eu.etaxonomy.cdm.api.service.INameService;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
-import eu.etaxonomy.cdm.model.common.RelationshipBase;
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.OccurrenceCreator;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.ReferenceCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider;
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.ReferenceSortProvider;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
-import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.UserCreator;
import eu.etaxonomy.taxeditor.store.CdmStore;