Revision 725cf795
Added by Niels Hoffmann almost 13 years ago
.gitattributes | ||
---|---|---|
66 | 66 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/IBulkEditorConstants.java -text |
67 | 67 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/IBulkEditorSortProvider.java -text |
68 | 68 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/PropertyTester.java -text |
69 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorInputTypeValues.java -text |
|
70 | 69 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorPropertyTester.java -text |
71 | 70 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DeleteObjectContributionItem.java -text |
72 | 71 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicMarkerTypeEditingMenu.java -text |
... | ... | |
85 | 84 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/SetMergeTargetHandler.java -text |
86 | 85 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java -text |
87 | 86 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java -text |
87 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputTypeValues.java -text |
|
88 | 88 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/GroupEditorInput.java -text |
89 | 89 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java -text |
90 | 90 |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameRelationshipEditorInput.java -text |
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml | ||
---|---|---|
149 | 149 |
<commandParameter |
150 | 150 |
id="taxeditor-bulkeditor.commandParameter.inputType" |
151 | 151 |
name="Bulk Editor Class" |
152 |
values="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues">
|
|
152 |
values="eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues">
|
|
153 | 153 |
</commandParameter> |
154 | 154 |
</command> |
155 | 155 |
<command |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorSearch.java | ||
---|---|---|
50 | 50 |
*/ |
51 | 51 |
private static final String SEARCH = "Search"; |
52 | 52 |
|
53 |
private static final String DEFAULT_TEXT = "Use \"*\" for wildcard searching";
|
|
53 |
private static final String WILDCARD = "*";
|
|
54 | 54 |
|
55 |
private BulkEditor editor; |
|
55 |
private static final String DEFAULT_TEXT = String.format("Use \'%s\' for wildcard searching", WILDCARD); |
|
56 |
|
|
57 |
private final BulkEditor editor; |
|
56 | 58 |
private Menu sortMenu; |
57 | 59 |
|
58 | 60 |
private Text text; |
... | ... | |
181 | 183 |
private void updateEditorInput() { |
182 | 184 |
|
183 | 185 |
String searchString = getSearchString().trim(); |
186 |
|
|
187 |
if(WILDCARD.equals(searchString.trim())){ |
|
188 |
BulkEditorUtil.warningDialog("Could not execute search", this, String.format("Please type at least one character when using the \"%s\" wildcard.", WILDCARD)); |
|
189 |
return; |
|
190 |
} |
|
191 |
|
|
184 | 192 |
|
185 | 193 |
if(DEFAULT_TEXT.equals(searchString) || CdmUtils.isEmpty(searchString)){ |
186 | 194 |
return; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorUtil.java | ||
---|---|---|
19 | 19 |
import org.eclipse.ui.PartInitException; |
20 | 20 |
|
21 | 21 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
22 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType; |
|
23 | 22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
23 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType; |
|
24 | 24 |
import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin; |
25 | 25 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
26 | 26 |
|
... | ... | |
49 | 49 |
/** |
50 | 50 |
* <p>openEmptyEditor</p> |
51 | 51 |
* |
52 |
* @param inputType a {@link eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType} object.
|
|
52 |
* @param inputType a {@link eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType} object.
|
|
53 | 53 |
* @throws org.eclipse.ui.PartInitException if any. |
54 | 54 |
*/ |
55 | 55 |
public static void openEmptyEditor(BulkEditorInputType inputType) throws PartInitException{ |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorInputTypeValues.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.bulkeditor.command; |
|
12 |
|
|
13 |
import java.util.HashMap; |
|
14 |
import java.util.Map; |
|
15 |
|
|
16 |
import org.eclipse.core.commands.IParameterValues; |
|
17 |
import org.eclipse.ui.IEditorInput; |
|
18 |
|
|
19 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
|
20 |
import eu.etaxonomy.cdm.model.common.Group; |
|
21 |
import eu.etaxonomy.cdm.model.common.User; |
|
22 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
|
23 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
24 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
25 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
26 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
|
27 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AgentEditorInput; |
|
28 |
import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput; |
|
29 |
import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput; |
|
30 |
import eu.etaxonomy.taxeditor.bulkeditor.input.NameRelationshipEditorInput; |
|
31 |
import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput; |
|
32 |
import eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput; |
|
33 |
import eu.etaxonomy.taxeditor.bulkeditor.input.UserEditorInput; |
|
34 |
|
|
35 |
/** |
|
36 |
* <p> |
|
37 |
* BulkEditorInputTypeValues class. |
|
38 |
* </p> |
|
39 |
* |
|
40 |
* @author p.ciardelli |
|
41 |
* @created 20.08.2009 |
|
42 |
* @version 1.0 |
|
43 |
*/ |
|
44 |
public class BulkEditorInputTypeValues implements IParameterValues { |
|
45 |
|
|
46 |
public enum BulkEditorInputType { |
|
47 |
REFERENCE("Reference", ReferenceEditorInput.ID), NAME("Name", |
|
48 |
NameEditorInput.ID), AGENT("Authors and Author Teams", |
|
49 |
AgentEditorInput.ID), OCCURRENCE("Specimens and Observations", |
|
50 |
OccurrenceEditorInput.ID), NAME_RELATIONSHIP( |
|
51 |
"Name Relationship", NameRelationshipEditorInput.ID), USER( |
|
52 |
"User", UserEditorInput.ID), GROUP("Group", GroupEditorInput.ID); |
|
53 |
|
|
54 |
public String id; |
|
55 |
public String label; |
|
56 |
|
|
57 |
BulkEditorInputType(String label, String id) { |
|
58 |
this.id = id; |
|
59 |
this.label = label; |
|
60 |
} |
|
61 |
|
|
62 |
public static BulkEditorInputType getById(String id) { |
|
63 |
|
|
64 |
for (BulkEditorInputType type : values()) { |
|
65 |
if (id.equals(type.id)) { |
|
66 |
return type; |
|
67 |
} |
|
68 |
} |
|
69 |
|
|
70 |
return null; |
|
71 |
} |
|
72 |
|
|
73 |
public static BulkEditorInputType getByType(Class clazz) { |
|
74 |
if (Reference.class.isAssignableFrom(clazz)) { |
|
75 |
return REFERENCE; |
|
76 |
} else if (TaxonNameBase.class.isAssignableFrom(clazz)) { |
|
77 |
return NAME; |
|
78 |
} else if (AgentBase.class.isAssignableFrom(clazz)) { |
|
79 |
return AGENT; |
|
80 |
} else if (SpecimenOrObservationBase.class.isAssignableFrom(clazz)) { |
|
81 |
return OCCURRENCE; |
|
82 |
} else if (NameRelationship.class.isAssignableFrom(clazz)) { |
|
83 |
return NAME_RELATIONSHIP; |
|
84 |
} else if (Group.class.isAssignableFrom(clazz)) { |
|
85 |
return GROUP; |
|
86 |
} else if (User.class.isAssignableFrom(clazz)) { |
|
87 |
return USER; |
|
88 |
} |
|
89 |
return null; |
|
90 |
} |
|
91 |
|
|
92 |
public static BulkEditorInputType getByInput(IEditorInput input) { |
|
93 |
if (input instanceof ReferenceEditorInput) { |
|
94 |
return REFERENCE; |
|
95 |
} else if (input instanceof NameEditorInput) { |
|
96 |
return NAME; |
|
97 |
} else if (input instanceof AgentEditorInput) { |
|
98 |
return AGENT; |
|
99 |
} else if (input instanceof OccurrenceEditorInput) { |
|
100 |
return OCCURRENCE; |
|
101 |
} else if (input instanceof NameRelationshipEditorInput) { |
|
102 |
return NAME_RELATIONSHIP; |
|
103 |
} else if (input instanceof UserEditorInput) { |
|
104 |
return USER; |
|
105 |
} else if (input instanceof GroupEditorInput) { |
|
106 |
return GROUP; |
|
107 |
} |
|
108 |
return null; |
|
109 |
} |
|
110 |
|
|
111 |
public static AbstractBulkEditorInput getInput( |
|
112 |
BulkEditorInputType inputType) { |
|
113 |
switch (inputType) { |
|
114 |
case REFERENCE: |
|
115 |
return new ReferenceEditorInput(); |
|
116 |
case NAME: |
|
117 |
return new NameEditorInput(); |
|
118 |
case AGENT: |
|
119 |
return new AgentEditorInput(); |
|
120 |
case OCCURRENCE: |
|
121 |
return new OccurrenceEditorInput(); |
|
122 |
case NAME_RELATIONSHIP: |
|
123 |
return new NameRelationshipEditorInput(); |
|
124 |
case USER: |
|
125 |
return new UserEditorInput(); |
|
126 |
case GROUP: |
|
127 |
return new GroupEditorInput(); |
|
128 |
default: |
|
129 |
throw new IllegalStateException( |
|
130 |
"No input class for the given input type defined."); |
|
131 |
} |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
/* |
|
136 |
* (non-Javadoc) |
|
137 |
* |
|
138 |
* @see org.eclipse.core.commands.IParameterValues#getParameterValues() |
|
139 |
*/ |
|
140 |
/** |
|
141 |
* <p> |
|
142 |
* getParameterValues |
|
143 |
* </p> |
|
144 |
* |
|
145 |
* @return a {@link java.util.Map} object. |
|
146 |
*/ |
|
147 |
@Override |
|
148 |
public Map getParameterValues() { |
|
149 |
final Map values = new HashMap(); |
|
150 |
|
|
151 |
// TODO user role determines which editor inputs are returned |
|
152 |
for (BulkEditorInputType inputType : BulkEditorInputType.values()) { |
|
153 |
values.put(inputType.label, inputType.id); |
|
154 |
} |
|
155 |
|
|
156 |
return values; |
|
157 |
} |
|
158 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DeleteObjectContributionItem.java | ||
---|---|---|
21 | 21 |
import org.eclipse.ui.menus.CommandContributionItemParameter; |
22 | 22 |
|
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; |
24 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
25 | 25 |
|
26 | 26 |
/** |
27 | 27 |
* <p>DeleteObjectContributionItem class.</p> |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java | ||
---|---|---|
23 | 23 |
import org.eclipse.ui.menus.CommandContributionItemParameter; |
24 | 24 |
|
25 | 25 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; |
26 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues; |
|
26 | 27 |
|
27 | 28 |
/** |
28 | 29 |
* <p> |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/OpenBulkEditorHandler.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor; |
19 | 19 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants; |
20 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType; |
|
21 | 20 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
21 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType; |
|
22 | 22 |
|
23 | 23 |
/** |
24 | 24 |
* <p>OpenBulkEditorHandler class.</p> |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
32 | 32 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery; |
33 | 33 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil; |
34 | 34 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
35 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
35 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
36 | 36 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider; |
37 | 37 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator; |
38 | 38 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
61 | 61 |
/** |
62 | 62 |
* <p>NewInstance</p> |
63 | 63 |
* |
64 |
* @param inputType a {@link eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType} object.
|
|
64 |
* @param inputType a {@link eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType} object.
|
|
65 | 65 |
* @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object. |
66 | 66 |
*/ |
67 | 67 |
static public AbstractBulkEditorInput NewInstance(BulkEditorInputType inputType) { |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
19 | 19 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
20 | 20 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
21 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
21 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
22 | 22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.AgentCreator; |
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider; |
24 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputTypeValues.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2007 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
|
|
11 |
package eu.etaxonomy.taxeditor.bulkeditor.input; |
|
12 |
|
|
13 |
import java.util.HashMap; |
|
14 |
import java.util.Map; |
|
15 |
|
|
16 |
import org.eclipse.core.commands.IParameterValues; |
|
17 |
import org.eclipse.ui.IEditorInput; |
|
18 |
|
|
19 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
|
20 |
import eu.etaxonomy.cdm.model.common.Group; |
|
21 |
import eu.etaxonomy.cdm.model.common.User; |
|
22 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
|
23 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
24 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
25 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
26 |
|
|
27 |
/** |
|
28 |
* <p> |
|
29 |
* BulkEditorInputTypeValues class. |
|
30 |
* </p> |
|
31 |
* |
|
32 |
* @author p.ciardelli |
|
33 |
* @created 20.08.2009 |
|
34 |
* @version 1.0 |
|
35 |
*/ |
|
36 |
public class BulkEditorInputTypeValues implements IParameterValues { |
|
37 |
|
|
38 |
public enum BulkEditorInputType { |
|
39 |
REFERENCE("Reference", ReferenceEditorInput.ID), NAME("Name", |
|
40 |
NameEditorInput.ID), AGENT("Authors and Author Teams", |
|
41 |
AgentEditorInput.ID), OCCURRENCE("Specimens and Observations", |
|
42 |
OccurrenceEditorInput.ID), NAME_RELATIONSHIP( |
|
43 |
"Name Relationship", NameRelationshipEditorInput.ID), USER( |
|
44 |
"User", UserEditorInput.ID), GROUP("Group", GroupEditorInput.ID); |
|
45 |
|
|
46 |
public String id; |
|
47 |
public String label; |
|
48 |
|
|
49 |
BulkEditorInputType(String label, String id) { |
|
50 |
this.id = id; |
|
51 |
this.label = label; |
|
52 |
} |
|
53 |
|
|
54 |
public static BulkEditorInputType getById(String id) { |
|
55 |
|
|
56 |
for (BulkEditorInputType type : values()) { |
|
57 |
if (id.equals(type.id)) { |
|
58 |
return type; |
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
return null; |
|
63 |
} |
|
64 |
|
|
65 |
public static BulkEditorInputType getByType(Class clazz) { |
|
66 |
if (Reference.class.isAssignableFrom(clazz)) { |
|
67 |
return REFERENCE; |
|
68 |
} else if (TaxonNameBase.class.isAssignableFrom(clazz)) { |
|
69 |
return NAME; |
|
70 |
} else if (AgentBase.class.isAssignableFrom(clazz)) { |
|
71 |
return AGENT; |
|
72 |
} else if (SpecimenOrObservationBase.class.isAssignableFrom(clazz)) { |
|
73 |
return OCCURRENCE; |
|
74 |
} else if (NameRelationship.class.isAssignableFrom(clazz)) { |
|
75 |
return NAME_RELATIONSHIP; |
|
76 |
} else if (Group.class.isAssignableFrom(clazz)) { |
|
77 |
return GROUP; |
|
78 |
} else if (User.class.isAssignableFrom(clazz)) { |
|
79 |
return USER; |
|
80 |
} |
|
81 |
return null; |
|
82 |
} |
|
83 |
|
|
84 |
public static BulkEditorInputType getByInput(IEditorInput input) { |
|
85 |
if (input instanceof ReferenceEditorInput) { |
|
86 |
return REFERENCE; |
|
87 |
} else if (input instanceof NameEditorInput) { |
|
88 |
return NAME; |
|
89 |
} else if (input instanceof AgentEditorInput) { |
|
90 |
return AGENT; |
|
91 |
} else if (input instanceof OccurrenceEditorInput) { |
|
92 |
return OCCURRENCE; |
|
93 |
} else if (input instanceof NameRelationshipEditorInput) { |
|
94 |
return NAME_RELATIONSHIP; |
|
95 |
} else if (input instanceof UserEditorInput) { |
|
96 |
return USER; |
|
97 |
} else if (input instanceof GroupEditorInput) { |
|
98 |
return GROUP; |
|
99 |
} |
|
100 |
return null; |
|
101 |
} |
|
102 |
|
|
103 |
public static AbstractBulkEditorInput getInput( |
|
104 |
BulkEditorInputType inputType) { |
|
105 |
switch (inputType) { |
|
106 |
case REFERENCE: |
|
107 |
return new ReferenceEditorInput(); |
|
108 |
case NAME: |
|
109 |
return new NameEditorInput(); |
|
110 |
case AGENT: |
|
111 |
return new AgentEditorInput(); |
|
112 |
case OCCURRENCE: |
|
113 |
return new OccurrenceEditorInput(); |
|
114 |
case NAME_RELATIONSHIP: |
|
115 |
return new NameRelationshipEditorInput(); |
|
116 |
case USER: |
|
117 |
return new UserEditorInput(); |
|
118 |
case GROUP: |
|
119 |
return new GroupEditorInput(); |
|
120 |
default: |
|
121 |
throw new IllegalStateException( |
|
122 |
"No input class for the given input type defined."); |
|
123 |
} |
|
124 |
} |
|
125 |
} |
|
126 |
|
|
127 |
/* |
|
128 |
* (non-Javadoc) |
|
129 |
* |
|
130 |
* @see org.eclipse.core.commands.IParameterValues#getParameterValues() |
|
131 |
*/ |
|
132 |
/** |
|
133 |
* <p> |
|
134 |
* getParameterValues |
|
135 |
* </p> |
|
136 |
* |
|
137 |
* @return a {@link java.util.Map} object. |
|
138 |
*/ |
|
139 |
@Override |
|
140 |
public Map getParameterValues() { |
|
141 |
final Map values = new HashMap(); |
|
142 |
|
|
143 |
// TODO user role determines which editor inputs are returned |
|
144 |
for (BulkEditorInputType inputType : BulkEditorInputType.values()) { |
|
145 |
values.put(inputType.label, inputType.id); |
|
146 |
} |
|
147 |
|
|
148 |
return values; |
|
149 |
} |
|
150 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/GroupEditorInput.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
19 | 19 |
import eu.etaxonomy.cdm.model.common.Group; |
20 | 20 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
21 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
21 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
22 | 22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.GroupCreator; |
23 | 23 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
24 | 24 |
|
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
20 | 20 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
21 | 21 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
22 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.NameCreator; |
24 | 24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider; |
25 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameRelationshipEditorInput.java | ||
---|---|---|
21 | 21 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
22 | 22 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil; |
24 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
25 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
26 | 26 |
|
27 | 27 |
/** |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/OccurrenceEditorInput.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
20 | 20 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
21 | 21 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
22 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.OccurrenceCreator; |
24 | 24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider; |
25 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.cdm.model.reference.Reference; |
20 | 20 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
21 | 21 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
22 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.ReferenceCreator; |
24 | 24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.CdmBaseSortProvider; |
25 | 25 |
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.IdentifiableEntitySortProvider; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/UserEditorInput.java | ||
---|---|---|
18 | 18 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
19 | 19 |
import eu.etaxonomy.cdm.model.common.User; |
20 | 20 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
21 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
21 |
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputTypeValues.BulkEditorInputType;
|
|
22 | 22 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.UserCreator; |
23 | 23 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
24 | 24 |
|
Also available in: Unified diff
Fixes #2366