Project

General

Profile

« Previous | Next » 

Revision eeaf651a

Added by Katja Luther almost 7 years ago

ref #6390: fix display of misapplied names in name editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/MisapplicationContainer.java
11 11

  
12 12
import javax.persistence.GenerationType;
13 13

  
14
import org.apache.commons.lang.StringUtils;
14 15
import org.eclipse.swt.graphics.Font;
15 16

  
17
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
18
import eu.etaxonomy.cdm.model.name.TaxonName;
16 19
import eu.etaxonomy.cdm.model.taxon.Taxon;
17 20
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
18 21
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
......
77 80
		}
78 81
		String title = "";
79 82
		String author = "";
80
		if (getMisappliedName().getName().getAuthorshipCache() != null && getMisappliedName().getAppendedPhrase() == null){
81
			author = ", non " + getMisappliedName().getName().getAuthorshipCache();
83
		TaxonName misappliedNameName = HibernateProxyHelper.deproxy(getMisappliedName().getName(), TaxonName.class);
84
		if (misappliedNameName.getAuthorshipCache() != null && !StringUtils.isBlank(misappliedNameName.getAuthorshipCache())&& getMisappliedName().getAppendedPhrase() == null){
85
			author = ", non " + misappliedNameName.getAuthorshipCache();
82 86
		}
83 87
		if (misapplication.getCitation() == null) {
84 88
		    if (getMisappliedName().getAppendedPhrase() != null ){
85 89
		        title = getMisappliedName().getAppendedPhrase();
86 90
		    }else{
87 91
		        title = "auct."; //$NON-NLS-1$
92
		        
88 93
		    }
94
		  
89 95
		} else {
90 96
			String sec = " sensu "; //$NON-NLS-1$
91 97
			if (getMisappliedName().getAppendedPhrase() != null ){
92 98
			    sec = getMisappliedName().getAppendedPhrase() + " "+sec; //$NON-NLS-1$
93 99
			}
94 100
			title += sec + misapplication.getCitation().getTitleCache();
95
			title += author;
96
			title = title.replace("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
97 101
			
98 102
			
99
			setNonEditableInfo(title, false);
103
			
104
			
100 105
		}
106
		title += author;
107
		title = title.replace("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
108
		setNonEditableInfo(title, false);
101 109
	}
102 110

  
103 111
	/**
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java
61 61
		URI source = dataSourcePage.getUri();
62 62
		configurator.setSource(source);
63 63
		configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
64
		configurator.setSourceReferenceTitle(dataSourcePage.getTextReferenceString().getText());
64 65
		File file = new File(source);
65 66
		FileInputStream fis = null;
66 67

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ImportFromFileDataSourceWizardPage.java
39 39
	private String[] extensions = {"*.xml"};
40 40

  
41 41
	private FileDialog fileDialog;
42

  
43

  
42
	private Text textReferenceString;
44 43

  
45 44
	protected ImportFromFileDataSourceWizardPage(String title, String description, String[] extensions) {
46 45
		super(PAGE_NAME);
......
95 94

  
96 95
		});
97 96

  
98

  
97
		Label labelRef = new Label(composite, SWT.NONE);
98
        labelRef.setText("Default import souce reference");
99
        labelRef.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
100
        textReferenceString = new Text(composite, SWT.NONE);
101
        textReferenceString.setEnabled(true);
102
        GridData gd_textReferenceString = new GridData(SWT.LEFT, SWT.CENTER, true, true, 3, 1);
103
        gd_textReferenceString.widthHint = 229;
104
        textReferenceString.setLayoutData(gd_textReferenceString);
99 105
		setControl(composite);
100 106
	}
101 107

  
102 108
	public File getFile() {
103 109
		return new File(text_source.getText());
104 110
	}
111
	
112
	public Text getTextReferenceString() {
113
		return textReferenceString;
114
	}
115

  
116
	public void setTextReferenceString(Text textReferenceString) {
117
		this.textReferenceString = textReferenceString;
118
	}
119

  
105 120

  
106 121
	@Override
107 122
    public URI getUri() {
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteMediaConfiguratorComposite.java
84 84
//            });
85 85
            btnRemoveFromImageGallery = new Button(this, SWT.RADIO);
86 86
            btnRemoveFromImageGallery.setText(Messages.DeleteConfiguration_media_removeFromGallery);
87
            btnDelete.setSelection(!configurator.isOnlyRemoveFromGallery());
87
            btnDelete.setSelection(true);
88 88
        	btnRemoveFromImageGallery.setSelection(configurator.isOnlyRemoveFromGallery());
89 89
        }
90 90

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
53 53
public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElement<Reference>
54 54
		implements IErrorIntolerableElement, IExceptionHandler {
55 55

  
56
	private LabelElement warnForReferencedObjects;
56

  
57 57

  
58 58
    private ToggleableTextElement toggleableAbbrevCache;
59 59

  
......
621 621
	    setIrrelevant(pushedState, except);
622 622
	}
623 623

  
624
	public void setWarnForReferencingObjects(ICdmFormElement formElement){
625
	    if (getEntity().getId() != 0){
626
	        Integer referencingObjectsCount = CdmStore.getCommonService().getReferencingObjectsCount(getEntity());
627

  
628
    		if (referencingObjectsCount > 1){
629
    			warnForReferencedObjects = formFactory.createLabel(formElement, CdmUtils.Nz("The reference is referenced by " + referencingObjectsCount+ " objects, if you change it, it is changed for all these objects"));
630
    			warnForReferencedObjects.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
631
    			warnForReferencedObjects.setLayout(LayoutConstants.FILL(2, 3));
632

  
633
    			warnForReferencedObjects.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
634
    		}
635
	    }
636
	}
637

  
638
	public void setWarnForReferencingObjectsVisible(boolean isVisible){
639
		if (warnForReferencedObjects != null){
640
			warnForReferencedObjects.setVisible(isVisible);
641
		}
642
	}
624
	
643 625

  
644 626

  
645 627
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java
93 93
				getEntity().getCitationMicroReference(),null,
94 94
				SWT.WRAP);
95 95

  
96
		checkbox_doubtful = formFactory.createCheckbox(formElement,
97
					entity.getClass().getSimpleName() + " Misappl. doubtful", entity.isDoubtful(), style);
96
		
98 97
	
99 98
	
100 99
		checkbox_published = formFactory.createCheckbox(formElement,
101
					"Taxon is published", taxon.isPublish(), style);
100
					"Published", taxon.isPublish(), style);
102 101
			
103 102
			
104 103
		secReference = formFactory.createSelectionElement(Reference.class,
105
				getConversationHolder(), formElement, "err. Secundum",
104
				getConversationHolder(), formElement, "Err. Secundum",
106 105
				taxon.getSec(), EntitySelectionElement.ALL,
107 106
				style);
108 107
	
......
110 109
	            formElement, "Detail",
111 110
	            taxon.getSecMicroReference(),null,
112 111
	            SWT.WRAP);
112
		checkbox_doubtful = formFactory.createCheckbox(formElement,
113
				" Misappl. doubtful", entity.isDoubtful(), style);
113 114

  
114 115
		
115 116
	}

Also available in: Unified diff