* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.taxeditor.ui.section.name;
import java.util.Arrays;
private TextWithLabelElement text_breed;
//private NumberWithLabelElement text_publicationYear;
//private NumberWithLabelElement text_originalPublicationYear;
- private int cursorPosition;
- NameDetailsConfigurator config;
+ private NameDetailsConfigurator config;
/**
* <p>Constructor for NameDetailElement.</p>
int style) {
super(cdmFormFactory, formElement);
// make this element selectable
-
-
}
- /** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, INonViralName nonViralName, int style) {
Comparator<Rank> comparator = null;
if(PreferencesUtil.getSortRanksHierarchichally()){
comparator = new Comparator<Rank>(){
-
- @Override
- public int compare(Rank o1, Rank o2) {
- return o2.compareTo(o1);
- }
-
- };
+ @Override
+ public int compare(Rank o1, Rank o2) {
+ return o2.compareTo(o1);
+ }
+ };
}
if (config == null){
toggleable_cache = formFactory.createToggleableTextField(this, "Name Cache", nonViralName.getNameCache(), nonViralName.isProtectedNameCache(), style);
for (ICdmFormElement element: this.getElements()){
element.setBackground(getPersistentBackground());
}
-
}
/**
}
}
- /** {@inheritDoc} */
@Override
public void updateContent() {
if(getEntity() == null){
}
}
-
private void createSpecificNameParts(ICdmFormElement formElement,
INonViralName nonViralName, int style) {
NomenclaturalCode code = nonViralName.getNameType();
}
}
-
private void createBacterialNameParts(ICdmFormElement formElement, INonViralName nonViralName, int style) {
IBacterialName bacterialName = (IBacterialName) nonViralName;
text_subGenusAuthorship = formFactory.createTextWithLabelElement(formElement, "Subgenus Authorship", bacterialName.getSubGenusAuthorship(), style);
}
}
- /** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource){
if (eventSource == toggleable_cache) {
}else if(eventSource == this.text_subGenusAuthorship){
((IBacterialName)getEntity()).setSubGenusAuthorship(text_subGenusAuthorship.getText());
}
-
}
- /*
- * (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.forms.section.cdmdetail.ISelectableElement#getSelectionArbitrator()
- */
/**
* <p>Getter for the field <code>selectionArbitrator</code>.</p>
- *
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator} object.
*/
@Override
public SelectionArbitrator getSelectionArbitrator() {
toggleable_cache.setIrrelevant(irrelevant);
}
}
-
}
-
-
-
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.taxeditor.ui.section.name;
import java.util.Arrays;
private HybridDetailSection section_hybrid;
private LsidWithExceptionLabelElement textLsid;
private TextWithLabelElement text_nameApprobation;
- //protected boolean isAdvancedView ;
public NonViralNameDetailElement(CdmFormFactory formFactory,
ICdmFormElement formElement) {
super(formFactory, formElement);
-
}
- /** {@inheritDoc} */
@Override
protected void createControls(ICdmFormElement formElement, final TaxonName entity, int style) {
NameDetailsConfigurator config = PreferencesUtil.getPreferredNameDetailsConfiguration();
}
textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
-
}else{
if (config.isNameCacheActivated()){
toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
textLsid = formFactory.createLsidWithExceptionLabelElement(formElement, "Lsid", entity.getLsid(), style);
}
-
-
}
-
section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(NameDetailSection.class, entity.getClass().getCanonicalName(), true));
section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_name);
section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
addControl(section_hybrid);
addElement(section_hybrid);
-
}
-
-
}
- /** {@inheritDoc} */
@Override
protected void updateContent() {
super.updateContent();
- // disable nomenclatural code, because changing of nom.code is not
- // implemented on library side
-// if(combo_nomenclaturalCode!=null){
-// combo_nomenclaturalCode.setEnabled(false);
-// }
- if(toggleable_cache!=null){
+ if(toggleable_cache != null){
toggleable_cache.setEnabled(getEntity().isProtectedTitleCache() || getEntity().isProtectedFullTitleCache());
setIrrelevant(toggleable_cache.getState(),
Arrays.asList(new Object[] { toggleable_cache, textLsid, text_nameApprobation }));
}
}
- /** {@inheritDoc} */
@Override
public void setEntity(TaxonName entity) {
super.setEntity(entity);
}
}
- /** {@inheritDoc} */
@Override
public void removeElements() {
super.removeElements();
}
}
- /** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
if (eventSource == toggleable_cache) {
getEntity().setProtectedFullTitleCache(false);
} else if (eventSource == section_name || eventSource == section_author) {
if (getParentElement() instanceof AbstractCdmDetailSection) {
- ((AbstractCdmDetailSection) getParentElement()).updateTitle();
+ ((AbstractCdmDetailSection<?>) getParentElement()).updateTitle();
}
if (toggleable_cache != null){
if (!toggleable_cache.getState()) {
((IBacterialName)getEntity()).setNameApprobation(text_nameApprobation.getText());
}
}
+
private boolean checkForDeletableParts(NomenclaturalCode selection) {
NomenclaturalCode actualCode = getEntity().getNameType();
if (selection.equals(actualCode)){
}else {
return true;
}
-
}
if (actualCode.equals(NomenclaturalCode.ICNB)){
if (getEntity().getNameApprobation() != null || getEntity().getSubGenusAuthorship() != null){
}else{
return true;
}
-
}
if (actualCode.equals(NomenclaturalCode.NonViral)){
return true;
}else{
return true;
}
-
}
if (actualCode.equals(NomenclaturalCode.ICNAFP)){
return true;
setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, textLsid, text_nameApprobation }));
updateToggleableCacheField();
}
-
-
-
-
-// @Override
-// public void toggleAdvancedMediaView(){
-// mediaDetailElement.toggleAdvancedMediaView();
-// }
-}
+}
\ No newline at end of file