public static final Image MISAPPLIEDNAME_ICON = ImageResources.getImage(ImageResources.MISAPPLIED_NAME_ICON);
/** Constant <code>PROPARTE_ICON</code> */
public static final Image PRO_PARTE_SYNONYM_ICON = ImageResources.getImage(ImageResources.PRO_PARTE_SYNONYM_ICON);
+ /** Constant <code>PARTIAL_SYN_ICON</code> */
+ public static final Image PARTIAL_SYNONYM_ICON = ImageResources.getImage(ImageResources.PARTIAL_SYNONYM_ICON);
/** Constant <code>CONCEPT_ICON</code> */
public static final Image CONCEPT_ICON = ImageResources.getImage(ImageResources.CONCEPT_ICON);
/** Constant <code>AUTONYM_ICON</code> */
import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
import eu.etaxonomy.taxeditor.editor.name.container.EditorAnnotation;
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
if (rel.getType().isAnyMisappliedName() && isMisapplication){
relationship = rel;
break;
- }else if (rel.getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR()) && !isMisapplication){
+ }else if (rel.getType().isAnySynonym() && !isMisapplication){
relationship = rel;
break;
}
protected void updateIcon() {
if (isMisapplication){
setIcon(MISAPPLIEDNAME_ICON);
- }else{
+ }else if (relationship.getType().isProParte()){
setIcon(PRO_PARTE_SYNONYM_ICON);
- }
+ }else {
+ setIcon(PARTIAL_SYNONYM_ICON);
+ }
}
private void showSec() {
}else if (!isMisapplication && StringUtils.isNotBlank(conceptName.getAuthorshipCache())){
author = conceptName.getAuthorshipCache();
}
- if (getMisappliedName().getSec() == null) {
+ if ((isMisapplication &&getMisappliedName().getSec() == null) || (!isMisapplication && relationship.getCitation() == null)) {
if (getMisappliedName().getAppendedPhrase() != null ){
title = getMisappliedName().getAppendedPhrase();
}else if (isMisapplication){
}
} else {
- String sec = " sensu ";
+ String sec ;
+ if (isMisapplication){
+ sec = " sensu ";
+ }else{
+ sec = " syn sec ";
+ }
if (getMisappliedName().getAppendedPhrase() != null ){
sec = getMisappliedName().getAppendedPhrase() + " " + sec;
}
-
- title += sec + getMisappliedName().getSec().getCacheStrategy().getCitation(getMisappliedName().getSec());
+ if (isMisapplication){
+ title += sec + getMisappliedName().getSec().getCacheStrategy().getCitation(getMisappliedName().getSec());
+ }else{
+ title += sec + relationship.getCitation().getCacheStrategy().getCitation(relationship.getCitation());
+ }
}
- if (relationship.getType().equals(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR()) || relationship.getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR())){
+ if (relationship.getType().isProParte() && isMisapplication){
title += " p.p. ";
}
title += author;
@Override
protected void createContainers() {
- for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames(true)){
- ConceptContainerE4 container = new ConceptContainerE4(this, misapplication, true);
- this.add(container);
- container.createContent();
- }
for(Taxon misapplication : getEditor().getTaxon().getProParteAndPartialSynonyms()){
ConceptContainerE4 container = new ConceptContainerE4(this, misapplication, false);
this.add(container);
container.createContent();
+ }
+ for(Taxon misapplication : getEditor().getTaxon().getMisappliedNames(true)){
+
+ ConceptContainerE4 container = new ConceptContainerE4(this, misapplication, true);
+ this.add(container);
+ container.createContent();
}
}
/** Constant <code>MISAPPLIED_NAME_ICON="misapplied_icon"</code> */
public static final String MISAPPLIED_NAME_ICON = "misapplied_icon";
/** Constant <code>PRO_PARTE_SYNONYM_ICON="pro_parte_synonym_icon"</code> */
- public static final String PRO_PARTE_SYNONYM_ICON = "proparte_icon";
+ public static final String PRO_PARTE_SYNONYM_ICON = "proparte_syn_icon";
+ /** Constant <code>PRO_PARTE_SYNONYM_ICON="pro_parte_synonym_icon"</code> */
+ public static final String PARTIAL_SYNONYM_ICON = "partial_syn_icon";
/** Constant <code>CONCEPT_ICON="concept_icon"</code> */
public static final String CONCEPT_ICON = "concept_icon";
/** Constant <code>AUTONYM_ICON="autonym_icon"</code> */
"misapplied_no_bg.gif");
registerImage(registry, PRO_PARTE_SYNONYM_ICON,
"proparte-bright.gif");
+ registerImage(registry, PARTIAL_SYNONYM_ICON,
+ "proparte-dark.gif");
registerImage(registry, CONCEPT_ICON,
"concept_no_bg.gif");
registerImage(registry, AUTONYM_ICON,
String labelString, TaxonRelationshipType selection, boolean addEmptyElement, int style, boolean useAbbrevLabel) {
super(formFactory, parentElement, TaxonRelationshipType.class, labelString, selection, addEmptyElement, style);
List<TaxonRelationshipType> relTypes = new ArrayList<>();
- relTypes.add(TaxonRelationshipType.MISAPPLIED_NAME_FOR());
- relTypes.add(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR());
+ if (selection.isAnyMisappliedName()){
+ relTypes.add(TaxonRelationshipType.MISAPPLIED_NAME_FOR());
+ relTypes.add(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR());
+ relTypes.add(TaxonRelationshipType.PARTIAL_MISAPPLIED_NAME_FOR());
+ }else if (selection.isAnySynonym()){
+ relTypes.add(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR());
+ relTypes.add(TaxonRelationshipType.PARTIAL_SYNONYM_FOR());
+ }
populateTerms(relTypes);
setSelection(selection);
}
LanguageString languageString = ((LanguageStringWithLabelElement) eventSource)
.getLanguageString();
multilanguageText.put(languageString.getLanguage(), languageString);
- //firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
+ firePropertyChangeEvent(new CdmPropertyChangeEvent(this, event));
}
}
@Override
protected void createControls(ICdmFormElement formElement,
TaxonRelationship entity, int style) {
- if ((entity.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR()) || entity.getType().equals(TaxonRelationshipType.PRO_PARTE_MISAPPLIED_NAME_FOR())) ){
+ if ((entity.getType().isAnyMisappliedName()) ){
taxon = entity.getFromTaxon();
taxonElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(taxonElement);
addElement(taxonElement);
- combo_misappliedRelationshipType = formFactory.createMisappliedRelationshipComboElement(formElement, "Relationship Type",
+ combo_misappliedRelationshipType = formFactory.createMisappliedRelationshipComboElement(formElement, "Misapplication Type",
entity.getType(), style);
combo_misappliedRelationshipType.setEnabled(true);
entity.getCitationMicroReference(),null,
SWT.WRAP);
checkBoxDoubtful = formFactory.createCheckbox(formElement, "Misapplication Doubtful", entity.isDoubtful(), style);
- }else if ((entity.getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR()) || entity.getType().equals(TaxonRelationshipType.PARTIAL_SYNONYM_FOR())) ){
+ }else if (entity.getType().isAnySynonym() ){
taxon = entity.getFromTaxon();
taxonElement = formFactory.createTaxonDetailSection(getConversationHolder(), formElement, null, style);
taxonElement.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(taxonElement);
addElement(taxonElement);
- combo_misappliedRelationshipType = formFactory.createMisappliedRelationshipComboElement(formElement, "Relationship Type",
- entity.getType(), style);
- combo_misappliedRelationshipType.setEnabled(true);
sensuReference = formFactory.createSelectionElement(Reference.class,//getConversationHolder(),
- formElement, "Sensu",
+ formElement, "Sec",
taxon.getSec(), EntitySelectionElement.ALL,
style);
formElement, "Detail",
entity.getCitationMicroReference(),null,
SWT.WRAP);
- checkBoxDoubtful = formFactory.createCheckbox(formElement, "PP Doubtful", entity.isDoubtful(), style);
+
+ combo_misappliedRelationshipType = formFactory.createMisappliedRelationshipComboElement(formElement, "Synonym Type",
+ entity.getType(), style);
+
+ combo_misappliedRelationshipType.setEnabled(true);
+ checkBoxDoubtful = formFactory.createCheckbox(formElement, "Syn. Doubtful", entity.isDoubtful(), style);
}else{
combo_taxonRelationshipType = formFactory.createTermComboElement(
import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
if (rels != null && rels.iterator().hasNext()){
TaxonRelationship rel = rels.iterator().next();
- if ((rel.getType().isAnyMisappliedName() || rel.getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR()))&& !rel.getFromTaxon().equals(((ITaxonEditor) part).getTaxon())){
+ if ((rel.getType().isAnyMisappliedName() || rel.getType().isAnySynonym())&& !rel.getFromTaxon().equals(((ITaxonEditor) part).getTaxon())){
viewer.setInput(rel);
return;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
} else if (input instanceof Group) {
createGroupSection(rootElement);
} else if (input instanceof TaxonRelationship && ((TaxonRelationship)input).getType()!=null
- && (((TaxonRelationship)input).getType().isAnyMisappliedName() || ((TaxonRelationship)input).getType().equals(TaxonRelationshipType.PRO_PARTE_SYNONYM_FOR()))) {
+ && (((TaxonRelationship)input).getType().isAnyMisappliedName() || ((TaxonRelationship)input).getType().isAnySynonym())){
createMisappliedNameSection(rootElement);
}else if (input instanceof TaxonRelationship ) {
createTaxonRelationshipSection(rootElement);