* text=auto !eol
/LICENSE.txt -text
+/README.txt -text
/pom.xml -text
src/changes/changes.xml -text
src/site/apt/download.apt -text
taxeditor-cdmlib/lib/msbase-2000.3.jar -text
taxeditor-cdmlib/lib/mssqlserver-2000.3.jar -text
taxeditor-cdmlib/lib/msutil-2000.3.jar -text
-taxeditor-cdmlib/lib/mysql-connector-java-3.1.14-bin.jar -text
+taxeditor-cdmlib/lib/mysql-connector-java-5.0.5.jar -text
taxeditor-cdmlib/lib/odfdom-0.8-javadoc.zip -text
taxeditor-cdmlib/lib/odfdom-0.8-sources.zip -text
taxeditor-cdmlib/lib/odfdom-0.8.jar -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveContentProvider.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveLabelProvider.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java -text
-taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/AddDescriptionHandler.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionElementHandler.java -text
-taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteDescriptionHandler.java -text
+taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/CreateDescriptionHandler.java -text
+taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DescriptionsMenuPropertyTester.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/detail/CdmSectionPart.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/NomenclaturalReferenceDetailSection.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailElement.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseDetailSection.java -text
-taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceBaseWizardPage.java -text
+taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/reference/ReferenceWizardPage.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractMediaRepresentationPartElement.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractOriginalSourceElement.java -text
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/section/supplemental/AbstractReferencedEntityElement.java -text
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteSynonymOperation.java -text
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTaxonDescriptionOperation.java -text
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/DeleteTreeNodeOperation.java -text
-taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditTaxonomicTreeOperation.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditClassificationOperation.java -text
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/EditUserOperation.java -text
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/IPostOperationEnabled.java -text
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/operations/MoveMediaInListOperation.java -text
--- /dev/null
+For more information please see http://wp5.e-taxonomy.eu/taxeditor
import eu.etaxonomy.cdm.model.common.Marker;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener;
import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
*/
/** {@inheritDoc} */
public String getSupplementalText(Object entity) {
- if (entity instanceof ReferenceBase) {
- ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(entity);
+ if (entity instanceof Reference) {
+ Reference reference = (Reference) HibernateProxyHelper.deproxy(entity);
// Nobody seems to like displaying the date
// TimePeriod datePublished = ((StrictReferenceBase) reference).getDatePublished();
//
*/
/** {@inheritDoc} */
public void setText(String text, Object entity) {
- if (entity instanceof ReferenceBase) {
- ((ReferenceBase) entity).setTitleCache(text);
+ if (entity instanceof Reference) {
+ ((Reference) entity).setTitleCache(text);
}
}
*/
/** {@inheritDoc} */
public String getEmptyCacheMessage(Object entity) {
- if (entity instanceof ReferenceBase) {
+ if (entity instanceof Reference) {
return "No reference title cache";
}
if (entity instanceof TaxonNameBase) {
*/
/** {@inheritDoc} */
public boolean isEntityCacheEmpty(Object entity) {
- if (entity instanceof ReferenceBase) {
- String text = ((ReferenceBase) entity).getTitleCache();
+ if (entity instanceof Reference) {
+ String text = ((Reference) entity).getTitleCache();
return (text == null || text.equals(""));
}
if (entity instanceof TaxonNameBase) {
import org.eclipse.ui.IEditorInput;
import eu.etaxonomy.cdm.model.common.TimePeriod;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IdentifiableEntityComparator;
import eu.etaxonomy.taxeditor.bulkeditor.input.ReferenceEditorInput;
* @return
*/
private String getYearString(Object o) {
- TimePeriod datePublished = o == null || !(o instanceof ReferenceBase) ?
- null : ((ReferenceBase) o).getDatePublished();
+ TimePeriod datePublished = o == null || !(o instanceof Reference) ?
+ null : ((Reference) o).getDatePublished();
return datePublished == null? null : datePublished.toString();
}
import org.apache.log4j.Logger;
-import eu.etaxonomy.cdm.model.reference.Article;
-import eu.etaxonomy.cdm.model.reference.Book;
-import eu.etaxonomy.cdm.model.reference.BookSection;
-import eu.etaxonomy.cdm.model.reference.CdDvd;
-import eu.etaxonomy.cdm.model.reference.Database;
-import eu.etaxonomy.cdm.model.reference.Generic;
-import eu.etaxonomy.cdm.model.reference.InProceedings;
-import eu.etaxonomy.cdm.model.reference.Journal;
-import eu.etaxonomy.cdm.model.reference.Patent;
-import eu.etaxonomy.cdm.model.reference.PersonalCommunication;
-import eu.etaxonomy.cdm.model.reference.PrintSeries;
-import eu.etaxonomy.cdm.model.reference.Proceedings;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
-import eu.etaxonomy.cdm.model.reference.Report;
-import eu.etaxonomy.cdm.model.reference.Thesis;
-import eu.etaxonomy.cdm.model.reference.WebPage;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
/**
* @created 07.07.2009
* @version 1.0
*/
-public class ReferenceCreator implements IEntityCreator<ReferenceBase> {
+public class ReferenceCreator implements IEntityCreator<Reference> {
private static final Logger logger = Logger
.getLogger(ReferenceCreator.class);
* @see eu.etaxonomy.taxeditor.bulkeditor.IEntityCreator#createEntity(java.lang.String)
*/
/** {@inheritDoc} */
- public ReferenceBase createEntity(String text) {
- return createEntity(Generic.class, text);
+ public Reference createEntity(String text) {
+ return createEntity(Reference.class, text);
}
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
*/
/** {@inheritDoc} */
- public ReferenceBase createEntity(Object key, String text) {
- ReferenceBase reference = null;
+ public Reference createEntity(Object key, String text) {
+ Reference reference = null;
// TODO replace w more generic method when cdmlib matures accordingly
if (ReferenceType.Article.getMessage().equals(key)) {
- reference = Article.NewInstance();
+ reference = ReferenceFactory.newArticle();
}
if (ReferenceType.Book.getMessage().equals(key)) {
- reference = Book.NewInstance();
+ reference = ReferenceFactory.newBook();
}
if (ReferenceType.BookSection.getMessage().equals(key)) {
- reference = BookSection.NewInstance();
+ reference = ReferenceFactory.newBookSection();
}
if (ReferenceType.CdDvd.getMessage().equals(key)) {
- reference = CdDvd.NewInstance();
+ reference = ReferenceFactory.newCdDvd();
}
if (ReferenceType.Database.getMessage().equals(key)) {
- reference = Database.NewInstance();
+ reference = ReferenceFactory.newDatabase();
}
if (ReferenceType.Generic.getMessage().equals(key)) {
- reference = Generic.NewInstance();
+ reference = ReferenceFactory.newGeneric();
}
if (ReferenceType.InProceedings.getMessage().equals(key)) {
- reference = InProceedings.NewInstance();
+ reference = ReferenceFactory.newInProceedings();
}
if (ReferenceType.Journal.getMessage().equals(key)) {
- reference = Journal.NewInstance();
+ reference = ReferenceFactory.newJournal();
}
if (ReferenceType.Map.getMessage().equals(key)) {
- reference = eu.etaxonomy.cdm.model.reference.Map.NewInstance();
+ reference = ReferenceFactory.newMap();
}
if (ReferenceType.Patent.getMessage().equals(key)) {
- reference = Patent.NewInstance();
+ reference = ReferenceFactory.newPatent();
}
if (ReferenceType.PersonalCommunication.getMessage().equals(key)) {
- reference = PersonalCommunication.NewInstance();
+ reference = ReferenceFactory.newPersonalCommunication();
}
if (ReferenceType.PrintSeries.getMessage().equals(key)) {
- reference = PrintSeries.NewInstance();
+ reference = ReferenceFactory.newPrintSeries();
}
if (ReferenceType.Proceedings.getMessage().equals(key)) {
- reference = Proceedings.NewInstance();
+ reference = ReferenceFactory.newProceedings();
}
if (ReferenceType.Report.getMessage().equals(key)) {
- reference = Report.NewInstance();
+ reference = ReferenceFactory.newReport();
}
if (ReferenceType.Thesis.getMessage().equals(key)) {
- reference = Thesis.NewInstance();
+ reference = ReferenceFactory.newThesis();
}
if (ReferenceType.WebPage.getMessage().equals(key)) {
- reference = WebPage.NewInstance();
+ reference = ReferenceFactory.newWebPage();
}
if (reference == null) {
logger.warn("Reference type " + key + " not found. Creating reference with default type.");
- reference = Generic.NewInstance();
+ reference = ReferenceFactory.newGeneric();
}
reference.setTitleCache(text);
return reference;
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.AgentEditorInput;
import eu.etaxonomy.taxeditor.bulkeditor.input.NameEditorInput;
}
public static BulkEditorInputType getByType(Class clazz){
- if (ReferenceBase.class.isAssignableFrom(clazz)) {
+ if (Reference.class.isAssignableFrom(clazz)) {
return REFERENCE;
}
else if (TaxonNameBase.class.isAssignableFrom(clazz)) {
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.merge.MergeException;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
import eu.etaxonomy.taxeditor.annotatedlineeditor.IdentifiableEntityComparator;
/** {@inheritDoc} */
public boolean merge(Object entity, Object mergeTarget) {
logger.info("Merge " + entity + " into " + mergeTarget);
- if (entity instanceof ReferenceBase) {
+ if (entity instanceof Reference) {
try {
- CdmStore.getCommonService().merge((ReferenceBase) mergeTarget, (ReferenceBase) entity, null);
+ CdmStore.getCommonService().merge((Reference) mergeTarget, (Reference) entity, null);
} catch (MergeException e) {
logger.error("Problems merging objects", e);
}
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
import eu.etaxonomy.cdm.model.common.MarkerType;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
import eu.etaxonomy.taxeditor.store.CdmStore;
* @created 25.06.2009
* @version 1.0
*/
-public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase> {
+public class ReferenceEditorInput extends AbstractBulkEditorInput<Reference> {
/**
*
/** {@inheritDoc} */
@Override
- public ReferenceBase loadEntity(UUID entityUuid) {
+ public Reference loadEntity(UUID entityUuid) {
List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"});
return CdmStore.getReferenceService().load(entityUuid, propertyPaths);
}
/** {@inheritDoc} */
public boolean delete(Object entity) {
- return CdmStore.getReferenceService().delete((ReferenceBase) entity) != null;
+ return CdmStore.getReferenceService().delete((Reference) entity) != null;
}
/** {@inheritDoc} */
public boolean save(Object entity) {
- return CdmStore.getReferenceService().saveOrUpdate((ReferenceBase) entity) != null;
+ return CdmStore.getReferenceService().saveOrUpdate((Reference) entity) != null;
}
}
lib/msbase-2000.3.jar,
lib/mssqlserver-2000.3.jar,
lib/msutil-2000.3.jar,
- lib/mysql-connector-java-3.1.14-bin.jar,
+ lib/mysql-connector-java-5.0.5.jar,
lib/odfdom-0.8.jar,
lib/opencsv-1.8.jar,
lib/org.apache.commons.codec-1.3.0.jar,
lib/org.springframework.web.servlet-3.0.4.RELEASE.jar,
lib/dozer-5.3.0.jar,
lib/google-api-translate-java-0.92.jar,
- lib/cdmlib-commons-2.5.jar,
- lib/cdmlib-ext-2.5.jar,
- lib/cdmlib-io-2.5.jar,
- lib/cdmlib-model-2.5.jar,
- lib/cdmlib-persistence-2.5.jar,
- lib/cdmlib-print-2.5.jar,
- lib/cdmlib-remote-2.5.jar,
- lib/cdmlib-services-2.5.jar
+ lib/cdmlib-commons-3.0.jar,
+ lib/cdmlib-ext-3.0.jar,
+ lib/cdmlib-io-3.0.jar,
+ lib/cdmlib-model-3.0.jar,
+ lib/cdmlib-persistence-3.0.jar,
+ lib/cdmlib-print-3.0.jar,
+ lib/cdmlib-remote-3.0.jar,
+ lib/cdmlib-services-3.0.jar
Export-Package: com.google.api,
com.google.api.detect,
com.google.api.translate,
bin.includes = META-INF/,\\r
lib/,\\r
- lib/cdmlib-commons-2.5.jar,\\r
- lib/cdmlib-ext-2.5.jar,\\r
- lib/cdmlib-io-2.5.jar,\\r
- lib/cdmlib-model-2.5.jar,\\r
- lib/cdmlib-persistence-2.5.jar,\\r
- lib/cdmlib-print-2.5.jar,\\r
- lib/cdmlib-remote-2.5.jar,\\r
- lib/cdmlib-services-2.5.jar\r
+ lib/cdmlib-commons-3.0.jar,\\r
+ lib/cdmlib-ext-3.0.jar,\\r
+ lib/cdmlib-io-3.0.jar,\\r
+ lib/cdmlib-model-3.0.jar,\\r
+ lib/cdmlib-persistence-3.0.jar,\\r
+ lib/cdmlib-print-3.0.jar,\\r
+ lib/cdmlib-remote-3.0.jar,\\r
+ lib/cdmlib-services-3.0.jar,\\r
+ lib/mysql-connector-java-5.0.5.jar\r
jars.compile.order = cdmLibrary.jar\r
src.includes = lib/\r
jre.compilation.profile = J2SE-1.6\r
<extension
point="org.eclipse.ui.handlers">
<handler
- class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteDescriptionHandler"
+ class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
commandId="org.eclipse.ui.edit.delete">
<activeWhen>
<reference
name="Create Description Element">
</command>
<command
- defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.AddDescriptionHandler"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler"
id="eu.etaxonomy.taxeditor.description.commands.adddescription"
name="New Description">
</command>
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
* @version 1.0
*/
public class FilteredClassificationSelectionDialog extends
- AbstractFilteredCdmResourceSelectionDialog<TaxonomicTree> {
+ AbstractFilteredCdmResourceSelectionDialog<Classification> {
/**
* <p>select</p>
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
- public static TaxonomicTree select(Shell shell, ConversationHolder conversation) {
+ public static Classification select(Shell shell, ConversationHolder conversation) {
FilteredClassificationSelectionDialog dialog = new FilteredClassificationSelectionDialog(shell, conversation,
"Choose a Classification", false, "", null);
return getSelectionFromDialog(dialog);
* @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
protected FilteredClassificationSelectionDialog(Shell shell, ConversationHolder conversation, String title,
- boolean multi, String settings, TaxonomicTree classification) {
+ boolean multi, String settings, Classification classification) {
super(shell, conversation, title, multi, settings, classification);
}
*/
/** {@inheritDoc} */
@Override
- protected TaxonomicTree getPersistentObject(UUID cdmUuid) {
- return CdmStore.getTaxonTreeService().getTaxonomicTreeByUuid(cdmUuid);
+ protected Classification getPersistentObject(UUID cdmUuid) {
+ return CdmStore.getClassificationService().getClassificationByUuid(cdmUuid);
}
/* (non-Javadoc)
/** {@inheritDoc} */
@Override
protected void initModel() {
- model = CdmStore.getTaxonTreeService().getUuidAndTitleCache();
+ model = CdmStore.getClassificationService().getUuidAndTitleCache();
}
/** {@inheritDoc} */
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.cache.reference.ReferenceBaseDefaultCacheStrategy;
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.editor.newWizard.NewReferenceWizard;
* @created 04.06.2009
* @version 1.0
*/
-public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<ReferenceBase> {
+public class FilteredReferenceSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<Reference> {
/**
* <p>select</p>
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
*/
- public static ReferenceBase select(Shell shell, ConversationHolder conversation, ReferenceBase reference) {
+ public static Reference select(Shell shell, ConversationHolder conversation, Reference reference) {
FilteredReferenceSelectionDialog dialog = new FilteredReferenceSelectionDialog(shell, conversation,
- "Choose a reference", false, (ReferenceBase) reference);
+ "Choose a reference", false, (Reference) reference);
return getSelectionFromDialog(dialog);
}
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param multi a boolean.
*/
- protected FilteredReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, ReferenceBase reference) {
+ protected FilteredReferenceSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, Reference reference) {
super(shell, conversation, title, multi, FilteredReferenceSelectionDialog.class.getCanonicalName(), null);
}
*/
/** {@inheritDoc} */
@Override
- protected ReferenceBase getPersistentObject(UUID cdmUuid) {
+ protected Reference getPersistentObject(UUID cdmUuid) {
return CdmStore.getReferenceService().load(cdmUuid);
}
/** {@inheritDoc} */
@Override
- protected String getTitle(ReferenceBase cdmObject) {
+ protected String getTitle(Reference cdmObject) {
if(cdmObject.getAuthorTeam() == null){
return super.getTitle(cdmObject);
}else{
import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
import eu.etaxonomy.taxeditor.store.CdmStore;
private Combo classificationSelectionCombo;
- private List<TaxonomicTree> classifications;
+ private List<Classification> classifications;
- private TaxonomicTree selectedClassification;
+ private Classification selectedClassification;
/**
classificationSelectionCombo = new Combo(classificationSelection, SWT.BORDER | SWT.READ_ONLY);
classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
- for(TaxonomicTree tree : classifications){
+ for(Classification tree : classifications){
classificationSelectionCombo.add(tree.getName().getText(), classifications.indexOf(tree));
}
/** {@inheritDoc} */
@Override
protected TaxonNode getPersistentObject(UUID uuid) {
- return CdmStore.getTaxonTreeService().getTaxonNodeByUuid(uuid);
+ return CdmStore.getClassificationService().getTaxonNodeByUuid(uuid);
}
/* (non-Javadoc)
if(classifications == null){
- classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+ classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
selectedClassification = classifications.iterator().next();
}
- model = CdmStore.getTaxonTreeService().getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByTaxonomicTree(selectedClassification);
+ model = CdmStore.getClassificationService().getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(selectedClassification);
}
/** {@inheritDoc} */
ConversationHolder conversation = CdmStore.createConversation();
TaxonNameBase<?, ?> name = PreferencesUtil.getPreferredNomenclaturalCode().getNewTaxonNameInstance(null);
- ITreeNode parentNode = CdmStore.getTaxonTreeService().getTreeNodeByUuid(parentNodeUuid);
+ ITreeNode parentNode = CdmStore.getClassificationService().getTreeNodeByUuid(parentNodeUuid);
Taxon newTaxon = Taxon.NewInstance(name, parentNode.getReference());
TaxonNode newTaxonNode = parentNode.addChildTaxon(newTaxon, parentNode.getReference(), parentNode.getMicroReference(), null);
if(! CdmStore.isActive()){
return null;
}
- if (taxonNodeUuid == null || CdmStore.getTaxonTreeService().getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
+ if (taxonNodeUuid == null || CdmStore.getClassificationService().getTaxonNodeByUuid(UUID.fromString(taxonNodeUuid)) == null) {
EditorUtil.warn(this.getClass(), "Couldn't find taxon node with UUID " + taxonNodeUuid);
return null;
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.ext.ipni.IIpniService;
import eu.etaxonomy.cdm.ext.ipni.IpniService;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.store.CdmStore;
.getLogger(ExternalReferenceServiceWizardPage.class);
private ConversationHolder conversation;
private CdmFormFactory formFactory;
- private ReferenceBase entity;
+ private Reference entity;
private Composite control;
private ListViewer viewer;
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
*/
- protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, ReferenceBase entity) {
+ protected ExternalReferenceServiceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) {
super("ExternalReferenceServiceWizardPage");
this.formFactory = formFactory;
this.entity = entity;
viewer.setLabelProvider(new LabelProvider(){
@Override
public String getText(Object element) {
- if(element instanceof ReferenceBase){
- return ((ReferenceBase) element).getTitleCache();
+ if(element instanceof Reference){
+ return ((Reference) element).getTitleCache();
}
return "Element is not a reference";
}
@Override
public void widgetSelected(SelectionEvent e) {
String query = text_query.getText();
- List<ReferenceBase> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null);
+ List<Reference> publications = ipniService.getPublications(query, null, (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationController(), null);
viewer.setInput(publications);
}
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- ReferenceBase selectedReference = (ReferenceBase) selection.getFirstElement();
+ Reference selectedReference = (Reference) selection.getFirstElement();
if(selectedReference != null){
((AbstractNewEntityWizard) getWizard()).setEntity(selectedReference);
}
package eu.etaxonomy.taxeditor.editor.newWizard;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
-import eu.etaxonomy.taxeditor.section.reference.ReferenceBaseWizardPage;
+import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* @created Jun 1, 2010
* @version 1.0
*/
-public class NewReferenceWizard extends AbstractNewEntityWizard<ReferenceBase> {
+public class NewReferenceWizard extends AbstractNewEntityWizard<Reference> {
- private ReferenceBaseWizardPage referenceBasePage;
+ private ReferenceWizardPage referencePage;
/** {@inheritDoc} */
@Override
public void addPages() {
// TODO disabling external service wizard page for now
// addPage(new ExternalReferenceServiceWizardPage(formFactory, getConversationHolder(), entity));
- referenceBasePage = new ReferenceBaseWizardPage(formFactory, getConversationHolder(), entity);
- addPage(referenceBasePage);
+ referencePage = new ReferenceWizardPage(formFactory, getConversationHolder(), entity);
+ addPage(referencePage);
}
/** {@inheritDoc} */
@Override
- protected ReferenceBase createNewEntity() {
+ protected Reference createNewEntity() {
return ReferenceFactory.newGeneric();
}
/** {@inheritDoc} */
@Override
- public void setEntity(ReferenceBase entity) {
+ public void setEntity(Reference entity) {
super.setEntity(entity);
- referenceBasePage.getDetailElement().setEntity(entity);
+ referencePage.getDetailElement().setEntity(entity);
}
}
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.log4j.Logger;
import org.eclipse.jface.viewers.ITreeContentProvider;
public boolean postOperation(CdmBase objectAffectedByOperation) {
boolean result = super.postOperation(objectAffectedByOperation);
- if(objectAffectedByOperation != null){
-
- if(objectAffectedByOperation instanceof DescriptionElementBase){
- DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation;
- FeatureNodeContainer container = getFeatureNodeContainerForDescriptionElement(descriptionElement);
- viewer.expandToLevel(container, 1);
- }
-
- StructuredSelection selection = new StructuredSelection(objectAffectedByOperation);
- viewer.setSelection(selection, true);
- }
+// if(objectAffectedByOperation != null){
+//
+// if(objectAffectedByOperation instanceof DescriptionElementBase){
+// DescriptionElementBase descriptionElement = (DescriptionElementBase) objectAffectedByOperation;
+// FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription());
+// FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement);
+//// viewer.refresh(featureNodeContainer, true);
+// viewer.expandToLevel(featureNodeContainer, 1);
+// }
+//
+// StructuredSelection selection = new StructuredSelection(objectAffectedByOperation);
+// viewer.setSelection(selection, true);
+// }else{
+//// viewer.refresh();
+// }
return result;
}
-
- /**
- *
- * @param descriptionElement
- * @return
- */
- private FeatureNodeContainer getFeatureNodeContainerForDescriptionElement(
- DescriptionElementBase descriptionElement) {
- FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription());
- FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.getFeatureNodeContainerForDescriptionElement(descriptionElement);
- return featureNodeContainer;
- }
/** {@inheritDoc} */
@Override
public void changed(Object object) {
-// viewer.refresh(true);
-// viewer.update(object, null);
- viewer.refresh(object, true);
+ if(object instanceof DescriptionElementBase){
+ DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
+ FeatureNodeContainer featureNodeContainerBranch = featureNodeContainerCache.get(descriptionElement.getInDescription());
+ FeatureNodeContainer featureNodeContainer = featureNodeContainerBranch.processDescriptionElement(descriptionElement);
+ viewer.refresh(featureNodeContainer, true);
+ viewer.expandToLevel(featureNodeContainer, 1);
+
+ }else{
+ viewer.refresh(true);
+ }
+
+ if(object != null){
+ StructuredSelection selection = new StructuredSelection(object);
+ viewer.setSelection(selection, true);
+ }
+
super.changed(object);
}
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler;
-import org.apache.log4j.Logger;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
* @created 11.08.2009
* @version 1.0
*/
-public class AddDescriptionHandler extends AbstractHandler {
+public class CreateDescriptionHandler extends AbstractHandler {
private static final Logger logger = Logger
.getLogger(CreateDescriptionElementHandler.class);
* @created Jun 22, 2010
* @version 1.0
*/
-public class DeleteDescriptionHandler extends AbstractHandler {
+public class DeleteHandler extends AbstractHandler {
private static final Logger logger = Logger
- .getLogger(DeleteDescriptionHandler.class);
+ .getLogger(DeleteHandler.class);
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
createNameSections(rootElement);
currentViewPart = VIEW_PART.NAME;
}
- }else if(getInput() instanceof ReferenceBase){
+ }else if(getInput() instanceof Reference){
if(currentViewPart != VIEW_PART.REFEERENCE){
createReferenceSections(rootElement);
currentViewPart = VIEW_PART.REFEERENCE;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
import eu.etaxonomy.cdm.model.occurrence.Specimen;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.forms.selection.AbstractSelectionElement;
else if(entity instanceof Modifier){
element = new ModifierElement(this, parentElement, (Modifier) entity, removeListener, style);
}
- else if(entity instanceof ReferenceBase){
- element = new DescriptionSourceElement(this, parentElement, (ReferenceBase) entity, removeListener, style);
+ else if(entity instanceof Reference){
+ element = new DescriptionSourceElement(this, parentElement, (Reference) entity, removeListener, style);
}
else if(entity instanceof NameTypeDesignation){
element = new NameTypeDesignationElement(this, parentElement, (NameTypeDesignation) entity, removeListener, style);
element = new NameSelectionElement(this, conversation, parentElement, labelString, (TaxonNameBase) entity, style);
break;
case REFERENCE:
- element = new ReferenceSelectionElement(this, conversation, parentElement, labelString, (ReferenceBase) entity, style);
+ element = new ReferenceSelectionElement(this, conversation, parentElement, labelString, (Reference) entity, style);
break;
case TAXON_BASE:
element = new TaxonBaseSelectionElement(this, conversation, parentElement, labelString, (TaxonBase) entity, style);
element = new FeatureTreeSelectionElement(this, conversation, parentElement, labelString, (FeatureTree) entity, style);
break;
case CLASSIFICATION:
- element = new ClassificationSelectionElement(this, conversation, parentElement, labelString, (TaxonomicTree) entity, style);
+ element = new ClassificationSelectionElement(this, conversation, parentElement, labelString, (Classification) entity, style);
break;
case TAXON_NODE:
element = new TaxonNodeSelectionElement(this, conversation, parentElement, labelString, (TaxonNode) entity, style);
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.http.HttpEntity;
import org.apache.http.HttpException;
-import org.apache.http.HttpResponse;
-import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
*/
public class ImageElement extends AbstractCdmFormElement implements PaintListener, ControlListener{
- private static final Logger logger = Logger.getLogger(ImageElement.class);
-
private URI imageUri;
private Image image;
private Rectangle imageMaxBounds;
public void setImageUri(URI uri) {
this.imageUri = uri;
- logger.warn("Setting image uri" + imageUri);
-
if(imageUri != null){
final Display display = Display.getCurrent();
display.asyncExec(new Runnable(){
@Override
public void run() {
-// EditorUtil.reflowDetailsViewer();
- getLayoutComposite().layout();
+ EditorUtil.reflowDetailsViewer();
+// getLayoutComposite().layout();
}
});
return Status.OK_STATUS;
}catch (IOException e) {
- logger.error("Error reading image", e);
+ EditorUtil.error(getClass(), e);
} catch (HttpException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ EditorUtil.error(getClass(), e);
}
return Status.CANCEL_STATUS;
}
/** {@inheritDoc} */
@Override
public void controlResized(ControlEvent e) {
-// EditorUtil.reflowDetailsViewer();
+ EditorUtil.reflowDetailsViewer();
}
}
import org.eclipse.swt.events.ModifyEvent;
import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
/**
* <p>LanguageStringWithLabelElement class.</p>
*/
public void setLanguageString(LanguageString languageString) {
this.languageString = languageString;
- if(languageString != null) {
- super.setText(languageString.getText());
- }else{
- super.setText("");
- EditorUtil.warn(getClass(), "LanguageString is null. This should not be the case.");
- }
+ super.setText(languageString != null ? languageString.getText() : "");
}
}
import org.eclipse.swt.events.SelectionEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredClassificationSelectionDialog;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
* @created Sep 27, 2010
* @version 1.0
*/
-public class ClassificationSelectionElement extends AbstractSelectionElement<TaxonomicTree> {
+public class ClassificationSelectionElement extends AbstractSelectionElement<Classification> {
/**
* <p>Constructor for ClassificationSelectionElement.</p>
*/
public ClassificationSelectionElement(CdmFormFactory formFactory,
ConversationHolder conversation, ICdmFormElement parentElement,
- String labelString, TaxonomicTree entity, int style) {
+ String labelString, Classification entity, int style) {
super(formFactory, conversation, parentElement, labelString, entity,
false, false, true, style);
}
/** {@inheritDoc} */
@Override
public void widgetSelected(SelectionEvent e) {
- TaxonomicTree newSelection = FilteredClassificationSelectionDialog.select(getShell(), getConversationHolder());
+ Classification newSelection = FilteredClassificationSelectionDialog.select(getShell(), getConversationHolder());
setSelectionInternal(newSelection);
}
package eu.etaxonomy.taxeditor.forms.selection;
-import org.apache.log4j.Logger;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.section.agent.TeamWizardPage;
import eu.etaxonomy.taxeditor.section.name.NonViralNameWizardPage;
import eu.etaxonomy.taxeditor.section.occurrence.DerivedUnitFacadeWizardPage;
-import eu.etaxonomy.taxeditor.section.reference.ReferenceBaseWizardPage;
+import eu.etaxonomy.taxeditor.section.reference.ReferenceWizardPage;
/**
* <p>EditFromSelectionWizard class.</p>
CdmFormFactory formFactory = selectionElement.getFormFactory();
IdentifiableEntity entity = (IdentifiableEntity) HibernateProxyHelper.deproxy(selectionElement.getEntity());
- if(entity instanceof ReferenceBase){
- page = new ReferenceBaseWizardPage(formFactory, selectionElement.getConversationHolder(), (ReferenceBase) entity);
+ if(entity instanceof Reference){
+ page = new ReferenceWizardPage(formFactory, selectionElement.getConversationHolder(), (Reference) entity);
}
else if(entity instanceof Team){
page = new TeamWizardPage(formFactory, selectionElement.getConversationHolder(), (Team) entity);
import org.eclipse.swt.events.SelectionEvent;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.dialogs.filteredSelection.FilteredReferenceSelectionDialog;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
* @author n.hofmann
* @version $Id: $
*/
-public class ReferenceSelectionElement extends AbstractSelectionElement<ReferenceBase>{
+public class ReferenceSelectionElement extends AbstractSelectionElement<Reference>{
/**
* <p>Constructor for ReferenceSelectionElement.</p>
* @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
*/
public ReferenceSelectionElement(CdmFormFactory toolkit, ConversationHolder conversation, ICdmFormElement parentElement, String labelString,
- ReferenceBase selection, int style) {
+ Reference selection, int style) {
super(toolkit, conversation, parentElement, labelString, selection, true, true, true, style);
}
*/
/** {@inheritDoc} */
public void widgetSelected(SelectionEvent e) {
- ReferenceBase newSelection = FilteredReferenceSelectionDialog.select(getShell(), getConversationHolder(), entity);
+ Reference newSelection = FilteredReferenceSelectionDialog.select(getShell(), getConversationHolder(), entity);
- ReferenceBase freshlyLoadedSelection = null;
+ Reference freshlyLoadedSelection = null;
if(newSelection != null)
freshlyLoadedSelection = CdmStore.getReferenceService().load(newSelection.getUuid());
import org.apache.log4j.Logger;
import org.eclipse.swt.SWT;
-import eu.etaxonomy.cdm.model.common.IAnnotatableEntity;
import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
* @created Sep 27, 2010
* @version 1.0
*/
-public class ClassificationDetailElement extends AbstractCdmDetailElement<TaxonomicTree> {
+public class ClassificationDetailElement extends AbstractCdmDetailElement<Classification> {
private static final Logger logger = Logger
/** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement,
- TaxonomicTree entity, int style) {
+ Classification entity, int style) {
text_treeLabel = formFactory.createTextWithLabelElement(formElement, "Label", entity != null ? entity.getTitleCache() : null, SWT.NULL);
selection_reference = (ReferenceSelectionElement) formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), formElement, "Reference", entity != null ? entity.getReference() : null, SWT.NULL);
text_microReference = formFactory.createTextWithLabelElement(formElement, "Reference Detail", entity != null ? entity.getMicroReference() : null, SWT.NULL);
import org.eclipse.jface.viewers.ISelectionProvider;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
* @created Sep 27, 2010
* @version 1.0
*/
-public class ClassificationDetailSection extends AbstractCdmDetailSection<TaxonomicTree> {
+public class ClassificationDetailSection extends AbstractCdmDetailSection<Classification> {
private static final Logger logger = Logger
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
* @created 23.06.2009
* @version 1.0
*/
-public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<TaxonomicTree>{
+public class ClassificationWizardPage extends AbstractCdmEntityWizardPage<Classification>{
private static final Logger logger = Logger
.getLogger(ClassificationWizardPage.class);
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param entity a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
- public ClassificationWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, TaxonomicTree entity){
+ public ClassificationWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Classification entity){
super(formFactory, conversation, entity);
setTitle("Classification");
}
*
* @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
- public TaxonomicTree getClassification() {
+ public Classification getClassification() {
return getDetailElement().getEntity();
}
}
package eu.etaxonomy.taxeditor.section.classification;
-import org.apache.log4j.Logger;
-
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.ITreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
import eu.etaxonomy.taxeditor.forms.CdmPropertyChangeEvent;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
import eu.etaxonomy.taxeditor.forms.TextWithLabelElement;
import eu.etaxonomy.taxeditor.forms.selection.ClassificationSelectionElement;
-import eu.etaxonomy.taxeditor.forms.selection.TaxonNodeSelectionElement;
import eu.etaxonomy.taxeditor.forms.selection.TaxonBaseSelectionElement;
+import eu.etaxonomy.taxeditor.forms.selection.TaxonNodeSelectionElement;
import eu.etaxonomy.taxeditor.parser.ParseHandler;
import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
*/
public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITreeNode> {
- private static final Logger logger = Logger
- .getLogger(TaxonNodeDetailElement.class);
-
private ClassificationSelectionElement selection_classification;
- private TaxonomicTree classification;
+ private Classification classification;
private TaxonNodeSelectionElement selection_parentTaxonNode;
*
* @return the classification
*/
- public TaxonomicTree getClassification() {
+ public Classification getClassification() {
return classification;
}
/**
* @param classification the classification to set
*/
- private void setClassification(TaxonomicTree classification) {
+ private void setClassification(Classification classification) {
this.classification = classification;
setParentTreeNode(classification);
}
private void setParentTreeNode(ITreeNode parentTreeNode) {
this.parentTreeNode = parentTreeNode;
- if(parentTreeNode instanceof TaxonomicTree){
+ if(parentTreeNode instanceof Classification){
selection_parentTaxonNode.setEntity(null);
}
else if(parentTreeNode instanceof TaxonNode){
- classification = ((TaxonNode) parentTreeNode).getTaxonomicTree();
+ classification = ((TaxonNode) parentTreeNode).getClassification();
selection_classification.setEntity(classification);
selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode);
}
private void setTaxon(String taxonNameString){
TaxonNameBase taxonName = ParseHandler.quickParse(taxonNameString);
- ReferenceBase secundum = null;
+ Reference secundum = null;
if(getParentTreeNode() != null){
- if(getParentElement() instanceof TaxonomicTree){
- secundum = ((TaxonomicTree) getParentTreeNode()).getReference();
+ if(getParentElement() instanceof Classification){
+ secundum = ((Classification) getParentTreeNode()).getReference();
}
else if(getParentTreeNode() instanceof TaxonNode){
secundum = ((TaxonNode) getParentTreeNode()).getTaxon().getSec();
import org.apache.log4j.Logger;
import org.eclipse.swt.events.SelectionListener;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.forms.AbstractFormSection;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
+import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
import eu.etaxonomy.taxeditor.forms.selection.ReferenceSelectionElement;
import eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement;
* @created Mar 18, 2010
* @version 1.0
*/
-public class DescriptionSourceElement extends AbstractEntityCollectionElement<ReferenceBase> {
+public class DescriptionSourceElement extends AbstractEntityCollectionElement<Reference> {
private static final Logger logger = Logger
* @param style a int.
*/
public DescriptionSourceElement(CdmFormFactory cdmFormFactory,
- AbstractFormSection formElement, ReferenceBase element,
+ AbstractFormSection formElement, Reference element,
SelectionListener removeListener, int style) {
super(cdmFormFactory, formElement, element, removeListener, null, style);
// TODO Auto-generated constructor stub
/** {@inheritDoc} */
@Override
- public void setEntity(ReferenceBase element) {
+ public void setEntity(Reference element) {
selection_descriptionSource.setEntity(element);
}
import java.util.Collection;
-import org.apache.log4j.Logger;
-
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
* @version 1.0
*/
public class DescriptionSourceSection extends
- AbstractEntityCollectionSection<DescriptionBase, ReferenceBase>{
- private static final Logger logger = Logger
- .getLogger(DescriptionSourceSection.class);
+ AbstractEntityCollectionSection<DescriptionBase, Reference>{
/**
* <p>Constructor for DescriptionSourceSection.</p>
/** {@inheritDoc} */
@Override
- public void addElement(ReferenceBase element) {
+ public void addElement(Reference element) {
getEntity().addDescriptionSource(element);
}
/** {@inheritDoc} */
@Override
- public ReferenceBase createNewElement() {
+ public Reference createNewElement() {
return new ReferenceFactory().newGeneric();
}
/** {@inheritDoc} */
@Override
- public Collection<ReferenceBase> getCollection(DescriptionBase entity) {
+ public Collection<Reference> getCollection(DescriptionBase entity) {
return entity.getDescriptionSources();
}
/** {@inheritDoc} */
@Override
- public void removeElement(ReferenceBase element) {
+ public void removeElement(Reference element) {
getEntity().removeDescriptionSource(element);
}
}
package eu.etaxonomy.taxeditor.section.name;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.forms.AbstractFormSection;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
mediaRepresentationPart = mediaRepresentation.getParts().iterator().next();
- protologueUriText.setText(mediaRepresentationPart.getUri());
+ protologueUriText.setText(mediaRepresentationPart.getUri().toString());
}
/* (non-Javadoc)
@Override
public void handleEvent(Object eventSource) {
if(eventSource == protologueUriText){
- mediaRepresentationPart.setUri(protologueUriText.getText());
+ try {
+ mediaRepresentationPart.setUri(new URI(protologueUriText.getText()));
+ } catch (URISyntaxException e) {
+ EditorUtil.warningDialog("Could not parse URI", getClass(), e.getMessage());
+ }
}
}
}
text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", facade.getBarcode(), style);
- text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", facade.getExsiccatum(), style);
+ try {
+ text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", facade.getExsiccatum(), style);
+ } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+ // we ignore this
+ EditorUtil.info(e.getMessage());
+ }
// source
selection_collection = (CollectionSelectionElement) formFactory.createSelectionElement(SelectionType.COLLECTION, getConversationHolder(), formElement, "Collection", facade.getCollection(), style);
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
+import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
import eu.etaxonomy.taxeditor.forms.TextWithLabelElement;
-import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
import eu.etaxonomy.taxeditor.forms.selection.ReferenceSelectionElement;
import eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement;
protected void createControls(ICdmFormElement formElement, TaxonNameBase entity, int style) {
selection_nomenclaturalReference = (ReferenceSelectionElement)
formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(),
- formElement, "Reference", (ReferenceBase) entity.getNomenclaturalReference(), style);
+ formElement, "Reference", (Reference) entity.getNomenclaturalReference(), style);
text_referenceDetail = formFactory.createTextWithLabelElement(formElement, "Reference Detail", entity.getNomenclaturalMicroReference(), style);
}
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.agent.Institution;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-import eu.etaxonomy.cdm.model.reference.Generic;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
* @created Mar 2, 2010
* @version 1.0
*/
-public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<ReferenceBase> implements IErrorIntolerableElement, IExceptionHandler {
+public class ReferenceBaseDetailElement extends AbstractCdmDetailElement<Reference> implements IErrorIntolerableElement, IExceptionHandler {
// property holder
private ToggleableTextElement toggleable_cache;
private TextWithLabelElement text_uri;
private AbstractSelectionElement<AgentBase> selection_authorTeam;
private TimePeriodElement element_timePeriod;
- private AbstractSelectionElement<ReferenceBase> selection_inReference;
+ private AbstractSelectionElement<Reference> selection_inReference;
private AbstractSelectionElement<Institution> selection_institution;
private ReferenceTypeComboElement combo_referenceType;
*/
/** {@inheritDoc} */
@Override
- protected void createControls(ICdmFormElement formElement, ReferenceBase entity, int style) {
+ protected void createControls(ICdmFormElement formElement, Reference entity, int style) {
toggleable_cache = formFactory.createToggleableTextField(formElement, "Reference Cache", entity.getTitleCache(), entity.isProtectedTitleCache(), style);
combo_referenceType = (ReferenceTypeComboElement) formFactory.createEnumComboElement(EnumComboType.REFERENCETYPE, formElement, style);
* @param listener
* @param style
*/
- private void createGenericControls(ICdmFormElement element, ReferenceBase reference, int style){
+ private void createGenericControls(ICdmFormElement element, Reference reference, int style){
//editor
text_editor = formFactory.createTextWithLabelElement(element, "Editor", reference.getEditor(), style);
* @param listener
* @param style
*/
- private void createPublicationControls(ICdmFormElement element, ReferenceType referenceType, ReferenceBase reference, int style){
+ private void createPublicationControls(ICdmFormElement element, ReferenceType referenceType, Reference reference, int style){
// placePublished
text_placePublished = formFactory.createTextWithLabelElement(element, "Place Published", reference.getPlacePublished(), style);
* @param reference
* @param style
*/
- private void createSectionControls(ICdmFormElement element, ReferenceBase reference, int style){
+ private void createSectionControls(ICdmFormElement element, Reference reference, int style){
// in reference
if(reference.getType() == ReferenceType.BookSection || reference.getType() == ReferenceType.InProceedings){
* @param reference
* @param style
*/
- private void createVolumeControls(ICdmFormElement element, ReferenceBase reference, int style){
+ private void createVolumeControls(ICdmFormElement element, Reference reference, int style){
if(reference.getType() == ReferenceType.Article){
selection_inReference = formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), element, "Journal", reference.getInReference(), style);
}
* @param reference
* @param style
*/
- private void createPrintedUnitControls(ICdmFormElement element, ReferenceType referenceType, ReferenceBase reference, int style){
+ private void createPrintedUnitControls(ICdmFormElement element, ReferenceType referenceType, Reference reference, int style){
// in series
- selection_inSeries = (ReferenceSelectionElement) formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), element, "In Series", (ReferenceBase) reference.getInSeries(), style);
+ selection_inSeries = (ReferenceSelectionElement) formFactory.createSelectionElement(SelectionType.REFERENCE, getConversationHolder(), element, "In Series", (Reference) reference.getInSeries(), style);
//editor
text_editor = formFactory.createTextWithLabelElement(element, "Editor", reference.getEditor(), style);
}
private void createUriAndAbstract(ICdmFormElement element,
- ReferenceBase reference, int style) {
+ Reference reference, int style) {
// uri
text_uri = formFactory.createTextWithLabelElement(element, "URI", reference.getUri(), style);
// abstract
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
-import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
+import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
import eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection;
import eu.etaxonomy.taxeditor.section.ITaxonDetailSection;
* @created 05.06.2009
* @version 1.0
*/
-public class ReferenceBaseDetailSection extends AbstractCdmDetailSection<ReferenceBase> implements ITaxonDetailSection{
+public class ReferenceBaseDetailSection extends AbstractCdmDetailSection<Reference> implements ITaxonDetailSection{
private static final Logger logger = Logger
public void setTaxon(TaxonBase entity) {
NonViralName name = (NonViralName) HibernateProxyHelper.deproxy(entity.getName());
- ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+ Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
setEntity(reference);
}
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.DetailType;
* @created Jun 1, 2010
* @version 1.0
*/
-public class ReferenceBaseWizardPage extends AbstractCdmEntityWizardPage<ReferenceBase> implements IExceptionHandler{
+public class ReferenceWizardPage extends AbstractCdmEntityWizardPage<Reference> implements IExceptionHandler{
/**
* <p>Constructor for ReferenceBaseWizardPage.</p>
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param entity a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
*/
- public ReferenceBaseWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, ReferenceBase entity) {
+ public ReferenceWizardPage(CdmFormFactory formFactory, ConversationHolder conversation, Reference entity) {
super(formFactory, conversation, entity);
setTitle("Reference");
}
import java.net.URISyntaxException;
import org.apache.commons.io.FileUtils;
-import org.apache.log4j.Logger;
import org.eclipse.swt.events.SelectionListener;
import eu.etaxonomy.cdm.common.mediaMetaData.ImageMetaData;
import eu.etaxonomy.taxeditor.forms.AbstractFormSection;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.ICdmFormElement;
-import eu.etaxonomy.taxeditor.forms.BrowserElement;
import eu.etaxonomy.taxeditor.forms.ImageElement;
-import eu.etaxonomy.taxeditor.forms.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.forms.KeyValueViewerElement;
+import eu.etaxonomy.taxeditor.forms.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
private NumberWithLabelElement text_height;
private NumberWithLabelElement text_width;
- private BrowserElement element_browser;
private KeyValueViewerElement element_keyValue;
private ImageElement element_image;
text_height.setEnabled(false);
text_width = formFactory.createIntegerTextWithLabelElement(formElement, "Width", null, style);
text_width.setEnabled(false);
-// element_browser = formFactory.createBrowserElement(formElement, null, style);
element_image = formFactory.createImageElement(formElement, null, style);
element_keyValue = formFactory.createKeyValueViewerElement(formElement, "Key", "Value", null);
@Override
public void setEntity(ImageFile entity) {
this.entity = entity;
- text_uri.setText(entity.getUri());
+ if(entity.getUri() != null){
+ text_uri.setText(entity.getUri().toString());
+ }
if(entity.getSize() != null){
text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize()));
}
text_height.setInteger(entity.getHeight());
text_width.setInteger(entity.getWidth());
-
+
showImage(entity.getUri());
}
- private void showImage(String uriString){
- if(uriString == null){
+ private void showImage(URI uri){
+ if(uri == null){
return;
}
try {
- URI imageUri = new URI(uriString);
- Integer size = CdmStore.getMediaService().getImageSize(imageUri, 10000);
+ Integer size = CdmStore.getMediaService().getImageSize(uri, 10000);
if(size != null){
text_size.setText(FileUtils.byteCountToDisplaySize(size));
ImageMetaData imageInfo;
try {
- imageInfo = CdmStore.getMediaService().getImageInfo(imageUri, 10000);
+ imageInfo = CdmStore.getMediaService().getImageInfo(uri, 10000);
text_height.setInteger(imageInfo.getHeight());
getEntity().setHeight(imageInfo.getHeight());
getEntity().setWidth(imageInfo.getWidth());
element_keyValue.setInput(imageInfo.getMetaData());
-// element_browser.setImageUri(imageUri);
- element_image.setImageUri(imageUri);
+ element_image.setImageUri(uri);
} catch (IOException e) {
EditorUtil.error(getClass(), e);
}
- } catch (URISyntaxException e) {
- EditorUtil.info("Image Uri is not valid");
- } catch (Exception e) {
+ } catch (Exception e) {
EditorUtil.error(getClass(), "Image could not be shown: ", e);
}
}
@Override
public void handleEvent(Object eventSource) {
if(eventSource == text_uri){
- getEntity().setUri(text_uri.getText());
+ try {
+ getEntity().setUri(new URI(text_uri.getText()));
+ } catch (URISyntaxException e) {
+ EditorUtil.warningDialog("Could not parse URI", getClass(), e.getMessage());
+ }
showImage(getEntity().getUri());
}
}
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationContentProvider"
- id="eu.etaxonomy.taxeditor.navigation.taxonomictreecontent"
+ id="eu.etaxonomy.taxeditor.navigation.classificationContent"
labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.ClassificationLabelProvider"
- name="Taxonomic Tree">
+ name="Classification">
<triggerPoints>
<instanceof
value="eu.etaxonomy.taxeditor.navigation.navigator.Root">
</navigatorContent>
<navigatorContent
contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeContentProvider"
- id="eu.etaxonomy.taxeditor.navigation.taxoncontent"
+ id="eu.etaxonomy.taxeditor.navigation.taxonNodeContent"
labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.TaxonNodeLabelProvider"
- name="Taxon">
+ name="TaxonNode">
<triggerPoints>
<or>
<instanceof
<navigatorContent
activeByDefault="false"
contentProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymContentProvider"
- id="eu.etaxonomy.taxeditor.navigation.synonymcontent"
+ id="eu.etaxonomy.taxeditor.navigation.synonymContent"
labelProvider="eu.etaxonomy.taxeditor.navigation.navigator.SynonymLabelProvider"
name="Synonyms (experimental)"
priority="highest">
<viewerContentBinding viewerId="eu.etaxonomy.taxeditor.navigation.navigator">
<includes>
<contentExtension
- pattern="eu.etaxonomy.taxeditor.navigation.taxonomictreecontent">
+ pattern="eu.etaxonomy.taxeditor.navigation.classificationContent">
</contentExtension>
- <contentExtension pattern="eu.etaxonomy.taxeditor.navigation.taxoncontent"/>
+ <contentExtension pattern="eu.etaxonomy.taxeditor.navigation.taxonNodeContent"/>
<contentExtension pattern="eu.etaxonomy.taxeditor.navigation.taxonlinkhelper"/>
<contentExtension
- pattern="eu.etaxonomy.taxeditor.navigation.synonymcontent">
+ pattern="eu.etaxonomy.taxeditor.navigation.synonymContent">
</contentExtension>
</includes>
</viewerContentBinding>
import org.eclipse.ui.handlers.HandlerUtil;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.wizard.ClassificationWizard;
if(selection instanceof StructuredSelection){
final StructuredSelection structuredSelection = (StructuredSelection) selection;
- if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof TaxonomicTree){
- ClassificationWizard classificationWizard = new ClassificationWizard((TaxonomicTree) structuredSelection.getFirstElement());
+ if(structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof Classification){
+ ClassificationWizard classificationWizard = new ClassificationWizard((Classification) structuredSelection.getFirstElement());
WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShell(event), classificationWizard);
dialog.open();
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+
/**
* <p>ClassificationContentProvider class.</p>
*
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof Root) {
return ((Root) parentElement).getParentBeans().toArray();
+ }else if(parentElement instanceof Classification){
+ return ((Classification) parentElement).getChildNodes().toArray();
}
+
return new Object[0];
}
import org.apache.log4j.Logger;
import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.StyledString;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.navigator.IDescriptionProvider;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
/**
* <p>ClassificationLabelProvider class.</p>
/** {@inheritDoc} */
@Override
public String getText(Object element) {
- if(element instanceof TaxonomicTree){
- String text = ((TaxonomicTree) element).getName().getText();
+ if(element instanceof Classification){
+ String text = ((Classification) element).getName().getText();
return text != null ? text : "Unnamed Taxonomic Tree";
}
return new String();
*/
/** {@inheritDoc} */
public String getDescription(Object anElement) {
- if (anElement instanceof TaxonomicTree) {
- return "Taxonomic Tree: " + ((TaxonomicTree) anElement).getTitleCache(); //$NON-NLS-1$
+ if (anElement instanceof Classification) {
+ return "Taxonomic Tree: " + ((Classification) anElement).getTitleCache(); //$NON-NLS-1$
}
return null;
}
import java.util.ArrayList;
import java.util.List;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
/**
* <p>EmptyRoot class.</p>
*
* @return a {@link java.util.List} object.
*/
- public List<TaxonomicTree> getParentBeans() {
- return new ArrayList<TaxonomicTree>();
+ public List<Classification> getParentBeans() {
+ return new ArrayList<Classification>();
}
}
import org.eclipse.ui.IPersistableElement;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
*
* @return a {@link java.util.List} object.
*/
- public List<TaxonomicTree> getParentBeans() {
- List<TaxonomicTree> classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+ public List<Classification> getParentBeans() {
+ List<Classification> classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
if(classifications.size() == 0){
CdmStore.createDefaultClassification(conversation);
- classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
+ classifications = CdmStore.getClassificationService().list(null, null, null, null, null);
}
return classifications;
if(string.length() == 0) return null;
for (String uuid : string.split(" ")) {
- CdmBase cdmBaseObject = CdmStore.getTaxonTreeService().getTaxonNodeByUuid(UUID.fromString(uuid));
+ CdmBase cdmBaseObject = CdmStore.getClassificationService().getTaxonNodeByUuid(UUID.fromString(uuid));
if (cdmBaseObject == null) {
// is this a tree uuid?
- cdmBaseObject = CdmStore.getTaxonTreeService().getTaxonomicTreeByUuid(UUID.fromString(uuid));
+ cdmBaseObject = CdmStore.getClassificationService().getClassificationByUuid(UUID.fromString(uuid));
if(cdmBaseObject == null) return null;
}
import org.eclipse.core.expressions.PropertyTester;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
public class TaxonNodePropertyTester extends PropertyTester {
private static final Object HAS_SYNONYMS = "hasSynonyms";
}
}
- if (receiver instanceof TaxonomicTree && HAS_TAXA.equals(property)) {
- TaxonomicTree taxononomicTree = (TaxonomicTree) receiver;
+ if (receiver instanceof Classification && HAS_TAXA.equals(property)) {
+ Classification taxononomicTree = (Classification) receiver;
return taxononomicTree.getChildNodes().size() > 0;
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
private ClassificationWizardPage page;
- private TaxonomicTree classification;
+ private Classification classification;
private ConversationHolder conversation;
*
* @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
- public ClassificationWizard(TaxonomicTree classification){
+ public ClassificationWizard(Classification classification){
this();
setWindowTitle("Edit Entity");
- this.classification = CdmStore.getTaxonTreeService().load(classification.getUuid());
+ this.classification = CdmStore.getClassificationService().load(classification.getUuid());
}
/* (non-Javadoc)
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.common.LanguageString;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
public class ClassificationWizardPage extends WizardPage implements IPropertyChangeListener, IConversationEnabled {
private static final Logger logger = Logger
.getLogger(ClassificationWizardPage.class);
- private TaxonomicTree classification;
+ private Classification classification;
private ConversationHolder conversation;
private CdmFormFactory formFactory;
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
* @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
- protected ClassificationWizardPage(ConversationHolder conversation, TaxonomicTree classification){
+ protected ClassificationWizardPage(ConversationHolder conversation, Classification classification){
super("Classification");
this.setTitle("Classification");
this.setDescription(classification == null ? "Create a new Classification." : "Edit Classification.");
private void initialize() {
if(classification == null){
- classification = TaxonomicTree.NewInstance(null, null, CdmStore.getDefaultLanguage());
+ classification = Classification.NewInstance(null, null, CdmStore.getDefaultLanguage());
}
}
*
* @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
*/
- public TaxonomicTree getClassification() {
+ public Classification getClassification() {
return classification;
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.ITreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
if(selectedObject instanceof ITreeNode){
ITreeNode treeNode = (ITreeNode) selectedObject;
- if(treeNode instanceof TaxonomicTree){
- return CdmStore.getTaxonTreeService().load(treeNode.getUuid());
+ if(treeNode instanceof Classification){
+ return CdmStore.getClassificationService().load(treeNode.getUuid());
}
else if(treeNode instanceof TaxonNode){
return CdmStore.getTaxonNodeService().load(treeNode.getUuid());
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.ITreeNode;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory;
import eu.etaxonomy.taxeditor.forms.CdmFormFactory.SelectionType;
private CdmFormFactory formFactory;
private NameSelectionElement selection_reuseExistingName;
private ITreeNode parentTreeNode;
- private TaxonomicTree classification;
+ private Classification classification;
private Taxon taxon;
private boolean openInEditor = true;
private ConversationHolder conversation;
/**
* @param classification the classification to set
*/
- private void setClassification(TaxonomicTree classification) {
+ private void setClassification(Classification classification) {
this.classification = classification;
setParentTreeNode(classification);
}
this.parentTreeNode = parentTreeNode;
- if(parentTreeNode instanceof TaxonomicTree){
- classification = (TaxonomicTree) parentTreeNode;
+ if(parentTreeNode instanceof Classification){
+ classification = (Classification) parentTreeNode;
selection_classification.setEntity(classification);
selection_parentTaxonNode.setEntity(null);
}
else if(parentTreeNode instanceof TaxonNode){
- classification = ((TaxonNode) parentTreeNode).getTaxonomicTree();
+ classification = ((TaxonNode) parentTreeNode).getClassification();
selection_classification.setEntity(classification);
selection_parentTaxonNode.setEntity((TaxonNode) parentTreeNode);
}
}
private void setTaxon(TaxonNameBase taxonName){
- ReferenceBase secundum = null;
+ Reference secundum = null;
if(getParentTreeNode() != null){
- if(getParentTreeNode() instanceof TaxonomicTree){
- secundum = ((TaxonomicTree) getParentTreeNode()).getReference();
+ if(getParentTreeNode() instanceof Classification){
+ secundum = ((Classification) getParentTreeNode()).getReference();
}
else if(getParentTreeNode() instanceof TaxonNode){
secundum = ((TaxonNode) getParentTreeNode()).getTaxon().getSec();
package eu.etaxonomy.taxeditor.io;
-import org.apache.log4j.Logger;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
* @version 1.0
*/
public class ExportHandler extends AbstractIOHandler<IExportConfigurator>{
- private static final Logger logger = Logger
- .getLogger(ExportHandler.class);
-
+
/**
*
* @param applicationController
monitor.worked(10);
CdmDefaultExport<IExportConfigurator> exporter = new CdmDefaultExport<IExportConfigurator>();
- configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
+ configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateSubMonitor(monitor, 80));
exporter.setCdmAppController(applicationController);
monitor.worked(10);
package eu.etaxonomy.taxeditor.io;
-import org.apache.log4j.Logger;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
*/
public class ImportHandler extends AbstractIOHandler<IImportConfigurator> {
- private static final Logger logger = Logger
- .getLogger(ImportHandler.class);
-
/**
* @param applicationController
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("Importing data", 100);
- configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateMonitor(monitor));
+ configurator.setProgressMonitor(CdmProgressMonitorAdapter.CreateSubMonitor(monitor, 70));
monitor.worked(10);
public void run() {
MessageDialog.openWarning(getShell(), title, message);
- warn(AbstractUtility.class, message);
+ warn(source.getClass(), message);
}
});
}
public void run() {
MessageDialog.openError(getShell(), title, message);
- error(AbstractUtility.class, message, t);
+ error(source.getClass(), message, t);
}
});
}
}
}
+ public void addDescriptionElement(DescriptionElementBase descriptionElement){
+ descriptionElements.add(descriptionElement);
+ }
+
+ public void removeDescriptionElement(DescriptionElementBase descriptionElement){
+ descriptionElements.remove(descriptionElement);
+ }
+
/**
* If {@link #isLeaf()} is true, i.e. this container should have elements, returns the list of description elements.
*
return descriptionElements;
}
+ /**
+ * @param descriptionElement
+ * @return
+ */
+ public FeatureNodeContainer processDescriptionElement(
+ DescriptionElementBase descriptionElement) {
+ FeatureNodeContainer container = getFeatureNodeContainerForDescriptionElement(descriptionElement);
+ if(container != null){
+ container.removeDescriptionElement(descriptionElement);
+ }else{
+ container = getFeatureNodeContainerByFeature(descriptionElement.getFeature());
+ if(container != null){
+ container.addDescriptionElement(descriptionElement);
+ }
+ }
+ return container;
+ }
+
+ /**
+ * @param feature
+ * @return
+ */
+ public FeatureNodeContainer getFeatureNodeContainerByFeature(Feature feature) {
+ List<FeatureNodeContainer> leafs = getLeafs();
+
+ for(FeatureNodeContainer container : leafs){
+ if(container.getFeature().equals(feature)){
+ return container;
+ }
+ }
+ return null;
+ }
+
/**
* <p>getFeatureNodeContainerForDescriptionElement</p>
*
/** {@inheritDoc} */
@Override
public void removeMarker(Marker marker) {}
+
}
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
/**
* <p>NewReferenceWizard class.</p>
*
* @return a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase} object.
*/
- public ReferenceBase getReference(){
+ public Reference getReference(){
return null;
}
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
private Taxon relatedTaxon;
private TaxonRelationshipType relationshipType;
- private ReferenceBase<?> citation;
+ private Reference<?> citation;
private String microcitation;
private TaxonRelationship taxonRelationship;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
private Taxon misapplication;
- private ReferenceBase<?> citation;
+ private Reference<?> citation;
private String microcitation;
import org.eclipse.core.runtime.IStatus;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.ITreeNode;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
for (ITreeNode treeNode : treeNodes){
if(treeNode instanceof TaxonNode){
((TaxonNode) treeNode).delete();
- }else if(treeNode instanceof TaxonomicTree){
- TaxonomicTree taxonomicTree = (TaxonomicTree) treeNode;
+ }else if(treeNode instanceof Classification){
+ Classification taxonomicTree = (Classification) treeNode;
if(taxonomicTree.hasChildNodes()){
StoreUtil.warningDialog("Tree is not empty", this, "It is not possible to delete a Taxonomic Tree that " +
"is not empty. Please delete included taxa first");
}else{
- CdmStore.getTaxonTreeService().delete(taxonomicTree);
+ CdmStore.getClassificationService().delete(taxonomicTree);
}
}
}
import org.eclipse.core.runtime.IStatus;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* @created Jul 12, 2010
* @version 1.0
*/
-public class EditTaxonomicTreeOperation extends AbstractPersistentPostOperation {
- private TaxonomicTree classification;
+public class EditClassificationOperation extends AbstractPersistentPostOperation {
+ private Classification classification;
/**
* <p>Constructor for EditTaxonomicTreeOperation.</p>
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operations.IPostOperationEnabled} object.
* @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
*/
- public EditTaxonomicTreeOperation(String label, IUndoContext undoContext, TaxonomicTree classification,
+ public EditClassificationOperation(String label, IUndoContext undoContext, Classification classification,
IPostOperationEnabled postOperationEnabled,
IConversationEnabled conversationEnabled) {
super(label, undoContext, postOperationEnabled, conversationEnabled);
throws ExecutionException {
bind();
- CdmStore.getTaxonTreeService().save(classification);
+ CdmStore.getClassificationService().save(classification);
monitor.worked(40);
import org.eclipse.core.runtime.IStatus;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
*/
public class SaveClassificationOperation extends AbstractPersistentPostOperation {
- private TaxonomicTree classification;
+ private Classification classification;
/**
* <p>Constructor for SaveClassificationOperation.</p>
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operations.IPostOperationEnabled} object.
* @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
*/
- public SaveClassificationOperation(String label, IUndoContext undoContext, TaxonomicTree classification,
+ public SaveClassificationOperation(String label, IUndoContext undoContext, Classification classification,
IPostOperationEnabled postOperationEnabled,
IConversationEnabled conversationEnabled) {
super(label, undoContext, postOperationEnabled, conversationEnabled);
monitor.worked(20);
if(classification.getReference() == null){
- ReferenceBase reference = ReferenceFactory.newGeneric();
+ Reference reference = ReferenceFactory.newGeneric();
reference.setTitleCache(classification.getTitleCache());
classification.setReference(reference);
}
- CdmStore.getTaxonTreeService().saveOrUpdate(classification);
+ CdmStore.getClassificationService().saveOrUpdate(classification);
monitor.worked(40);
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.name.NonViralName;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
import eu.etaxonomy.cdm.strategy.match.MatchMode;
* @throws eu.etaxonomy.cdm.strategy.match.MatchException if any.
*/
public static IMatchStrategy getDefaultReferenceMatchStrategy() throws MatchException{
- IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(ReferenceBase.class);
+ IMatchStrategy strategy = PreferencesUtil.getDefaultMatchStrategy(Reference.class);
strategy.setMatchMode("title", MatchMode.EQUAL);
strategy.setMatchMode("inReference", MatchMode.IGNORE);
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.match.MatchException;
import eu.etaxonomy.cdm.strategy.parser.NonViralNameParserImpl;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
* @param name The name to resolve duplicates for.
*/
private void resolveDuplicateInReferences(NonViralName name) {
- ReferenceBase reference = (ReferenceBase) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+ Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
if(duplicateInReferences.size() > 0){
- ReferenceBase inReference = (ReferenceBase) duplicateInReferences.iterator().next();
+ Reference inReference = (Reference) duplicateInReferences.iterator().next();
reference.setInReference(inReference);
StoreUtil.warn(this.getClass(), reference.generateTitle());
// FIXME TODO resolve multiple duplications. We use first match for a start
if(duplicateCombinationAuthorTeams.size() > 0){
name.setCombinationAuthorTeam(duplicateCombinationAuthorTeams.iterator().next());
- ReferenceBase reference = (ReferenceBase) name.getNomenclaturalReference();
+ Reference reference = (Reference) name.getNomenclaturalReference();
if(reference != null){
reference.setAuthorTeam(duplicateCombinationAuthorTeams.iterator().next());
}
// check if the reference has an inreference and also check if the inReference already exists
if(nomenclaturalReference != null){
- ReferenceBase inReference = ((ReferenceBase)nomenclaturalReference).getInReference();
+ Reference inReference = ((Reference)nomenclaturalReference).getInReference();
if(inReference != null){
doResolveInReferences = true;
duplicateInReferences = findMatchingNomenclaturalReference(inReference);
import org.eclipse.ui.IWorkbench;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
import eu.etaxonomy.cdm.strategy.match.MatchException;
import eu.etaxonomy.taxeditor.parser.MatchStrategyConfigurator;
* @created Jan 22, 2010
* @version 1.0
*/
-public class ReferenceMatchingPreference extends AbstractMatchingPreferences<ReferenceBase> {
+public class ReferenceMatchingPreference extends AbstractMatchingPreferences<Reference> {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
/** {@inheritDoc} */
public void init(IWorkbench workbench) {
- clazz = ReferenceBase.class;
+ clazz = Reference.class;
try {
matchStrategy = MatchStrategyConfigurator.ReferenceMatchStrategy();
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.service.IAgentService;
+import eu.etaxonomy.cdm.api.service.IClassificationService;
import eu.etaxonomy.cdm.api.service.ICollectionService;
import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
import eu.etaxonomy.cdm.api.service.IReferenceService;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.api.service.ITaxonTreeService;
import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.api.service.IUserService;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
import eu.etaxonomy.taxeditor.datasource.view.CdmDataSourceViewPart;
import eu.etaxonomy.taxeditor.io.ExportHandler;
*
* @return a {@link eu.etaxonomy.cdm.api.service.ITaxonTreeService} object.
*/
- public static ITaxonTreeService getTaxonTreeService() { return getCurrentApplicationController().getTaxonTreeService();}
+ public static IClassificationService getClassificationService() { return getCurrentApplicationController().getClassificationService();}
/**
* <p>getTaxonNodeService</p>
* @param configurator a {@link eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator} object.
* @return a {@link java.util.List} object.
*/
- public static List<ReferenceBase> findReferences(IIdentifiableEntityServiceConfigurator configurator){
+ public static List<Reference> findReferences(IIdentifiableEntityServiceConfigurator configurator){
// TODO we want to use IIdentifiableEntityServiceConfigurator for all find methods
// unfortunately this is not consistently implemented in the library.
// FIXME use proper method once it is implemented in the library
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
*/
public static void createDefaultClassification(ConversationHolder conversation){
- TaxonomicTree defaultClassification = TaxonomicTree.NewInstance("My Classification");
- getTaxonTreeService().saveOrUpdate(defaultClassification);
+ Classification defaultClassification = Classification.NewInstance("My Classification");
+ getClassificationService().saveOrUpdate(defaultClassification);
conversation.commit(true);
}
}
import org.junit.BeforeClass;
import org.junit.Test;
+import eu.etaxonomy.cdm.model.taxon.Classification;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.cdm.model.taxon.TaxonomicTree;
/**
* @author n.hoffmann
private static Taxon oldParentTaxon;
private static Taxon newParentTaxon;
- private static TaxonomicTree tree;
+ private static Classification tree;
private static TaxonNode oldParentTaxonNode;
private static TaxonNode newParentTaxonNode;
private static TaxonNode taxonNode;
oldParentTaxon = Taxon.NewInstance(null, null);
newParentTaxon = Taxon.NewInstance(null, null);
- tree = TaxonomicTree.NewInstance(null);
+ tree = Classification.NewInstance(null);
oldParentTaxonNode = tree.addChildTaxon(oldParentTaxon, null, null, null);
newParentTaxonNode = tree.addChildTaxon(newParentTaxon, null, null, null);