Project

General

Profile

« Previous | Next » 

Revision 32e6766e

Added by Katja Luther almost 8 years ago

add original publication year to simple details view

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
13 13
import java.util.Arrays;
14 14

  
15 15
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
16
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
16 17
import eu.etaxonomy.cdm.model.name.NonViralName;
18
import eu.etaxonomy.cdm.model.name.ZoologicalName;
17 19
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
18 20
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
19 21
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
20 22
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
21 23
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
24
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
22 25
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
23 26
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
24 27

  
......
38 41
    private EntitySelectionElement<TeamOrPersonBase> selectionBasionymAuthor;
39 42
    private EntitySelectionElement<TeamOrPersonBase> selectionExCombinationAuthor;
40 43
    private EntitySelectionElement<TeamOrPersonBase> selectionCombinationAuthor;
44

  
45
    private NumberWithLabelElement text_publicationYear;
46
    private NumberWithLabelElement text_originalPublicationYear;
41 47
	/**
42 48
	 * <p>
43 49
	 * Constructor for AuthorshipDetailElement.
......
70 76
                toggleable_cache.setVisible(false);
71 77
            }
72 78
	    }
79
	    NomenclaturalCode code = entity.getNomenclaturalCode();
73 80

  
74
		selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
81
        selectionCombinationAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class,
75 82
				getConversationHolder(),
76 83
				formElement, "Author",
77 84
				entity.getCombinationAuthorship(),
......
83 90
				entity.getExCombinationAuthorship(),
84 91
				EntitySelectionElement.ALL, style);
85 92
		addElement(selectionExCombinationAuthor);
93
		if (code != null){
94
            if (code.equals(NomenclaturalCode.ICZN)){
95
                text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", ((ZoologicalName)entity).getPublicationYear(), style);
96

  
97
            }
98
         }
86 99
		selectionBasionymAuthor = formFactory.createSelectionElementWithAbbreviatedTitle(TeamOrPersonBase.class, getConversationHolder(),
87 100
                formElement, "Basionym Author", entity.getBasionymAuthorship(),
88 101
                EntitySelectionElement.ALL, style);
......
92 105
		        EntitySelectionElement.ALL, style);
93 106

  
94 107
		addElement(selectionExBasionymAuthor);
108
		 if (code != null){
109
	            if (code.equals(NomenclaturalCode.ICZN)){
110

  
111
	                text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", ((ZoologicalName)entity).getOriginalPublicationYear(), style);
112

  
113
	            }
114
	         }
115

  
116

  
117

  
95 118
	}
96 119

  
97 120
	/** {@inheritDoc} */
......
137 160
		} else if (eventSource == selectionExBasionymAuthor) {
138 161
			getEntity().setExBasionymAuthorship(
139 162
					selectionExBasionymAuthor.getSelection());
140
		}
163
		} else if (eventSource == text_originalPublicationYear) {
164
            ((ZoologicalName)getEntity()).setOriginalPublicationYear(text_originalPublicationYear.getInteger());
165
        } else if (eventSource == text_publicationYear) {
166
            ((ZoologicalName)getEntity()).setPublicationYear(text_publicationYear.getInteger());
167
        }
141 168

  
142 169
//		if (eventSource != toggleable_cache) {
143 170
//			toggleable_cache.setText(getEntity().getAuthorshipCache());
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
30 30
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
31 31
import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
32 32
import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
33
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
34 33
import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
35 34
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
36 35
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
......
55 54
	private SelectionArbitrator selectionArbitrator;
56 55
	private CheckboxElement checkbox_anamorphic;
57 56
	private TextWithLabelElement text_breed;
58
	private NumberWithLabelElement text_publicationYear;
59
	private NumberWithLabelElement text_originalPublicationYear;
57
	//private NumberWithLabelElement text_publicationYear;
58
	//private NumberWithLabelElement text_originalPublicationYear;
60 59
	private int cursorPosition;
61 60

  
62 61
	/**
......
164 163

  
165 164
	private void createZoologicalNameParts(ICdmFormElement formElement, NonViralName nonViralName, int style){
166 165
		ZoologicalName zoologicalName = (ZoologicalName) nonViralName;
167
		text_publicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Publication Year", zoologicalName.getPublicationYear(), style);
166

  
168 167
		if (isAdvancedView){
169 168
		    text_breed = formFactory.createTextWithLabelElement(formElement, "Breed", zoologicalName.getBreed(), style);
170
			text_originalPublicationYear = formFactory.createNumberTextWithLabelElement(formElement, "Orig. Publication Year", zoologicalName.getOriginalPublicationYear(), style);
171 169
		}
172 170
	}
173 171

  
......
231 229
		}
232 230
		else if(eventSource == checkbox_anamorphic){
233 231
			((BotanicalName)getEntity()).setAnamorphic(checkbox_anamorphic.getSelection());
234
		}
232
		}else if(eventSource == text_breed){
233
            ((ZoologicalName)getEntity()).setBreed(text_breed.getText());
234
        }
235

  
235 236
	}
236 237

  
237 238
	/*

Also available in: Unified diff