CommonNameVocabularyPreferencePage_description=Select the vocabularies for common name area selection.
CommonNameLanguagePreferencePage_description=Choose the languages available for common names.
EnumCombo_Placement_status=Placement status
-OriginalSourceAdvancedSection_advanced=Advanced
\ No newline at end of file
+OriginalSourceAdvancedSection_advanced=Additional information
\ No newline at end of file
CommonNameLanguagePreferencePage_description=Wählen Sie die für Trivialnamen verfügbaren Sprachen.
EnumCombo_Placement_status=Platzierungsstatus
-OriginalSourceAdvancedSection_advanced=Erweitert
\ No newline at end of file
+OriginalSourceAdvancedSection_advanced=Zusätzliche Informationen
\ No newline at end of file
formElement, SECUNDUM_REFERENCE, taxon != null? taxon.getSec(): null,
EntitySelectionElement.DELETABLE, style, 100);
+ microReference = formFactory.createTextWithLabelElement(formElement, "Secundum Details", "", style);
+
+
checkbox_publish = formFactory.createCheckbox(formElement,
Messages.TaxonNodeWizardPage_TAXON_IS_PUBLISH, true, style);
checkbox_publish.setEnabled(isCreateNew());
- Label seperator = new Label(getLayoutComposite(), SWT.HORIZONTAL | SWT.SEPARATOR);
- seperator.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
+
Label nodeTitle = new Label(getLayoutComposite(), SWT.NULL);
nodeTitle.setText(Messages.TaxonNodeWizardPage_TAXON_NODE);
nodeTitle.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
nodeTitle.setFont(FONT_BOLD);
-
-
-// microReference = formFactory.createTextWithLabelElement(formElement,
-// Messages.TaxonNodeWizardPage_PLACEMENT_SOURCE_DETAIL, "", style);
-// microReference.setText(parentNode.getMicroReference());
selection_parentTaxonNode = formFactory
.createTaxonNodeSelectionElement(getConversationHolder(), formElement, Messages.TaxonNodeWizardPage_PARENT, parentNode,
EntitySelectionElement.DELETABLE, style, 100);
Messages.TaxonNodeWizardPage_TAXON, taxon,
EntitySelectionElement.DELETABLE, style);
- textTaxonSec = formFactory.createTextWithLabelElement(formElement,SECUNDUM_REFERENCE, "", style);
+ textTaxonSec = formFactory.createTextWithLabelElement(formElement,SECUNDUM_REFERENCE, "", style);
+ microReference = formFactory.createTextWithLabelElement(formElement, "Secundum Details", "", style);
if (entity.getTaxon().getSec() != null){
textTaxonSec.setText(taxon.getSec().getTitleCache());
}
textTaxonSec.setEnabled(false);
+ microReference.setEnabled(false);
Label nodeTitle = new Label(getLayoutComposite(), SWT.NULL);
nodeTitle.setText("Taxon Node");
formElement, Messages.TaxonNodeWizardPage_PARENT, entity.getParent().getTaxon().getTitleCache(), style);
textParent.setEnabled(false);
}
-// sourceSection = formFactory.createOriginalSourceElement(formElement, entity);
-
-
}
Label spacer = new Label(getLayoutComposite(), SWT.NULL);
spacer.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
if (selection_reuseExistingTaxon.getEntity() != null){
setTaxon(selection_reuseExistingTaxon.getEntity());
if (getTaxon().getSec()!= null){
+ microReference.setText(getTaxon().getSecMicroReference());
if (isCreateNew()){
selection_SecRef.setEntity(getTaxon().getSec());
}else{
textTaxonSec.setText((getTaxon().getSec().getTitleCache()));
}
}else{
+ microReference.setText("");
if (isCreateNew()){
- selection_SecRef.setEntity(null);
+ selection_SecRef.setEntity(null);
}else{
textTaxonSec.setText("");
}
taxon.setSec(selection_SecRef.getEntity());
}
}else if (eventSource == microReference) {
- if(!isCreateNew()){
- getEntity().setMicroReference(microReference.getText());
- }
+ getEntity().getTaxon().setSecMicroReference(microReference.getText());
+
} else if (eventSource == checkbox_publish) {
if (taxon != null){
taxon.setPublish(checkbox_publish.getSelection());
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
+import eu.etaxonomy.cdm.model.name.TaxonName;
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.section.common.ExternalLinksSection;
+import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* @author k.luther
protected TextWithLabelElement text_idNamespace;
protected TextWithLabelElement text_originaleNameString;
protected TextWithLabelElement text_cdmsource;
+ protected EntitySelectionElement<TaxonName> select_nameUsedInSource;
protected ExternalLinksSection externalLinks;
Display display = Display.getCurrent();
Color background = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
- if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
+ if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowIdInSource.getKey())){
text_idInSource = formFactory.createTextWithLabelElement(formElement, "ID in Source", entity != null?((OriginalSourceBase)entity).getIdInSource():null, style);
text_idInSource.setBackground(background);
+
}
if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowNamespaceInSource.getKey())){
text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", entity != null?((OriginalSourceBase)entity).getIdNamespace():null, style);
formElement, "Original Information", entity != null?entity.getOriginalNameString():null, SWT.NULL);
text_originaleNameString.setBackground(background);
-// text_cdmsource = formFactory.createTextWithLabelElement(
-// formElement, "CDM Source", entity != null?entity.getCdmSource():null, SWT.NULL);
+
+ select_nameUsedInSource = formFactory.createSelectionElement(TaxonName.class, formElement, "Name in Source", entity != null? ((DescriptionElementSource)entity).getNameUsedInSource(): null, EntitySelectionElement.DELETABLE, style);
externalLinks = formFactory.createExternalLinksSection(getConversationHolder(), formElement, StoreUtil.getSectionStyle(ExternalLinksSection.class, DescriptionElementSource.class.getCanonicalName()));
externalLinks.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 3));
externalLinks.setEntity( ((OriginalSourceBase)entity));
((OriginalSourceBase)getEntity()).setIdNamespace(text_idNamespace.getText());
}else if (eventSource.equals(text_originaleNameString)){
((OriginalSourceBase)getEntity()).setOriginalNameString(text_originaleNameString.getText());
+ }else if (eventSource.equals(select_nameUsedInSource)){
+ ((DescriptionElementSource)getEntity()).setNameUsedInSource(select_nameUsedInSource.getEntity());
}
}
package eu.etaxonomy.taxeditor.ui.section.reference;
import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
return Messages.OriginalSourceAdvancedSection_advanced;
}
+ @Override
+ protected void createControlsByType(AbstractCdmDetailSection<ReferencedEntityBase> formElement, Class<ReferencedEntityBase> entityClass, int style) {
+ super.createControlsByType(formElement, entityClass, style);
+
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.topMargin = 0;
+ layout.bottomMargin = 0;
+ layout.numColumns = DEFAULT_NUM_COLUMNS;
+ setLayout(layout);
+
+ }
}
package eu.etaxonomy.taxeditor.ui.section.reference;
import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.ui.forms.widgets.TableWrapData;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
*/
public class OriginalSourceElement extends AbstractCdmDetailElement<ReferencedEntityBase> implements IPropertyChangeListener{
-// protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
-
private EntitySelectionElement<Reference> selection_Ref;
+ private TextWithLabelElement microReference;
private OriginalSourceAdvancedSection advancedSection;
private CdmBase cdmEntity;
-// protected EntitySelectionElement<Reference> selection_reference;
-// protected TextWithLabelElement text_referenceDetail;
-
-
public OriginalSourceElement(CdmFormFactory formFactory, ICdmFormElement formElement, CdmBase cdmEntity) {
super(formFactory, formElement);
this.cdmEntity = cdmEntity;
selection_Ref.setEntity(entity.getCitation());
}
selection_Ref.setBackground(this.getPersistentBackground());
+ microReference = formFactory.createTextWithLabelElement(formElement, "Details", entity != null? entity.getCitationMicroReference(): "", style);
for (ICdmFormElement element: selection_Ref.getElements()){
element.setBackground(getPersistentBackground());
}
+
advancedSection = formFactory.createOriginalSourceAdvancedSection(getConversationHolder(), formElement, null, StoreUtil.getSectionStyle(OriginalSourceAdvancedSection.class, INomenclaturalReference.class.getCanonicalName()));
- advancedSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
+
+
+ advancedSection.setLayoutData(layoutData);
addControl(advancedSection);
addElement(advancedSection);
//TODO: why is this null????ß
getEntity().setCitation(selection_Ref.getEntity());
+ }else if (eventSource.equals(microReference)){
+
+ if (getEntity() == null){
+ DescriptionElementSource source = DescriptionElementSource.NewPrimarySourceInstance(null, null);
+ setEntity(source);
+ if (cdmEntity != null && cdmEntity instanceof TaxonNode){
+ ((TaxonNode)cdmEntity).setSource(source);
+ }
+ }
+ //TODO: why is this null????ß
+ getEntity().setCitationMicroReference(microReference.getText());
+
}
}