AbstractGroupedContainer : updated 'isNameUsedMultipleTimes' to factor in orphaned taxa
TaxonEditorInput : added display of message in case of orphaned taxa
ImageResources : added new orphaned-taxa image icon to resources
<classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.2-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
TaxonEditorInput input = null;
TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
-
- if(taxonBase.isInstanceOf(Taxon.class)){
+ if(taxonBase.isOrphaned()) {
+ EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
+ }
+ else if(taxonBase.isInstanceOf(Taxon.class)){
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
if (taxon.isMisapplication()){
package eu.etaxonomy.taxeditor.editor.name.container;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
return enableFreetext;
}
+ /**
+ * Checks whether there are more than one, non-orphaned taxon bases
+ * attached to the taxon name
+ *
+ * @return
+ */
private boolean isNameUsedMultipleTimes() {
- if (getName().getTaxonBases().size() > 1) {
+
+ Set<TaxonBase> taxonBases = getName().getTaxonBases();
+ Iterator<TaxonBase> tbItr = taxonBases.iterator();
+ int nonOrphanedTaxonBaseCount = taxonBases.size();
+
+ while(tbItr.hasNext()) {
+ TaxonBase tb = tbItr.next();
+ if(tb.isOrphaned()) {
+ nonOrphanedTaxonBaseCount--;
+ }
+ }
+ if(nonOrphanedTaxonBaseCount > 1) {
return true;
}
return false;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* <p>SearchResultLabelProvider class.</p>
// return ImageResources.getImage(ImageResources.MISAPPLIED_NAME_ICON);
// }else{
if(type == Taxon.class){
+ if(((UuidAndTitleCache) element).getIsOrphaned()) {
+ return ImageResources.getImage(ImageResources.ORPHANED_TAXON);
+ }
return ImageResources.getImage(ImageResources.BLACK_SQUARE_ICON);
}else if(type == Synonym.class){
return ImageResources.getImage(ImageResources.HETEROTYPIC_SYN_ICON);
public static final String TWO_PRONGED_EQUAL = "2_pronged_equal";
/** Constant <code>MISAPPLIED_NAME="misapplied_name"</code> */
public static final String MISAPPLIED_NAME = "misapplied_name";
+ /** Constant <code>ORPHANED_TAXON="orphaned_taxon"</code> */
+ public static final String ORPHANED_TAXON = "orphaned_taxon";
/** Constant <code>EXPAND_ALL="expand_all"</code> */
public static final String EXPAND_ALL = "expand_all";
/** Constant <code>COLLAPSE_ALL="collapse_all"</code> */
registerImage(registry, TWO_PRONGED_EQUAL,
"2_pronged_equal_small.GIF");
registerImage(registry, MISAPPLIED_NAME,
- "ma_12x12.gif");
+ "ma_12x12.gif");
+ registerImage(registry, ORPHANED_TAXON,
+ "orphaned.gif");
registerImage(registry, EXPAND_ALL,
"expandAll.jpg");
registerImage(registry, COLLAPSE_ALL,