Revision d31115e0
Added by Niels Hoffmann over 13 years ago
.gitattributes | ||
---|---|---|
1 | 1 |
* text=auto !eol |
2 | 2 |
/LICENSE.txt -text |
3 |
/README.txt -text |
|
3 | 4 |
/pom.xml -text |
4 | 5 |
src/changes/changes.xml -text |
5 | 6 |
src/site/apt/download.apt -text |
... | ... | |
214 | 215 |
taxeditor-cdmlib/lib/msbase-2000.3.jar -text |
215 | 216 |
taxeditor-cdmlib/lib/mssqlserver-2000.3.jar -text |
216 | 217 |
taxeditor-cdmlib/lib/msutil-2000.3.jar -text |
217 |
taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar -text
|
|
218 |
taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar -text
|
|
218 | 219 |
taxeditor-cdmlib/lib/odfdom-0.8-javadoc.zip -text |
219 | 220 |
taxeditor-cdmlib/lib/odfdom-0.8-sources.zip -text |
220 | 221 |
taxeditor-cdmlib/lib/odfdom-0.8.jar -text |
... | ... | |
426 | 427 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java -text |
427 | 428 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveLabelProvider.java -text |
428 | 429 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java -text |
429 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/AddDescriptionHandler.java -text |
|
430 | 430 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java -text |
431 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteDescriptionHandler.java -text |
|
431 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java -text |
|
432 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java -text |
|
432 | 433 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DescriptionsMenuPropertyTester.java -text |
433 | 434 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java -text |
434 | 435 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/detail/CdmSectionPart.java -text |
... | ... | |
620 | 621 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/NomenclaturalReferenceDetailSection.java -text |
621 | 622 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailElement.java -text |
622 | 623 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailSection.java -text |
623 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseWizardPage.java -text
|
|
624 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceWizardPage.java -text |
|
624 | 625 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractMediaRepresentationPartElement.java -text |
625 | 626 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractOriginalSourceElement.java -text |
626 | 627 |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractReferencedEntityElement.java -text |
... | ... | |
1006 | 1007 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteSynonymOperation.java -text |
1007 | 1008 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTaxonDescriptionOperation.java -text |
1008 | 1009 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTreeNodeOperation.java -text |
1009 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditTaxonomicTreeOperation.java -text
|
|
1010 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditClassificationOperation.java -text
|
|
1010 | 1011 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditUserOperation.java -text |
1011 | 1012 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/IPostOperationEnabled.java -text |
1012 | 1013 |
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/MoveMediaInListOperation.java -text |
README.txt | ||
---|---|---|
1 |
For more information please see http://wp5.e-taxonomy.eu/taxeditor |
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorLineDisplay.java | ||
---|---|---|
23 | 23 |
import eu.etaxonomy.cdm.model.common.Marker; |
24 | 24 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
25 | 25 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
26 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
26 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
27 | 27 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener; |
28 | 28 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy; |
29 | 29 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
90 | 90 |
*/ |
91 | 91 |
/** {@inheritDoc} */ |
92 | 92 |
public String getSupplementalText(Object entity) { |
93 |
if (entity instanceof ReferenceBase) {
|
|
94 |
ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(entity);
|
|
93 |
if (entity instanceof Reference) { |
|
94 |
Reference reference = (Reference) HibernateProxyHelper.deproxy(entity);
|
|
95 | 95 |
// Nobody seems to like displaying the date |
96 | 96 |
// TimePeriod datePublished = ((StrictReferenceBase) reference).getDatePublished(); |
97 | 97 |
// |
... | ... | |
134 | 134 |
*/ |
135 | 135 |
/** {@inheritDoc} */ |
136 | 136 |
public void setText(String text, Object entity) { |
137 |
if (entity instanceof ReferenceBase) {
|
|
138 |
((ReferenceBase) entity).setTitleCache(text);
|
|
137 |
if (entity instanceof Reference) { |
|
138 |
((Reference) entity).setTitleCache(text); |
|
139 | 139 |
} |
140 | 140 |
} |
141 | 141 |
|
... | ... | |
173 | 173 |
*/ |
174 | 174 |
/** {@inheritDoc} */ |
175 | 175 |
public String getEmptyCacheMessage(Object entity) { |
176 |
if (entity instanceof ReferenceBase) {
|
|
176 |
if (entity instanceof Reference) { |
|
177 | 177 |
return "No reference title cache"; |
178 | 178 |
} |
179 | 179 |
if (entity instanceof TaxonNameBase) { |
... | ... | |
190 | 190 |
*/ |
191 | 191 |
/** {@inheritDoc} */ |
192 | 192 |
public boolean isEntityCacheEmpty(Object entity) { |
193 |
if (entity instanceof ReferenceBase) {
|
|
194 |
String text = ((ReferenceBase) entity).getTitleCache();
|
|
193 |
if (entity instanceof Reference) { |
|
194 |
String text = ((Reference) entity).getTitleCache(); |
|
195 | 195 |
return (text == null || text.equals("")); |
196 | 196 |
} |
197 | 197 |
if (entity instanceof TaxonNameBase) { |
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditorSortMenuProvider.java | ||
---|---|---|
19 | 19 |
import org.eclipse.ui.IEditorInput; |
20 | 20 |
|
21 | 21 |
import eu.etaxonomy.cdm.model.common.TimePeriod; |
22 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
22 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
23 | 23 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IdentifiableEntityComparator; |
24 | 24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput; |
25 | 25 |
|
... | ... | |
73 | 73 |
* @return |
74 | 74 |
*/ |
75 | 75 |
private String getYearString(Object o) { |
76 |
TimePeriod datePublished = o == null || !(o instanceof ReferenceBase) ?
|
|
77 |
null : ((ReferenceBase) o).getDatePublished();
|
|
76 |
TimePeriod datePublished = o == null || !(o instanceof Reference) ? |
|
77 |
null : ((Reference) o).getDatePublished(); |
|
78 | 78 |
return datePublished == null? null : datePublished.toString(); |
79 | 79 |
} |
80 | 80 |
|
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/ReferenceCreator.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import org.apache.log4j.Logger; |
17 | 17 |
|
18 |
import eu.etaxonomy.cdm.model.reference.Article; |
|
19 |
import eu.etaxonomy.cdm.model.reference.Book; |
|
20 |
import eu.etaxonomy.cdm.model.reference.BookSection; |
|
21 |
import eu.etaxonomy.cdm.model.reference.CdDvd; |
|
22 |
import eu.etaxonomy.cdm.model.reference.Database; |
|
23 |
import eu.etaxonomy.cdm.model.reference.Generic; |
|
24 |
import eu.etaxonomy.cdm.model.reference.InProceedings; |
|
25 |
import eu.etaxonomy.cdm.model.reference.Journal; |
|
26 |
import eu.etaxonomy.cdm.model.reference.Patent; |
|
27 |
import eu.etaxonomy.cdm.model.reference.PersonalCommunication; |
|
28 |
import eu.etaxonomy.cdm.model.reference.PrintSeries; |
|
29 |
import eu.etaxonomy.cdm.model.reference.Proceedings; |
|
30 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
|
18 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
19 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
31 | 20 |
import eu.etaxonomy.cdm.model.reference.ReferenceType; |
32 |
import eu.etaxonomy.cdm.model.reference.Report; |
|
33 |
import eu.etaxonomy.cdm.model.reference.Thesis; |
|
34 |
import eu.etaxonomy.cdm.model.reference.WebPage; |
|
35 | 21 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator; |
36 | 22 |
|
37 | 23 |
/** |
... | ... | |
41 | 27 |
* @created 07.07.2009 |
42 | 28 |
* @version 1.0 |
43 | 29 |
*/ |
44 |
public class ReferenceCreator implements IEntityCreator<ReferenceBase> {
|
|
30 |
public class ReferenceCreator implements IEntityCreator<Reference> { |
|
45 | 31 |
private static final Logger logger = Logger |
46 | 32 |
.getLogger(ReferenceCreator.class); |
47 | 33 |
|
... | ... | |
49 | 35 |
* @see eu.etaxonomy.taxeditor.bulkeditor.IEntityCreator#createEntity(java.lang.String) |
50 | 36 |
*/ |
51 | 37 |
/** {@inheritDoc} */ |
52 |
public ReferenceBase createEntity(String text) {
|
|
53 |
return createEntity(Generic.class, text);
|
|
38 |
public Reference createEntity(String text) { |
|
39 |
return createEntity(Reference.class, text);
|
|
54 | 40 |
} |
55 | 41 |
|
56 | 42 |
/* (non-Javadoc) |
57 | 43 |
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String) |
58 | 44 |
*/ |
59 | 45 |
/** {@inheritDoc} */ |
60 |
public ReferenceBase createEntity(Object key, String text) {
|
|
61 |
ReferenceBase reference = null;
|
|
46 |
public Reference createEntity(Object key, String text) { |
|
47 |
Reference reference = null; |
|
62 | 48 |
|
63 | 49 |
// TODO replace w more generic method when cdmlib matures accordingly |
64 | 50 |
if (ReferenceType.Article.getMessage().equals(key)) { |
65 |
reference = Article.NewInstance();
|
|
51 |
reference = ReferenceFactory.newArticle();
|
|
66 | 52 |
} |
67 | 53 |
if (ReferenceType.Book.getMessage().equals(key)) { |
68 |
reference = Book.NewInstance();
|
|
54 |
reference = ReferenceFactory.newBook();
|
|
69 | 55 |
} |
70 | 56 |
if (ReferenceType.BookSection.getMessage().equals(key)) { |
71 |
reference = BookSection.NewInstance();
|
|
57 |
reference = ReferenceFactory.newBookSection();
|
|
72 | 58 |
} |
73 | 59 |
if (ReferenceType.CdDvd.getMessage().equals(key)) { |
74 |
reference = CdDvd.NewInstance();
|
|
60 |
reference = ReferenceFactory.newCdDvd();
|
|
75 | 61 |
} |
76 | 62 |
if (ReferenceType.Database.getMessage().equals(key)) { |
77 |
reference = Database.NewInstance();
|
|
63 |
reference = ReferenceFactory.newDatabase();
|
|
78 | 64 |
} |
79 | 65 |
if (ReferenceType.Generic.getMessage().equals(key)) { |
80 |
reference = Generic.NewInstance();
|
|
66 |
reference = ReferenceFactory.newGeneric();
|
|
81 | 67 |
} |
82 | 68 |
if (ReferenceType.InProceedings.getMessage().equals(key)) { |
83 |
reference = InProceedings.NewInstance();
|
|
69 |
reference = ReferenceFactory.newInProceedings();
|
|
84 | 70 |
} |
85 | 71 |
if (ReferenceType.Journal.getMessage().equals(key)) { |
86 |
reference = Journal.NewInstance();
|
|
72 |
reference = ReferenceFactory.newJournal();
|
|
87 | 73 |
} |
88 | 74 |
if (ReferenceType.Map.getMessage().equals(key)) { |
89 |
reference = eu.etaxonomy.cdm.model.reference.Map.NewInstance();
|
|
75 |
reference = ReferenceFactory.newMap();
|
|
90 | 76 |
} |
91 | 77 |
if (ReferenceType.Patent.getMessage().equals(key)) { |
92 |
reference = Patent.NewInstance();
|
|
78 |
reference = ReferenceFactory.newPatent();
|
|
93 | 79 |
} |
94 | 80 |
if (ReferenceType.PersonalCommunication.getMessage().equals(key)) { |
95 |
reference = PersonalCommunication.NewInstance();
|
|
81 |
reference = ReferenceFactory.newPersonalCommunication();
|
|
96 | 82 |
} |
97 | 83 |
if (ReferenceType.PrintSeries.getMessage().equals(key)) { |
98 |
reference = PrintSeries.NewInstance();
|
|
84 |
reference = ReferenceFactory.newPrintSeries();
|
|
99 | 85 |
} |
100 | 86 |
if (ReferenceType.Proceedings.getMessage().equals(key)) { |
101 |
reference = Proceedings.NewInstance();
|
|
87 |
reference = ReferenceFactory.newProceedings();
|
|
102 | 88 |
} |
103 | 89 |
if (ReferenceType.Report.getMessage().equals(key)) { |
104 |
reference = Report.NewInstance();
|
|
90 |
reference = ReferenceFactory.newReport();
|
|
105 | 91 |
} |
106 | 92 |
if (ReferenceType.Thesis.getMessage().equals(key)) { |
107 |
reference = Thesis.NewInstance();
|
|
93 |
reference = ReferenceFactory.newThesis();
|
|
108 | 94 |
} |
109 | 95 |
if (ReferenceType.WebPage.getMessage().equals(key)) { |
110 |
reference = WebPage.NewInstance();
|
|
96 |
reference = ReferenceFactory.newWebPage();
|
|
111 | 97 |
} |
112 | 98 |
if (reference == null) { |
113 | 99 |
logger.warn("Reference type " + key + " not found. Creating reference with default type."); |
114 |
reference = Generic.NewInstance();
|
|
100 |
reference = ReferenceFactory.newGeneric();
|
|
115 | 101 |
} |
116 | 102 |
reference.setTitleCache(text); |
117 | 103 |
return reference; |
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/BulkEditorInputTypeValues.java | ||
---|---|---|
20 | 20 |
import eu.etaxonomy.cdm.model.name.NameRelationship; |
21 | 21 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
22 | 22 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
23 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
23 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
24 | 24 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput; |
25 | 25 |
import eu.etaxonomy.taxeditor.bulkeditor.input.AgentEditorInput; |
26 | 26 |
import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput; |
... | ... | |
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
public static BulkEditorInputType getByType(Class clazz){ |
67 |
if (ReferenceBase.class.isAssignableFrom(clazz)) {
|
|
67 |
if (Reference.class.isAssignableFrom(clazz)) { |
|
68 | 68 |
return REFERENCE; |
69 | 69 |
} |
70 | 70 |
else if (TaxonNameBase.class.isAssignableFrom(clazz)) { |
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
25 | 25 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
26 | 26 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
27 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
27 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
28 | 28 |
import eu.etaxonomy.cdm.strategy.merge.MergeException; |
29 | 29 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService; |
30 | 30 |
import eu.etaxonomy.taxeditor.annotatedlineeditor.IdentifiableEntityComparator; |
... | ... | |
259 | 259 |
/** {@inheritDoc} */ |
260 | 260 |
public boolean merge(Object entity, Object mergeTarget) { |
261 | 261 |
logger.info("Merge " + entity + " into " + mergeTarget); |
262 |
if (entity instanceof ReferenceBase) {
|
|
262 |
if (entity instanceof Reference) { |
|
263 | 263 |
try { |
264 |
CdmStore.getCommonService().merge((ReferenceBase) mergeTarget, (ReferenceBase) entity, null);
|
|
264 |
CdmStore.getCommonService().merge((Reference) mergeTarget, (Reference) entity, null);
|
|
265 | 265 |
} catch (MergeException e) { |
266 | 266 |
logger.error("Problems merging objects", e); |
267 | 267 |
} |
taxeditor-bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/ReferenceEditorInput.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
17 | 17 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
18 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
18 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
19 | 19 |
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType; |
20 | 20 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
21 | 21 |
|
... | ... | |
27 | 27 |
* @created 25.06.2009 |
28 | 28 |
* @version 1.0 |
29 | 29 |
*/ |
30 |
public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase> {
|
|
30 |
public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> { |
|
31 | 31 |
|
32 | 32 |
/** |
33 | 33 |
* |
... | ... | |
122 | 122 |
|
123 | 123 |
/** {@inheritDoc} */ |
124 | 124 |
@Override |
125 |
public ReferenceBase loadEntity(UUID entityUuid) {
|
|
125 |
public Reference loadEntity(UUID entityUuid) { |
|
126 | 126 |
List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"}); |
127 | 127 |
return CdmStore.getReferenceService().load(entityUuid, propertyPaths); |
128 | 128 |
} |
129 | 129 |
|
130 | 130 |
/** {@inheritDoc} */ |
131 | 131 |
public boolean delete(Object entity) { |
132 |
return CdmStore.getReferenceService().delete((ReferenceBase) entity) != null;
|
|
132 |
return CdmStore.getReferenceService().delete((Reference) entity) != null; |
|
133 | 133 |
} |
134 | 134 |
|
135 | 135 |
/** {@inheritDoc} */ |
136 | 136 |
public boolean save(Object entity) { |
137 |
return CdmStore.getReferenceService().saveOrUpdate((ReferenceBase) entity) != null;
|
|
137 |
return CdmStore.getReferenceService().saveOrUpdate((Reference) entity) != null; |
|
138 | 138 |
} |
139 | 139 |
} |
taxeditor-cdmlib/META-INF/MANIFEST.MF | ||
---|---|---|
61 | 61 |
lib/msbase-2000.3.jar, |
62 | 62 |
lib/mssqlserver-2000.3.jar, |
63 | 63 |
lib/msutil-2000.3.jar, |
64 |
lib/mysql-connector-java-3.1.14-bin.jar,
|
|
64 |
lib/mysql-connector-java-5.0.5.jar,
|
|
65 | 65 |
lib/odfdom-0.8.jar, |
66 | 66 |
lib/opencsv-1.8.jar, |
67 | 67 |
lib/org.apache.commons.codec-1.3.0.jar, |
... | ... | |
105 | 105 |
lib/org.springframework.web.servlet-3.0.4.RELEASE.jar, |
106 | 106 |
lib/dozer-5.3.0.jar, |
107 | 107 |
lib/google-api-translate-java-0.92.jar, |
108 |
lib/cdmlib-commons-2.5.jar,
|
|
109 |
lib/cdmlib-ext-2.5.jar,
|
|
110 |
lib/cdmlib-io-2.5.jar,
|
|
111 |
lib/cdmlib-model-2.5.jar,
|
|
112 |
lib/cdmlib-persistence-2.5.jar,
|
|
113 |
lib/cdmlib-print-2.5.jar,
|
|
114 |
lib/cdmlib-remote-2.5.jar,
|
|
115 |
lib/cdmlib-services-2.5.jar
|
|
108 |
lib/cdmlib-commons-3.0.jar,
|
|
109 |
lib/cdmlib-ext-3.0.jar,
|
|
110 |
lib/cdmlib-io-3.0.jar,
|
|
111 |
lib/cdmlib-model-3.0.jar,
|
|
112 |
lib/cdmlib-persistence-3.0.jar,
|
|
113 |
lib/cdmlib-print-3.0.jar,
|
|
114 |
lib/cdmlib-remote-3.0.jar,
|
|
115 |
lib/cdmlib-services-3.0.jar
|
|
116 | 116 |
Export-Package: com.google.api, |
117 | 117 |
com.google.api.detect, |
118 | 118 |
com.google.api.translate, |
taxeditor-cdmlib/build.properties | ||
---|---|---|
1 | 1 |
bin.includes = META-INF/,\ |
2 | 2 |
lib/,\ |
3 |
lib/cdmlib-commons-2.5.jar,\ |
|
4 |
lib/cdmlib-ext-2.5.jar,\ |
|
5 |
lib/cdmlib-io-2.5.jar,\ |
|
6 |
lib/cdmlib-model-2.5.jar,\ |
|
7 |
lib/cdmlib-persistence-2.5.jar,\ |
|
8 |
lib/cdmlib-print-2.5.jar,\ |
|
9 |
lib/cdmlib-remote-2.5.jar,\ |
|
10 |
lib/cdmlib-services-2.5.jar |
|
3 |
lib/cdmlib-commons-3.0.jar,\ |
|
4 |
lib/cdmlib-ext-3.0.jar,\ |
|
5 |
lib/cdmlib-io-3.0.jar,\ |
|
6 |
lib/cdmlib-model-3.0.jar,\ |
|
7 |
lib/cdmlib-persistence-3.0.jar,\ |
|
8 |
lib/cdmlib-print-3.0.jar,\ |
|
9 |
lib/cdmlib-remote-3.0.jar,\ |
|
10 |
lib/cdmlib-services-3.0.jar,\ |
|
11 |
lib/mysql-connector-java-5.0.5.jar |
|
11 | 12 |
jars.compile.order = cdmLibrary.jar |
12 | 13 |
src.includes = lib/ |
13 | 14 |
jre.compilation.profile = J2SE-1.6 |
taxeditor-editor/plugin.xml | ||
---|---|---|
709 | 709 |
<extension |
710 | 710 |
point="org.eclipse.ui.handlers"> |
711 | 711 |
<handler |
712 |
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteDescriptionHandler"
|
|
712 |
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler" |
|
713 | 713 |
commandId="org.eclipse.ui.edit.delete"> |
714 | 714 |
<activeWhen> |
715 | 715 |
<reference |
... | ... | |
726 | 726 |
name="Create Description Element"> |
727 | 727 |
</command> |
728 | 728 |
<command |
729 |
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.AddDescriptionHandler"
|
|
729 |
defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler"
|
|
730 | 730 |
id="eu.etaxonomy.taxeditor.description.commands.adddescription" |
731 | 731 |
name="New Description"> |
732 | 732 |
</command> |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/dialogs/filteredSelection/FilteredClassificationSelectionDialog.java | ||
---|---|---|
17 | 17 |
import org.eclipse.swt.widgets.Shell; |
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
20 |
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
|
|
20 |
import eu.etaxonomy.cdm.model.taxon.Classification;
|
|
21 | 21 |
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard; |
22 | 22 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
23 | 23 |
|
... | ... | |
29 | 29 |
* @version 1.0 |
30 | 30 |
*/ |
31 | 31 |
public class FilteredClassificationSelectionDialog extends |
32 |
AbstractFilteredCdmResourceSelectionDialog<TaxonomicTree> {
|
|
32 |
AbstractFilteredCdmResourceSelectionDialog<Classification> {
|
|
33 | 33 |
|
34 | 34 |
/** |
35 | 35 |
* <p>select</p> |
... | ... | |
38 | 38 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
39 | 39 |
* @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object. |
40 | 40 |
*/ |
41 |
public static TaxonomicTree select(Shell shell, ConversationHolder conversation) {
|
|
41 |
public static Classification select(Shell shell, ConversationHolder conversation) {
|
|
42 | 42 |
FilteredClassificationSelectionDialog dialog = new FilteredClassificationSelectionDialog(shell, conversation, |
43 | 43 |
"Choose a Classification", false, "", null); |
44 | 44 |
return getSelectionFromDialog(dialog); |
... | ... | |
55 | 55 |
* @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object. |
56 | 56 |
*/ |
57 | 57 |
protected FilteredClassificationSelectionDialog(Shell shell, ConversationHolder conversation, String title, |
58 |
boolean multi, String settings, TaxonomicTree classification) {
|
|
58 |
boolean multi, String settings, Classification classification) {
|
|
59 | 59 |
super(shell, conversation, title, multi, settings, classification); |
60 | 60 |
} |
61 | 61 |
|
... | ... | |
74 | 74 |
*/ |
75 | 75 |
/** {@inheritDoc} */ |
76 | 76 |
@Override |
77 |
protected TaxonomicTree getPersistentObject(UUID cdmUuid) {
|
|
78 |
return CdmStore.getTaxonTreeService().getTaxonomicTreeByUuid(cdmUuid);
|
|
77 |
protected Classification getPersistentObject(UUID cdmUuid) {
|
|
78 |
return CdmStore.getClassificationService().getClassificationByUuid(cdmUuid);
|
|
79 | 79 |
} |
80 | 80 |
|
81 | 81 |
/* (non-Javadoc) |
... | ... | |
84 | 84 |
/** {@inheritDoc} */ |
85 | 85 |
@Override |
86 | 86 |
protected void initModel() { |
87 |
model = CdmStore.getTaxonTreeService().getUuidAndTitleCache();
|
|
87 |
model = CdmStore.getClassificationService().getUuidAndTitleCache();
|
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
/** {@inheritDoc} */ |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/dialogs/filteredSelection/FilteredReferenceSelectionDialog.java | ||
---|---|---|
15 | 15 |
import org.eclipse.swt.widgets.Shell; |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
18 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
18 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
19 | 19 |
import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceBaseDefaultCacheStrategy; |
20 | 20 |
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard; |
21 | 21 |
import eu.etaxonomy.taxeditor.editor.newWizard.NewReferenceWizard; |
... | ... | |
28 | 28 |
* @created 04.06.2009 |
29 | 29 |
* @version 1.0 |
30 | 30 |
*/ |
31 |
public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<ReferenceBase> {
|
|
31 |
public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<Reference> { |
|
32 | 32 |
|
33 | 33 |
/** |
34 | 34 |
* <p>select</p> |
... | ... | |
38 | 38 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
39 | 39 |
* @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object. |
40 | 40 |
*/ |
41 |
public static ReferenceBase select(Shell shell, ConversationHolder conversation, ReferenceBase reference) {
|
|
41 |
public static Reference select(Shell shell, ConversationHolder conversation, Reference reference) {
|
|
42 | 42 |
FilteredReferenceSelectionDialog dialog = new FilteredReferenceSelectionDialog(shell, conversation, |
43 |
"Choose a reference", false, (ReferenceBase) reference);
|
|
43 |
"Choose a reference", false, (Reference) reference); |
|
44 | 44 |
return getSelectionFromDialog(dialog); |
45 | 45 |
} |
46 | 46 |
|
... | ... | |
54 | 54 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
55 | 55 |
* @param multi a boolean. |
56 | 56 |
*/ |
57 |
protected FilteredReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, ReferenceBase reference) {
|
|
57 |
protected FilteredReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, Reference reference) { |
|
58 | 58 |
super(shell, conversation, title, multi, FilteredReferenceSelectionDialog.class.getCanonicalName(), null); |
59 | 59 |
} |
60 | 60 |
|
... | ... | |
64 | 64 |
*/ |
65 | 65 |
/** {@inheritDoc} */ |
66 | 66 |
@Override |
67 |
protected ReferenceBase getPersistentObject(UUID cdmUuid) {
|
|
67 |
protected Reference getPersistentObject(UUID cdmUuid) { |
|
68 | 68 |
return CdmStore.getReferenceService().load(cdmUuid); |
69 | 69 |
} |
70 | 70 |
|
... | ... | |
80 | 80 |
|
81 | 81 |
/** {@inheritDoc} */ |
82 | 82 |
@Override |
83 |
protected String getTitle(ReferenceBase cdmObject) {
|
|
83 |
protected String getTitle(Reference cdmObject) { |
|
84 | 84 |
if(cdmObject.getAuthorTeam() == null){ |
85 | 85 |
return super.getTitle(cdmObject); |
86 | 86 |
}else{ |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/dialogs/filteredSelection/FilteredTaxonNodeSelectionDialog.java | ||
---|---|---|
19 | 19 |
import org.eclipse.swt.widgets.Shell; |
20 | 20 |
|
21 | 21 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
22 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
22 | 23 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
23 |
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree; |
|
24 | 24 |
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard; |
25 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
26 | 26 |
|
... | ... | |
54 | 54 |
|
55 | 55 |
private Combo classificationSelectionCombo; |
56 | 56 |
|
57 |
private List<TaxonomicTree> classifications;
|
|
57 |
private List<Classification> classifications;
|
|
58 | 58 |
|
59 |
private TaxonomicTree selectedClassification;
|
|
59 |
private Classification selectedClassification;
|
|
60 | 60 |
|
61 | 61 |
|
62 | 62 |
/** |
... | ... | |
107 | 107 |
classificationSelectionCombo = new Combo(classificationSelection, SWT.BORDER | SWT.READ_ONLY); |
108 | 108 |
classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true)); |
109 | 109 |
|
110 |
for(TaxonomicTree tree : classifications){
|
|
110 |
for(Classification tree : classifications){
|
|
111 | 111 |
classificationSelectionCombo.add(tree.getName().getText(), classifications.indexOf(tree)); |
112 | 112 |
} |
113 | 113 |
|
... | ... | |
132 | 132 |
/** {@inheritDoc} */ |
133 | 133 |
@Override |
134 | 134 |
protected TaxonNode getPersistentObject(UUID uuid) { |
135 |
return CdmStore.getTaxonTreeService().getTaxonNodeByUuid(uuid);
|
|
135 |
return CdmStore.getClassificationService().getTaxonNodeByUuid(uuid);
|
|
136 | 136 |
} |
137 | 137 |
|
138 | 138 |
/* (non-Javadoc) |
... | ... | |
146 | 146 |
|
147 | 147 |
|
148 | 148 |
if(classifications == null){ |
149 |
classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
|
|
149 |
classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
|
|
150 | 150 |
selectedClassification = classifications.iterator().next(); |
151 | 151 |
} |
152 | 152 |
|
153 |
model = CdmStore.getTaxonTreeService().getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByTaxonomicTree(selectedClassification);
|
|
153 |
model = CdmStore.getClassificationService().getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(selectedClassification);
|
|
154 | 154 |
} |
155 | 155 |
|
156 | 156 |
/** {@inheritDoc} */ |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java | ||
---|---|---|
181 | 181 |
ConversationHolder conversation = CdmStore.createConversation(); |
182 | 182 |
|
183 | 183 |
TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null); |
184 |
ITreeNode parentNode = CdmStore.getTaxonTreeService().getTreeNodeByUuid(parentNodeUuid);
|
|
184 |
ITreeNode parentNode = CdmStore.getClassificationService().getTreeNodeByUuid(parentNodeUuid);
|
|
185 | 185 |
|
186 | 186 |
Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference()); |
187 | 187 |
TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference(), null); |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputFactory.java | ||
---|---|---|
49 | 49 |
if(! CdmStore.isActive()){ |
50 | 50 |
return null; |
51 | 51 |
} |
52 |
if (taxonNodeUuid == null || CdmStore.getTaxonTreeService().getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
|
|
52 |
if (taxonNodeUuid == null || CdmStore.getClassificationService().getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
|
|
53 | 53 |
EditorUtil.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid); |
54 | 54 |
return null; |
55 | 55 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/newWizard/ExternalReferenceServiceWizardPage.java | ||
---|---|---|
32 | 32 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
33 | 33 |
import eu.etaxonomy.cdm.ext.ipni.IIpniService; |
34 | 34 |
import eu.etaxonomy.cdm.ext.ipni.IpniService; |
35 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
35 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
36 | 36 |
import eu.etaxonomy.taxeditor.forms.CdmFormFactory; |
37 | 37 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
38 | 38 |
|
... | ... | |
50 | 50 |
.getLogger(ExternalReferenceServiceWizardPage.class); |
51 | 51 |
private ConversationHolder conversation; |
52 | 52 |
private CdmFormFactory formFactory; |
53 |
private ReferenceBase entity;
|
|
53 |
private Reference entity; |
|
54 | 54 |
private Composite control; |
55 | 55 |
private ListViewer viewer; |
56 | 56 |
|
... | ... | |
65 | 65 |
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object. |
66 | 66 |
* @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object. |
67 | 67 |
*/ |
68 |
protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, ReferenceBase entity) {
|
|
68 |
protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) { |
|
69 | 69 |
super("ExternalReferenceServiceWizardPage"); |
70 | 70 |
this.formFactory = formFactory; |
71 | 71 |
this.entity = entity; |
... | ... | |
118 | 118 |
viewer.setLabelProvider(new LabelProvider(){ |
119 | 119 |
@Override |
120 | 120 |
public String getText(Object element) { |
121 |
if(element instanceof ReferenceBase){
|
|
122 |
return ((ReferenceBase) element).getTitleCache();
|
|
121 |
if(element instanceof Reference){ |
|
122 |
return ((Reference) element).getTitleCache(); |
|
123 | 123 |
} |
124 | 124 |
return "Element is not a reference"; |
125 | 125 |
} |
... | ... | |
134 | 134 |
@Override |
135 | 135 |
public void widgetSelected(SelectionEvent e) { |
136 | 136 |
String query = text_query.getText(); |
137 |
List<ReferenceBase> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null);
|
|
137 |
List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null); |
|
138 | 138 |
viewer.setInput(publications); |
139 | 139 |
} |
140 | 140 |
|
... | ... | |
147 | 147 |
public void selectionChanged(SelectionChangedEvent event) { |
148 | 148 |
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); |
149 | 149 |
|
150 |
ReferenceBase selectedReference = (ReferenceBase) selection.getFirstElement();
|
|
150 |
Reference selectedReference = (Reference) selection.getFirstElement();
|
|
151 | 151 |
if(selectedReference != null){ |
152 | 152 |
((AbstractNewEntityWizard) getWizard()).setEntity(selectedReference); |
153 | 153 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/newWizard/NewReferenceWizard.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.editor.newWizard; |
12 | 12 |
|
13 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
13 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
14 | 14 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
15 |
import eu.etaxonomy.taxeditor.section.reference.ReferenceBaseWizardPage;
|
|
15 |
import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage; |
|
16 | 16 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
17 | 17 |
|
18 | 18 |
/** |
... | ... | |
22 | 22 |
* @created Jun 1, 2010 |
23 | 23 |
* @version 1.0 |
24 | 24 |
*/ |
25 |
public class NewReferenceWizard extends AbstractNewEntityWizard<ReferenceBase> {
|
|
25 |
public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> { |
|
26 | 26 |
|
27 |
private ReferenceBaseWizardPage referenceBasePage;
|
|
27 |
private ReferenceWizardPage referencePage;
|
|
28 | 28 |
|
29 | 29 |
/** {@inheritDoc} */ |
30 | 30 |
@Override |
31 | 31 |
public void addPages() { |
32 | 32 |
// TODO disabling external service wizard page for now |
33 | 33 |
// addPage(new ExternalReferenceServiceWizardPage(formFactory, getConversationHolder(), entity)); |
34 |
referenceBasePage = new ReferenceBaseWizardPage(formFactory, getConversationHolder(), entity);
|
|
35 |
addPage(referenceBasePage);
|
|
34 |
referencePage = new ReferenceWizardPage(formFactory, getConversationHolder(), entity);
|
|
35 |
addPage(referencePage); |
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
/** {@inheritDoc} */ |
39 | 39 |
@Override |
40 |
protected ReferenceBase createNewEntity() {
|
|
40 |
protected Reference createNewEntity() { |
|
41 | 41 |
return ReferenceFactory.newGeneric(); |
42 | 42 |
} |
43 | 43 |
|
... | ... | |
49 | 49 |
|
50 | 50 |
/** {@inheritDoc} */ |
51 | 51 |
@Override |
52 |
public void setEntity(ReferenceBase entity) {
|
|
52 |
public void setEntity(Reference entity) { |
|
53 | 53 |
super.setEntity(entity); |
54 |
referenceBasePage.getDetailElement().setEntity(entity);
|
|
54 |
referencePage.getDetailElement().setEntity(entity); |
|
55 | 55 |
} |
56 | 56 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java | ||
---|---|---|
6 | 6 |
import java.util.ArrayList; |
7 | 7 |
import java.util.List; |
8 | 8 |
import java.util.Map; |
9 |
import java.util.Set; |
|
10 | 9 |
|
11 | 10 |
import org.apache.log4j.Logger; |
12 | 11 |
import org.eclipse.jface.viewers.ITreeContentProvider; |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java | ||
---|---|---|
194 | 194 |
public boolean postOperation(CdmBase objectAffectedByOperation) { |
195 | 195 |
boolean result = super.postOperation(objectAffectedByOperation); |
196 | 196 |
|
197 |
if(objectAffectedByOperation != null){ |
|
198 |
|
|
199 |
if(objectAffectedByOperation instanceof DescriptionElementBase){ |
|
200 |
DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation; |
|
201 |
FeatureNodeContainer container = getFeatureNodeContainerForDescriptionElement(descriptionElement); |
|
202 |
viewer.expandToLevel(container, 1); |
|
203 |
} |
|
204 |
|
|
205 |
StructuredSelection selection = new StructuredSelection(objectAffectedByOperation); |
|
206 |
viewer.setSelection(selection, true); |
|
207 |
} |
|
197 |
// if(objectAffectedByOperation != null){ |
|
198 |
// |
|
199 |
// if(objectAffectedByOperation instanceof DescriptionElementBase){ |
|
200 |
// DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation; |
|
201 |
// FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription()); |
|
202 |
// FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement); |
|
203 |
//// viewer.refresh(featureNodeContainer, true); |
|
204 |
// viewer.expandToLevel(featureNodeContainer, 1); |
|
205 |
// } |
|
206 |
// |
|
207 |
// StructuredSelection selection = new StructuredSelection(objectAffectedByOperation); |
|
208 |
// viewer.setSelection(selection, true); |
|
209 |
// }else{ |
|
210 |
//// viewer.refresh(); |
|
211 |
// } |
|
208 | 212 |
|
209 | 213 |
return result; |
210 | 214 |
} |
211 |
|
|
212 |
/** |
|
213 |
* |
|
214 |
* @param descriptionElement |
|
215 |
* @return |
|
216 |
*/ |
|
217 |
private FeatureNodeContainer getFeatureNodeContainerForDescriptionElement( |
|
218 |
DescriptionElementBase descriptionElement) { |
|
219 |
FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription()); |
|
220 |
FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.getFeatureNodeContainerForDescriptionElement(descriptionElement); |
|
221 |
return featureNodeContainer; |
|
222 |
} |
|
223 | 215 |
|
224 | 216 |
/** {@inheritDoc} */ |
225 | 217 |
@Override |
226 | 218 |
public void changed(Object object) { |
227 |
// viewer.refresh(true); |
|
228 |
// viewer.update(object, null); |
|
229 |
viewer.refresh(object, true); |
|
219 |
if(object instanceof DescriptionElementBase){ |
|
220 |
DescriptionElementBase descriptionElement = (DescriptionElementBase) object; |
|
221 |
FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription()); |
|
222 |
FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement); |
|
223 |
viewer.refresh(featureNodeContainer, true); |
|
224 |
viewer.expandToLevel(featureNodeContainer, 1); |
|
225 |
|
|
226 |
}else{ |
|
227 |
viewer.refresh(true); |
|
228 |
} |
|
229 |
|
|
230 |
if(object != null){ |
|
231 |
StructuredSelection selection = new StructuredSelection(object); |
|
232 |
viewer.setSelection(selection, true); |
|
233 |
} |
|
234 |
|
|
230 | 235 |
super.changed(object); |
231 | 236 |
} |
232 | 237 |
|
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/AddDescriptionHandler.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 |
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler; |
|
11 |
import org.apache.log4j.Logger; |
|
12 |
import org.eclipse.core.commands.AbstractHandler; |
|
13 |
import org.eclipse.core.commands.ExecutionEvent; |
|
14 |
import org.eclipse.core.commands.ExecutionException; |
|
15 |
import org.eclipse.core.commands.common.NotDefinedException; |
|
16 |
import org.eclipse.ui.IEditorInput; |
|
17 |
import org.eclipse.ui.IEditorPart; |
|
18 |
import org.eclipse.ui.IWorkbenchPart; |
|
19 |
import org.eclipse.ui.forms.editor.FormEditor; |
|
20 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
21 |
|
|
22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
23 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
24 |
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput; |
|
25 |
import eu.etaxonomy.taxeditor.operations.AbstractPostOperation; |
|
26 |
import eu.etaxonomy.taxeditor.operations.CreateTaxonDescriptionOperation; |
|
27 |
import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled; |
|
28 |
|
|
29 |
/** |
|
30 |
* <p>AddDescriptionHandler class.</p> |
|
31 |
* |
|
32 |
* @author p.ciardelli |
|
33 |
* @created 11.08.2009 |
|
34 |
* @version 1.0 |
|
35 |
*/ |
|
36 |
public class AddDescriptionHandler extends AbstractHandler { |
|
37 |
private static final Logger logger = Logger |
|
38 |
.getLogger(CreateDescriptionElementHandler.class); |
|
39 |
|
|
40 |
/* (non-Javadoc) |
|
41 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
42 |
*/ |
|
43 |
/** {@inheritDoc} */ |
|
44 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
45 |
IWorkbenchPart part = HandlerUtil.getActivePart(event); |
|
46 |
IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null; |
|
47 |
|
|
48 |
|
|
49 |
IEditorPart editor = HandlerUtil.getActiveEditor(event); |
|
50 |
if (editor instanceof FormEditor) { |
|
51 |
editor = ((FormEditor) editor).getActiveEditor(); |
|
52 |
} |
|
53 |
IEditorInput input = editor.getEditorInput(); |
|
54 |
if (input instanceof TaxonEditorInput) { |
|
55 |
Taxon taxon = ((TaxonEditorInput) input).getTaxon(); |
|
56 |
AbstractPostOperation operation; |
|
57 |
try { |
|
58 |
// TODO use undo context specific to editor |
|
59 |
operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(), |
|
60 |
EditorUtil.getUndoContext(), taxon, postOperationEnabled); |
|
61 |
EditorUtil.executeOperation(operation); |
|
62 |
} catch (NotDefinedException e) { |
|
63 |
logger.warn("Command name not set"); |
|
64 |
} |
|
65 |
} |
|
66 |
return null; |
|
67 |
} |
|
68 |
|
|
69 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler; |
12 | 12 |
|
13 |
import org.apache.log4j.Logger; |
|
14 | 13 |
import org.eclipse.core.commands.AbstractHandler; |
15 | 14 |
import org.eclipse.core.commands.ExecutionEvent; |
16 | 15 |
import org.eclipse.core.commands.ExecutionException; |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.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 |
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler; |
|
11 |
import org.apache.log4j.Logger; |
|
12 |
import org.eclipse.core.commands.AbstractHandler; |
|
13 |
import org.eclipse.core.commands.ExecutionEvent; |
|
14 |
import org.eclipse.core.commands.ExecutionException; |
|
15 |
import org.eclipse.core.commands.common.NotDefinedException; |
|
16 |
import org.eclipse.ui.IEditorInput; |
|
17 |
import org.eclipse.ui.IEditorPart; |
|
18 |
import org.eclipse.ui.IWorkbenchPart; |
|
19 |
import org.eclipse.ui.forms.editor.FormEditor; |
|
20 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
21 |
|
|
22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
|
23 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
24 |
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput; |
|
25 |
import eu.etaxonomy.taxeditor.operations.AbstractPostOperation; |
|
26 |
import eu.etaxonomy.taxeditor.operations.CreateTaxonDescriptionOperation; |
|
27 |
import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled; |
|
28 |
|
|
29 |
/** |
|
30 |
* <p>AddDescriptionHandler class.</p> |
|
31 |
* |
|
32 |
* @author p.ciardelli |
|
33 |
* @created 11.08.2009 |
|
34 |
* @version 1.0 |
|
35 |
*/ |
|
36 |
public class CreateDescriptionHandler extends AbstractHandler { |
|
37 |
private static final Logger logger = Logger |
|
38 |
.getLogger(CreateDescriptionElementHandler.class); |
|
39 |
|
|
40 |
/* (non-Javadoc) |
|
41 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
42 |
*/ |
|
43 |
/** {@inheritDoc} */ |
|
44 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
45 |
IWorkbenchPart part = HandlerUtil.getActivePart(event); |
|
46 |
IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null; |
|
47 |
|
|
48 |
|
|
49 |
IEditorPart editor = HandlerUtil.getActiveEditor(event); |
|
50 |
if (editor instanceof FormEditor) { |
|
51 |
editor = ((FormEditor) editor).getActiveEditor(); |
|
52 |
} |
|
53 |
IEditorInput input = editor.getEditorInput(); |
|
54 |
if (input instanceof TaxonEditorInput) { |
|
55 |
Taxon taxon = ((TaxonEditorInput) input).getTaxon(); |
|
56 |
AbstractPostOperation operation; |
|
57 |
try { |
|
58 |
// TODO use undo context specific to editor |
|
59 |
operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(), |
|
60 |
EditorUtil.getUndoContext(), taxon, postOperationEnabled); |
|
61 |
EditorUtil.executeOperation(operation); |
|
62 |
} catch (NotDefinedException e) { |
|
63 |
logger.warn("Command name not set"); |
|
64 |
} |
|
65 |
} |
|
66 |
return null; |
|
67 |
} |
|
68 |
|
|
69 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteDescriptionHandler.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.editor.view.descriptive.handler; |
|
12 |
|
|
13 |
import java.util.ArrayList; |
|
14 |
import java.util.List; |
|
15 |
|
|
16 |
import org.apache.log4j.Logger; |
|
17 |
import org.eclipse.core.commands.AbstractHandler; |
|
18 |
import org.eclipse.core.commands.ExecutionEvent; |
|
19 |
import org.eclipse.core.commands.ExecutionException; |
|
20 |
import org.eclipse.core.commands.common.NotDefinedException; |
|
21 |
import org.eclipse.core.commands.operations.IUndoContext; |
|
22 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
23 |
import org.eclipse.jface.viewers.TreePath; |
|
24 |
import org.eclipse.jface.viewers.TreeSelection; |
|
25 |
import org.eclipse.ui.IWorkbenchPart; |
|
26 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
27 |
|
|
28 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
|
29 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
|
30 |
import eu.etaxonomy.cdm.model.media.Media; |
|
31 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
32 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer; |
|
33 |
import eu.etaxonomy.taxeditor.operations.AbstractPostOperation; |
|
34 |
import eu.etaxonomy.taxeditor.operations.DeleteDescriptionElementOperation; |
|
35 |
import eu.etaxonomy.taxeditor.operations.DeleteMediaOperation; |
|
36 |
import eu.etaxonomy.taxeditor.operations.DeleteTaxonDescriptionOperation; |
|
37 |
import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled; |
|
38 |
|
|
39 |
/** |
|
40 |
* <p>DeleteDescriptionHandler class.</p> |
|
41 |
* |
|
42 |
* @author n.hoffmann |
|
43 |
* @created Jun 22, 2010 |
|
44 |
* @version 1.0 |
|
45 |
*/ |
|
46 |
public class DeleteDescriptionHandler extends AbstractHandler { |
|
47 |
private static final Logger logger = Logger |
|
48 |
.getLogger(DeleteDescriptionHandler.class); |
|
49 |
|
|
50 |
/* (non-Javadoc) |
|
51 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
52 |
*/ |
|
53 |
/** {@inheritDoc} */ |
|
54 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
55 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveMenuSelection(event); |
|
56 |
|
|
57 |
IWorkbenchPart part = HandlerUtil.getActivePart(event); |
|
58 |
IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null; |
|
59 |
|
|
60 |
try { |
|
61 |
String label = event.getCommand().getName(); |
|
62 |
|
|
63 |
IUndoContext undoContext = EditorUtil.getUndoContext(); |
|
64 |
|
|
65 |
List<AbstractPostOperation> operations = new ArrayList<AbstractPostOperation>(); |
|
66 |
|
|
67 |
for(Object object : selection.toArray()){ |
|
68 |
|
|
69 |
AbstractPostOperation operation = null; |
|
70 |
|
|
71 |
// TaxonDescription |
|
72 |
if(object instanceof TaxonDescription){ |
|
73 |
operations.add(new DeleteTaxonDescriptionOperation(label, undoContext, (TaxonDescription) object, postOperationEnabled)); |
|
74 |
} |
|
75 |
// DescriptionElementBase |
|
76 |
else if(object instanceof DescriptionElementBase){ |
|
77 |
operations.add(new DeleteDescriptionElementOperation(label, undoContext, (DescriptionElementBase) object, postOperationEnabled)); |
|
78 |
} |
|
79 |
else if(object instanceof FeatureNodeContainer){ |
|
80 |
List<DescriptionElementBase> descriptions = ((FeatureNodeContainer) object).getDescriptionElementsForEntireBranch(); |
|
81 |
|
|
82 |
for(DescriptionElementBase description : descriptions){ |
|
83 |
operations.add(new DeleteDescriptionElementOperation(label, undoContext, (DescriptionElementBase) object, postOperationEnabled)); |
|
84 |
} |
|
85 |
} |
|
86 |
// Media |
|
87 |
else if(object instanceof Media){ |
|
88 |
TreeSelection treeSelection = (TreeSelection) HandlerUtil.getActiveMenuSelection(event); |
|
89 |
|
|
90 |
TreePath[] path = treeSelection.getPathsFor(object); |
|
91 |
|
|
92 |
TaxonDescription imageGallery = (TaxonDescription) path[0].getFirstSegment(); |
|
93 |
|
|
94 |
operations.add(new DeleteMediaOperation(label, undoContext, imageGallery, (Media) object, postOperationEnabled)); |
|
95 |
} |
|
96 |
else{ |
|
97 |
logger.error("Selection os not valid for this delete handler"); |
|
98 |
} |
|
99 |
} |
|
100 |
|
|
101 |
// execute all cumulated operations |
|
102 |
for(AbstractPostOperation operation : operations){ |
|
103 |
EditorUtil.executeOperation(operation); |
|
104 |
} |
|
105 |
|
|
106 |
} catch (NotDefinedException e) { |
|
107 |
logger.warn("Command name not set"); |
|
108 |
} |
|
109 |
|
|
110 |
|
|
111 |
return null; |
|
112 |
} |
|
113 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.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.editor.view.descriptive.handler; |
|
12 |
|
|
13 |
import java.util.ArrayList; |
|
14 |
import java.util.List; |
|
15 |
|
|
16 |
import org.apache.log4j.Logger; |
|
17 |
import org.eclipse.core.commands.AbstractHandler; |
|
18 |
import org.eclipse.core.commands.ExecutionEvent; |
|
19 |
import org.eclipse.core.commands.ExecutionException; |
|
20 |
import org.eclipse.core.commands.common.NotDefinedException; |
|
21 |
import org.eclipse.core.commands.operations.IUndoContext; |
|
22 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
23 |
import org.eclipse.jface.viewers.TreePath; |
|
24 |
import org.eclipse.jface.viewers.TreeSelection; |
|
25 |
import org.eclipse.ui.IWorkbenchPart; |
|
26 |
import org.eclipse.ui.handlers.HandlerUtil; |
|
27 |
|
|
28 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
|
29 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
|
30 |
import eu.etaxonomy.cdm.model.media.Media; |
|
31 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
32 |
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer; |
|
33 |
import eu.etaxonomy.taxeditor.operations.AbstractPostOperation; |
|
34 |
import eu.etaxonomy.taxeditor.operations.DeleteDescriptionElementOperation; |
|
35 |
import eu.etaxonomy.taxeditor.operations.DeleteMediaOperation; |
|
36 |
import eu.etaxonomy.taxeditor.operations.DeleteTaxonDescriptionOperation; |
|
37 |
import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled; |
|
38 |
|
|
39 |
/** |
|
40 |
* <p>DeleteDescriptionHandler class.</p> |
|
41 |
* |
|
42 |
* @author n.hoffmann |
|
43 |
* @created Jun 22, 2010 |
|
44 |
* @version 1.0 |
|
45 |
*/ |
|
46 |
public class DeleteHandler extends AbstractHandler { |
|
47 |
private static final Logger logger = Logger |
|
48 |
.getLogger(DeleteHandler.class); |
|
49 |
|
|
50 |
/* (non-Javadoc) |
|
51 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
|
52 |
*/ |
|
53 |
/** {@inheritDoc} */ |
|
54 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
55 |
IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveMenuSelection(event); |
|
56 |
|
|
57 |
IWorkbenchPart part = HandlerUtil.getActivePart(event); |
|
58 |
IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null; |
|
59 |
|
|
60 |
try { |
|
61 |
String label = event.getCommand().getName(); |
|
62 |
|
|
63 |
IUndoContext undoContext = EditorUtil.getUndoContext(); |
|
64 |
|
|
65 |
List<AbstractPostOperation> operations = new ArrayList<AbstractPostOperation>(); |
|
66 |
|
|
67 |
for(Object object : selection.toArray()){ |
|
68 |
|
|
69 |
AbstractPostOperation operation = null; |
|
70 |
|
|
71 |
// TaxonDescription |
|
72 |
if(object instanceof TaxonDescription){ |
|
73 |
operations.add(new DeleteTaxonDescriptionOperation(label, undoContext, (TaxonDescription) object, postOperationEnabled)); |
|
74 |
} |
|
75 |
// DescriptionElementBase |
|
76 |
else if(object instanceof DescriptionElementBase){ |
|
77 |
operations.add(new DeleteDescriptionElementOperation(label, undoContext, (DescriptionElementBase) object, postOperationEnabled)); |
|
78 |
} |
|
79 |
else if(object instanceof FeatureNodeContainer){ |
|
80 |
List<DescriptionElementBase> descriptions = ((FeatureNodeContainer) object).getDescriptionElementsForEntireBranch(); |
|
81 |
|
|
82 |
for(DescriptionElementBase description : descriptions){ |
|
83 |
operations.add(new DeleteDescriptionElementOperation(label, undoContext, (DescriptionElementBase) object, postOperationEnabled)); |
|
84 |
} |
|
85 |
} |
|
86 |
// Media |
|
87 |
else if(object instanceof Media){ |
|
88 |
TreeSelection treeSelection = (TreeSelection) HandlerUtil.getActiveMenuSelection(event); |
|
89 |
|
|
90 |
TreePath[] path = treeSelection.getPathsFor(object); |
|
91 |
|
|
92 |
TaxonDescription imageGallery = (TaxonDescription) path[0].getFirstSegment(); |
|
93 |
|
|
94 |
operations.add(new DeleteMediaOperation(label, undoContext, imageGallery, (Media) object, postOperationEnabled)); |
|
95 |
} |
|
96 |
else{ |
|
97 |
logger.error("Selection os not valid for this delete handler"); |
|
98 |
} |
|
99 |
} |
|
100 |
|
|
101 |
// execute all cumulated operations |
|
102 |
for(AbstractPostOperation operation : operations){ |
|
103 |
EditorUtil.executeOperation(operation); |
|
104 |
} |
|
105 |
|
|
106 |
} catch (NotDefinedException e) { |
|
107 |
logger.warn("Command name not set"); |
|
108 |
} |
|
109 |
|
|
110 |
|
|
111 |
return null; |
|
112 |
} |
|
113 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/detail/DetailsViewer.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.model.media.Media; |
25 | 25 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
26 | 26 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase; |
27 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
27 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
28 | 28 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
29 | 29 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
30 | 30 |
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor; |
... | ... | |
107 | 107 |
createNameSections(rootElement); |
108 | 108 |
currentViewPart = VIEW_PART.NAME; |
109 | 109 |
} |
110 |
}else if(getInput() instanceof ReferenceBase){
|
|
110 |
}else if(getInput() instanceof Reference){ |
|
111 | 111 |
if(currentViewPart != VIEW_PART.REFEERENCE){ |
112 | 112 |
createReferenceSections(rootElement); |
113 | 113 |
currentViewPart = VIEW_PART.REFEERENCE; |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/CdmFormFactory.java | ||
---|---|---|
30 | 30 |
import org.eclipse.swt.widgets.Display; |
31 | 31 |
import org.eclipse.swt.widgets.Event; |
32 | 32 |
import org.eclipse.swt.widgets.Label; |
33 |
import org.eclipse.swt.widgets.Text; |
|
34 | 33 |
import org.eclipse.ui.forms.IFormColors; |
35 | 34 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
36 | 35 |
import org.eclipse.ui.forms.widgets.Section; |
... | ... | |
108 | 107 |
import eu.etaxonomy.cdm.model.occurrence.FieldObservation; |
109 | 108 |
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod; |
110 | 109 |
import eu.etaxonomy.cdm.model.occurrence.Specimen; |
111 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
|
110 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
111 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
112 | 112 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
113 | 113 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
114 |
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree; |
|
115 | 114 |
import eu.etaxonomy.cdm.strategy.parser.ParserProblem; |
116 | 115 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
117 | 116 |
import eu.etaxonomy.taxeditor.forms.selection.AbstractSelectionElement; |
... | ... | |
1594 | 1593 |
else if(entity instanceof Modifier){ |
1595 | 1594 |
element = new ModifierElement(this, parentElement, (Modifier) entity, removeListener, style); |
1596 | 1595 |
} |
1597 |
else if(entity instanceof ReferenceBase){
|
|
1598 |
element = new DescriptionSourceElement(this, parentElement, (ReferenceBase) entity, removeListener, style);
|
|
1596 |
else if(entity instanceof Reference){ |
|
1597 |
element = new DescriptionSourceElement(this, parentElement, (Reference) entity, removeListener, style); |
|
1599 | 1598 |
} |
1600 | 1599 |
else if(entity instanceof NameTypeDesignation){ |
1601 | 1600 |
element = new NameTypeDesignationElement(this, parentElement, (NameTypeDesignation) entity, removeListener, style); |
... | ... | |
1684 | 1683 |
element = new NameSelectionElement(this, conversation, parentElement, labelString, (TaxonNameBase) entity, style); |
1685 | 1684 |
break; |
1686 | 1685 |
case REFERENCE: |
1687 |
element = new ReferenceSelectionElement(this, conversation, parentElement, labelString, (ReferenceBase) entity, style);
|
|
1686 |
element = new ReferenceSelectionElement(this, conversation, parentElement, labelString, (Reference) entity, style); |
|
1688 | 1687 |
break; |
1689 | 1688 |
case TAXON_BASE: |
1690 | 1689 |
element = new TaxonBaseSelectionElement(this, conversation, parentElement, labelString, (TaxonBase) entity, style); |
... | ... | |
1699 | 1698 |
element = new FeatureTreeSelectionElement(this, conversation, parentElement, labelString, (FeatureTree) entity, style); |
1700 | 1699 |
break; |
1701 | 1700 |
case CLASSIFICATION: |
1702 |
element = new ClassificationSelectionElement(this, conversation, parentElement, labelString, (TaxonomicTree) entity, style);
|
|
1701 |
element = new ClassificationSelectionElement(this, conversation, parentElement, labelString, (Classification) entity, style);
|
|
1703 | 1702 |
break; |
1704 | 1703 |
case TAXON_NODE: |
1705 | 1704 |
element = new TaxonNodeSelectionElement(this, conversation, parentElement, labelString, (TaxonNode) entity, style); |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/ImageElement.java | ||
---|---|---|
13 | 13 |
import java.io.IOException; |
14 | 14 |
import java.io.InputStream; |
15 | 15 |
import java.net.URI; |
16 |
import java.util.HashMap; |
|
17 |
import java.util.Map; |
|
18 | 16 |
|
19 |
import org.apache.http.HttpEntity; |
|
20 | 17 |
import org.apache.http.HttpException; |
21 |
import org.apache.http.HttpResponse; |
|
22 |
import org.apache.log4j.Logger; |
|
23 | 18 |
import org.eclipse.core.runtime.IProgressMonitor; |
24 | 19 |
import org.eclipse.core.runtime.IStatus; |
25 | 20 |
import org.eclipse.core.runtime.Status; |
... | ... | |
46 | 41 |
*/ |
47 | 42 |
public class ImageElement extends AbstractCdmFormElement implements PaintListener, ControlListener{ |
48 | 43 |
|
49 |
private static final Logger logger = Logger.getLogger(ImageElement.class); |
|
50 |
|
|
51 | 44 |
private URI imageUri; |
52 | 45 |
private Image image; |
53 | 46 |
private Rectangle imageMaxBounds; |
... | ... | |
93 | 86 |
public void setImageUri(URI uri) { |
94 | 87 |
this.imageUri = uri; |
95 | 88 |
|
96 |
logger.warn("Setting image uri" + imageUri); |
|
97 |
|
|
98 | 89 |
if(imageUri != null){ |
99 | 90 |
|
100 | 91 |
final Display display = Display.getCurrent(); |
... | ... | |
109 | 100 |
display.asyncExec(new Runnable(){ |
110 | 101 |
@Override |
111 | 102 |
public void run() { |
112 |
// EditorUtil.reflowDetailsViewer();
|
|
113 |
getLayoutComposite().layout(); |
|
103 |
EditorUtil.reflowDetailsViewer(); |
|
104 |
// getLayoutComposite().layout();
|
|
114 | 105 |
} |
115 | 106 |
}); |
116 | 107 |
return Status.OK_STATUS; |
117 | 108 |
}catch (IOException e) { |
118 |
logger.error("Error reading image", e);
|
|
109 |
EditorUtil.error(getClass(), e);
|
|
119 | 110 |
} catch (HttpException e) { |
120 |
// TODO Auto-generated catch block |
|
121 |
e.printStackTrace(); |
|
111 |
EditorUtil.error(getClass(), e); |
|
122 | 112 |
} |
123 | 113 |
return Status.CANCEL_STATUS; |
124 | 114 |
} |
... | ... | |
185 | 175 |
/** {@inheritDoc} */ |
186 | 176 |
@Override |
187 | 177 |
public void controlResized(ControlEvent e) { |
188 |
// EditorUtil.reflowDetailsViewer();
|
|
178 |
EditorUtil.reflowDetailsViewer(); |
|
189 | 179 |
} |
190 | 180 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/LanguageStringWithLabelElement.java | ||
---|---|---|
13 | 13 |
import org.eclipse.swt.events.ModifyEvent; |
14 | 14 |
|
15 | 15 |
import eu.etaxonomy.cdm.model.common.LanguageString; |
16 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
|
17 | 16 |
|
18 | 17 |
/** |
19 | 18 |
* <p>LanguageStringWithLabelElement class.</p> |
... | ... | |
91 | 90 |
*/ |
92 | 91 |
public void setLanguageString(LanguageString languageString) { |
93 | 92 |
this.languageString = languageString; |
94 |
if(languageString != null) { |
|
95 |
super.setText(languageString.getText()); |
|
96 |
}else{ |
|
97 |
super.setText(""); |
|
98 |
EditorUtil.warn(getClass(), "LanguageString is null. This should not be the case."); |
|
99 |
} |
|
93 |
super.setText(languageString != null ? languageString.getText() : ""); |
|
100 | 94 |
} |
101 | 95 |
} |
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/selection/ClassificationSelectionElement.java | ||
---|---|---|
13 | 13 |
import org.eclipse.swt.events.SelectionEvent; |
14 | 14 |
|
15 | 15 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
16 |
import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
|
|
16 |
import eu.etaxonomy.cdm.model.taxon.Classification;
|
|
17 | 17 |
import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredClassificationSelectionDialog; |
18 | 18 |
import eu.etaxonomy.taxeditor.forms.CdmFormFactory; |
19 | 19 |
import eu.etaxonomy.taxeditor.forms.ICdmFormElement; |
... | ... | |
25 | 25 |
* @created Sep 27, 2010 |
26 | 26 |
* @version 1.0 |
27 | 27 |
*/ |
28 |
public class ClassificationSelectionElement extends AbstractSelectionElement<TaxonomicTree> {
|
|
28 |
public class ClassificationSelectionElement extends AbstractSelectionElement<Classification> {
|
|
29 | 29 |
|
30 | 30 |
/** |
31 | 31 |
* <p>Constructor for ClassificationSelectionElement.</p> |
... | ... | |
39 | 39 |
*/ |
40 | 40 |
public ClassificationSelectionElement(CdmFormFactory formFactory, |
41 | 41 |
ConversationHolder conversation, ICdmFormElement parentElement, |
42 |
String labelString, TaxonomicTree entity, int style) {
|
|
42 |
String labelString, Classification entity, int style) {
|
|
43 | 43 |
super(formFactory, conversation, parentElement, labelString, entity, |
44 | 44 |
false, false, true, style); |
45 | 45 |
} |
... | ... | |
50 | 50 |
/** {@inheritDoc} */ |
51 | 51 |
@Override |
52 | 52 |
public void widgetSelected(SelectionEvent e) { |
53 |
TaxonomicTree newSelection = FilteredClassificationSelectionDialog.select(getShell(), getConversationHolder());
|
|
53 |
Classification newSelection = FilteredClassificationSelectionDialog.select(getShell(), getConversationHolder());
|
|
54 | 54 |
setSelectionInternal(newSelection); |
55 | 55 |
} |
56 | 56 |
|
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/forms/selection/EditFromSelectionWizard.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.forms.selection; |
12 | 12 |
|
13 |
import org.apache.log4j.Logger; |
|
14 | 13 |
import org.eclipse.core.runtime.IStatus; |
15 | 14 |
import org.eclipse.jface.wizard.Wizard; |
16 | 15 |
import org.eclipse.jface.wizard.WizardDialog; |
... | ... | |
23 | 22 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
24 | 23 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
25 | 24 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase; |
26 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
|
|
25 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
27 | 26 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
28 | 27 |
import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage; |
29 | 28 |
import eu.etaxonomy.taxeditor.forms.CdmFormFactory; |
... | ... | |
31 | 30 |
import eu.etaxonomy.taxeditor.section.agent.TeamWizardPage; |
32 | 31 |
import eu.etaxonomy.taxeditor.section.name.NonViralNameWizardPage; |
33 | 32 |
import eu.etaxonomy.taxeditor.section.occurrence.DerivedUnitFacadeWizardPage; |
34 |
import eu.etaxonomy.taxeditor.section.reference.ReferenceBaseWizardPage;
|
|
33 |
import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage; |
|
35 | 34 |
|
36 | 35 |
/** |
37 | 36 |
* <p>EditFromSelectionWizard class.</p> |
... | ... | |
64 | 63 |
CdmFormFactory formFactory = selectionElement.getFormFactory(); |
Also available in: Unified diff
added a readme file