Revision e3a4a3ff
Added by Andreas Müller almost 7 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLineDisplay.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.model.common.IAnnotatableEntity; |
25 | 25 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
26 | 26 |
import eu.etaxonomy.cdm.model.common.Marker; |
27 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
27 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
28 | 28 |
import eu.etaxonomy.cdm.model.reference.Reference; |
29 | 29 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener; |
30 | 30 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy; |
... | ... | |
35 | 35 |
* |
36 | 36 |
* @author p.ciardelli |
37 | 37 |
* @created 07.07.2009 |
38 |
* @version 1.0 |
|
39 | 38 |
*/ |
40 | 39 |
public class BulkEditorLineDisplay implements ILineDisplayStrategy { |
41 | 40 |
|
... | ... | |
50 | 49 |
this.editor = editor; |
51 | 50 |
} |
52 | 51 |
|
53 |
/* (non-Javadoc) |
|
54 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getIcon(java.lang.Object) |
|
55 |
*/ |
|
56 | 52 |
/** {@inheritDoc} */ |
57 | 53 |
@Override |
58 | 54 |
public Image getIcon(Object entity) { |
59 | 55 |
return null; |
60 | 56 |
} |
61 | 57 |
|
62 |
/* (non-Javadoc) |
|
63 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getIndent(java.lang.Object) |
|
64 |
*/ |
|
65 | 58 |
/** {@inheritDoc} */ |
66 | 59 |
@Override |
67 | 60 |
public int getIndent(Object entity) { |
68 | 61 |
return 0; |
69 | 62 |
} |
70 | 63 |
|
71 |
/* (non-Javadoc) |
|
72 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getText(java.lang.Object) |
|
73 |
*/ |
|
74 | 64 |
/** {@inheritDoc} */ |
75 | 65 |
@Override |
76 | 66 |
public String getText(Object entity) { |
77 | 67 |
return editor.getEditorInput().getText((ICdmBase) entity); |
78 | 68 |
} |
79 | 69 |
|
80 |
|
|
81 |
/* (non-Javadoc) |
|
82 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getSupplementalText(java.lang.Object) |
|
83 |
*/ |
|
84 | 70 |
/** {@inheritDoc} */ |
85 | 71 |
@Override |
86 | 72 |
public String getSupplementalText(Object entity) { |
... | ... | |
111 | 97 |
return supplementalText; |
112 | 98 |
} |
113 | 99 |
|
114 |
/* (non-Javadoc) |
|
115 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#setText(java.lang.String, java.lang.Object) |
|
116 |
*/ |
|
117 | 100 |
/** {@inheritDoc} */ |
118 | 101 |
@Override |
119 | 102 |
public void setText(String text, Object entity) { |
... | ... | |
122 | 105 |
} |
123 | 106 |
} |
124 | 107 |
|
125 |
/* (non-Javadoc) |
|
126 |
* @see eu.etaxonomy.taxeditor.bulkeditor.ILineDisplayStrategy#getHoverText(java.lang.Object) |
|
127 |
*/ |
|
128 | 108 |
/** {@inheritDoc} */ |
129 | 109 |
@Override |
130 | 110 |
public String getHoverText(Object entity) { |
... | ... | |
155 | 135 |
}).start(); |
156 | 136 |
} |
157 | 137 |
|
158 |
/* (non-Javadoc) |
|
159 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getEmptyText(java.lang.Object) |
|
160 |
*/ |
|
161 | 138 |
/** {@inheritDoc} */ |
162 | 139 |
@Override |
163 | 140 |
public String getEmptyCacheMessage(Object entity) { |
164 | 141 |
return entity.toString(); |
165 | 142 |
} |
166 | 143 |
|
167 |
/* (non-Javadoc) |
|
168 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#isEntityCacheEmpty(java.lang.Object) |
|
169 |
*/ |
|
170 | 144 |
/** {@inheritDoc} */ |
171 | 145 |
@Override |
172 | 146 |
public boolean isEntityCacheEmpty(Object entity) { |
... | ... | |
174 | 148 |
String text = ((Reference) entity).getTitleCache(); |
175 | 149 |
return (text == null || text.equals("")); |
176 | 150 |
} |
177 |
if (entity instanceof TaxonNameBase) {
|
|
178 |
String text = ((TaxonNameBase) entity).getTitleCache();
|
|
151 |
if (entity instanceof TaxonName) { |
|
152 |
String text = ((TaxonName) entity).getTitleCache(); |
|
179 | 153 |
return (text == null || text.equals("")); |
180 | 154 |
} |
181 | 155 |
if (entity instanceof AgentBase) { |
... | ... | |
185 | 159 |
return false; |
186 | 160 |
} |
187 | 161 |
|
188 |
/* (non-Javadoc) |
|
189 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#addDisplayListener(java.lang.Object) |
|
190 |
*/ |
|
191 | 162 |
/** {@inheritDoc} */ |
192 | 163 |
@Override |
193 | 164 |
public void addDisplayListener(Object entity, EntityListener listener) { |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java | ||
---|---|---|
20 | 20 |
import org.eclipse.core.runtime.Status; |
21 | 21 |
import org.eclipse.jface.dialogs.MessageDialog; |
22 | 22 |
import org.eclipse.jface.text.TextSelection; |
23 |
import org.eclipse.jface.text.source.Annotation; |
|
24 | 23 |
import org.eclipse.jface.viewers.IStructuredSelection; |
25 | 24 |
import org.eclipse.ui.IEditorInput; |
26 | 25 |
import org.eclipse.ui.IEditorPart; |
... | ... | |
43 | 42 |
import eu.etaxonomy.cdm.model.common.Group; |
44 | 43 |
import eu.etaxonomy.cdm.model.common.User; |
45 | 44 |
import eu.etaxonomy.cdm.model.media.Media; |
46 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
45 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
47 | 46 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
48 | 47 |
import eu.etaxonomy.cdm.model.reference.Reference; |
49 | 48 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
... | ... | |
96 | 95 |
|
97 | 96 |
IStructuredSelection structuredSelection = (IStructuredSelection) selection; |
98 | 97 |
DeleteConfiguratorBase config = null; |
99 |
IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;
|
|
98 |
IEntityPersistenceService<?> persistenceService = (IEntityPersistenceService<?>) input;
|
|
100 | 99 |
DeleteResult result = new DeleteResult(); |
101 | 100 |
String errorMessage= "The object "; |
102 | 101 |
for(Object object : structuredSelection.toList()){ |
103 | 102 |
if (object instanceof CdmBase){ |
104 | 103 |
CdmBase base = (CdmBase)object; |
105 |
LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);
|
|
104 |
LineAnnotation<?> annotation = (LineAnnotation<?>) model.getAnnotation(object);
|
|
106 | 105 |
if (base.getId() != 0){ |
107 | 106 |
|
108 | 107 |
|
... | ... | |
119 | 118 |
return null; |
120 | 119 |
} |
121 | 120 |
if (object != null){ |
122 |
result = service.isDeletable(((SpecimenOrObservationBase) object).getUuid(), config); |
|
121 |
result = service.isDeletable(((SpecimenOrObservationBase<?>) object).getUuid(), config);
|
|
123 | 122 |
errorMessage = "The specimen or observation "; |
124 | 123 |
|
125 | 124 |
} |
... | ... | |
134 | 133 |
errorMessage = "The group "; |
135 | 134 |
}else if (object instanceof User){ |
136 | 135 |
errorMessage = "The user "; |
137 |
} else if (object instanceof TaxonNameBase){
|
|
138 |
TaxonNameBase name = HibernateProxyHelper.deproxy(object, TaxonNameBase.class);
|
|
136 |
} else if (object instanceof TaxonName){ |
|
137 |
TaxonName name = HibernateProxyHelper.deproxy(object, TaxonName.class);
|
|
139 | 138 |
if (object != null){ |
140 | 139 |
config = new NameDeletionConfigurator(); |
141 | 140 |
|
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/BulkEditorInputType.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.model.common.User; |
25 | 25 |
import eu.etaxonomy.cdm.model.media.Media; |
26 | 26 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
27 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
27 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
28 | 28 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
29 | 29 |
import eu.etaxonomy.cdm.model.reference.Reference; |
30 | 30 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
... | ... | |
89 | 89 |
public static BulkEditorInputType getByType(Class clazz) { |
90 | 90 |
if (Reference.class.isAssignableFrom(clazz)) { |
91 | 91 |
return REFERENCE; |
92 |
} else if (TaxonNameBase.class.isAssignableFrom(clazz)) {
|
|
92 |
} else if (TaxonName.class.isAssignableFrom(clazz)) { |
|
93 | 93 |
return NAME; |
94 | 94 |
} else if (AgentBase.class.isAssignableFrom(clazz)) { |
95 | 95 |
return AGENT; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/NameEditorInput.java | ||
---|---|---|
17 | 17 |
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase; |
18 | 18 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
19 | 19 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
20 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 | 21 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
22 | 22 |
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorSortProvider; |
23 | 23 |
import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.NameCreator; |
... | ... | |
29 | 29 |
* |
30 | 30 |
* @author p.ciardelli |
31 | 31 |
* @created 20.08.2009 |
32 |
* @version 1.0 |
|
33 | 32 |
*/ |
34 |
public class NameEditorInput extends AbstractBulkEditorInput<TaxonNameBase> {
|
|
33 |
public class NameEditorInput extends AbstractBulkEditorInput<TaxonName> { |
|
35 | 34 |
|
36 |
/** |
|
37 |
* |
|
38 |
*/ |
|
39 | 35 |
private static final long serialVersionUID = -3085029575759626823L; |
40 | 36 |
private static NameEditorInput instance; |
41 | 37 |
|
... | ... | |
54 | 50 |
return instance; |
55 | 51 |
} |
56 | 52 |
|
57 |
/* (non-Javadoc) |
|
58 |
* @see org.eclipse.ui.IEditorInput#getName() |
|
59 |
*/ |
|
60 | 53 |
/** |
61 | 54 |
* <p>getName</p> |
62 | 55 |
* |
... | ... | |
67 | 60 |
return BulkEditorInputType.NAME.label; |
68 | 61 |
} |
69 | 62 |
|
70 |
/* (non-Javadoc) |
|
71 |
* @see org.eclipse.ui.IEditorInput#getToolTipText() |
|
72 |
*/ |
|
73 | 63 |
/** |
74 | 64 |
* <p>getToolTipText</p> |
75 | 65 |
* |
... | ... | |
114 | 104 |
} |
115 | 105 |
*/ |
116 | 106 |
@Override |
117 |
public boolean delete(TaxonNameBase entity, DeleteConfiguratorBase config) {
|
|
107 |
public boolean delete(TaxonName entity, DeleteConfiguratorBase config) { |
|
118 | 108 |
NameDeletionConfigurator nameConfig = null; |
119 | 109 |
if (config instanceof NameDeletionConfigurator){ |
120 | 110 |
nameConfig = (NameDeletionConfigurator) config; |
... | ... | |
126 | 116 |
|
127 | 117 |
/** {@inheritDoc} */ |
128 | 118 |
@Override |
129 |
public TaxonNameBase save(TaxonNameBase entity) {
|
|
130 |
TaxonNameBase mergedName = null;
|
|
119 |
public TaxonName save(TaxonName entity) {
|
|
120 |
TaxonName mergedName = null; |
|
131 | 121 |
mergedName = CdmStore.getService(INameService.class).merge(entity, true).getMergedEntity(); |
132 | 122 |
return mergedName; |
133 | 123 |
|
134 | 124 |
} |
135 | 125 |
|
136 |
/* (non-Javadoc) |
|
137 |
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator() |
|
138 |
*/ |
|
139 | 126 |
@Override |
140 |
protected IEntityCreator<TaxonNameBase> createEntityCreator() {
|
|
127 |
protected IEntityCreator<TaxonName> createEntityCreator() { |
|
141 | 128 |
return new NameCreator(); |
142 | 129 |
} |
143 | 130 |
|
144 |
/* (non-Javadoc) |
|
145 |
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getSortProviders() |
|
146 |
*/ |
|
147 | 131 |
@Override |
148 |
public List<IBulkEditorSortProvider<TaxonNameBase>> getSortProviders() {
|
|
149 |
List<IBulkEditorSortProvider<TaxonNameBase>> sortProviders = super.getSortProviders();
|
|
132 |
public List<IBulkEditorSortProvider<TaxonName>> getSortProviders() { |
|
133 |
List<IBulkEditorSortProvider<TaxonName>> sortProviders = super.getSortProviders(); |
|
150 | 134 |
|
151 |
sortProviders.add(0, new IdentifiableEntitySortProvider<TaxonNameBase>());
|
|
135 |
sortProviders.add(0, new IdentifiableEntitySortProvider<>()); |
|
152 | 136 |
|
153 | 137 |
return sortProviders; |
154 | 138 |
} |
155 | 139 |
|
156 |
/* (non-Javadoc) |
|
157 |
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object) |
|
158 |
*/ |
|
159 | 140 |
@Override |
160 | 141 |
public String getTypeText(Object entity) { |
161 |
if((entity instanceof TaxonNameBase) && (((TaxonNameBase) entity).getNomenclaturalCode() != null)){
|
|
162 |
return ((TaxonNameBase) entity).getNomenclaturalCode().getTitleCache();
|
|
142 |
if((entity instanceof TaxonName) && (((TaxonName) entity).getNomenclaturalCode() != null)){
|
|
143 |
return ((TaxonName) entity).getNomenclaturalCode().getTitleCache(); |
|
163 | 144 |
} |
164 | 145 |
return super.getTypeText(entity); |
165 | 146 |
} |
166 | 147 |
|
167 |
/* (non-Javadoc) |
|
168 |
* @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase) |
|
169 |
*/ |
|
170 | 148 |
@Override |
171 |
public String getText(TaxonNameBase entity) {
|
|
149 |
public String getText(TaxonName entity) { |
|
172 | 150 |
return (entity).getFullTitleCache(); |
173 | 151 |
} |
174 | 152 |
|
175 |
/* (non-Javadoc) |
|
176 |
* @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge() |
|
177 |
*/ |
|
178 | 153 |
@Override |
179 | 154 |
public void merge() { |
180 | 155 |
|
181 | 156 |
} |
182 | 157 |
|
183 | 158 |
@Override |
184 |
protected TaxonNameBase loadEntity(UUID entityUuid) {
|
|
159 |
protected TaxonName loadEntity(UUID entityUuid) { |
|
185 | 160 |
List<String> propertyPaths = Arrays.asList(new String[]{}); |
186 | 161 |
return CdmStore.getService(INameService.class).load(entityUuid, getPropertyPaths()); |
187 | 162 |
} |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/NameCreator.java | ||
---|---|---|
15 | 15 |
import java.util.TreeMap; |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.model.name.Rank; |
18 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
19 | 19 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
20 | 20 |
import eu.etaxonomy.taxeditor.parser.ParseHandler; |
21 | 21 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
28 | 28 |
* @created 07.07.2009 |
29 | 29 |
* @version 1.0 |
30 | 30 |
*/ |
31 |
public class NameCreator implements IEntityCreator<TaxonNameBase> {
|
|
31 |
public class NameCreator implements IEntityCreator<TaxonName> { |
|
32 | 32 |
|
33 |
/* (non-Javadoc) |
|
34 |
* @see eu.etaxonomy.taxeditor.bulkeditor.IEntityCreator#createEntity(java.lang.String) |
|
35 |
*/ |
|
36 | 33 |
/** {@inheritDoc} */ |
37 | 34 |
@Override |
38 |
public TaxonNameBase createEntity(String text) {
|
|
39 |
TaxonNameBase name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
|
|
35 |
public TaxonName createEntity(String text) { |
|
36 |
TaxonName name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null); |
|
40 | 37 |
name.setTitleCache(text, true); |
41 | 38 |
//name.setTitleCache(text); |
42 | 39 |
return name; |
43 | 40 |
} |
44 | 41 |
|
45 |
/* (non-Javadoc) |
|
46 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String) |
|
47 |
*/ |
|
48 | 42 |
/** {@inheritDoc} */ |
49 | 43 |
@Override |
50 |
public TaxonNameBase createEntity(Object key, String text) {
|
|
44 |
public TaxonName createEntity(Object key, String text) { |
|
51 | 45 |
return ParseHandler.parseName(text, (Rank) key); |
52 | 46 |
} |
53 | 47 |
|
54 |
/* (non-Javadoc) |
|
55 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#getClassLabelPairs() |
|
56 |
*/ |
|
57 | 48 |
/** |
58 | 49 |
* <p>getKeyLabelPairs</p> |
59 | 50 |
* |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/TaxonCreator.java | ||
---|---|---|
6 | 6 |
import eu.etaxonomy.cdm.model.agent.Person; |
7 | 7 |
import eu.etaxonomy.cdm.model.agent.Team; |
8 | 8 |
import eu.etaxonomy.cdm.model.name.Rank; |
9 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
9 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
10 | 10 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
11 | 11 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
12 | 12 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java | ||
---|---|---|
70 | 70 |
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode; |
71 | 71 |
import eu.etaxonomy.cdm.model.media.Media; |
72 | 72 |
import eu.etaxonomy.cdm.model.molecular.Sequence; |
73 |
import eu.etaxonomy.cdm.model.name.NonViralName;
|
|
73 |
import eu.etaxonomy.cdm.model.name.TaxonName;
|
|
74 | 74 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
75 | 75 |
import eu.etaxonomy.cdm.model.reference.Reference; |
76 | 76 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
... | ... | |
278 | 278 |
try { |
279 | 279 |
if (objectClass.getSuperclass().equals(TeamOrPersonBase.class) ){ |
280 | 280 |
referencedObject = CdmStore.getService(IAgentService.class).load(entity); |
281 |
} else if (objectClass.getSuperclass().equals(NonViralName.class)){
|
|
281 |
} else if (objectClass.getSuperclass().equals(TaxonName.class)){
|
|
282 | 282 |
referencedObject = CdmStore.getService(INameService.class).load(entity); |
283 | 283 |
} else if (objectClass.getSuperclass().equals(TaxonBase.class)){ |
284 | 284 |
referencedObject = CdmStore.getService(ITaxonService.class).load(entity); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java | ||
---|---|---|
29 | 29 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
30 | 30 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
31 | 31 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
32 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
32 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
34 | 34 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
35 | 35 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
... | ... | |
299 | 299 |
protected void setPartName() { |
300 | 300 |
|
301 | 301 |
String partName = null; |
302 |
TaxonNameBase<?, ?> name = getTaxon().getName();
|
|
302 |
TaxonName name = getTaxon().getName(); |
|
303 | 303 |
|
304 | 304 |
if (name != null) { |
305 | 305 |
partName = name.getTitleCache(); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditorDataChangeBehaviour.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.apache.log4j.Logger; |
15 | 15 |
|
16 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
16 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
17 | 17 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
18 | 18 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
19 | 19 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent; |
... | ... | |
96 | 96 |
for(CdmDataChangeEvent event : events){ |
97 | 97 |
|
98 | 98 |
// update editor title |
99 |
if(event.getEntity() instanceof TaxonNameBase){
|
|
99 |
if(event.getEntity() instanceof TaxonName){ |
|
100 | 100 |
if(input.getTaxon().getName().equals(event.getEntity())){ |
101 | 101 |
// set the name of the editor window |
102 | 102 |
source.setPartName(); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/OpenEditorConfiguration.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.editor; |
11 | 11 |
|
12 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
12 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
13 | 13 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
14 | 14 |
|
15 | 15 |
/** |
... | ... | |
17 | 17 |
* |
18 | 18 |
* @author n.hoffmann |
19 | 19 |
* @created Sep 27, 2010 |
20 |
* @version 1.0 |
|
21 | 20 |
*/ |
22 | 21 |
public class OpenEditorConfiguration { |
23 | 22 |
|
24 | 23 |
private TaxonNode parentNode; |
25 | 24 |
|
26 |
private NonViralName nonViralName; |
|
25 |
private INonViralName nonViralName;
|
|
27 | 26 |
|
28 | 27 |
private boolean openInEditor; |
29 | 28 |
|
... | ... | |
70 | 69 |
* |
71 | 70 |
* @return the nonViralName |
72 | 71 |
*/ |
73 |
public NonViralName getNonViralName() { |
|
72 |
public INonViralName getNonViralName() {
|
|
74 | 73 |
return nonViralName; |
75 | 74 |
} |
76 | 75 |
|
... | ... | |
79 | 78 |
* |
80 | 79 |
* @param nonViralName the nonViralName to set |
81 | 80 |
*/ |
82 |
public void setNonViralName(NonViralName nonViralName) { |
|
81 |
public void setNonViralName(INonViralName nonViralName) {
|
|
83 | 82 |
this.nonViralName = nonViralName; |
84 | 83 |
} |
85 | 84 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java | ||
---|---|---|
28 | 28 |
import eu.etaxonomy.cdm.api.service.ITaxonNodeService; |
29 | 29 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
30 | 30 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
31 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
31 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
32 | 32 |
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode; |
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
34 | 34 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
154 | 154 |
private void initForParentTaxonNode(UUID parentNodeUuid){ |
155 | 155 |
|
156 | 156 |
|
157 |
TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
|
|
157 |
TaxonName name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null); |
|
158 | 158 |
ITaxonTreeNode parentNode = CdmStore.getService(IClassificationService.class).getTreeNodeByUuid(parentNodeUuid); |
159 | 159 |
|
160 | 160 |
Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference()); |
... | ... | |
273 | 273 |
if(getTaxon() == null){ |
274 | 274 |
return null; |
275 | 275 |
} |
276 |
TaxonNameBase<?, ?> name = getTaxon().getName();
|
|
276 |
TaxonName name = getTaxon().getName(); |
|
277 | 277 |
if (name == null || name.getTitleCache() == null) { |
278 | 278 |
return Messages.TaxonEditorInput_NEW_TAXON; |
279 | 279 |
} else { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java | ||
---|---|---|
49 | 49 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
50 | 50 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
51 | 51 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
52 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
53 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
52 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
54 | 53 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
55 | 54 |
import eu.etaxonomy.cdm.strategy.parser.ParserProblem; |
56 | 55 |
import eu.etaxonomy.taxeditor.editor.CdmDataTransfer; |
... | ... | |
178 | 177 |
// parse the text |
179 | 178 |
String text = nameViewer.getTextWidget().getText(); |
180 | 179 |
|
181 |
TaxonNameBase<?,?> name = (TaxonNameBase<?,?>)parseHandler.parse(text);
|
|
180 |
TaxonName name = (TaxonName)parseHandler.parse(text);
|
|
182 | 181 |
getTaxonBase().setName(name); |
183 | 182 |
getTaxonBase().setTitleCache((getTaxonBase().generateTitle())); |
184 | 183 |
|
... | ... | |
244 | 243 |
* |
245 | 244 |
*/ |
246 | 245 |
private void showNameRelations() { |
247 |
TaxonNameBase<?, ?> name = getName();
|
|
246 |
TaxonName name = getName(); |
|
248 | 247 |
if (name == null) { |
249 | 248 |
return; |
250 | 249 |
} |
... | ... | |
259 | 258 |
} |
260 | 259 |
// for (NameRelationship nameRelation : nameRelations) { |
261 | 260 |
// String typeLabel = null; |
262 |
// TaxonNameBase<?, ?> relatedName = null;
|
|
261 |
// TaxonName relatedName = null; |
|
263 | 262 |
// |
264 | 263 |
// if (name.equals(nameRelation.getFromName())) { |
265 | 264 |
// typeLabel = labelProvider.getNameRelationTypeLabel( |
... | ... | |
382 | 381 |
*/ |
383 | 382 |
protected void handleSplitText(String text) { |
384 | 383 |
// Create a synonym in a new homotypic group using text as name |
385 |
TaxonNameBase synonymName = ParseHandler
|
|
386 |
.parseReferencedName(text, null);
|
|
384 |
TaxonName synonymName = TaxonName.castAndDeproxy(
|
|
385 |
ParseHandler.parseReferencedName(text, null));
|
|
387 | 386 |
|
388 | 387 |
EditorUtil.executeOperation(new CreateSynonymInNewGroupOperation( |
389 | 388 |
Messages.AbstractGroupedContainer_NEW_HETERO_SYNONYM, getEditor().getUndoContext(), |
... | ... | |
451 | 450 |
* @return |
452 | 451 |
*/ |
453 | 452 |
private boolean isFreetextEditingAllowed() { |
454 |
NonViralName name = (NonViralName) HibernateProxyHelper
|
|
453 |
INonViralName name = (INonViralName) HibernateProxyHelper
|
|
455 | 454 |
.deproxy(getName()); |
456 | 455 |
boolean enableFreetext = true; |
457 | 456 |
|
... | ... | |
486 | 485 |
} |
487 | 486 |
|
488 | 487 |
private boolean isNameParsable() { |
489 |
TaxonNameBase name = getName();
|
|
488 |
TaxonName name = getName(); |
|
490 | 489 |
|
491 | 490 |
boolean isParsable = true; |
492 | 491 |
isParsable &= CdmUtils.isEmpty(name.getAppendedPhrase()); // taxonFieldsEmpty(); |
493 | 492 |
|
494 |
if (name instanceof NonViralName) { |
|
495 |
NonViralName nonViralName = (NonViralName) name; |
|
496 |
isParsable &= !nonViralName.isProtectedAuthorshipCache(); |
|
497 |
isParsable &= !nonViralName.isProtectedNameCache(); |
|
498 |
} |
|
493 |
isParsable &= !name.isProtectedAuthorshipCache(); |
|
494 |
isParsable &= !name.isProtectedNameCache(); |
|
499 | 495 |
|
500 | 496 |
return isParsable; |
501 | 497 |
} |
... | ... | |
529 | 525 |
* |
530 | 526 |
* @return a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object. |
531 | 527 |
*/ |
532 |
public TaxonNameBase getName() {
|
|
528 |
public TaxonName getName() { |
|
533 | 529 |
return HibernateProxyHelper.deproxy(getTaxonBase() |
534 | 530 |
.getName()); |
535 | 531 |
} |
... | ... | |
549 | 545 |
// @Override |
550 | 546 |
// protected IStatus run(IProgressMonitor monitor) { |
551 | 547 |
// |
552 |
final TaxonNameBase<?,?> name = (TaxonNameBase<?,?>)parseHandler
|
|
548 |
final TaxonName name = (TaxonName)parseHandler
|
|
553 | 549 |
.parseAndResolveDuplicates(unparsedNameString); |
554 | 550 |
// |
555 | 551 |
// Display.getDefault().asyncExec(new Runnable(){ |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/SynonymContainer.java | ||
---|---|---|
17 | 17 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
18 | 18 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus; |
19 | 19 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
20 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 | 21 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
22 | 22 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
23 | 23 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
... | ... | |
70 | 70 |
} |
71 | 71 |
|
72 | 72 |
protected void updateIcon(){ |
73 |
TaxonNameBase name = getName();
|
|
73 |
TaxonName name = getName(); |
|
74 | 74 |
|
75 | 75 |
if(! name.getStatus().isEmpty()){ |
76 | 76 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/ChangeSynonymToAcceptedTaxonHandler.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
28 | 28 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
29 | 29 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
30 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
30 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
31 | 31 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
32 | 32 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
33 | 33 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
... | ... | |
47 | 47 |
* |
48 | 48 |
* @author n.hoffmann |
49 | 49 |
* @created 21.04.2009 |
50 |
* @version 1.0 |
|
51 | 50 |
*/ |
52 | 51 |
public class ChangeSynonymToAcceptedTaxonHandler extends AbstractHandler implements IPostOperationEnabled { |
53 | 52 |
private static final Logger logger = Logger |
... | ... | |
85 | 84 |
|
86 | 85 |
TaxonNode parentNode = (TaxonNode) HibernateProxyHelper.deproxy(((TaxonEditorInput) input).getTaxonNode().getParent()); |
87 | 86 |
|
88 |
List<UUID> excludeTaxa = new ArrayList<UUID>();
|
|
87 |
List<UUID> excludeTaxa = new ArrayList<>(); |
|
89 | 88 |
//excludeTaxa.add(taxon.getUuid());//there are some cases where the accepted taxon should be the parent of the new created accepted taxon |
90 | 89 |
|
91 | 90 |
TaxonNode newParentNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), Messages.ChangeSynonymToAcceptedTaxonHandler_SELECT_PARENT, null, null, ((TaxonEditorInput) input).getTaxonNode().getClassification()); |
... | ... | |
96 | 95 |
// TODO get synonyms from homotypical group and add them as homotypic synonyms to new accepted taxon |
97 | 96 |
// apply confirmation dialog |
98 | 97 |
HomotypicalGroup group = synonym.getHomotypicGroup(); |
99 |
Set<TaxonNameBase> namesInGroup = group.getTypifiedNames();
|
|
98 |
Set<TaxonName> namesInGroup = group.getTypifiedNames(); |
|
100 | 99 |
// FIXME with this implementation we can not create a taxonNode that is a direct child of the classification node |
101 | 100 |
AbstractPostOperation operation = new ChangeSynonymToAcceptedTaxonOperation(Messages.ChangeSynonymToAcceptedTaxonHandler_CHANGE_SYN_TO_ACC_TAXON, EditorUtil.getUndoContext(), |
102 | 101 |
taxon, newParentNode, synonym, namesInGroup, this, editor, (ICdmEntitySessionEnabled)editor.getEditorInput()); //$NON-NLS-1$ |
... | ... | |
107 | 106 |
return null; |
108 | 107 |
} |
109 | 108 |
|
110 |
/* (non-Javadoc) |
|
111 |
* @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase) |
|
112 |
*/ |
|
113 | 109 |
/** {@inheritDoc} */ |
114 | 110 |
@Override |
115 | 111 |
public boolean postOperation(CdmBase objectAffectedByOperation) { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateHeterotypicSynonymHandler.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.commands.IHandler; |
17 | 17 |
import org.eclipse.core.commands.common.NotDefinedException; |
18 | 18 |
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
20 | 20 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
21 | 21 |
import eu.etaxonomy.taxeditor.editor.Page; |
22 | 22 |
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor; |
... | ... | |
29 | 29 |
* |
30 | 30 |
* @author n.hoffmann |
31 | 31 |
* @created 06.02.2009 |
32 |
* @version 1.0 |
|
33 | 32 |
*/ |
34 | 33 |
public class CreateHeterotypicSynonymHandler extends AbstractHandler implements |
35 | 34 |
IHandler { |
36 | 35 |
private static final Logger logger = Logger |
37 | 36 |
.getLogger(CreateHeterotypicSynonymHandler.class); |
38 | 37 |
|
39 |
/* (non-Javadoc) |
|
40 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
41 |
*/ |
|
42 | 38 |
/** {@inheritDoc} */ |
43 | 39 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
44 | 40 |
TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage( |
45 | 41 |
Page.NAME); |
46 | 42 |
|
47 |
TaxonNameBase newSynonymName = ParseHandler.createEmptyName();
|
|
43 |
TaxonName newSynonymName = ParseHandler.createEmptyName(); |
|
48 | 44 |
|
49 |
AbstractPostOperation operation; |
|
45 |
AbstractPostOperation<?> operation;
|
|
50 | 46 |
try { |
51 | 47 |
operation = new CreateSynonymInNewGroupOperation(event.getCommand().getName(), |
52 | 48 |
editor.getUndoContext(), editor.getTaxon(), newSynonymName, editor); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateHomotypicSynonymHandler.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.commands.common.NotDefinedException; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
19 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
|
20 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
21 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
22 | 20 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
23 | 21 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
24 | 22 |
import eu.etaxonomy.taxeditor.editor.Page; |
... | ... | |
33 | 31 |
* |
34 | 32 |
* @author n.hoffmann |
35 | 33 |
* @created 06.02.2009 |
36 |
* @version 1.0 |
|
37 | 34 |
*/ |
38 | 35 |
public class CreateHomotypicSynonymHandler extends AbstractHandler implements |
39 | 36 |
IHandler { |
40 | 37 |
|
41 |
/* (non-Javadoc) |
|
42 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
43 |
*/ |
|
44 | 38 |
/** {@inheritDoc} */ |
45 | 39 |
@Override |
46 | 40 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
... | ... | |
48 | 42 |
Page.NAME); |
49 | 43 |
Taxon taxon = editor.getTaxon(); |
50 | 44 |
HomotypicalGroup group = taxon.getHomotypicGroup(); |
51 |
TaxonNameBase<?,?> newSynonymName = ParseHandler.createEmptyName();
|
|
45 |
TaxonName newSynonymName = ParseHandler.createEmptyName(); |
|
52 | 46 |
|
53 |
AbstractPostOperation operation; |
|
47 |
AbstractPostOperation<?> operation;
|
|
54 | 48 |
try { |
55 | 49 |
operation = new CreateSynonymInExistingHomotypicalGroupOperation(event.getCommand().getName(), |
56 | 50 |
editor.getUndoContext(), taxon, group, newSynonymName, editor); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateMisapplicationHandler.java | ||
---|---|---|
15 | 15 |
import org.eclipse.core.commands.ExecutionException; |
16 | 16 |
import org.eclipse.core.commands.common.NotDefinedException; |
17 | 17 |
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
19 | 19 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
20 | 20 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
21 | 21 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
... | ... | |
30 | 30 |
* |
31 | 31 |
* @author n.hoffmann |
32 | 32 |
* @created 16.04.2009 |
33 |
* @version 1.0 |
|
34 | 33 |
*/ |
35 | 34 |
public class CreateMisapplicationHandler extends AbstractHandler { |
36 | 35 |
private static final Logger logger = Logger |
37 | 36 |
.getLogger(CreateMisapplicationHandler.class); |
38 | 37 |
|
39 |
/* (non-Javadoc) |
|
40 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
41 |
*/ |
|
42 | 38 |
/** {@inheritDoc} */ |
43 | 39 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
44 | 40 |
TaxonNameEditor editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage( |
45 | 41 |
Page.NAME); |
46 | 42 |
|
47 | 43 |
|
48 |
TaxonNameBase conceptName = ParseHandler.createEmptyName();
|
|
44 |
TaxonName conceptName = ParseHandler.createEmptyName(); |
|
49 | 45 |
Taxon concept = Taxon.NewInstance(conceptName, null); |
50 | 46 |
|
51 | 47 |
TaxonRelationshipType type = TaxonRelationshipType.MISAPPLIED_NAME_FOR(); |
52 | 48 |
|
53 |
AbstractPostOperation operation; |
|
49 |
AbstractPostOperation<?> operation;
|
|
54 | 50 |
try { |
55 | 51 |
operation = new CreateConceptRelationOperation(event.getCommand().getName(), |
56 | 52 |
editor.getUndoContext(), editor.getTaxon(), concept, type, editor); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/handler/CreateSynonymInHomotypicalGroupHandler.java | ||
---|---|---|
20 | 20 |
import org.eclipse.ui.handlers.HandlerUtil; |
21 | 21 |
|
22 | 22 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
23 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
|
24 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
25 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
23 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
26 | 24 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
27 | 25 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
28 | 26 |
import eu.etaxonomy.taxeditor.editor.Page; |
... | ... | |
64 | 62 |
|
65 | 63 |
HomotypicalGroup group = synonym.getHomotypicGroup(); |
66 | 64 |
|
67 |
TaxonNameBase<?,?> newSynonymName = ParseHandler.createEmptyName();
|
|
65 |
TaxonName newSynonymName = ParseHandler.createEmptyName(); |
|
68 | 66 |
|
69 |
AbstractPostOperation operation; |
|
67 |
AbstractPostOperation<?> operation;
|
|
70 | 68 |
|
71 | 69 |
try { |
72 | 70 |
operation = new CreateSynonymInExistingHomotypicalGroupOperation(event.getCommand().getName(), editor.getUndoContext(), |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperation.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
21 | 21 |
import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException; |
22 | 22 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
23 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
23 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
24 | 24 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
25 | 25 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
26 | 26 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
... | ... | |
87 | 87 |
throws ExecutionException { |
88 | 88 |
|
89 | 89 |
// Create new synonym using concept name |
90 |
TaxonNameBase<?, ?> synonymName = concept.getName();
|
|
90 |
TaxonName synonymName = concept.getName(); |
|
91 | 91 |
Synonym synonym = null; |
92 | 92 |
try { |
93 | 93 |
synonym = |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicGroupOperation.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
19 | 19 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
20 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 | 21 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
22 | 22 |
import eu.etaxonomy.cdm.model.taxon.SynonymType; |
23 | 23 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
75 | 75 |
throws ExecutionException { |
76 | 76 |
|
77 | 77 |
// Get synonym name |
78 |
TaxonNameBase<?, ?> synonymName = synonym.getName();
|
|
78 |
TaxonName synonymName = synonym.getName(); |
|
79 | 79 |
monitor.worked(20); |
80 | 80 |
|
81 | 81 |
// TODO pass in homotypical group's taxon in case we are dragging from one editor to another |
... | ... | |
117 | 117 |
throws ExecutionException { |
118 | 118 |
|
119 | 119 |
// Get synonym name |
120 |
TaxonNameBase<?, ?> synonymName = this.synonym.getName();
|
|
120 |
TaxonName synonymName = this.synonym.getName(); |
|
121 | 121 |
if(synonymName == null){ |
122 | 122 |
// TODO |
123 | 123 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicalGroupBasionymOperation.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
21 | 21 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
22 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
22 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
23 | 23 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
24 | 24 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
25 | 25 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
... | ... | |
30 | 30 |
* |
31 | 31 |
* @author p.ciardelli |
32 | 32 |
* @created 15.01.2009 |
33 |
* @version 1.0 |
|
34 | 33 |
*/ |
35 | 34 |
public class ChangeHomotypicalGroupBasionymOperation extends |
36 | 35 |
AbstractPostTaxonOperation { |
36 |
|
|
37 | 37 |
private final TaxonBase taxonBase; |
38 | 38 |
|
39 | 39 |
/** |
... | ... | |
52 | 52 |
this.taxonBase = taxonBase; |
53 | 53 |
} |
54 | 54 |
|
55 |
/* (non-Javadoc) |
|
56 |
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
57 |
*/ |
|
58 | 55 |
/** {@inheritDoc} */ |
59 | 56 |
@Override |
60 | 57 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
61 | 58 |
throws ExecutionException { |
62 | 59 |
|
63 |
TaxonNameBase<?, ?> name = taxonBase.getName();
|
|
60 |
TaxonName name = taxonBase.getName(); |
|
64 | 61 |
|
65 | 62 |
monitor.worked(20); |
66 |
name = HibernateProxyHelper.deproxy(name, TaxonNameBase.class);
|
|
63 |
name = HibernateProxyHelper.deproxy(name); |
|
67 | 64 |
HomotypicalGroup group = HibernateProxyHelper.deproxy(name.getHomotypicalGroup(), HomotypicalGroup.class); |
68 |
TaxonNameBase oldBasionym = name.getBasionym();
|
|
65 |
TaxonName oldBasionym = name.getBasionym(); |
|
69 | 66 |
|
70 | 67 |
name.setAsGroupsBasionym(); |
71 | 68 |
|
72 | 69 |
monitor.worked(40); |
73 |
oldBasionym = HibernateProxyHelper.deproxy(oldBasionym, TaxonNameBase.class);
|
|
70 |
oldBasionym = HibernateProxyHelper.deproxy(oldBasionym); |
|
74 | 71 |
if (oldBasionym != null){ |
75 | 72 |
Set<TaxonBase> taxonBases = oldBasionym.getTaxonBases(); |
76 | 73 |
if (!taxonBases.isEmpty()){ |
... | ... | |
82 | 79 |
return postExecute(taxonBase); |
83 | 80 |
} |
84 | 81 |
|
85 |
/* (non-Javadoc) |
|
86 |
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
87 |
*/ |
|
88 | 82 |
/** {@inheritDoc} */ |
89 | 83 |
@Override |
90 | 84 |
public IStatus redo(IProgressMonitor monitor, IAdaptable info) |
... | ... | |
92 | 86 |
return execute(monitor, info); |
93 | 87 |
} |
94 | 88 |
|
95 |
/* (non-Javadoc) |
|
96 |
* @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
97 |
*/ |
|
98 | 89 |
/** {@inheritDoc} */ |
99 | 90 |
@Override |
100 | 91 |
public IStatus undo(IProgressMonitor monitor, IAdaptable info) |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToAcceptedTaxonOperation.java | ||
---|---|---|
21 | 21 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
22 | 22 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
23 | 23 |
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException; |
24 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
24 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
25 | 25 |
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode; |
26 | 26 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
27 | 27 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
38 | 38 |
* |
39 | 39 |
* @author n.hoffmann |
40 | 40 |
* @created 16.01.2009 |
41 |
* @version 1.0 |
|
42 | 41 |
*/ |
43 | 42 |
public class ChangeSynonymToAcceptedTaxonOperation extends AbstractPersistentPostOperation { |
44 | 43 |
|
45 |
private Taxon newTaxon; |
|
46 | 44 |
private final Synonym synonym; |
47 | 45 |
private final ITaxonTreeNode parentNode; |
48 | 46 |
|
49 | 47 |
private TaxonNode newNode; |
50 | 48 |
|
51 |
//private final Set<TaxonNameBase> namesInHomotypicGroup;
|
|
49 |
//private final Set<TaxonName> namesInHomotypicGroup; |
|
52 | 50 |
|
53 | 51 |
/** |
54 | 52 |
* <p>Constructor for ChangeSynonymToAcceptedTaxonOperation.</p> |
... | ... | |
67 | 65 |
Taxon taxon, |
68 | 66 |
ITaxonTreeNode parentNode, |
69 | 67 |
Synonym synonym, |
70 |
Set<TaxonNameBase> namesInHomotypicalGroup,
|
|
68 |
Set<TaxonName> namesInHomotypicalGroup, |
|
71 | 69 |
IPostOperationEnabled postOperationEnabled, |
72 | 70 |
IConversationEnabled conversationEnabled, |
73 | 71 |
ICdmEntitySessionEnabled cdmEntitySessionEnabled) { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateNameRelationOperation.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.runtime.IStatus; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.name.NameRelationshipType; |
19 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
20 | 20 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
21 | 21 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
22 | 22 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
... | ... | |
26 | 26 |
* |
27 | 27 |
* @author n.hoffmann |
28 | 28 |
* @created Mar 30, 2010 |
29 |
* @version 1.0 |
|
30 | 29 |
*/ |
31 | 30 |
public class CreateNameRelationOperation extends AbstractPostTaxonOperation { |
32 | 31 |
|
33 | 32 |
private TaxonBase taxonBase; |
34 |
private TaxonNameBase relatedName;
|
|
33 |
private TaxonName relatedName; |
|
35 | 34 |
private NameRelationshipType type; |
36 | 35 |
|
37 | 36 |
/** |
... | ... | |
44 | 43 |
* @param type a {@link eu.etaxonomy.cdm.model.name.NameRelationshipType} object. |
45 | 44 |
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object. |
46 | 45 |
*/ |
47 |
public CreateNameRelationOperation(String label, IUndoContext undoContext, TaxonBase taxonBase, TaxonNameBase relatedName, NameRelationshipType type, IPostOperationEnabled postOperationEnabled) {
|
|
46 |
public CreateNameRelationOperation(String label, IUndoContext undoContext, TaxonBase taxonBase, TaxonName relatedName, NameRelationshipType type, IPostOperationEnabled postOperationEnabled) { |
|
48 | 47 |
super(label, undoContext, postOperationEnabled); |
49 | 48 |
this.taxonBase = taxonBase; |
50 | 49 |
this.relatedName = relatedName; |
51 | 50 |
this.type = type; |
52 | 51 |
} |
53 | 52 |
|
54 |
/* (non-Javadoc) |
|
55 |
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
56 |
*/ |
|
57 | 53 |
/** {@inheritDoc} */ |
58 | 54 |
@Override |
59 | 55 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
60 | 56 |
throws ExecutionException { |
61 | 57 |
|
62 |
TaxonNameBase fromName = taxonBase.getName();
|
|
58 |
TaxonName fromName = taxonBase.getName(); |
|
63 | 59 |
|
64 | 60 |
fromName.addRelationshipToName(relatedName, type, null); |
65 | 61 |
|
66 | 62 |
return postExecute(taxonBase); |
67 | 63 |
} |
68 | 64 |
|
69 |
/* (non-Javadoc) |
|
70 |
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
71 |
*/ |
|
72 | 65 |
/** {@inheritDoc} */ |
73 | 66 |
@Override |
74 | 67 |
public IStatus redo(IProgressMonitor monitor, IAdaptable info) |
... | ... | |
76 | 69 |
return execute(monitor, info); |
77 | 70 |
} |
78 | 71 |
|
79 |
/* (non-Javadoc) |
|
80 |
* @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
81 |
*/ |
|
82 | 72 |
/** {@inheritDoc} */ |
83 | 73 |
@Override |
84 | 74 |
public IStatus undo(IProgressMonitor monitor, IAdaptable info) |
85 | 75 |
throws ExecutionException { |
86 |
TaxonNameBase fromName = taxonBase.getName();
|
|
76 |
TaxonName fromName = taxonBase.getName(); |
|
87 | 77 |
|
88 | 78 |
fromName.removeRelationToTaxonName(relatedName); |
89 | 79 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExistingHomotypicalGroupOperation.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
19 | 19 |
import eu.etaxonomy.cdm.model.name.INonViralName; |
20 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
21 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
22 | 21 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
23 | 22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
24 | 23 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
... | ... | |
34 | 33 |
AbstractPostTaxonOperation { |
35 | 34 |
|
36 | 35 |
private final HomotypicalGroup group; |
37 |
private final TaxonNameBase<?,?> newSynonymName;
|
|
36 |
private final TaxonName newSynonymName; |
|
38 | 37 |
|
39 | 38 |
private Synonym synonym; |
40 | 39 |
|
... | ... | |
50 | 49 |
*/ |
51 | 50 |
public CreateSynonymInExistingHomotypicalGroupOperation(String label, |
52 | 51 |
IUndoContext undoContext, Taxon taxon, HomotypicalGroup group, |
53 |
TaxonNameBase<?,?> newSynonymName, IPostOperationEnabled postOperationEnabled) {
|
|
52 |
TaxonName newSynonymName, IPostOperationEnabled postOperationEnabled) { |
|
54 | 53 |
super(label, undoContext, taxon, postOperationEnabled); |
55 | 54 |
this.group = group; |
56 | 55 |
this.newSynonymName = newSynonymName; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInNewGroupOperation.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
19 | 19 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
20 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 | 21 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
22 | 22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
23 | 23 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
... | ... | |
36 | 36 |
*/ |
37 | 37 |
public class CreateSynonymInNewGroupOperation extends AbstractPostTaxonOperation { |
38 | 38 |
|
39 |
private final TaxonNameBase newSynonymName;
|
|
39 |
private final TaxonName newSynonymName; |
|
40 | 40 |
private Synonym newSynonym; |
41 | 41 |
|
42 | 42 |
/** |
... | ... | |
49 | 49 |
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object. |
50 | 50 |
*/ |
51 | 51 |
public CreateSynonymInNewGroupOperation(String label, |
52 |
IUndoContext undoContext, Taxon taxon, TaxonNameBase newSynonymName, IPostOperationEnabled postOperationEnabled) {
|
|
52 |
IUndoContext undoContext, Taxon taxon, TaxonName newSynonymName, IPostOperationEnabled postOperationEnabled) { |
|
53 | 53 |
super(label, undoContext, taxon, postOperationEnabled); |
54 | 54 |
|
55 | 55 |
this.newSynonymName = newSynonymName; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteNameRelationOperation.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.runtime.IStatus; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
19 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
20 | 20 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
21 | 21 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
22 | 22 |
|
... | ... | |
25 | 25 |
* |
26 | 26 |
* @author n.hoffmann |
27 | 27 |
* @created Mar 30, 2010 |
28 |
* @version 1.0 |
|
29 | 28 |
*/ |
30 | 29 |
public class DeleteNameRelationOperation extends AbstractPostTaxonOperation { |
31 | 30 |
|
... | ... | |
45 | 44 |
this.nameRelationship = nameRelationship; |
46 | 45 |
} |
47 | 46 |
|
48 |
/* (non-Javadoc) |
|
49 |
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
50 |
*/ |
|
51 | 47 |
/** {@inheritDoc} */ |
52 | 48 |
@Override |
53 | 49 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
54 | 50 |
throws ExecutionException { |
55 | 51 |
|
56 |
TaxonNameBase fromName = nameRelationship.getFromName();
|
|
52 |
TaxonName fromName = nameRelationship.getFromName(); |
|
57 | 53 |
|
58 | 54 |
fromName.removeRelationToTaxonName(nameRelationship.getToName()); |
59 | 55 |
|
60 | 56 |
return postExecute(null); |
61 | 57 |
} |
62 | 58 |
|
63 |
/* (non-Javadoc) |
|
64 |
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
65 |
*/ |
|
66 | 59 |
/** {@inheritDoc} */ |
67 | 60 |
@Override |
68 | 61 |
public IStatus redo(IProgressMonitor monitor, IAdaptable info) |
... | ... | |
70 | 63 |
return execute(monitor, info); |
71 | 64 |
} |
72 | 65 |
|
73 |
/* (non-Javadoc) |
|
74 |
* @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
75 |
*/ |
|
76 | 66 |
/** {@inheritDoc} */ |
77 | 67 |
@Override |
78 | 68 |
public IStatus undo(IProgressMonitor monitor, IAdaptable info) |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/MoveSynonymToAnotherAcceptedTaxonOperation.java | ||
---|---|---|
13 | 13 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
14 | 14 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
15 | 15 |
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException; |
16 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
16 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
17 | 17 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
18 | 18 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
19 | 19 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
... | ... | |
63 | 63 |
throws ExecutionException { |
64 | 64 |
|
65 | 65 |
// Get synonym name |
66 |
TaxonNameBase<?, ?> synonymName = synonym.getName();
|
|
66 |
TaxonName synonymName = synonym.getName(); |
|
67 | 67 |
monitor.worked(20); |
68 | 68 |
|
69 | 69 |
// Switch groups |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/RemoveHomotypicalGroupBasionymOperation.java | ||
---|---|---|
15 | 15 |
import org.eclipse.core.runtime.IProgressMonitor; |
16 | 16 |
import org.eclipse.core.runtime.IStatus; |
17 | 17 |
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
19 | 19 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
20 | 20 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
21 | 21 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
... | ... | |
26 | 26 |
* |
27 | 27 |
* @author p.ciardelli |
28 | 28 |
* @created 15.01.2009 |
29 |
* @version 1.0 |
|
30 | 29 |
*/ |
31 | 30 |
public class RemoveHomotypicalGroupBasionymOperation extends |
32 | 31 |
AbstractPostTaxonOperation { |
... | ... | |
49 | 48 |
this.taxonBase = taxonBase; |
50 | 49 |
} |
51 | 50 |
|
52 |
/* (non-Javadoc) |
|
53 |
* @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
54 |
*/ |
|
55 | 51 |
/** {@inheritDoc} */ |
56 | 52 |
@Override |
57 | 53 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
58 | 54 |
throws ExecutionException { |
59 | 55 |
|
60 |
TaxonNameBase<?, ?> name = taxonBase.getName();
|
|
56 |
TaxonName name = taxonBase.getName(); |
|
61 | 57 |
monitor.worked(20); |
62 | 58 |
|
63 | 59 |
name.removeAsGroupsBasionym(); |
... | ... | |
66 | 62 |
return postExecute(taxonBase); |
67 | 63 |
} |
68 | 64 |
|
69 |
/* (non-Javadoc) |
|
70 |
* @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
71 |
*/ |
|
72 | 65 |
/** {@inheritDoc} */ |
73 | 66 |
@Override |
74 | 67 |
public IStatus redo(IProgressMonitor monitor, IAdaptable info) |
... | ... | |
76 | 69 |
return execute(monitor, info); |
77 | 70 |
} |
78 | 71 |
|
79 |
/* (non-Javadoc) |
|
80 |
* @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
81 |
*/ |
|
82 | 72 |
/** {@inheritDoc} */ |
83 | 73 |
@Override |
84 | 74 |
public IStatus undo(IProgressMonitor monitor, IAdaptable info) |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java | ||
---|---|---|
36 | 36 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
37 | 37 |
import eu.etaxonomy.cdm.model.description.Distribution; |
38 | 38 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
39 |
import eu.etaxonomy.cdm.model.name.NonViralName;
|
|
39 |
import eu.etaxonomy.cdm.model.name.TaxonName;
|
|
40 | 40 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
41 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
42 | 41 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
43 | 42 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
44 | 43 |
|
... | ... | |
46 | 45 |
* |
47 | 46 |
* @author a.oppermann |
48 | 47 |
* @created 30.04.2014 |
49 |
* @version 1.0 |
|
50 | 48 |
*/ |
51 | 49 |
public class ChecklistLabelProvider extends LabelProvider implements ITableLabelProvider { |
52 | 50 |
|
... | ... | |
81 | 79 |
return null; |
82 | 80 |
} |
83 | 81 |
|
84 |
/* |
|
85 |
* (non-Javadoc) |
|
86 |
* |
|
87 |
* @see |
|
88 |
* org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang |
|
89 |
* .Object, int) |
|
90 |
*/ |
|
91 | 82 |
/** {@inheritDoc} */ |
92 | 83 |
@Override |
93 | 84 |
public String getColumnText(Object element, int columnIndex) { |
... | ... | |
97 | 88 |
|
98 | 89 |
// List<TaxonDescription> listTaxonDescriptions = descriptionService.listTaxonDescriptions(taxon, null, null, null, null, null, DESC_INIT_STRATEGY);; |
99 | 90 |
Set<TaxonDescription> listTaxonDescriptions = taxon.getDescriptions(); |
100 |
NonViralName<?> nonViralName = HibernateProxyHelper.deproxy(taxon.getName(), NonViralName.class);
|
|
91 |
TaxonName nonViralName = HibernateProxyHelper.deproxy(taxon.getName());
|
|
101 | 92 |
|
102 | 93 |
switch (columnIndex) { |
103 | 94 |
case 0: |
... | ... | |
199 | 190 |
} |
200 | 191 |
|
201 | 192 |
public SortedSet<DefinedTermBase> getTermsOrderedByLabels(List<DefinedTermBase> listTerm,Language language){ |
202 |
TermLanguageComparator comp = new TermLanguageComparator();
|
|
193 |
TermLanguageComparator<?> comp = new TermLanguageComparator<>();
|
|
203 | 194 |
comp.setCompareLanguage(language); |
204 |
SortedSet result = new TreeSet(comp); |
|
195 |
SortedSet<DefinedTermBase> result = new TreeSet(comp);
|
|
205 | 196 |
if(listTerm != null){ |
206 | 197 |
result.addAll(listTerm); |
207 | 198 |
} |
... | ... | |
221 | 212 |
* @return |
222 | 213 |
*/ |
223 | 214 |
public SortedSet<DefinedTermBase> getTermsOrderedByIdInVocabulary(List<DefinedTermBase> namedAreas) { |
224 |
TermIdInVocabularyComparator comp = new TermIdInVocabularyComparator();
|
|
215 |
TermIdInVocabularyComparator<?> comp = new TermIdInVocabularyComparator<>();
|
|
225 | 216 |
|
226 |
SortedSet result = new TreeSet(comp); |
|
217 |
SortedSet<DefinedTermBase> result = new TreeSet(comp);
|
|
227 | 218 |
if(namedAreas != null){ |
228 | 219 |
result.addAll(namedAreas); |
229 | 220 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/filter/ChecklistEditorFilter.java | ||
---|---|---|
4 | 4 |
import org.eclipse.jface.viewers.ViewerFilter; |
5 | 5 |
|
6 | 6 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
7 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
8 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
7 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
9 | 8 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
10 | 9 |
|
11 | 10 |
public class ChecklistEditorFilter extends ViewerFilter { |
... | ... | |
26 | 25 |
return true; |
27 | 26 |
} |
28 | 27 |
Taxon taxon = (Taxon) element; |
29 |
NonViralName<?> nonVirlaName = HibernateProxyHelper.deproxy(taxon.getName(), NonViralName.class);
|
|
28 |
TaxonName nonVirlaName = HibernateProxyHelper.deproxy(taxon.getName());
|
|
30 | 29 |
// Reference reference = HibernateProxyHelper.deproxy(nonVirlaName.getNomenclaturalReference(), Reference.class); |
31 | 30 |
// String rank = taxon.getName().getRank().toString(); |
32 | 31 |
//TaxonName |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeConceptToSynonymOperationTest.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
20 | 20 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
21 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
22 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
21 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
22 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
23 | 23 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
24 | 24 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
25 | 25 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeHomotypicGroupOperationTest.java | ||
---|---|---|
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
20 | 20 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
21 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
22 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
21 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
22 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
23 | 23 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
24 | 24 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
25 | 25 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToConceptOperationTest.java | ||
---|---|---|
16 | 16 |
import org.junit.Test; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
19 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
19 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 | 21 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
22 | 22 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
23 | 23 |
import eu.etaxonomy.cdm.model.taxon.SynonymType; |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/ChangeSynonymToMisapplicationOperationTest.java | ||
---|---|---|
16 | 16 |
import org.junit.Test; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
19 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
19 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
20 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
21 | 21 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
22 | 22 |
import eu.etaxonomy.cdm.model.taxon.Synonym; |
23 | 23 |
import eu.etaxonomy.cdm.model.taxon.SynonymType; |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInExisitingHomotypicalGroupOperationTest.java | ||
---|---|---|
15 | 15 |
import org.junit.Test; |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
18 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
18 |
import eu.etaxonomy.cdm.model.name.INonViralName;
|
|
19 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
20 | 20 |
import eu.etaxonomy.cdm.model.name.TaxonNameFactory; |
21 | 21 |
import eu.etaxonomy.cdm.model.taxon.SynonymType; |
22 | 22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
... | ... | |
28 | 28 |
*/ |
29 | 29 |
public class CreateSynonymInExisitingHomotypicalGroupOperationTest extends AbstractTaxeditorOperationTestBase { |
30 | 30 |
|
31 |
private NonViralName<?> newSynonymName;
|
|
31 |
private TaxonName newSynonymName;
|
|
32 | 32 |
|
33 | 33 |
private HomotypicalGroup homotypicalGroup; |
34 | 34 |
|
35 | 35 |
|
36 |
private NonViralName<?> taxonName;
|
|
36 |
private TaxonName taxonName;
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @throws java.lang.Exception |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/name/operation/CreateSynonymInNewGroupOperationTest.java | ||
---|---|---|
14 | 14 |
import org.junit.BeforeClass; |
15 | 15 |
import org.junit.Test; |
16 | 16 |
|
17 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
Also available in: Unified diff
ref #6446 merge taxon name subclasses in TaxEditor