Revision e04a2b79
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java | ||
---|---|---|
137 | 137 |
if (entity instanceof TaxonNode) { |
138 | 138 |
checkbox_publish = formFactory.createCheckbox(formElement, |
139 | 139 |
"Taxon is public", ((TaxonNode)entity).getTaxon().isPublish(), style); |
140 |
|
|
141 |
if(isCreateNew()){ |
|
142 |
CdmPreference defaultPublish = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.DefaultBehaviourForPublishFlag); |
|
143 |
if (defaultPublish != null && defaultPublish.getValue().equals(IPreferenceKeys.PUBLISH)){ |
|
144 |
checkbox_publish.setSelection(true); |
|
145 |
} else if (defaultPublish != null && defaultPublish.getValue().equals(IPreferenceKeys.DO_NOT_PUBLISH)){ |
|
146 |
checkbox_publish.setSelection(false); |
|
147 |
}else{ |
|
148 |
if((this.getParentTreeNode()).isInstanceOf(TaxonNode.class)){ |
|
149 |
checkbox_publish.setSelection(((TaxonNode)this.getParentTreeNode()).getTaxon().isPublish()); |
|
150 |
}else{ |
|
151 |
checkbox_publish.setSelection(true); |
|
152 |
} |
|
153 |
} |
|
154 |
} |
|
140 |
}else{ |
|
141 |
checkbox_publish = formFactory.createCheckbox(formElement, |
|
142 |
"Taxon is public", true, style); |
|
155 | 143 |
} |
156 |
|
|
157 |
if (isCreateNew()){ |
|
158 |
setParentTreeNode(entity); |
|
159 |
} else{ |
|
144 |
if(isCreateNew()){ |
|
145 |
CdmPreference defaultPublish = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.DefaultBehaviourForPublishFlag); |
|
146 |
if (defaultPublish != null && defaultPublish.getValue().equals(IPreferenceKeys.PUBLISH)){ |
|
147 |
checkbox_publish.setSelection(true); |
|
148 |
} else if (defaultPublish != null && defaultPublish.getValue().equals(IPreferenceKeys.DO_NOT_PUBLISH)){ |
|
149 |
checkbox_publish.setSelection(false); |
|
150 |
}else{ |
|
151 |
if(this.getParentTreeNode() != null && this.getParentTreeNode().isInstanceOf(TaxonNode.class)){ |
|
152 |
checkbox_publish.setSelection(((TaxonNode)this.getParentTreeNode()).getTaxon().isPublish()); |
|
153 |
}else{ |
|
154 |
checkbox_publish.setSelection(true); |
|
155 |
} |
|
156 |
} |
|
157 |
setParentTreeNode(entity); |
|
158 |
} else{ |
|
160 | 159 |
setTreeNode(entity); |
161 | 160 |
complete = true; |
162 | 161 |
} |
163 | 162 |
if (entity instanceof TaxonNode) { |
164 | 163 |
checkbox_unplaced = formFactory.createCheckbox(formElement, |
165 | 164 |
"Taxon is unplaced", ((TaxonNode)entity).isUnplaced(), style); |
165 |
}else{ |
|
166 |
checkbox_unplaced = formFactory.createCheckbox(formElement, |
|
167 |
"Taxon is unplaced", false, style); |
|
166 | 168 |
} |
167 | 169 |
|
168 | 170 |
preFillTaxonName(); |
... | ... | |
172 | 174 |
"Taxon is excluded", ((TaxonNode)entity).isExcluded(), style); |
173 | 175 |
multiLanguageTextExcludedNotes = formFactory.createMultiLanguageTextElement(formElement, "Excluded Notes", ((TaxonNode)entity).getExcludedNote(), 50, style); |
174 | 176 |
multiLanguageTextExcludedNotes.setEnabled(((TaxonNode) entity).isExcluded()); |
177 |
}else{ |
|
178 |
checkbox_excluded = formFactory.createCheckbox(formElement, |
|
179 |
"Taxon is excluded", false, style); |
|
180 |
multiLanguageTextExcludedNotes = formFactory.createMultiLanguageTextElement(formElement, "Excluded Notes", null, 50, style); |
|
181 |
multiLanguageTextExcludedNotes.setEnabled(false); |
|
175 | 182 |
} |
176 | 183 |
if (!isCreateNew()){ |
177 | 184 |
selectionNodeAgentRelation = formFactory.createTaxonNodeAgentRelationCollectionSection(formElement, getConversationHolder(), style); |
... | ... | |
239 | 246 |
|
240 | 247 |
complete = !textNewTaxonName.getText().isEmpty(); |
241 | 248 |
} |
242 |
if(getEntity() instanceof TaxonNode){ |
|
243 |
if (eventSource == selection_Ref) { |
|
244 |
((TaxonNode) getEntity()).setReference(selection_Ref.getEntity()); |
|
245 |
}else if (eventSource == selection_SecRef) { |
|
246 |
((TaxonNode) getEntity()).getTaxon().setSec(selection_SecRef.getEntity()); |
|
247 |
}else if (eventSource == microReference) { |
|
248 |
((TaxonNode) getEntity()).setMicroReference(microReference.getText()); |
|
249 |
} else if (eventSource == textNewTaxonName) { |
|
250 |
boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText()); |
|
251 |
selection_reuseExistingTaxon.setEnabled(enabled); |
|
252 |
selection_reuseExistingName.setEnabled(enabled); |
|
253 |
|
|
254 |
complete = CdmUtils.isNotBlank(textNewTaxonName.getText()); |
|
255 |
} else if (eventSource == checkbox_excluded) { |
|
256 |
excluded = checkbox_excluded.getSelection(); |
|
257 |
((TaxonNode)getEntity()).setExcluded(excluded); |
|
258 |
|
|
259 |
multiLanguageTextExcludedNotes.setEnabled(excluded); |
|
260 |
} else if (eventSource == checkbox_unplaced) { |
|
261 |
unplaced = checkbox_unplaced.getSelection(); |
|
262 |
((TaxonNode)getEntity()).setUnplaced(unplaced); |
|
263 |
} else if (eventSource == checkbox_openInEditor) { |
|
264 |
setOpenInEditor(checkbox_openInEditor.getSelection()); |
|
265 |
} else if (eventSource == checkbox_publish) { |
|
266 |
((TaxonNode)getEntity()).getTaxon().setPublish(checkbox_publish.getSelection()); |
|
267 |
} |
|
249 |
if (!createNew){ |
|
250 |
if (eventSource == selection_Ref) { |
|
251 |
((TaxonNode) getEntity()).setReference(selection_Ref.getEntity()); |
|
252 |
}else if (eventSource == selection_SecRef) { |
|
253 |
((TaxonNode) getEntity()).getTaxon().setSec(selection_SecRef.getEntity()); |
|
254 |
}else if (eventSource == microReference) { |
|
255 |
((TaxonNode) getEntity()).setMicroReference(microReference.getText()); |
|
256 |
} else if (eventSource == checkbox_publish) { |
|
257 |
((TaxonNode)getEntity()).getTaxon().setPublish(checkbox_publish.getSelection()); |
|
258 |
} |
|
268 | 259 |
} |
269 |
else if (eventSource == selectionNodeAgentRelation){ |
|
260 |
if (eventSource == checkbox_excluded) { |
|
261 |
excluded = checkbox_excluded.getSelection(); |
|
262 |
if (!createNew){ |
|
263 |
((TaxonNode)getEntity()).setExcluded(excluded); |
|
264 |
} |
|
265 |
multiLanguageTextExcludedNotes.setEnabled(excluded); |
|
266 |
} |
|
267 |
if (eventSource == checkbox_unplaced) { |
|
268 |
unplaced = checkbox_unplaced.getSelection(); |
|
269 |
if (!createNew){ |
|
270 |
((TaxonNode)getEntity()).setUnplaced(unplaced); |
|
271 |
} |
|
272 |
} |
|
273 |
if (eventSource == textNewTaxonName) { |
|
274 |
boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText()); |
|
275 |
selection_reuseExistingTaxon.setEnabled(enabled); |
|
276 |
selection_reuseExistingName.setEnabled(enabled); |
|
277 |
|
|
278 |
complete = CdmUtils.isNotBlank(textNewTaxonName.getText()); |
|
279 |
} |
|
280 |
if (eventSource == checkbox_openInEditor) { |
|
281 |
setOpenInEditor(checkbox_openInEditor.getSelection()); |
|
282 |
} |
|
283 |
if (eventSource == selectionNodeAgentRelation){ |
|
270 | 284 |
boolean allComplete = true; |
271 | 285 |
for (ICdmFormElement element : selectionNodeAgentRelation.getElements()){ |
272 | 286 |
allComplete &=((TaxonNodeAgentRelationCollectionElement)element).isComplete(); |
Also available in: Unified diff
ref #7680: unplaced, excluded and publish checkboxes should be available in NewTaxonnodeWizard