Revision 5b087075
Added by Patrick Plitzner over 10 years ago
- completely removed EntityDetailType enum and all its uses
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java | ||
---|---|---|
103 | 103 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement; |
104 | 104 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; |
105 | 105 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
106 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection; |
|
107 | 106 |
import eu.etaxonomy.taxeditor.ui.section.EmptyElement; |
108 | 107 |
import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionDetailElement; |
109 | 108 |
import eu.etaxonomy.taxeditor.ui.section.agent.InstitutionDetailSection; |
... | ... | |
1789 | 1788 |
parentElement.addElement(element); |
1790 | 1789 |
} |
1791 | 1790 |
|
1792 |
/** |
|
1793 |
* |
|
1794 |
* Used to define which {@link AbstractEntityCollectionSection} should be |
|
1795 |
* created in |
|
1796 |
* {@link CdmFormFactory#createEntityDetailSection(EntityDetailType, ConversationHolder, ICdmFormElement, int)} |
|
1797 |
* |
|
1798 |
* @author n.hoffmann |
|
1799 |
* @created Mar 5, 2010 |
|
1800 |
* @version 1.0 |
|
1801 |
*/ |
|
1802 |
public static enum EntityDetailType { |
|
1803 |
TEAM, // never used |
|
1804 |
TEAMMEMBER, |
|
1805 |
ANNOTATION, |
|
1806 |
CREDIT, |
|
1807 |
DESCRIPTIONELEMENTSOURCE, |
|
1808 |
EXTENSION, |
|
1809 |
MARKER, |
|
1810 |
MEDIA, |
|
1811 |
DESCRIPTIONELEMENTMEDIA, |
|
1812 |
MEDIAREPRESENTATION, |
|
1813 |
MEDIAREPRESENTATIONPART, |
|
1814 |
MODIFIER, |
|
1815 |
NOMENCLATURALSTATUS, |
|
1816 |
NAME_RELATIONSHIP, |
|
1817 |
PROTOLOG, |
|
1818 |
RIGHTS, |
|
1819 |
SOURCE, |
|
1820 |
SCOPE, |
|
1821 |
DESCRIPTIONSOURCE, |
|
1822 |
TYPEDESIGNATION, |
|
1823 |
STATE_DATA, |
|
1824 |
STATISTICAL_MEASUREMENT_VALUE, |
|
1825 |
DESCRIBED_SPECIMEN, |
|
1826 |
COLLECTING_AREA, DETERMINATION_EVENT, // never used |
|
1827 |
SPECIMEN_COLLECTION, |
|
1828 |
IDENTIFIABLE_SOURCE_COLLECTION, |
|
1829 |
GEOGRAPHICAL_SCOPE, // never used |
|
1830 |
SCOPE_RESTRICTION, |
|
1831 |
MEMBER, |
|
1832 |
GRANTED_AUTHORITY, |
|
1833 |
GROUPS_BY_USER, |
|
1834 |
TAXONOMIC_SCOPE, |
|
1835 |
DETERMINATION_CURRENT, |
|
1836 |
DETERMINATION_HISTORY |
|
1791 |
|
|
1792 |
public TeamMemberSection createTeamMemberSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1793 |
TeamMemberSection section = new TeamMemberSection(this, conversation, parentElement, style); |
|
1794 |
addAndAdaptSection(parentElement, section); |
|
1795 |
return section; |
|
1837 | 1796 |
} |
1838 | 1797 |
|
1839 |
/** |
|
1840 |
* <p> |
|
1841 |
* createEntityDetailSection |
|
1842 |
* </p> |
|
1843 |
* |
|
1844 |
* @param entityDetailType |
|
1845 |
* a |
|
1846 |
* {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType} |
|
1847 |
* object. |
|
1848 |
* @param style |
|
1849 |
* a int. |
|
1850 |
* @param conversation |
|
1851 |
* a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} |
|
1852 |
* object. |
|
1853 |
* @param parentElement |
|
1854 |
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} |
|
1855 |
* object. |
|
1856 |
* @return a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} |
|
1857 |
* object. |
|
1858 |
*/ |
|
1859 |
public AbstractFormSection createEntityDetailSection(EntityDetailType entityDetailType, |
|
1860 |
ConversationHolder conversation, ICdmFormElement parentElement, int style) { |
|
1861 |
AbstractFormSection section = null; |
|
1862 |
|
|
1863 |
// System.out.println("EntityDetailSection: " + entityDetailType); |
|
1864 |
switch (entityDetailType) { |
|
1865 |
case TEAM: |
|
1866 |
// TODO this is not an AbstractEntityCollectionSection |
|
1867 |
section = new TeamDetailSection(this, conversation, parentElement, null, style); |
|
1868 |
break; |
|
1869 |
case TEAMMEMBER: |
|
1870 |
section = new TeamMemberSection(this, conversation, parentElement, style); |
|
1871 |
break; |
|
1872 |
case ANNOTATION: |
|
1873 |
section = new AnnotationSection(this, conversation, parentElement, style); |
|
1874 |
break; |
|
1875 |
case CREDIT: |
|
1876 |
section = new CreditSection(this, conversation, parentElement, style); |
|
1877 |
break; |
|
1878 |
case DESCRIPTIONELEMENTSOURCE: |
|
1879 |
section = new DescriptionElementSourceSection(this, conversation, parentElement, style); |
|
1880 |
break; |
|
1881 |
case EXTENSION: |
|
1882 |
section = new ExtensionSection(this, conversation, parentElement, style); |
|
1883 |
break; |
|
1884 |
case MARKER: |
|
1885 |
section = new MarkerSection(this, conversation, parentElement, style); |
|
1886 |
break; |
|
1887 |
case MEDIA: |
|
1888 |
section = new MediaSection(this, conversation, parentElement, style); |
|
1889 |
break; |
|
1890 |
case DESCRIPTIONELEMENTMEDIA: |
|
1891 |
section = new DescriptionElementMediaSection(this, conversation, parentElement, style); |
|
1892 |
break; |
|
1893 |
case MEDIAREPRESENTATION: |
|
1894 |
section = new MediaRepresentationSection(this, conversation, parentElement, style); |
|
1895 |
break; |
|
1896 |
case MEDIAREPRESENTATIONPART: |
|
1897 |
section = new MediaRepresentationPartSection(this, conversation, parentElement, style); |
|
1898 |
break; |
|
1899 |
case MODIFIER: |
|
1900 |
section = new ModifierSection(this, conversation, parentElement, style); |
|
1901 |
break; |
|
1902 |
case NOMENCLATURALSTATUS: |
|
1903 |
section = new NomenclaturalStatusSection(this, conversation, parentElement, style); |
|
1904 |
break; |
|
1905 |
case NAME_RELATIONSHIP: |
|
1906 |
section = new NameRelationshipDetailSection(this, conversation, parentElement, style); |
|
1907 |
break; |
|
1908 |
case PROTOLOG: |
|
1909 |
section = new ProtologueSection(this, conversation, parentElement, style); |
|
1910 |
break; |
|
1911 |
case RIGHTS: |
|
1912 |
section = new RightsSection(this, conversation, parentElement, style); |
|
1913 |
break; |
|
1914 |
case SOURCE: |
|
1915 |
section = new SourceSection(this, conversation, parentElement, style); |
|
1916 |
break; |
|
1917 |
case SCOPE: |
|
1918 |
section = new ScopeSection(this, conversation, parentElement, style); |
|
1919 |
break; |
|
1920 |
case DESCRIPTIONSOURCE: |
|
1921 |
section = new DescriptionSourceSection(this, conversation, parentElement, style); |
|
1922 |
break; |
|
1923 |
case TYPEDESIGNATION: |
|
1924 |
section = new TypeDesignationSection(this, conversation, parentElement, style); |
|
1925 |
break; |
|
1926 |
case STATE_DATA: |
|
1927 |
section = new StateDataSection(this, conversation, parentElement, style); |
|
1928 |
break; |
|
1929 |
case STATISTICAL_MEASUREMENT_VALUE: |
|
1930 |
section = new StatisticalMeasurementValueSection(this, conversation, parentElement, style); |
|
1931 |
break; |
|
1932 |
case DESCRIBED_SPECIMEN: |
|
1933 |
section = new DescribedSpecimenSection(this, conversation, parentElement, style); |
|
1934 |
break; |
|
1935 |
case COLLECTING_AREA: |
|
1936 |
section = new CollectingAreasDetailSection(this, conversation, parentElement, style); |
|
1937 |
break; |
|
1938 |
case DETERMINATION_CURRENT: |
|
1939 |
section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style); |
|
1940 |
break; |
|
1941 |
case DETERMINATION_HISTORY: |
|
1942 |
section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style); |
|
1943 |
break; |
|
1944 |
case SPECIMEN_COLLECTION: |
|
1945 |
section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style); |
|
1946 |
break; |
|
1947 |
case IDENTIFIABLE_SOURCE_COLLECTION: |
|
1948 |
section = new SourceCollectionDetailSection(this, conversation, parentElement, style); |
|
1949 |
break; |
|
1950 |
case GEOGRAPHICAL_SCOPE: |
|
1951 |
section = new GeographicalScopeDetailSection(this, conversation, parentElement, style); |
|
1952 |
break; |
|
1953 |
case SCOPE_RESTRICTION: |
|
1954 |
section = new ScopeRestrictionSection(this, conversation, parentElement, style); |
|
1955 |
break; |
|
1956 |
case MEMBER: |
|
1957 |
section = new MemberDetailSection(this, conversation, parentElement, style); |
|
1958 |
break; |
|
1959 |
case GRANTED_AUTHORITY: |
|
1960 |
section = new GrantedAuthorityDetailSection(this, conversation, parentElement, style); |
|
1961 |
break; |
|
1962 |
case GROUPS_BY_USER: |
|
1963 |
section = new GroupsByUserDetailSection(this, conversation, parentElement, style); |
|
1964 |
break; |
|
1965 |
case TAXONOMIC_SCOPE: |
|
1966 |
section = new TaxonomicScopeSection(this, conversation, parentElement, style); |
|
1967 |
break; |
|
1968 |
} |
|
1969 |
parentElement.addElement(section); |
|
1970 |
adapt(section); |
|
1798 |
public AnnotationSection createAnnotationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1799 |
AnnotationSection section = new AnnotationSection(this, conversation, parentElement, style); |
|
1800 |
addAndAdaptSection(parentElement, section); |
|
1801 |
return section; |
|
1802 |
} |
|
1803 |
|
|
1804 |
public CreditSection createCreditSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1805 |
CreditSection section = new CreditSection(this, conversation, parentElement, style); |
|
1806 |
addAndAdaptSection(parentElement, section); |
|
1807 |
return section; |
|
1808 |
} |
|
1809 |
|
|
1810 |
public DescriptionElementSourceSection createDescriptionElementSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1811 |
DescriptionElementSourceSection section = new DescriptionElementSourceSection(this, conversation, parentElement, style); |
|
1812 |
addAndAdaptSection(parentElement, section); |
|
1813 |
return section; |
|
1814 |
} |
|
1815 |
|
|
1816 |
public ExtensionSection createExtensionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1817 |
ExtensionSection section = new ExtensionSection(this, conversation, parentElement, style); |
|
1818 |
addAndAdaptSection(parentElement, section); |
|
1819 |
return section; |
|
1820 |
} |
|
1821 |
|
|
1822 |
public MarkerSection createMarkerSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1823 |
MarkerSection section = new MarkerSection(this, conversation, parentElement, style); |
|
1824 |
addAndAdaptSection(parentElement, section); |
|
1825 |
return section; |
|
1826 |
} |
|
1827 |
|
|
1828 |
public MediaSection createMediaSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1829 |
MediaSection section = new MediaSection(this, conversation, parentElement, style); |
|
1830 |
addAndAdaptSection(parentElement, section); |
|
1831 |
return section; |
|
1832 |
} |
|
1833 |
|
|
1834 |
public DescriptionElementMediaSection createDescriptionElementMediaSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1835 |
DescriptionElementMediaSection section = new DescriptionElementMediaSection(this, conversation, parentElement, style); |
|
1836 |
addAndAdaptSection(parentElement, section); |
|
1837 |
return section; |
|
1838 |
} |
|
1839 |
|
|
1840 |
public MediaRepresentationSection createMediaRepresentationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1841 |
MediaRepresentationSection section = new MediaRepresentationSection(this, conversation, parentElement, style); |
|
1842 |
addAndAdaptSection(parentElement, section); |
|
1843 |
return section; |
|
1844 |
} |
|
1845 |
|
|
1846 |
public MediaRepresentationPartSection createMediaRepresentationPartSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1847 |
MediaRepresentationPartSection section = new MediaRepresentationPartSection(this, conversation, parentElement, style); |
|
1848 |
addAndAdaptSection(parentElement, section); |
|
1849 |
return section; |
|
1850 |
} |
|
1851 |
|
|
1852 |
public ModifierSection createModifierSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1853 |
ModifierSection section = new ModifierSection(this, conversation, parentElement, style); |
|
1854 |
addAndAdaptSection(parentElement, section); |
|
1855 |
return section; |
|
1856 |
} |
|
1857 |
|
|
1858 |
public NomenclaturalStatusSection createNomenclaturalStatusSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1859 |
NomenclaturalStatusSection section = new NomenclaturalStatusSection(this, conversation, parentElement, style); |
|
1860 |
addAndAdaptSection(parentElement, section); |
|
1861 |
return section; |
|
1862 |
} |
|
1863 |
|
|
1864 |
public NameRelationshipDetailSection createNameRelationshipDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1865 |
NameRelationshipDetailSection section = new NameRelationshipDetailSection(this, conversation, parentElement, style); |
|
1866 |
addAndAdaptSection(parentElement, section); |
|
1867 |
return section; |
|
1868 |
} |
|
1869 |
|
|
1870 |
public ProtologueSection createProtologueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1871 |
ProtologueSection section = new ProtologueSection(this, conversation, parentElement, style); |
|
1872 |
addAndAdaptSection(parentElement, section); |
|
1873 |
return section; |
|
1874 |
} |
|
1875 |
|
|
1876 |
public RightsSection createRightsSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1877 |
RightsSection section = new RightsSection(this, conversation, parentElement, style); |
|
1878 |
addAndAdaptSection(parentElement, section); |
|
1879 |
return section; |
|
1880 |
} |
|
1881 |
|
|
1882 |
public SourceSection createSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1883 |
SourceSection section = new SourceSection(this, conversation, parentElement, style); |
|
1884 |
addAndAdaptSection(parentElement, section); |
|
1885 |
return section; |
|
1886 |
} |
|
1887 |
|
|
1888 |
public ScopeSection createScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1889 |
ScopeSection section = new ScopeSection(this, conversation, parentElement, style); |
|
1890 |
addAndAdaptSection(parentElement, section); |
|
1891 |
return section; |
|
1892 |
} |
|
1893 |
|
|
1894 |
public DescriptionSourceSection createDescriptionSourceSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1895 |
DescriptionSourceSection section = new DescriptionSourceSection(this, conversation, parentElement, style); |
|
1896 |
addAndAdaptSection(parentElement, section); |
|
1897 |
return section; |
|
1898 |
} |
|
1899 |
|
|
1900 |
public TypeDesignationSection createTypeDesignationSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1901 |
TypeDesignationSection section = new TypeDesignationSection(this, conversation, parentElement, style); |
|
1902 |
addAndAdaptSection(parentElement, section); |
|
1903 |
return section; |
|
1904 |
} |
|
1905 |
|
|
1906 |
public StateDataSection createStateDataSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1907 |
StateDataSection section = new StateDataSection(this, conversation, parentElement, style); |
|
1908 |
addAndAdaptSection(parentElement, section); |
|
1909 |
return section; |
|
1910 |
} |
|
1911 |
|
|
1912 |
public StatisticalMeasurementValueSection createStatisticalMeasurementValueSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1913 |
StatisticalMeasurementValueSection section = new StatisticalMeasurementValueSection(this, conversation, parentElement, style); |
|
1914 |
addAndAdaptSection(parentElement, section); |
|
1915 |
return section; |
|
1916 |
} |
|
1917 |
|
|
1918 |
public DescribedSpecimenSection createDescribedSpecimenSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1919 |
DescribedSpecimenSection section = new DescribedSpecimenSection(this, conversation, parentElement, style); |
|
1920 |
addAndAdaptSection(parentElement, section); |
|
1921 |
return section; |
|
1922 |
} |
|
1923 |
|
|
1924 |
public CollectingAreasDetailSection createCollectingAreasDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1925 |
CollectingAreasDetailSection section = new CollectingAreasDetailSection(this, conversation, parentElement, style); |
|
1926 |
addAndAdaptSection(parentElement, section); |
|
1927 |
return section; |
|
1928 |
} |
|
1929 |
|
|
1930 |
public CurrentDeterminationDetailSection createCurrentDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1931 |
CurrentDeterminationDetailSection section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style); |
|
1932 |
addAndAdaptSection(parentElement, section); |
|
1933 |
return section; |
|
1934 |
} |
|
1935 |
|
|
1936 |
public DeterminationHistoryDetailSection createDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1937 |
DeterminationHistoryDetailSection section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style); |
|
1938 |
addAndAdaptSection(parentElement, section); |
|
1939 |
return section; |
|
1940 |
} |
|
1941 |
|
|
1942 |
public SpecimenCollectionDetailSection createSpecimenCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1943 |
SpecimenCollectionDetailSection section = new SpecimenCollectionDetailSection(this, conversation, parentElement, style); |
|
1944 |
addAndAdaptSection(parentElement, section); |
|
1945 |
return section; |
|
1946 |
} |
|
1947 |
|
|
1948 |
public SourceCollectionDetailSection createSourceCollectionDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1949 |
SourceCollectionDetailSection section = new SourceCollectionDetailSection(this, conversation, parentElement, style); |
|
1950 |
addAndAdaptSection(parentElement, section); |
|
1951 |
return section; |
|
1952 |
} |
|
1953 |
|
|
1954 |
public GeographicalScopeDetailSection createGeographicalScopeDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1955 |
GeographicalScopeDetailSection section = new GeographicalScopeDetailSection(this, conversation, parentElement, style); |
|
1956 |
addAndAdaptSection(parentElement, section); |
|
1957 |
return section; |
|
1958 |
} |
|
1959 |
|
|
1960 |
public ScopeRestrictionSection createScopeRestrictionSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1961 |
ScopeRestrictionSection section = new ScopeRestrictionSection(this, conversation, parentElement, style); |
|
1962 |
addAndAdaptSection(parentElement, section); |
|
1963 |
return section; |
|
1964 |
} |
|
1965 |
|
|
1966 |
public MemberDetailSection createMemberDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1967 |
MemberDetailSection section = new MemberDetailSection(this, conversation, parentElement, style); |
|
1968 |
addAndAdaptSection(parentElement, section); |
|
1969 |
return section; |
|
1970 |
} |
|
1971 |
|
|
1972 |
public GrantedAuthorityDetailSection createGrantedAuthorityDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1973 |
GrantedAuthorityDetailSection section = new GrantedAuthorityDetailSection(this, conversation, parentElement, style); |
|
1974 |
addAndAdaptSection(parentElement, section); |
|
1975 |
return section; |
|
1976 |
} |
|
1977 |
|
|
1978 |
public GroupsByUserDetailSection createGroupsByUserDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1979 |
GroupsByUserDetailSection section = new GroupsByUserDetailSection(this, conversation, parentElement, style); |
|
1980 |
addAndAdaptSection(parentElement, section); |
|
1981 |
return section; |
|
1982 |
} |
|
1983 |
|
|
1984 |
public TaxonomicScopeSection createTaxonomicScopeSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){ |
|
1985 |
TaxonomicScopeSection section = new TaxonomicScopeSection(this, conversation, parentElement, style); |
|
1986 |
addAndAdaptSection(parentElement, section); |
|
1971 | 1987 |
return section; |
1972 | 1988 |
} |
1973 | 1989 |
|
Also available in: Unified diff