From 45a359602ebdfd6656461410bc679c217312fc4f Mon Sep 17 00:00:00 2001 From: "a.theys" Date: Wed, 25 Jan 2012 09:32:12 +0000 Subject: [PATCH] AT: commiting latest changes to the Palm Use data extension --- .../editor/view/uses/UsesContentProvider.java | 1 + .../taxeditor/ui/forms/CdmFormFactory.java | 23 +++++++++---- .../userecords/UseRecordDetailElement.java | 33 +++++++++++++++---- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.java index 7eae64139..18a9a5d9b 100644 --- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.java +++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.java @@ -149,6 +149,7 @@ public class UsesContentProvider implements ITreeContentProvider { Set descriptionMarkers = description.getMarkers(); if(descriptionMarkers != null) { for (Marker marker: descriptionMarkers) { + //TODO Use the GetbyUUID method if(marker.getMarkerType().getTitleCache().equals("use")) { descriptions.add(description); } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/CdmFormFactory.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/CdmFormFactory.java index 33a1cff74..4ede4f660 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/CdmFormFactory.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/CdmFormFactory.java @@ -257,8 +257,10 @@ import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailElement; import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection; import eu.etaxonomy.taxeditor.ui.section.user.UserDetailElement; import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection; +import eu.etaxonomy.taxeditor.ui.section.userecords.UseCategorySection; import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailElement; import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection; +import eu.etaxonomy.taxeditor.ui.section.userecords.UseSubCategorySection; import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement; import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailSection; import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection; @@ -1841,9 +1843,10 @@ public class CdmFormFactory extends FormToolkit { element = new DefinedTermDetailElement(this, parentElement); break; - /*case USE_RECORD: - element = new UseRecordDetailElement(this, parentElement, style); - break;*/ + case USE_RECORD: + //element = new UseRecordDetailElement(this, parentElement, style); + element = new UseRecordDetailElement(this, parentElement); + break; } if (element == null) { @@ -1865,7 +1868,7 @@ public class CdmFormFactory extends FormToolkit { * @version 1.0 */ public static enum EntityDetailType { - TEAM, TEAMMEMBER, ANNOTATION, CREDIT, DESCRIPTIONELEMENTSOURCE, EXTENSION, MARKER, MEDIA, DESCRIPTIONELEMENTMEDIA, MEDIAREPRESENTATION, MEDIAREPRESENTATIONPART, MODIFIER, NOMENCLATURALSTATUS, NAME_RELATIONSHIP, PROTOLOG, RIGHTS, SOURCE, SCOPE, DESCRIPTIONSOURCE, TYPEDESIGNATION, STATE_DATA, STATISTICAL_MEASUREMENT_VALUE, DESCRIBED_SPECIMEN, COLLECTING_AREA, DETERMINATION_EVENT, SPECIMEN_COLLECTION, IDENTIFIABLE_SOURCE_COLLECTION, GEOGRAPHICAL_SCOPE, SCOPE_RESTRICTION, MEMBER, GRANTED_AUTHORITY, GROUPS_BY_USER, TAXONOMIC_SCOPE, DETERMINATION_CURRENT, DETERMINATION_HISTORY + TEAM, TEAMMEMBER, ANNOTATION, CREDIT, DESCRIPTIONELEMENTSOURCE, EXTENSION, MARKER, MEDIA, DESCRIPTIONELEMENTMEDIA, MEDIAREPRESENTATION, MEDIAREPRESENTATIONPART, MODIFIER, NOMENCLATURALSTATUS, NAME_RELATIONSHIP, PROTOLOG, RIGHTS, SOURCE, SCOPE, DESCRIPTIONSOURCE, TYPEDESIGNATION, STATE_DATA, STATISTICAL_MEASUREMENT_VALUE, DESCRIBED_SPECIMEN, COLLECTING_AREA, DETERMINATION_EVENT, SPECIMEN_COLLECTION, IDENTIFIABLE_SOURCE_COLLECTION, GEOGRAPHICAL_SCOPE, SCOPE_RESTRICTION, MEMBER, GRANTED_AUTHORITY, GROUPS_BY_USER, TAXONOMIC_SCOPE, DETERMINATION_CURRENT, DETERMINATION_HISTORY, USE_CAT, USE_SUBCAT } /** @@ -2028,6 +2031,14 @@ public class CdmFormFactory extends FormToolkit { section = new TaxonomicScopeSection(this, conversation, parentElement, style); break; + case USE_CAT: + section = new UseCategorySection(this, conversation, parentElement, + style); + break; + case USE_SUBCAT: + section = new UseSubCategorySection(this, conversation, parentElement, + style); + break; } parentElement.addElement(section); adapt(section); @@ -2428,7 +2439,7 @@ public class CdmFormFactory extends FormToolkit { } - public AbstractDetailedDescriptionDetailElement createUseRecordDetailElement( + /*public AbstractDetailedDescriptionDetailElement createUseRecordDetailElement( ICdmFormElement parentElement, DescriptionElementBase entity, int style) { AbstractDetailedDescriptionDetailElement useRecordElement = null; @@ -2442,7 +2453,7 @@ public class CdmFormFactory extends FormToolkit { adapt(useRecordElement); parentElement.addElement(useRecordElement); return useRecordElement; - } + }*/ /** * Creates a styled text as a part of the form. diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java index f0710628b..bd7862777 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java @@ -5,6 +5,8 @@ import org.eclipse.ui.forms.widgets.Section; import eu.etaxonomy.cdm.model.description.CategoricalData; import eu.etaxonomy.cdm.model.description.DescriptionElementBase; +import eu.etaxonomy.cdm.model.description.State; +import eu.etaxonomy.taxeditor.ui.combo.TermComboElement; import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory; import eu.etaxonomy.taxeditor.ui.forms.CheckboxElement; import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement; @@ -14,28 +16,45 @@ import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailEle import eu.etaxonomy.taxeditor.ui.section.description.StateDataSection; import eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement; -public class UseRecordDetailElement extends AbstractDetailedDescriptionDetailElement { +//public class UseRecordDetailElement extends AbstractDetailedDescriptionDetailElement { +public class UseRecordDetailElement extends AbstractCdmDetailElement { + private static final Logger logger = Logger .getLogger(DescriptionElementDetailElement.class); private CheckboxElement checkbox_orderRelevant; - private StateDataSection section_stateData; + private TermComboElement UseCategory_stateData; + private UseSubCategorySection UseSubCategory_stateData; //private AbstractDetailedDescriptionDetailElement detailElement; - public UseRecordDetailElement(CdmFormFactory formFactory, + /*public UseRecordDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement, CategoricalData entity, int style) { super(formFactory, formElement, entity, style); + }*/ + /*public UseRecordDetailElement(CdmFormFactory formFactory, + ICdmFormElement formElement, int style) {*/ + public UseRecordDetailElement(CdmFormFactory formFactory, + ICdmFormElement formElement) { + super(formFactory, formElement); } /** {@inheritDoc} */ @Override protected void createControls(ICdmFormElement formElement, CategoricalData entity, int style) { - checkbox_orderRelevant = formFactory.createCheckbox(formElement, "Order Relevant", entity.getOrderRelevant(), style); - section_stateData = (StateDataSection) formFactory.createEntityDetailSection(EntityDetailType.STATE_DATA, getConversationHolder(), formElement, Section.TWISTIE | Section.EXPANDED); - section_stateData.setEntity(entity); - section_stateData.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1)); + + + State state = State.NewInstance("Tato", "Toto", "Titi"); + //checkbox_orderRelevant = formFactory.createCheckbox(formElement, "Order Relevant", entity.getOrderRelevant(), style); + UseCategory_stateData = formFactory.createTermComboElement(State.class, this, "Use Category", state , style); + //createEntityDetailSection(EntityDetailType.USE_CAT, getConversationHolder(), formElement, Section.EXPANDED); + UseSubCategory_stateData = (UseSubCategorySection) formFactory.createEntityDetailSection(EntityDetailType.USE_SUBCAT, getConversationHolder(), formElement,Section.EXPANDED); + //UseCategory_stateData.setEntity(entity); + UseSubCategory_stateData.setEntity(entity); + //UseCategory_stateData.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1)); + UseSubCategory_stateData.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1)); + } -- 2.34.1