Revision 85367589
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java | ||
---|---|---|
51 | 51 |
|
52 | 52 |
private EntitySelectionElement<Taxon> selection_reuseExistingTaxon; |
53 | 53 |
private EntitySelectionElement<Reference> selection_SecRef; |
54 |
private EntitySelectionElement<Reference> selection_Ref; |
|
55 |
private TextWithLabelElement microReference; |
|
54 | 56 |
|
55 | 57 |
private Taxon taxon; |
56 | 58 |
|
... | ... | |
70 | 72 |
|
71 | 73 |
private boolean complete; |
72 | 74 |
|
75 |
private boolean excluded = false; |
|
76 |
private boolean unplaced = false; |
|
77 |
|
|
73 | 78 |
private EntitySelectionElement<TaxonName> selection_reuseExistingName; |
74 | 79 |
|
75 | 80 |
public TaxonNodeDetailElement(CdmFormFactory formFactory, |
... | ... | |
105 | 110 |
.createSelectionElement(Reference.class,//getConversationHolder(), |
106 | 111 |
formElement, "Secundum Reference", null, |
107 | 112 |
EntitySelectionElement.DELETABLE, style); |
113 |
selection_Ref = formFactory |
|
114 |
.createSelectionElement(Reference.class,//getConversationHolder(), |
|
115 |
formElement, "Parent Child Relationship Reference", null, |
|
116 |
EntitySelectionElement.DELETABLE, style); |
|
117 |
microReference = formFactory.createTextWithLabelElement(formElement,"Detail", "", style); |
|
118 |
if (!isCreateNew()){ |
|
119 |
selection_Ref.setEntity(entity.getReference()); |
|
120 |
} |
|
108 | 121 |
if (isCreateNew()){ |
109 | 122 |
textNewTaxonName = formFactory.createTextWithLabelElement(formElement,"New Taxon", "", style); |
110 | 123 |
textNewTaxonName.setFocus(); |
... | ... | |
121 | 134 |
} |
122 | 135 |
if (entity instanceof TaxonNode) { |
123 | 136 |
checkbox_unplaced = formFactory.createCheckbox(formElement, |
124 |
"Taxon is unplaced", ((TaxonNode) entity).isUnplaced(), style);
|
|
137 |
"Taxon is unplaced", unplaced, style);
|
|
125 | 138 |
} |
126 | 139 |
|
127 | 140 |
if (!isCreateNew()){ |
... | ... | |
133 | 146 |
|
134 | 147 |
if (entity instanceof TaxonNode) { |
135 | 148 |
checkbox_excluded = formFactory.createCheckbox(formElement, |
136 |
"Taxon is excluded", ((TaxonNode) entity).isExcluded(), style);
|
|
149 |
"Taxon is excluded", excluded, style);
|
|
137 | 150 |
multiLanguageTextExcludedNotes = formFactory.createMultiLanguageTextElement(formElement, "Excluded Notes", ((TaxonNode)entity).getExcludedNote(), 50, style); |
138 | 151 |
multiLanguageTextExcludedNotes.setEnabled(((TaxonNode) entity).isExcluded()); |
139 | 152 |
} |
... | ... | |
197 | 210 |
textNewTaxonName.setEnabled(enabled); |
198 | 211 |
|
199 | 212 |
complete = !textNewTaxonName.getText().isEmpty(); |
200 |
} else if (eventSource == textNewTaxonName) { |
|
213 |
}else if (eventSource == selection_Ref) { |
|
214 |
((TaxonNode) getEntity()).setReference(selection_Ref.getEntity()); |
|
215 |
}else if (eventSource == microReference) { |
|
216 |
((TaxonNode) getEntity()).setMicroReference(microReference.getText()); |
|
217 |
} else if (eventSource == textNewTaxonName) { |
|
201 | 218 |
boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText()); |
202 | 219 |
selection_reuseExistingTaxon.setEnabled(enabled); |
203 | 220 |
selection_reuseExistingName.setEnabled(enabled); |
204 | 221 |
|
205 | 222 |
complete = CdmUtils.isNotBlank(textNewTaxonName.getText()); |
206 | 223 |
} else if (eventSource == checkbox_excluded) { |
207 |
boolean isExcluded = checkbox_excluded.getSelection(); |
|
208 |
((TaxonNode) getEntity()).setExcluded(isExcluded); |
|
209 |
multiLanguageTextExcludedNotes.setEnabled(isExcluded); |
|
224 |
excluded = checkbox_excluded.getSelection(); |
|
225 |
if (!isCreateNew()){ |
|
226 |
((TaxonNode)getEntity()).setExcluded(excluded); |
|
227 |
} |
|
228 |
|
|
229 |
multiLanguageTextExcludedNotes.setEnabled(excluded); |
|
210 | 230 |
} else if (eventSource == checkbox_unplaced) { |
211 |
((TaxonNode) getEntity()).setUnplaced(checkbox_unplaced.getSelection()); |
|
231 |
unplaced = checkbox_unplaced.getSelection(); |
|
232 |
if (!isCreateNew()){ |
|
233 |
((TaxonNode)getEntity()).setUnplaced(unplaced); |
|
234 |
} |
|
212 | 235 |
} else if (eventSource == checkbox_openInEditor) { |
213 | 236 |
setOpenInEditor(checkbox_openInEditor.getSelection()); |
214 | 237 |
} else if (eventSource == selectionNodeAgentRelation){ |
... | ... | |
329 | 352 |
return createNew; |
330 | 353 |
} |
331 | 354 |
|
355 |
public boolean isExcluded() { |
|
356 |
return excluded; |
|
357 |
} |
|
358 |
|
|
359 |
public boolean isUnplaced() { |
|
360 |
return unplaced; |
|
361 |
} |
|
362 |
|
|
332 | 363 |
} |
Also available in: Unified diff
fix #6533: fix setting of excluded/unplaced in newTaxonnodeWizard