eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Default.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/PolytomousKey.java -text
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Taxonomic.java -text
+eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Uses.java -text
eu.etaxonomy.taxeditor.application/src/main/resources/log4j.properties -text
eu.etaxonomy.taxeditor.bulkeditor/.classpath -text
eu.etaxonomy.taxeditor.bulkeditor/.project -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputDataChangeBehaviour.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInputFactory.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/UseObjectManager.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/ViewerConfiguration.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/DeleteMediaOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/MoveMediaInListOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/RemoveImageFromDescriptionElementOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesContentProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesLabelProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/UsesViewPart.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseRecordHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/handler/CreateUseSummaryHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateTaxonUseOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseRecordOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseSummaryOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/resources/TaonDescriptionEditor.screen -text
eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties -text
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/Application.java -text
eu.etaxonomy.taxeditor.store/icons/icon.png -text
eu.etaxonomy.taxeditor.store/icons/import_wiz.gif -text
eu.etaxonomy.taxeditor.store/icons/large_image.gif -text
+eu.etaxonomy.taxeditor.store/icons/leaf_detail.png -text
eu.etaxonomy.taxeditor.store/icons/linkto_help.gif -text
eu.etaxonomy.taxeditor.store/icons/lockedstate.gif -text
eu.etaxonomy.taxeditor.store/icons/ma_12x12.gif -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceSQLServerWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceTypeSelectionWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/datasource/wizard/CdmDataSourceWizard.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/UsageTermCollection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/AbstractTermBaseDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailSection.java -text
+/.project
eu.etaxonomy.taxeditor.application/.settings
eu.etaxonomy.taxeditor.application/target
eu.etaxonomy.taxeditor.bulkeditor/.settings
id="eu.etaxonomy.taxeditor.application.perspective.polytomous"\r
name="Polytomous Key">\r
</perspective>\r
+ <perspective\r
+ class="eu.etaxonomy.taxeditor.perspective.Uses"\r
+ id="eu.etaxonomy.taxeditor.application.perspective.uses"\r
+ name="Uses">\r
+ </perspective>\r
+ \r
</extension>\r
<!--extension\r
point="org.eclipse.ui.views">\r
id="eu.etaxonomy.taxeditor.editor.forms.detailsView">\r
</showInPart>\r
</perspectiveExtension>\r
+ <perspectiveExtension\r
+ targetID="eu.etaxonomy.taxeditor.application.perspective.uses">\r
+ <showInPart\r
+ id="eu.etaxonomy.taxeditor.editor.forms.detailsView">\r
+ </showInPart>\r
+ </perspectiveExtension>\r
</extension>\r
<extension\r
point="org.eclipse.ui.menus">\r
--- /dev/null
+/**\r
+ * \r
+ */\r
+package eu.etaxonomy.taxeditor.perspective;\r
+\r
+import org.eclipse.ui.IPageLayout;\r
+import eu.etaxonomy.taxeditor.editor.view.uses.UsesViewPart;\r
+import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;\r
+import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;\r
+\r
+/**\r
+ * Uses Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class Uses extends Default {\r
+\r
+ /* (non-Javadoc)\r
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)\r
+ */\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public void createInitialLayout(IPageLayout layout) {\r
+ layout.addView(TaxonNavigator.ID, IPageLayout.LEFT, 0.25f, layout.getEditorArea());\r
+ layout.addView(DetailsViewPart.ID, IPageLayout.RIGHT, 0.25f, layout.getEditorArea());\r
+ layout.addView(UsesViewPart.ID, IPageLayout.BOTTOM, 0.25f, layout.getEditorArea());\r
+ \r
+ createAdditionalFolder(layout, layout.getEditorArea());\r
+ }\r
+ \r
+\r
+}\r
+\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.11-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.11-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.11-SNAPSHOT.jar" sourcepath="lib/cdmlib-io-3.0.11-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.11-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.11-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.11-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.11-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.11-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.0.11-SNAPSHOT-sources.jar"/>\r
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
- <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/asm.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.6.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar" sourcepath="lib/dozer-5.3.0src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar" sourcepath="lib/ezmorph-1.0.4src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/fop.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar" sourcepath="lib/httpclient-4.0.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar" sourcepath="lib/httpcore-4.0.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.2.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jta.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jtds-1.2.2.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/junit-4.8.1.jar" sourcepath="lib/junit-4.8.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/msbase-2000.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/mssqlserver-2000.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/msutil-2000.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.0.5.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/opencsv-1.8.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.apache.commons.codec-1.3.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20100503.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.6.2.R36x_v20110210.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.asm-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aspects-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context.support-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.expression-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.oxm-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web.servlet-3.0.4.RELEASEsrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/poi-3.6.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/postgresql-8.2-504.jdbc4.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/servlet-2.5.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.0.5.RELEASE.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.5.RELEASE.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar" sourcepath="lib/wsdl4j-1.6.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>\r
- <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>\r
- <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="lib" path="lib/activation-1.1.jar" sourcepath="lib/activation-1.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm-attrs.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/asm.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.6.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.6.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/avalon-framework-4.2.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/batik-all-1.7.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.1.jar" sourcepath="lib/c3p0-0.9.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/cglib-2.1.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="lib/commons-beanutils-1.7.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.jar" sourcepath="lib/commons-collections-3.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.2.2.jar" sourcepath="lib/commons-dbcp-1.2.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-io-1.3.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-io-1.4.jar" sourcepath="lib/commons-io-1.4src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.3.jar" sourcepath="lib/commons-pool-1.3src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar" sourcepath="lib/dozer-5.3.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/ehcache-1.2.3.jar" sourcepath="lib/ehcache-1.2.3src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/ejb3-persistence.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.4.jar" sourcepath="lib/ezmorph-1.0.4src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/fop.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/h2-1.1.115.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-commons-annotations-3.4.0-SNAPSHOTsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-core-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-core-3.4.0-SNAPSHOTsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-search-3.1.0.GA.jar" sourcepath="lib/hibernate-search-3.1.0.GAsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-tools-3.2.0.ga.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.0.0.CR1.jar" sourcepath="lib/hibernate-validator-4.0.0.CR1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar" sourcepath="lib/httpclient-4.0.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar" sourcepath="lib/httpcore-4.0.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/javassist.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.1.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.1.6.jar" sourcepath="lib/jaxb-impl-2.1.6src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jdbc-1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jdbc2_0-stdext.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/joda-time-1.5.jar" sourcepath="lib/joda-time-1.5src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/joda-time-hibernate-1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/json-lib-2.2.3-jdk15.jar" sourcepath="lib/json-lib-2.2.3-jdk15src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar" sourcepath="lib/jsr250-api-1.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/jta.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jtds-1.2.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/junit-4.8.1.jar" sourcepath="lib/junit-4.8.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar" sourcepath="lib/log4j-1.2.14src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/lsid-client-1.1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/lsid-server-1.1.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/lucene-core-2.4.0.jar" sourcepath="lib/lucene-core-2.4.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-2.4.0.jar" sourcepath="lib/lucene-spellchecker-2.4.0src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/mail-1.4.jar" sourcepath="lib/mail-1.4src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/msbase-2000.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/mssqlserver-2000.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/msutil-2000.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.0.5.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/opencsv-1.8.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.apache.commons.codec-1.3.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20100503.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.6.2.R36x_v20110210.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aop-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.asm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.asm-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.aspects-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.beans-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.context.support-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.core-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.expression-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.jdbc-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.orm-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.oxm-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.transaction-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.0.4.RELEASE.jar" sourcepath="lib/org.springframework.web.servlet-3.0.4.RELEASEsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/poi-3.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/postgresql-8.2-504.jdbc4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/saxon9he.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/serializer-2.7.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/servlet-2.5.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar" sourcepath="lib/servlet-api-2.5src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.5.2.jar" sourcepath="lib/slf4j-api-1.5.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.5.2.jar" sourcepath="lib/slf4j-log4j12-1.5.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar" sourcepath="lib/spring-modules-cache-0.7src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-modules-lucene-0.8a.jar" sourcepath="lib/spring-modules-lucene-0.8asrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.0.5.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.0.5.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.1.jar" sourcepath="lib/wsdl4j-1.6.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/xalan-2.7.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.7.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xercesImpl.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.3.04.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar" sourcepath="lib/xml-resolver-1.2src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xsltc.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/xstream-1.3.1.jar" sourcepath="lib/xstream-1.3.1src.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-3.4.0-SNAPSHOT.jar" sourcepath="lib/hibernate-envers-3.4.0-SNAPSHOTsrc.zip"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.0.11-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
eu.etaxonomy.taxeditor.editor.name,
eu.etaxonomy.taxeditor.editor.name.handler,
eu.etaxonomy.taxeditor.editor.view.descriptive,
- eu.etaxonomy.taxeditor.editor.view.media
+ eu.etaxonomy.taxeditor.editor.view.media,
+ eu.etaxonomy.taxeditor.editor.view.uses
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.expressions,
id="eu.etaxonomy.taxeditor.editor.view.descriptive"
name="Descriptive"
restorable="true">
+ </view>
+ <view
+ allowMultiple="false"
+ class="eu.etaxonomy.taxeditor.editor.view.uses.UsesViewPart"
+ icon="icons/leaf.png"
+ id="eu.etaxonomy.taxeditor.editor.view.uses"
+ name="Uses"
+ restorable="true">
</view>
<view
allowMultiple="false"
style="push">
</command>
</menuContribution>
+
+
+
+
+ <menuContribution
+ locationURI="popup:eu.etaxonomy.taxeditor.editor.view.uses">
+ <command
+ commandId="eu.etaxonomy.taxeditor.use.commands.adduse"
+ label="New Use"
+ style="push">
+ </command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.use.createUseSummary"
+ label="New Use Summary"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <or>
+ <reference
+ definitionId="isDescription">
+ </reference>
+ <reference
+ definitionId="isDescriptionElement">
+ </reference>
+ <reference
+ definitionId="isFeatureNodeContainer">
+ </reference>
+ </or>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
+ label="New Use Record"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <or>
+ <reference
+ definitionId="isDescription">
+ </reference>
+ <reference
+ definitionId="isDescriptionElement">
+ </reference>
+ <reference
+ definitionId="isFeatureNodeContainer">
+ </reference>
+ </or>
+ </visibleWhen>
+ </command>
+ <separator
+ name="eu.etaxonomy.taxeditor.usesEditor.separator3"
+ visible="true">
+ </separator>
+ <separator
+ name="taxeditor-editor.separator1"
+ visible="true">
+ </separator>
+ <separator
+ name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator.afterNew"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.ui.edit.delete"
+ label="Delete"
+ style="push">
+ </command>
+ <separator
+ name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator.afterDelete"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.ui.file.save"
+ label="Save"
+ style="push">
+ </command>
+ </menuContribution>
+
+
+
+
+
<menuContribution
locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">
<command
</with>
</activeWhen>
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
+ commandId="org.eclipse.ui.edit.delete">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.view.uses">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
</extension>
<extension
name="Name Commands"
id="eu.etaxonomy.taxeditor.description.commands.moveDescriptionElements"
name="Move Description Elements">
</command>
+ <category
+ id="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
+ name="-- New Uses">
+ </category>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseHandler"
+ id="eu.etaxonomy.taxeditor.use.commands.adduse"
+ name="New Use">
+ </command>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseSummaryHandler"
+ id="eu.etaxonomy.taxeditor.editor.use.createUseSummary"
+ name="New Use Summary">
+ </command>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.editor.view.uses.command.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.view.uses.handler.CreateUseRecordHandler"
+ id="eu.etaxonomy.taxeditor.editor.use.createUseRecord"
+ name="New Use Record">
+ </command>
<category
id="eu.etaxonomy.taxeditor.editor.media.category"
name="-- Media">
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor;\r
+\r
+import java.net.URI;\r
+import java.net.URISyntaxException;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.ui.IMemento;\r
+\r
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
+import eu.etaxonomy.cdm.api.service.IFeatureTreeService;\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
+import eu.etaxonomy.cdm.model.common.MarkerType;\r
+import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
+import eu.etaxonomy.cdm.model.description.Feature;\r
+import eu.etaxonomy.cdm.model.description.FeatureNode;\r
+import eu.etaxonomy.cdm.model.description.FeatureTree;\r
+import eu.etaxonomy.cdm.model.description.Modifier;\r
+import eu.etaxonomy.cdm.model.description.State;\r
+import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.StoreUtil;\r
+\r
+/**\r
+ * The context listener will call this class when the uses view is being loaded.\r
+ * It checks if the uses view's necessary terms are present in the database. \r
+ * It will persist the terms that aren't present, using the CDMLib's services classes. \r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UseObjectManager extends ContextListenerAdapter{\r
+ @Override\r
+ public void contextRefresh(IProgressMonitor monitor) {\r
+ monitor.subTask("Refreshing the Uses View");\r
+ StoreUtil.warn(getClass(), "Refreshing Uses View warn");\r
+ setupNecessaryItems(monitor);\r
+ }\r
+ \r
+ \r
+ @Override\r
+ public void contextStart(IMemento memento, IProgressMonitor monitor) {\r
+ monitor.subTask("Starting the Uses View");\r
+ StoreUtil.warn(getClass(), "Starting Uses View warn");\r
+ setupNecessaryItems(monitor);\r
+ }\r
+ \r
+ private void setupNecessaryItems(IProgressMonitor monitor) {\r
+ MarkerType existingMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
+ TermVocabulary<State> stateVocabulary = (TermVocabulary<State>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidUseCategoryVocabulary);\r
+ Feature featureUseRecord = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);\r
+ Feature featureUseSummary = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
+ TermVocabulary<Modifier> countryVocabulary = (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidCountryVocabulary);\r
+ TermVocabulary<Modifier> plantPartVocabulary = (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidPlantPartVocabulary);\r
+ TermVocabulary<Modifier> humanGroupVocabulary = (TermVocabulary<Modifier>) CdmStore.getService(IVocabularyService.class).find(UsageTermCollection.uuidHumanGroupVocabulary);\r
+ \r
+ ConversationHolder conversation = CdmStore.createConversation();\r
+ if (existingMarkertype == null) {\r
+ existingMarkertype = MarkerType.NewInstance(UsageTermCollection.useMakerLabel, UsageTermCollection.useMakerLabel, null);\r
+ existingMarkertype.setUuid( UsageTermCollection.uuidUseMarkerType);\r
+ TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidMarkersVocabulary));\r
+ markerTypeVocabulary.addTerm(existingMarkertype);\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(markerTypeVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ if (stateVocabulary == null) {\r
+ monitor.subTask("stateVocabulary empty");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+ stateVocabulary = TermVocabulary.NewInstance(UsageTermCollection.useCategoryVocabularyLabel, UsageTermCollection.useCategoryVocabularyLabel, null, termSourceUri);\r
+ stateVocabulary.setUuid(UsageTermCollection.uuidUseCategoryVocabulary);\r
+ State newDummyState = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyState.setUuid(UsageTermCollection.uuidUseCategoryDummy);\r
+ State newDummySubCat = State.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummySubCat.setUuid(UsageTermCollection.uuidUseSubCategoryDummy);\r
+ newDummyState.addIncludes(newDummySubCat);\r
+ stateVocabulary.addTerm(newDummyState);\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(stateVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ if (countryVocabulary == null) {\r
+ monitor.subTask("countryVocabulary empty");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+ countryVocabulary = TermVocabulary.NewInstance(UsageTermCollection.countryLabel, UsageTermCollection.countryLabel, null, termSourceUri);\r
+ countryVocabulary.setUuid(UsageTermCollection.uuidCountryVocabulary);\r
+ Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyModifier.setUuid(UsageTermCollection.uuidCountryDummy);\r
+ countryVocabulary.addTerm(newDummyModifier);\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(countryVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ if (plantPartVocabulary == null) {\r
+ monitor.subTask("plantPartVocabulary empty");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+ plantPartVocabulary = TermVocabulary.NewInstance(UsageTermCollection.plantPartLabel, UsageTermCollection.plantPartLabel, null, termSourceUri);\r
+ plantPartVocabulary.setUuid(UsageTermCollection.uuidPlantPartVocabulary);\r
+ Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyModifier.setUuid(UsageTermCollection.uuidPlantPartDummy);\r
+ plantPartVocabulary.addTerm(newDummyModifier);\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(plantPartVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ if (humanGroupVocabulary == null) {\r
+ monitor.subTask("humanGroupVocabulary empty");\r
+ URI termSourceUri = null;\r
+ try {\r
+ termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");\r
+ } catch (URISyntaxException e) {\r
+ e.printStackTrace();\r
+ }\r
+ humanGroupVocabulary = TermVocabulary.NewInstance(UsageTermCollection.humanGroupLabel, UsageTermCollection.humanGroupLabel, null, termSourceUri);\r
+ humanGroupVocabulary.setUuid(UsageTermCollection.uuidHumanGroupVocabulary);\r
+ Modifier newDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newDummyModifier.setUuid(UsageTermCollection.uuidHumanGroupDummy);\r
+ Modifier newSubDummyModifier = Modifier.NewInstance(UsageTermCollection.notAvailableLabel, UsageTermCollection.notAvailableLabel, null);\r
+ newSubDummyModifier.setUuid(UsageTermCollection.uuidEthnicGroupDummy);\r
+ newDummyModifier.addIncludes(newSubDummyModifier);\r
+ humanGroupVocabulary.addTerm(newDummyModifier);\r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(humanGroupVocabulary);\r
+ conversation.commit(true);\r
+ }\r
+ \r
+ if(featureUseRecord == null|| featureUseSummary == null) {\r
+ TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)CdmStore.getService(IVocabularyService.class).find((UsageTermCollection.uuidFeatureVocabulary));\r
+ FeatureTree palmWebFeatureTree = CdmStore.getService(IFeatureTreeService.class).find(UsageTermCollection.uuidPalmWebFeatureTree);\r
+ \r
+ if (featureUseRecord == null ) {\r
+ featureUseRecord = Feature.NewInstance(UsageTermCollection.useRecordFeatureLabel, UsageTermCollection.useRecordFeatureLabel, null);\r
+ featureUseRecord.setUuid(UsageTermCollection.uuidUseRecordFeature);\r
+ featureUseRecord.isSupportsCategoricalData();\r
+ featureUseRecord.setSupportsCategoricalData(true);\r
+ featureVocabulary.addTerm(featureUseRecord);\r
+ FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord);\r
+ palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);\r
+ }\r
+ if (featureUseSummary == null) {\r
+ featureUseSummary = Feature.NewInstance(UsageTermCollection.useSummaryFeatureLabel, UsageTermCollection.useSummaryFeatureLabel, null);\r
+ featureUseSummary.setUuid(UsageTermCollection.uuidUseSummaryFeature);\r
+ featureUseSummary.isSupportsTextData();\r
+ featureUseSummary.setSupportsTextData(true);\r
+ featureVocabulary.addTerm(featureUseSummary);\r
+ FeatureNode useSumFeatureNode = FeatureNode.NewInstance(featureUseSummary);\r
+ palmWebFeatureTree.getRoot().addChild(useSumFeatureNode);\r
+ }\r
+ \r
+ CdmStore.getService(IVocabularyService.class).saveOrUpdate(featureVocabulary);\r
+ CdmStore.getService(IFeatureTreeService.class).saveOrUpdate(palmWebFeatureTree);\r
+ conversation.commit(true);\r
+ \r
+ }\r
+ conversation.close(); \r
+ }\r
+}\r
import org.osgi.framework.BundleContext;
import eu.etaxonomy.taxeditor.editor.EditorStateManager;
+import eu.etaxonomy.taxeditor.editor.UseObjectManager;
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
super.start(context);
EditorStateManager stateManager = new EditorStateManager();
+ UseObjectManager useManager = new UseObjectManager();
CdmStore.getContextManager().addContextListener(stateManager);
+ CdmStore.getContextManager().addContextListener(useManager);
plugin = this;
logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
/**
* @param viewer
*/
- protected DescriptionElementDropAdapter(Viewer viewer) {
+ public DescriptionElementDropAdapter(Viewer viewer) {
super(viewer);
}
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.FeatureTree;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.TermStore;
/**
*/
public class DescriptiveContentProvider implements ITreeContentProvider {
- private static final Object[] NO_CHILDREN = new Object[0];
- private Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache;
+ protected static final Object[] NO_CHILDREN = new Object[0];
+ protected Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache;
/**
* <p>Constructor for DescriptiveContentProvider.</p>
* @param parentElement
* @return
*/
- private List<DescriptionBase> getDescriptions(TaxonEditorInput parentElement) {
+ protected List<DescriptionBase> getDescriptions(TaxonEditorInput parentElement) {
Taxon taxon = parentElement.getTaxon();
List<DescriptionBase> descriptions = new ArrayList<DescriptionBase>();
for(DescriptionBase description : taxon.getDescriptions()){
if(! description.isImageGallery()){
- descriptions.add(description);
+ MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
+ Set<Marker> descriptionMarkers = description.getMarkers();
+ if(descriptionMarkers != null && !descriptionMarkers.isEmpty()) {
+ for (Marker marker: descriptionMarkers) {
+ if(!(marker.getMarkerType().equals(useMarkertype))) {
+ descriptions.add(description);
+ }
+ }
+ }
+ else {
+ descriptions.add(description);
+ }
}
+
}
return descriptions;
}
/**
- *
- */
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* 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.editor.view.descriptive;
import org.eclipse.jface.viewers.ColumnLabelProvider;
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive";
- private TreeViewer viewer;
+ protected TreeViewer viewer;
- private Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache = new HashMap<TaxonDescription, FeatureNodeContainerTree>();
+ protected Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache = new HashMap<TaxonDescription, FeatureNodeContainerTree>();
- private ToggleDescriptionAction showAllElementsAction;
+ protected ToggleDescriptionAction showAllElementsAction;
- private ToggleDescriptionAction hideAllElementsAction;
+ protected ToggleDescriptionAction hideAllElementsAction;
- private int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
+ protected int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
/** {@inheritDoc} */
@Override
public void createViewer(Composite parent) {
-
viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL | SWT.FULL_SELECTION));
-
viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));
viewer.setLabelProvider(new DescriptiveLabelProvider());
-
viewer.setSorter(new DescriptiveViewerSorter());
-
viewer.setAutoExpandLevel(2);
-
-
Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(
this));
return super.getInitialSelection();
}
- private void createToolbar() {
+ protected void createToolbar() {
IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
toolBarManager.add(showAllElementsAction);
toolBarManager.add(hideAllElementsAction);
/*
* TODO add to the views menu
*/
- private void createMenu(){
+ protected void createMenu(){
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
* @created May 28, 2010
* @version 1.0
*/
- private class ToggleDescriptionAction extends Action{
+ protected class ToggleDescriptionAction extends Action{
private boolean expanded;
public ToggleDescriptionAction(boolean expand){
}
if (description != null) {
-
- Feature feature = (Feature) ((Event) event.getTrigger()).data;
-
AbstractPostOperation operation = null;
try {
// TODO use undo context specific to editor
- operation = new CreateDescriptionElementOperation(event
- .getCommand().getName(),
- EditorUtil.getUndoContext(), taxon,
- description, feature, postOperationEnabled);
+ operation = operationCreationInstance(event.getCommand().getName(), event, taxon, description, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
EditorUtil.warn(getClass(), "Command name not set");
return null;
}
+
+ /**
+ * Added to make the Class more generic and limit the amount of code changes required
+ * @param label
+ * @param event
+ * @param taxon
+ * @param description
+ * @param postOperationEnabled
+ * @return
+ */
+ protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, Taxon taxon, TaxonDescription description, IPostOperationEnabled postOperationEnabled) {
+ Feature feature = (Feature) ((Event) event.getTrigger()).data;
+ return new CreateDescriptionElementOperation(label,
+ EditorUtil.getUndoContext(), taxon,
+ description, feature, postOperationEnabled);
+ }
+
}
// $Id$
/**
-* Copyright (C) 2007 EDIT
+* Copyright (C) 2011 EDIT
* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
*
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.taxeditor.editor.view.descriptive.handler;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
Taxon taxon = ((TaxonEditorInput) input).getTaxon();
AbstractPostOperation operation;
try {
- // TODO use undo context specific to editor
- operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
- EditorUtil.getUndoContext(), taxon, postOperationEnabled);
+
+ operation = createOperationInstance(event.getCommand().getName(), taxon, postOperationEnabled);
EditorUtil.executeOperation(operation);
} catch (NotDefinedException e) {
EditorUtil.warn(getClass(), "Command name not set.");
}
return null;
}
+
+ /**Comments for funtion createOperationInstance
+ * The function is used to make the specific object creation more generic
+ * @param eventLabel
+ * @param taxon
+ * @param postOperationEnabled
+ * @return
+ */
+ protected AbstractPostOperation createOperationInstance(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {
+ // TODO use undo context specific to editor
+ return new CreateTaxonDescriptionOperation(eventLabel, EditorUtil.getUndoContext(), taxon, postOperationEnabled);
+ }
+
}
--- /dev/null
+/**\r
+ * Copyright (C) 2011 EDIT\r
+ * European Distributed Institute of Taxonomy \r
+ * http://www.e-taxonomy.eu\r
+ * \r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+package eu.etaxonomy.taxeditor.editor.view.uses;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.Set;\r
+\r
+import org.eclipse.jface.viewers.ITreeContentProvider;\r
+import org.eclipse.jface.viewers.Viewer;\r
+\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.model.common.Marker;\r
+import eu.etaxonomy.cdm.model.common.MarkerType;\r
+import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
+import eu.etaxonomy.cdm.model.description.Feature;\r
+import eu.etaxonomy.cdm.model.description.FeatureTree;\r
+import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveContentProvider;\r
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;\r
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;\r
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.TermStore;\r
+\r
+/**\r
+ * The class provides the required content to the Uses View\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UsesContentProvider extends DescriptiveContentProvider implements ITreeContentProvider {\r
+\r
+ Set<MarkerType> markerTypes = new HashSet<MarkerType>();\r
+ \r
+ /**\r
+ * <p>Constructor for DescriptiveContentProvider.</p>\r
+ *\r
+ * @param featureNodeContainerCache a {@link java.util.Map} object.\r
+ */\r
+ public UsesContentProvider(Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache) {\r
+ super(featureNodeContainerCache);\r
+ this.featureNodeContainerCache = featureNodeContainerCache;\r
+ }\r
+\r
+ /**\r
+ * Get all descriptions associated with the given TaxonEditorInput\r
+ * \r
+ * @param parentElement\r
+ * @return\r
+ */\r
+ @Override\r
+ protected List<DescriptionBase> getDescriptions(TaxonEditorInput parentElement) {\r
+ this.markerTypes.addAll(CdmStore.getTermManager().getPreferredTerms(MarkerType.class));\r
+ Taxon taxon = parentElement.getTaxon();\r
+ List<DescriptionBase> descriptions = new ArrayList<DescriptionBase>();\r
+ \r
+ for(DescriptionBase description : taxon.getDescriptions()){\r
+ if(! description.isImageGallery()){\r
+ MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
+ Set<Marker> descriptionMarkers = description.getMarkers();\r
+ if(descriptionMarkers != null) {\r
+ for (Marker marker: descriptionMarkers) {\r
+ if(marker.getMarkerType().equals(useMarkertype)) {\r
+ descriptions.add(description);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ } \r
+ return descriptions;\r
+ }\r
+\r
+}\r
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.view.uses;\r
+\r
+import java.util.Arrays;\r
+import java.util.List;\r
+\r
+import org.eclipse.jface.viewers.ColumnLabelProvider;\r
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;\r
+import org.eclipse.jface.viewers.StyledString;\r
+\r
+import eu.etaxonomy.cdm.model.common.Language;\r
+import eu.etaxonomy.cdm.model.common.LanguageString;\r
+import eu.etaxonomy.cdm.model.description.CategoricalData;\r
+import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
+import eu.etaxonomy.cdm.model.description.Modifier;\r
+import eu.etaxonomy.cdm.model.description.StateData;\r
+import eu.etaxonomy.cdm.model.description.TextData;\r
+import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
+\r
+/**\r
+ * UsesLabelProvider Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UsesLabelProvider extends ColumnLabelProvider implements\r
+ IStyledLabelProvider {\r
+ \r
+ /** {@inheritDoc} */\r
+ public String getText(Object element) {\r
+ String text = "";\r
+\r
+ if (element instanceof DescriptionBase) {\r
+ text = ((DescriptionBase) element).getTitleCache();\r
+ if (text == null || text.length() == 0) {\r
+ text = "Use: No label provided";\r
+ }\r
+ else {\r
+ text = "Use: " + text;\r
+ }\r
+ }\r
+ else if (element instanceof CategoricalData) {\r
+ if (!((CategoricalData) element).getStates().isEmpty()) {\r
+ boolean isUseCategoryAbsent = true;\r
+ for (StateData statedata : ((CategoricalData) element).getStates()) {\r
+ if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useCategoryVocabularyLabel)) {\r
+ text = text + statedata.getState().getTitleCache() + ";";\r
+ isUseCategoryAbsent = false;\r
+ }\r
+ }\r
+ if(isUseCategoryAbsent) {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ \r
+ boolean isUseSubCategoryAbsent = true;\r
+ for (StateData statedata : ((CategoricalData) element).getStates()) {\r
+ if(statedata.getState() != null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) !=null && statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel)) {\r
+ text = text + statedata.getState().getTitleCache() + ";";\r
+ isUseSubCategoryAbsent = false;\r
+ }\r
+ }\r
+ if(isUseSubCategoryAbsent) {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ }\r
+ else {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";" + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ if (!((CategoricalData) element).getModifiers().isEmpty()) {\r
+ for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+ modifier.getPartOf();\r
+ modifier.getVocabulary();\r
+ }\r
+ \r
+ boolean isPlantPartAbsent = true;\r
+ for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+ if(GetVocabularyType(modifier, UsageTermCollection.plantPartLabel)) {\r
+ text = text + modifier.getTitleCache()+ ";";\r
+ isPlantPartAbsent = false;\r
+ }\r
+ \r
+ }\r
+ if (isPlantPartAbsent) {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ \r
+ boolean isHumanGroupAbsent = true;\r
+ for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+ if(GetVocabularyType(modifier, UsageTermCollection.humanGroupLabel)) {\r
+ text = text + modifier.getTitleCache()+ ";";\r
+ isHumanGroupAbsent = false;\r
+ }\r
+ }\r
+ if (isHumanGroupAbsent) {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ \r
+ boolean isEthnicGroupAbsent = true;\r
+ for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+ if(GetVocabularyType(modifier, UsageTermCollection.ethnicGroupLabel)) {\r
+ text = text + modifier.getTitleCache()+ ";";\r
+ isEthnicGroupAbsent = false;\r
+ }\r
+ }\r
+ if (isEthnicGroupAbsent) {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ \r
+ boolean isCountryAbsent = true;\r
+ for (Modifier modifier: ((CategoricalData) element).getModifiers()){\r
+ if(GetVocabularyType(modifier, UsageTermCollection.countryLabel)) {\r
+ text = text + modifier.getTitleCache()+ ";";\r
+ isCountryAbsent = false;\r
+ }\r
+ }\r
+ if (isCountryAbsent) {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ }\r
+ else {\r
+ text = text + UsageTermCollection.notAvailableLabel + ";" + UsageTermCollection.notAvailableLabel + ";" + UsageTermCollection.notAvailableLabel + ";" + UsageTermCollection.notAvailableLabel + ";";\r
+ }\r
+ \r
+ if (text == null || text.length() == 0) {\r
+ text = "No data provided";\r
+ }\r
+ else {\r
+ String[] textElements = text.split(";");\r
+ String dataportalString = textElements[0] + ";" + textElements[1] + ";" + textElements[5] + ";" + textElements[2] + ";" + textElements[3] + ";" + textElements[4] + ";" ; \r
+ \r
+ ((CategoricalData)element).putModifyingText(CdmStore.getDefaultLanguage(), dataportalString);\r
+ }\r
+ return text;\r
+ }\r
+ \r
+ else if (element instanceof TextData) {\r
+ List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});\r
+ LanguageString languageString = ((TextData) element).getPreferredLanguageString(languages);\r
+ text = languageString != null ? languageString.getText() : null;\r
+ if (text == null || text.length() == 0) {\r
+ text = "No data provided";\r
+ }\r
+ }\r
+ \r
+ else if (element instanceof FeatureNodeContainer){\r
+ text = ((FeatureNodeContainer)element).getFeature().getTitleCache();\r
+ }\r
+\r
+ return text;\r
+ }\r
+\r
+ /** Function dertmining which vocabulary is the term part of \r
+ * \r
+ * @param term\r
+ * @param vocabularyExpected\r
+ * @return\r
+ */\r
+ private boolean GetVocabularyType(Modifier term, String vocabularyExpected) {\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(vocabularyExpected))) {\r
+ return true;\r
+ }\r
+ else if ((term.getVocabulary() != null) && (term.getPartOf() == null) && (term.getVocabulary().getTitleCache().equals(vocabularyExpected))) {\r
+ return true;\r
+ }\r
+ else if ((vocabularyExpected.equals(UsageTermCollection.ethnicGroupLabel)) && (term.getVocabulary() == null) && ((term.getPartOf() != null))) {\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public StyledString getStyledText(Object element) {\r
+ return new StyledString(this.getText(element),\r
+ StyledString.QUALIFIER_STYLER);\r
+ }\r
+ \r
+ \r
+\r
+}\r
--- /dev/null
+/**\r
+ * Copyright (C) 2011 EDIT\r
+ * European Distributed Institute of Taxonomy \r
+ * http://www.e-taxonomy.eu\r
+ * \r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+package eu.etaxonomy.taxeditor.editor.view.uses;\r
+\r
+import org.eclipse.jface.viewers.TreeViewer;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.dnd.Transfer;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Tree;\r
+\r
+import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDragListener;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementDropAdapter;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptionElementTransfer;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;\r
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;\r
+import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;\r
+\r
+\r
+/**\r
+ * The Class create a speific Use View to keep the taxonomic view clean\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UsesViewPart extends DescriptiveViewPart implements IPartContentHasDetails, IPartContentHasSupplementalData {\r
+\r
+ /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.uses"</code> */\r
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.view.uses";\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public void createViewer(Composite parent) {\r
+ \r
+ viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL\r
+ | SWT.V_SCROLL | SWT.FULL_SELECTION));\r
+ viewer.setContentProvider(new UsesContentProvider(featureNodeContainerCache));\r
+ viewer.setLabelProvider(new UsesLabelProvider());\r
+ viewer.setAutoExpandLevel(2);\r
+ \r
+ \r
+ \r
+ Transfer[] transfers = new Transfer[] { DescriptionElementTransfer.getInstance() };\r
+ viewer.addDragSupport(dndOperations, transfers, new DescriptionElementDragListener(\r
+ this));\r
+ viewer.addDropSupport(dndOperations, transfers,\r
+ new DescriptionElementDropAdapter(viewer));\r
+ \r
+ // Propagate selection from viewer\r
+ getSite().setSelectionProvider(viewer);\r
+ \r
+ showAllElementsAction = new ToggleDescriptionAction(false); \r
+ hideAllElementsAction = new ToggleDescriptionAction(true);\r
+ \r
+ // Add context menu to tree\r
+ createMenu();\r
+ \r
+ createToolbar();\r
+\r
+ }\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public boolean postOperation(CdmBase objectAffectedByOperation) {\r
+ viewer.refresh();\r
+ return super.postOperation(objectAffectedByOperation);\r
+ }\r
+ \r
+\r
+\r
+}\r
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.view.uses.handler;\r
+\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionHandler;\r
+import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateTaxonUseOperation;\r
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+\r
+/**\r
+ * CreateUseHandler Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class CreateUseHandler extends CreateDescriptionHandler {\r
+\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected AbstractPostOperation createOperationInstance(String eventLabel, Taxon taxon, IPostOperationEnabled postOperationEnabled) {\r
+ return new CreateTaxonUseOperation(eventLabel, EditorUtil.getUndoContext(), taxon, postOperationEnabled);\r
+ }\r
+}\r
--- /dev/null
+/**
+ * Copyright (C) 2011 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * 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.editor.view.uses.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;
+import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseRecordOperation;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * CreateUseRecordHandler Class
+ * @author a.theys
+ * @created mar 13, 2012
+ * @version 1.0
+ */
+public class CreateUseRecordHandler extends CreateDescriptionElementHandler {
+ /** {@inheritDoc} */
+ @Override
+ protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, Taxon taxon, TaxonDescription description, IPostOperationEnabled postOperationEnabled) {
+ //Use Record Feature retrieval below
+ Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseRecordFeature);
+ feature.setSupportsCategoricalData(true);
+ return new CreateUseRecordOperation(label,
+ EditorUtil.getUndoContext(), taxon,
+ description, feature, postOperationEnabled);
+ }
+
+
+
+}
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.view.uses.handler;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.model.description.Feature;\r
+import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.handler.CreateDescriptionElementHandler;\r
+import eu.etaxonomy.taxeditor.editor.view.uses.operation.CreateUseSummaryOperation;\r
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+/**\r
+ * CreateUseSummaryHandler Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class CreateUseSummaryHandler extends CreateDescriptionElementHandler {\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected AbstractPostOperation operationCreationInstance(String label, ExecutionEvent event, Taxon taxon, TaxonDescription description, IPostOperationEnabled postOperationEnabled) {\r
+ //Use Record Feature retrieval below\r
+ Feature feature = (Feature) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseSummaryFeature);\r
+ feature.setSupportsTextData(true);\r
+ return new CreateUseSummaryOperation(label, EditorUtil.getUndoContext(), taxon, description, feature, postOperationEnabled);\r
+ }\r
+ \r
+}\r
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.view.uses.operation;\r
+\r
+import java.util.UUID;\r
+\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.core.runtime.IAdaptable;\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+\r
+import eu.etaxonomy.cdm.api.service.ITermService;\r
+import eu.etaxonomy.cdm.model.common.Marker;\r
+import eu.etaxonomy.cdm.model.common.MarkerType;\r
+import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+\r
+/**\r
+ * CreateTaxonUseOperation Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class CreateTaxonUseOperation extends CreateTaxonDescriptionOperation {\r
+ private TaxonDescription description;\r
+ private Marker marker;\r
+\r
+ /**\r
+ * <p>Constructor for CreateTaxonUseOperation.</p>\r
+ *\r
+ * @param label a {@link java.lang.String} object.\r
+ * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.\r
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.\r
+ * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.\r
+ */\r
+ public CreateTaxonUseOperation(String label, IUndoContext undoContext,\r
+ Taxon taxon, IPostOperationEnabled postOperationEnabled) {\r
+ this(label, undoContext, taxon, postOperationEnabled, false);\r
+ }\r
+\r
+ /**\r
+ * <p>Constructor for CreateTaxonUseOperation.</p>\r
+ *\r
+ * @param label a {@link java.lang.String} object.\r
+ * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.\r
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.\r
+ * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.\r
+ * @param isImageGallery a boolean.\r
+ */\r
+ public CreateTaxonUseOperation(String label, IUndoContext undoContext,\r
+ Taxon taxon, IPostOperationEnabled postOperationEnabled, boolean isImageGallery) {\r
+ super(label, undoContext, taxon, postOperationEnabled);\r
+ }\r
+ \r
+ /* (non-Javadoc)\r
+ * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)\r
+ */\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
+ throws ExecutionException {\r
+ \r
+ description = TaxonDescription.NewInstance(taxon);\r
+ monitor.worked(20);\r
+ MarkerType useMarkerType = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);\r
+ marker = Marker.NewInstance(useMarkerType, true);\r
+ description.addMarker(marker);\r
+ monitor.worked(40);\r
+\r
+ return postExecute(description);\r
+ }\r
+}\r
+\r
--- /dev/null
+/**
+* Copyright (C) 2011 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* 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.editor.view.uses.operation;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import eu.etaxonomy.cdm.model.description.CategoricalData;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.description.TextData;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+
+/**
+ * CreateUseRecordOperation Class
+ * @author a.theys
+ * @created mar 13, 2012
+ * @version 1.0
+ */
+public class CreateUseRecordOperation extends AbstractPostOperation {
+
+ /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.use."{trunked}</code> */
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.use.createUseRecord";
+ private TaxonDescription description;
+ private Feature feature;
+ private DescriptionElementBase element;
+
+ /**
+ * <p>Constructor for CreateUseRecordOperation.</p>
+ *
+ * @param label a {@link java.lang.String} object.
+ * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
+ * @param description a {@link eu.etaxonomy.cdm.model.description.TaxonDescription} object.
+ * @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object.
+ * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+ */
+ public CreateUseRecordOperation(String label, IUndoContext undoContext,
+ Taxon taxon, TaxonDescription description, Feature feature, IPostOperationEnabled postOperationEnabled) {
+ super(label, undoContext, taxon, postOperationEnabled);
+
+ this.description = description;
+ this.feature = feature;
+ }
+
+
+ /**
+ * <p>Constructor for CreateUseRecordOperation.</p>
+ *
+ * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
+ * @param description a {@link eu.etaxonomy.cdm.model.description.TaxonDescription} object.
+ * @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object.
+ * @param element a {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase} object.
+ * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
+ * @param label a {@link java.lang.String} object.
+ */
+ public CreateUseRecordOperation(String label,
+ IUndoContext undoContext, Taxon taxon,
+ TaxonDescription description, Feature feature,
+ DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {
+ this(label, undoContext, taxon, description, feature, postOperationEnabled);
+
+ this.element = element;
+ }
+
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ monitor.worked(20);
+ if (element == null) {
+ if(feature.isSupportsCategoricalData()){
+ element = CategoricalData.NewInstance();
+ }
+ else {
+ element = TextData.NewInstance();
+ }
+ }
+
+
+ element.setFeature(feature);
+ description.addElement(element);
+ monitor.worked(40);
+
+ return postExecute(element);
+ }
+
+ @Override
+ public IStatus redo(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+
+ description.addElement(element);
+
+ return postExecute(element);
+ }
+
+ @Override
+ public IStatus undo(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ description.removeElement(element);
+
+ return postExecute(null);
+ }
+}
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor.view.uses.operation;\r
+\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.core.commands.operations.IUndoContext;\r
+import org.eclipse.core.runtime.IAdaptable;\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.IStatus;\r
+\r
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
+import eu.etaxonomy.cdm.model.description.Feature;\r
+import eu.etaxonomy.cdm.model.description.TaxonDescription;\r
+import eu.etaxonomy.cdm.model.description.TextData;\r
+import eu.etaxonomy.cdm.model.taxon.Taxon;\r
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
+\r
+\r
+/**\r
+ * CreateUseSummaryOperation Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class CreateUseSummaryOperation extends AbstractPostOperation {\r
+ \r
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.use.createUseRecord";\r
+ \r
+ private TaxonDescription description;\r
+ private Feature feature;\r
+ private DescriptionElementBase element;\r
+\r
+ \r
+ /**\r
+ * <p>Constructor for CreateUseSummaryOperation.</p>\r
+ *\r
+ * @param label a {@link java.lang.String} object.\r
+ * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.\r
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.\r
+ * @param description a {@link eu.etaxonomy.cdm.model.description.TaxonDescription} object.\r
+ * @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object.\r
+ * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.\r
+ */\r
+ public CreateUseSummaryOperation(String label, IUndoContext undoContext,\r
+ Taxon taxon, TaxonDescription description, Feature feature, IPostOperationEnabled postOperationEnabled) {\r
+ super(label, undoContext, taxon, postOperationEnabled);\r
+ \r
+ this.description = description;\r
+ this.feature = feature;\r
+ }\r
+\r
+ /**\r
+ * <p>Constructor for CreateUseSummaryOperation.</p>\r
+ *\r
+ * @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.\r
+ * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.\r
+ * @param description a {@link eu.etaxonomy.cdm.model.description.TaxonDescription} object.\r
+ * @param feature a {@link eu.etaxonomy.cdm.model.description.Feature} object.\r
+ * @param element a {@link eu.etaxonomy.cdm.model.description.DescriptionElementBase} object.\r
+ * @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.\r
+ * @param label a {@link java.lang.String} object.\r
+ */\r
+ public CreateUseSummaryOperation(String label,\r
+ IUndoContext undoContext, Taxon taxon,\r
+ TaxonDescription description, Feature feature,\r
+ DescriptionElementBase element, IPostOperationEnabled postOperationEnabled) {\r
+ this(label, undoContext, taxon, description, feature, postOperationEnabled);\r
+ \r
+ this.element = element;\r
+ }\r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
+ throws ExecutionException {\r
+ monitor.worked(20);\r
+ if (element == null) {\r
+\r
+ element = TextData.NewInstance();\r
+ }\r
+\r
+ \r
+ element.setFeature(feature);\r
+ description.addElement(element);\r
+ monitor.worked(40);\r
+\r
+ return postExecute(element);\r
+ }\r
+\r
+ @Override\r
+ public IStatus redo(IProgressMonitor monitor, IAdaptable info)\r
+ throws ExecutionException {\r
+ \r
+ description.addElement(element);\r
+ \r
+ return postExecute(element);\r
+ }\r
+\r
+ @Override\r
+ public IStatus undo(IProgressMonitor monitor, IAdaptable info)\r
+ throws ExecutionException {\r
+ description.removeElement(element);\r
+ \r
+ return postExecute(null);\r
+ }\r
+}\r
eu.etaxonomy.cdm.database,
eu.etaxonomy.taxeditor.datasource,
eu.etaxonomy.taxeditor.datasource.wizard,
+ eu.etaxonomy.taxeditor.editor,
eu.etaxonomy.taxeditor.editor.definedterm,
eu.etaxonomy.taxeditor.featuretree,
eu.etaxonomy.taxeditor.handler,
id="eu.etaxonomy.taxeditor.view.detail"
name="Details"
restorable="true">
+ </view>
+ <view
+ class="eu.etaxonomy.taxeditor.view.userecords.UseRecordsViewPart"
+ icon="icons/leaf_detail.png"
+ id="eu.etaxonomy.taxeditor.view.userecords"
+ name="Use Records"
+ restorable="true">
</view>
</extension>
<extension
value="eu.etaxonomy.cdm.model.description.Feature">
</parameter>
</command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.store.openDefinedTermEditor"
+ label="Modifier"
+ style="push">
+ <parameter
+ name="eu.etaxonomy.taxeditor.store.openDefinedTermEditor.parameter"
+ value="eu.etaxonomy.cdm.model.description.Modifier">
+ </parameter>
+ </command>
</menu>
</menuContribution>
<menuContribution
--- /dev/null
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.editor;\r
+\r
+import java.util.UUID;\r
+\r
+public class UsageTermCollection {\r
+ public final static UUID uuidMarkersVocabulary = UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305");\r
+ \r
+ public final static UUID uuidUseMarkerType = UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039");\r
+ public final static String useMakerLabel = "use";\r
+ \r
+ public final static UUID uuidFeatureVocabulary = UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8");\r
+ public final static UUID uuidPalmWebFeatureTree = UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0");\r
+ \r
+ \r
+ public final static UUID uuidUseRecordFeature = UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599");\r
+ public final static String useRecordFeatureLabel = "Use Record";\r
+ \r
+ public final static UUID uuidUseSummaryFeature = UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279");\r
+ public final static String useSummaryFeatureLabel = "Use";\r
+ \r
+ public final static UUID uuidUseCategoryVocabulary = UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931");\r
+ public final static String useCategoryVocabularyLabel = "Use Category";\r
+ public final static String useSubCategoryVocabularyLabel = "Use SubCategory";\r
+ public final static UUID uuidUseCategoryDummy = UUID.fromString("983a7184-6a51-489e-aca1-f21fc4fdbae3");\r
+ public final static UUID uuidUseSubCategoryDummy = UUID.fromString("a8d80223-5c79-4063-8c6b-4dc8681e9c62");\r
+ \r
+ public final static UUID uuidCountryVocabulary = UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b");\r
+ public final static String countryLabel = "Country";\r
+ public final static UUID uuidCountryDummy = UUID.fromString("761dddee-bfa2-41f4-82df-3a19c71adee0");\r
+ \r
+ public final static UUID uuidPlantPartVocabulary = UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35");\r
+ public final static String plantPartLabel = "Plant Part";\r
+ public final static UUID uuidPlantPartDummy = UUID.fromString("30150a82-a12f-4278-96ad-7ce708efa082");\r
+ \r
+ public final static UUID uuidHumanGroupVocabulary = UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc");\r
+ public final static String humanGroupLabel = "Human Group";\r
+ public final static UUID uuidHumanGroupDummy = UUID.fromString("c4b63327-2548-429d-8d55-81fdba5900a5");\r
+ public final static UUID uuidEthnicGroupDummy = UUID.fromString("3ca851e5-d0d4-41cd-9066-f79e246c36c2");\r
+ \r
+ public final static String ethnicGroupLabel = "Ethnic Group";\r
+ \r
+ public final static String notAvailableLabel = "N/A";\r
+ \r
+ \r
+ \r
+ \r
+ \r
+ \r
+\r
+\r
+ \r
+ \r
+}\r
import eu.etaxonomy.cdm.model.common.ExtensionType;\r
import eu.etaxonomy.cdm.model.common.MarkerType;\r
import eu.etaxonomy.cdm.model.description.Feature;\r
+import eu.etaxonomy.cdm.model.description.Modifier;\r
import eu.etaxonomy.cdm.model.description.State;\r
import eu.etaxonomy.cdm.model.location.NamedArea;\r
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;\r
if (clazz == State.class){\r
return new StateEditorInput();\r
}\r
+ if (clazz == Modifier.class){\r
+ return new ModifierEditorInput();\r
+ }\r
\r
return null;\r
}\r
if (text == null || text.length() == 0) {
text = "No label provided";
}
+
return "Description: " + text;
}
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.UseRecordDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.NamedAreaDetailSection;
REFERENCED_ENTITY,
TERM_VOCABULARY,
NAMED_AREA,
- NAMED_AREA_LEVEL
+ NAMED_AREA_LEVEL,
+ USE_RECORD
}
public AbstractFormSection createDefinedTermDetailSection(Class definedTermClass,
section = new NamedAreaDetailSection(this, conversation, parentElement,
selectionProvider, style);
break;
+ case USE_RECORD:
+ section = new UseRecordDetailSection(this, conversation, parentElement,
+ selectionProvider, style);
+ break;
}
+
if (section == null) {
throw new RuntimeException(
case NAMED_AREA_LEVEL:
element = new DefinedTermDetailElement<NamedAreaLevel>(this, parentElement);
break;
+ case USE_RECORD:
+ //element = new UseRecordDetailElement(this, parentElement, style);
+ element = new UseRecordDetailElement(this, parentElement);
+ break;
}
if (element == null) {
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.ui.section.userecords;\r
+\r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+import java.util.ListIterator;\r
+import java.util.Map;\r
+import java.util.Set;\r
+import org.apache.log4j.Logger;\r
+import org.eclipse.swt.events.SelectionEvent;\r
+import org.eclipse.swt.events.SelectionListener;\r
+import eu.etaxonomy.cdm.model.common.Language;\r
+import eu.etaxonomy.cdm.model.common.LanguageString;\r
+import eu.etaxonomy.cdm.model.common.Marker;\r
+import eu.etaxonomy.cdm.model.description.CategoricalData;\r
+import eu.etaxonomy.cdm.model.description.Modifier;\r
+import eu.etaxonomy.cdm.model.description.State;\r
+import eu.etaxonomy.cdm.model.description.StateData;\r
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.store.TermStore;\r
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;\r
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;\r
+\r
+ \r
+/**\r
+ * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.\r
+ *\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UseRecordDetailElement extends\r
+ AbstractCdmDetailElement<CategoricalData> implements SelectionListener {\r
+\r
+ private static final Logger logger = Logger\r
+ .getLogger(UseRecordDetailElement.class);\r
+\r
+ private TermComboElement<State> combo_UseCategory;\r
+ private TermComboElement<State> combo_UseSubCategory;\r
+ private TermComboElement<Modifier> combo_PlantPart;\r
+ private TermComboElement<Modifier> combo_Country;\r
+ private TermComboElement<Modifier> combo_HumanGroup;\r
+ private TermComboElement<Modifier> combo_EthnicGroup;\r
+\r
+ public UseRecordDetailElement(CdmFormFactory formFactory,\r
+ ICdmFormElement formElement) {\r
+ super(formFactory, formElement);\r
+ }\r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected void createControls(ICdmFormElement formElement,\r
+ CategoricalData entity, int style) {\r
+\r
+ combo_UseCategory = formFactory.createTermComboElement(State.class, this, UsageTermCollection.useCategoryVocabularyLabel, null, style);\r
+ combo_UseCategory.addSelectionListener(this);\r
+ combo_UseSubCategory = formFactory.createTermComboElement(State.class, this, UsageTermCollection.useSubCategoryVocabularyLabel, null, style);\r
+ combo_PlantPart = formFactory.createTermComboElement(Modifier.class, this, UsageTermCollection.plantPartLabel, null, style);\r
+ combo_HumanGroup = formFactory.createTermComboElement(Modifier.class, this, UsageTermCollection.humanGroupLabel, null, style);\r
+ combo_HumanGroup.addSelectionListener(this);\r
+ combo_EthnicGroup = formFactory.createTermComboElement(Modifier.class, this, UsageTermCollection.ethnicGroupLabel, null, style);\r
+ combo_Country = formFactory.createTermComboElement(Modifier.class, this, UsageTermCollection.countryLabel, null, style);\r
+ \r
+\r
+ List<State> termsUseCategory = setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false));\r
+ combo_UseCategory.setTerms(termsUseCategory);\r
+ combo_UseCategory.setSelection(stateSelection(UsageTermCollection.useCategoryVocabularyLabel));\r
+ \r
+ List<State> termsSubCategory = setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false), combo_UseCategory.getSelection());\r
+ \r
+ if (termsSubCategory != null) {\r
+ combo_UseSubCategory.setTerms(termsSubCategory);\r
+ combo_UseSubCategory.setSelection(stateSelection(UsageTermCollection.useSubCategoryVocabularyLabel));\r
+ combo_UseSubCategory.setEnabled(true);\r
+ }\r
+ else {\r
+ combo_UseSubCategory.setEnabled(false);\r
+ }\r
+ \r
+ List<Modifier> plantPartsToAdd = setModifierComboTerms(TermStore.getTerms(Modifier.class, null, false), UsageTermCollection.plantPartLabel);\r
+ combo_PlantPart.setTerms(plantPartsToAdd);\r
+ combo_PlantPart.setSelection(modifierSelection(UsageTermCollection.plantPartLabel));\r
+ \r
+ List<Modifier> countriesToAdd = setModifierComboTerms(TermStore.getTerms(Modifier.class, null, false), UsageTermCollection.countryLabel);\r
+ combo_Country.setTerms(countriesToAdd);\r
+ combo_Country.setSelection(modifierSelection(UsageTermCollection.countryLabel));\r
+ \r
+ List<Modifier> humanGroupToAdd = setModifierComboTerms(TermStore.getTerms(Modifier.class, null, false), UsageTermCollection.humanGroupLabel);\r
+ combo_HumanGroup.setTerms(humanGroupToAdd);\r
+ combo_HumanGroup.setSelection(modifierSelection(UsageTermCollection.humanGroupLabel));\r
+ \r
+ List<Modifier> ethnicGroupToAdd = setEthnicGroupComboTerms(TermStore.getTerms(Modifier.class, null, false), combo_HumanGroup.getSelection());\r
+ if (ethnicGroupToAdd != null) {\r
+ combo_EthnicGroup.setTerms(ethnicGroupToAdd);\r
+ combo_EthnicGroup.setSelection(modifierSelection(UsageTermCollection.ethnicGroupLabel));\r
+ combo_EthnicGroup.setEnabled(true);\r
+ } else {\r
+ combo_EthnicGroup.setEnabled(false);\r
+ }\r
+\r
+ }\r
+\r
+ /**\r
+ * Returns the select modifier\r
+ * @param comboCategory\r
+ * @return\r
+ */\r
+ private Modifier modifierSelection(String comboCategory) {\r
+ if(!getEntity().getModifiers().isEmpty()) {\r
+ for (Modifier modifier : getEntity().getModifiers()) {\r
+ if(GetVocabularyType(modifier, comboCategory)) {\r
+ return modifier;\r
+ }\r
+ }\r
+ } else {\r
+ return null;\r
+ }\r
+ return null;\r
+ \r
+ }\r
+ \r
+ /**\r
+ * Returns the selected state\r
+ * @param comboCategory\r
+ * @return\r
+ */\r
+ private State stateSelection(String comboCategory) {\r
+ if (!getEntity().getStates().isEmpty()) {\r
+ for (StateData statedata : getEntity().getStates()) {\r
+ if (statedata.getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {\r
+ String testString = statedata.getModifyingText().get(CdmStore.getDefaultLanguage()).getText();\r
+ if(testString.equals(comboCategory)) {\r
+ if(statedata.getState() !=null) {\r
+ return statedata.getState();\r
+ }\r
+ }\r
+ } \r
+ }\r
+ }\r
+ else {\r
+ return null;\r
+ }\r
+ return null;\r
+ \r
+ }\r
+ \r
+ /**\r
+ * This function sets the combo terms (Besides EthnicGroup\r
+ * @param listOfTerms\r
+ * @param modType\r
+ * @return\r
+ */\r
+ private List<Modifier> setModifierComboTerms(List<Modifier> listOfTerms, String modType) {\r
+ List<Modifier> termsToAdd = new ArrayList<Modifier>();\r
+ for (Modifier term : listOfTerms) {\r
+\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(modType))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ else if ((term.getVocabulary() != null) && (term.getPartOf() == null) && (term.getVocabulary().getTitleCache().equals(modType))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ }\r
+ \r
+ return termsToAdd;\r
+ }\r
+ \r
+\r
+ /**\r
+ * This function sets the Use Category combo term\r
+ * @param listOfTerms\r
+ * @return\r
+ */\r
+ private List<State> setUseCategoryComboTerms(List<State> listOfTerms) {\r
+ List<State> termsToAdd = new ArrayList<State>();\r
+ for (State term : listOfTerms) {\r
+\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(UsageTermCollection.useCategoryVocabularyLabel))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ else if ((term.getVocabulary() !=null) && (term.getPartOf() == null) && (term.getVocabulary().getTitleCache().equals(UsageTermCollection.useCategoryVocabularyLabel))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ }\r
+ return termsToAdd;\r
+\r
+ }\r
+\r
+ /**\r
+ * This function sets the Use SubCategory combo term\r
+ * @param listOfTerms\r
+ * @param selectedUseCategory\r
+ * @return\r
+ */\r
+ private List<State> setUseCategoryComboTerms(List<State> listOfTerms,\r
+ State selectedUseCategory) {\r
+ List<State> termsToAdd = new ArrayList<State>();\r
+ if (combo_UseCategory.getSelection() != null) {\r
+ \r
+ for (State term : listOfTerms) {\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(selectedUseCategory.getTitleCache()))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ else if ((term.getVocabulary() !=null) && (term.getVocabulary().getTitleCache().equals(selectedUseCategory.getTitleCache()))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ \r
+ }\r
+ }\r
+ else if (!getEntity().getStates().isEmpty()) {\r
+ for (StateData stateData : getEntity().getStates()) {\r
+ if (stateData.getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {\r
+ if ((stateData.getState() != null) && (stateData.getModifyingText().get(CdmStore.getDefaultLanguage()).getText() == UsageTermCollection.useCategoryVocabularyLabel)) {\r
+ for (State term : listOfTerms) {\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(stateData.getState().getTitleCache()))) {\r
+ termsToAdd.add(term);\r
+ } else if ((term.getVocabulary() != null) && (term.getVocabulary().getTitleCache().equals(stateData.getState().getTitleCache()))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+ }\r
+ \r
+ }\r
+ \r
+ else {\r
+ return null;\r
+ }\r
+\r
+ return termsToAdd;\r
+ }\r
+ \r
+ \r
+ /**\r
+ * This function sets the EthnicGroup combo term\r
+ * @param listOfTerms\r
+ * @param selectedHumangroup\r
+ * @return\r
+ */\r
+ private List<Modifier> setEthnicGroupComboTerms(List<Modifier> listOfTerms,\r
+ Modifier selectedHumangroup) {\r
+ List<Modifier> termsToAdd = new ArrayList<Modifier>();\r
+ if (combo_HumanGroup.getSelection() != null) {\r
+ for (Modifier term : listOfTerms) {\r
+ \r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(selectedHumangroup.getTitleCache()))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ else if ((term.getVocabulary() != null) && (term.getVocabulary().getTitleCache().equals(selectedHumangroup.getTitleCache()))) {\r
+ termsToAdd.add(term);\r
+ }\r
+ }\r
+ }\r
+ else if (!getEntity().getModifiers().isEmpty()) {\r
+ for (Modifier modifier : getEntity().getModifiers()) {\r
+ if (modifier.getMarkers() != null) {\r
+ for (Marker marker : modifier.getMarkers()) {\r
+ if(marker.getMarkerType().getTitleCache().equals(UsageTermCollection.humanGroupLabel)) {\r
+ for (Modifier term : listOfTerms) {\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(modifier.getTitleCache()))) {\r
+ termsToAdd.add(modifier);\r
+ } else if ((term.getVocabulary() != null) && (term.getVocabulary().getTitleCache().equals(modifier.getTitleCache()))) {\r
+ termsToAdd.add(modifier);\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ return null;\r
+ }\r
+ \r
+ return termsToAdd;\r
+ }\r
+\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public void handleEvent(Object eventSource) {\r
+ if (eventSource == combo_UseCategory) {\r
+ if (combo_UseCategory.getSelection() != null) {\r
+ boolean isChanged = false;\r
+ boolean isUseCategoryChanged = false;\r
+ if (!getEntity().getStates().isEmpty()) {\r
+ for (StateData useCategoryStateDataCheck : getEntity().getStates()) {\r
+ Map<Language, LanguageString> modText = useCategoryStateDataCheck.getModifyingText();\r
+ if(modText.get(CdmStore.getDefaultLanguage()) != null && modText.get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useCategoryVocabularyLabel)) {\r
+ if(!useCategoryStateDataCheck.getState().getTitleCache().equals(combo_UseCategory.getSelection().getTitleCache())) {\r
+ isUseCategoryChanged = true;\r
+ }\r
+ \r
+ }\r
+ }\r
+ ListIterator<StateData> itrExistingStates = getEntity().getStates().listIterator();\r
+ while(itrExistingStates.hasNext()) {\r
+ StateData existingStateData = itrExistingStates.next();\r
+ Map<Language, LanguageString> modifyingText = existingStateData\r
+ .getModifyingText();\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()) != null) {\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useCategoryVocabularyLabel)) {\r
+ isChanged = true;\r
+ if(!existingStateData.getState().getTitleCache().equals(combo_UseCategory.getSelection().getTitleCache())) {\r
+ itrExistingStates.remove();\r
+ StateData stateData = StateData.NewInstance(combo_UseCategory.getSelection());\r
+ stateData.setState(combo_UseCategory.getSelection());\r
+ stateData.putModifyingText(CdmStore.getDefaultLanguage(),UsageTermCollection.useCategoryVocabularyLabel);\r
+ itrExistingStates.add(stateData);\r
+ \r
+ }\r
+ } else if (modifyingText.get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel) && isUseCategoryChanged == true) {\r
+ itrExistingStates.remove();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ \r
+ if (isChanged == false) {\r
+ StateData stateData = StateData\r
+ .NewInstance(combo_UseCategory.getSelection());\r
+ stateData.setState(combo_UseCategory.getSelection());\r
+ stateData.putModifyingText(CdmStore.getDefaultLanguage(), UsageTermCollection.useCategoryVocabularyLabel);\r
+ getEntity().addState(stateData);\r
+ }\r
+ \r
+ combo_UseSubCategory.setEnabled(true);\r
+ \r
+ }\r
+ else {\r
+ if (!getEntity().getStates().isEmpty()) {\r
+ Iterator<StateData> itr = getEntity().getStates().iterator();\r
+ while(itr.hasNext()) {\r
+ StateData stateToRemove = itr.next();\r
+ itr.remove();\r
+ }\r
+ List<State> termsSubCategory = new ArrayList<State>();\r
+ State emptyState = State.NewInstance();\r
+ termsSubCategory.add(emptyState);\r
+ combo_UseSubCategory.setTerms(termsSubCategory);\r
+ combo_UseSubCategory.setEnabled(false);\r
+ }\r
+ }\r
+ }\r
+ \r
+ if (eventSource == combo_UseSubCategory) {\r
+ if (combo_UseSubCategory.getSelection() != null) {\r
+ boolean isChanged = false;\r
+ if (!getEntity().getStates().isEmpty()) {\r
+ ListIterator<StateData> itrExistingStates = getEntity().getStates().listIterator();\r
+ while(itrExistingStates.hasNext()) {\r
+ StateData existingStateData = itrExistingStates.next();\r
+ Map<Language, LanguageString> modifyingText = existingStateData\r
+ .getModifyingText();\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()) != null) {\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()).getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel)) {\r
+ isChanged = true;\r
+ if(!existingStateData.getState().getTitleCache().equals(combo_UseSubCategory.getSelection().getTitleCache())) {\r
+ itrExistingStates.remove();\r
+ StateData stateData = StateData.NewInstance(combo_UseSubCategory.getSelection());\r
+ stateData.setState(combo_UseSubCategory.getSelection());\r
+ stateData.putModifyingText(CdmStore.getDefaultLanguage(),UsageTermCollection.useSubCategoryVocabularyLabel);\r
+ itrExistingStates.add(stateData);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ if (isChanged == false){\r
+ StateData stateData = StateData\r
+ .NewInstance(combo_UseSubCategory.getSelection());\r
+ stateData.setState(combo_UseSubCategory.getSelection());\r
+ stateData.putModifyingText(CdmStore.getDefaultLanguage(), UsageTermCollection.useSubCategoryVocabularyLabel);\r
+ getEntity().addState(stateData);\r
+ }\r
+ \r
+ } else {\r
+ if (!getEntity().getStates().isEmpty()) {\r
+ Iterator<StateData> itrStateData = getEntity().getStates().iterator();\r
+ while(itrStateData.hasNext()) {\r
+ StateData existingStateData = itrStateData.next();\r
+ Map<Language, LanguageString> modifyingText = existingStateData\r
+ .getModifyingText();\r
+\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()) != null) {\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()).getText() == UsageTermCollection.useSubCategoryVocabularyLabel) {\r
+ itrStateData.remove();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (eventSource == combo_PlantPart) {\r
+ if (combo_PlantPart.getSelection() != null) {\r
+ Iterator<Modifier> itrExistingModifiers = getEntity().getModifiers().iterator();\r
+ while (itrExistingModifiers.hasNext()) {\r
+ Modifier modifier = itrExistingModifiers.next();\r
+ if(GetVocabularyType(modifier, UsageTermCollection.plantPartLabel)) {\r
+ itrExistingModifiers.remove();\r
+ }\r
+ \r
+ } \r
+ Modifier plantPart = combo_PlantPart.getSelection();\r
+ getEntity().addModifier(plantPart);\r
+ } else {\r
+ Set<Modifier> modifiers = getEntity().getModifiers();\r
+ if(!modifiers.isEmpty()) {\r
+ Iterator<Modifier> itr = modifiers.iterator();\r
+ while (itr.hasNext()) {\r
+ Modifier currentMod = itr.next();\r
+ if(GetVocabularyType(currentMod, UsageTermCollection.plantPartLabel)) {\r
+ itr.remove();\r
+ }\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+ if (eventSource == combo_Country) {\r
+ if (combo_Country.getSelection() != null) {\r
+ Iterator<Modifier> itrExistingModifiers = getEntity().getModifiers().iterator();\r
+ while (itrExistingModifiers.hasNext()) {\r
+ Modifier modifier = itrExistingModifiers.next();\r
+ if(GetVocabularyType(modifier, UsageTermCollection.countryLabel)) {\r
+ itrExistingModifiers.remove();\r
+ }\r
+ \r
+ }\r
+ Modifier country = combo_Country.getSelection();\r
+ getEntity().addModifier(country);\r
+ } else {\r
+ Set<Modifier> modifiers = getEntity().getModifiers();\r
+ if(!modifiers.isEmpty()) {\r
+ Iterator<Modifier> itr = modifiers.iterator();\r
+ while (itr.hasNext()) {\r
+ Modifier currentMod = itr.next();\r
+ if(GetVocabularyType(currentMod, UsageTermCollection.countryLabel)) {\r
+ itr.remove();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ if (eventSource == combo_HumanGroup) {\r
+ if (combo_HumanGroup.getSelection() != null) {\r
+ boolean isHumanGroupChanged = true;\r
+ for (Modifier modToCheck: getEntity().getModifiers()) {\r
+ if(modToCheck.equals(combo_HumanGroup.getSelection()) && (GetVocabularyType(modToCheck, UsageTermCollection.humanGroupLabel))) {\r
+ isHumanGroupChanged = false;\r
+ }\r
+ \r
+ \r
+ }\r
+ Iterator<Modifier> itrExistingModifiers = getEntity().getModifiers().iterator();\r
+ while (itrExistingModifiers.hasNext()) {\r
+ Modifier modifier = itrExistingModifiers.next();\r
+ if((GetVocabularyType(modifier, UsageTermCollection.humanGroupLabel) || GetVocabularyType(modifier, UsageTermCollection.ethnicGroupLabel)) && isHumanGroupChanged) {\r
+ itrExistingModifiers.remove();\r
+ }\r
+ \r
+ } \r
+ if(isHumanGroupChanged){\r
+ Modifier humanGroup = combo_HumanGroup.getSelection();\r
+ getEntity().addModifier(humanGroup);\r
+ }\r
+ combo_EthnicGroup.setEnabled(true);\r
+ } else {\r
+ Set<Modifier> modifiers = getEntity().getModifiers();\r
+ if(!modifiers.isEmpty()) {\r
+ Iterator<Modifier> itr = modifiers.iterator();\r
+ while (itr.hasNext()) {\r
+ Modifier currentMod = itr.next();\r
+ if(GetVocabularyType(currentMod, UsageTermCollection.humanGroupLabel) || GetVocabularyType(currentMod, UsageTermCollection.ethnicGroupLabel)) {\r
+ itr.remove();\r
+ }\r
+ }\r
+ }\r
+ List<Modifier> emptyListToResetComboBox = new ArrayList<Modifier>();\r
+ Modifier emptyMod = Modifier.NewInstance();\r
+ emptyListToResetComboBox.add(emptyMod);\r
+ combo_EthnicGroup.setTerms(emptyListToResetComboBox);\r
+ combo_EthnicGroup.setEnabled(false);\r
+ \r
+ }\r
+ }\r
+ if (eventSource == combo_EthnicGroup) {\r
+ if (combo_EthnicGroup.getSelection() != null) {\r
+ Iterator<Modifier> itrExistingModifiers = getEntity().getModifiers().iterator();\r
+ while (itrExistingModifiers.hasNext()) {\r
+ Modifier modifier = itrExistingModifiers.next();\r
+ if(GetVocabularyType(modifier, combo_HumanGroup.getSelection().getTitleCache())) {\r
+ itrExistingModifiers.remove();\r
+ }\r
+ \r
+ } \r
+ Modifier ethnicGroup = combo_EthnicGroup.getSelection();\r
+ getEntity().addModifier(ethnicGroup);\r
+ } else {\r
+ Set<Modifier> modifiers = getEntity().getModifiers();\r
+ if(!modifiers.isEmpty()) {\r
+ \r
+ Iterator<Modifier> itr = modifiers.iterator();\r
+ while (itr.hasNext()) {\r
+ Modifier currentMod = itr.next();\r
+ if(GetVocabularyType(currentMod, UsageTermCollection.ethnicGroupLabel)) {\r
+ itr.remove();\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ \r
+\r
+ /**\r
+ * This function Checks the vocabulary type\r
+ * @param term\r
+ * @param vocabularyExpected\r
+ * @return\r
+ */\r
+ private boolean GetVocabularyType(Modifier term, String vocabularyExpected) {\r
+ if ((term.getPartOf() != null) && (term.getPartOf().getTitleCache().equals(vocabularyExpected))) {\r
+ return true;\r
+ }\r
+ else if ((term.getVocabulary() != null) && (term.getPartOf()==null) && (term.getVocabulary().getTitleCache().equals(vocabularyExpected))) {\r
+ return true;\r
+ }\r
+ else if ((vocabularyExpected.equals(UsageTermCollection.ethnicGroupLabel)) && (term.getVocabulary() == null) && ((term.getPartOf() != null))) {\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
+ \r
+ \r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public void setEntity(CategoricalData entity) {\r
+ super.setEntity(entity);\r
+ }\r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public void widgetSelected(SelectionEvent e) {\r
+ Object eventSource = e.getSource();\r
+ for (Object object: combo_UseCategory.getControls()) {\r
+ if (object == eventSource) {\r
+ State selectedUseCategory = combo_UseCategory.getSelection();\r
+ if (selectedUseCategory != null) {\r
+ combo_UseSubCategory.setTerms(setUseCategoryComboTerms(TermStore.getTerms(State.class, null, false),selectedUseCategory));\r
+ \r
+ if (!getEntity().getStates().isEmpty()) {\r
+ Iterator<StateData> itrExistingState = getEntity().getStates().iterator();\r
+ while(itrExistingState.hasNext()) {\r
+ StateData existingStateData = (StateData) itrExistingState.next();\r
+ Map<Language, LanguageString> modifyingText = existingStateData.getModifyingText();\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage()) != null) {\r
+ if (modifyingText.get(CdmStore.getDefaultLanguage())\r
+ .getText().equals(UsageTermCollection.useSubCategoryVocabularyLabel)) {\r
+ combo_UseSubCategory.setSelection(stateSelection(UsageTermCollection.useSubCategoryVocabularyLabel));\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ for (Object object: combo_HumanGroup.getControls()) {\r
+ if (object == eventSource) {\r
+ Modifier selectedHumanGroup = combo_HumanGroup.getSelection();\r
+ if (selectedHumanGroup != null) {\r
+ combo_EthnicGroup.setTerms(setEthnicGroupComboTerms(TermStore.getTerms(Modifier.class, null, false), selectedHumanGroup));\r
+ if (!getEntity().getModifiers().isEmpty()) {\r
+ Iterator<Modifier> iterModifiers = getEntity().getModifiers().iterator();\r
+ while (iterModifiers.hasNext()) {\r
+ Modifier existingModifier = iterModifiers.next();\r
+ if(GetVocabularyType(existingModifier, UsageTermCollection.ethnicGroupLabel)) {\r
+ combo_EthnicGroup.setSelection(modifierSelection(UsageTermCollection.ethnicGroupLabel));\r
+ }\r
+ }\r
+ }\r
+ \r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public void widgetDefaultSelected(SelectionEvent e) {\r
+ // TODO Auto-generated method stub\r
+\r
+ }\r
+\r
+}\r
--- /dev/null
+/**\r
+* Copyright (C) 2011 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.ui.section.userecords;\r
+\r
+import org.eclipse.jface.viewers.ISelectionProvider;\r
+\r
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
+import eu.etaxonomy.taxeditor.store.CdmStore;\r
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;\r
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;\r
+\r
+/**\r
+ * UseRecordDetailSection Class\r
+ * @author a.theys \r
+ * @created mar 13, 2012\r
+ * @version 1.0\r
+ */\r
+public class UseRecordDetailSection extends AbstractCdmDetailSection<DescriptionElementBase> {\r
+ \r
+ /**Constructor for class UseRecordDetailSection\r
+ * \r
+ * @param cdmFormFactory\r
+ * @param conversation\r
+ * @param parentElement\r
+ * @param selectionProvider\r
+ * @param style\r
+ */\r
+ public UseRecordDetailSection(CdmFormFactory cdmFormFactory, ConversationHolder conversation,\r
+ ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {\r
+ super(cdmFormFactory, conversation, parentElement, selectionProvider, style);\r
+ }\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected DetailType getDetailType() {\r
+ return DetailType.USE_RECORD;\r
+ }\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ public String getHeading() {\r
+ return "Use Record";\r
+ }\r
+ \r
+ /** {@inheritDoc} */\r
+ @Override\r
+ protected void setSectionTitle() {\r
+ this.setText(getHeading() + ": " + getEntity().getFeature().getLabel(CdmStore.getDefaultLanguage()));\r
+ setTextClient(createToolbar());\r
+ }\r
+}\r
// $Id$
/**
- * Copyright (C) 2007 EDIT
+ * Copyright (C) 2011 EDIT
* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
*
package eu.etaxonomy.taxeditor.view.detail;
+import java.util.Set;
+
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
+import eu.etaxonomy.cdm.api.service.ITermService;
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
import eu.etaxonomy.cdm.model.common.TermVocabulary;
import eu.etaxonomy.cdm.model.common.User;
+import eu.etaxonomy.cdm.model.description.CategoricalData;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+
+import eu.etaxonomy.taxeditor.editor.UsageTermCollection;
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection;
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.userecords.UseRecordDetailSection;
import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailSection;
import eu.etaxonomy.taxeditor.view.AbstractCdmDataViewer;
import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
createTeamOrPersonBaseDetailSection(rootElement);
} else if (getInput() instanceof DescriptionBase) {
+ Set<Marker> descriptionMarkers = ((DescriptionBase) getInput()).getMarkers();
+ MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
+ Boolean isUseDescription = false;
+ for (Marker marker : descriptionMarkers) {
+ if (marker.getMarkerType().equals(useMarkertype)) {
+ isUseDescription = true;
+ }
+ }
if (((DescriptionBase) getInput()).isImageGallery()) {
createImageGallerySection(rootElement);
+ } else if (isUseDescription) {
+ createUseDescriptionSection(rootElement);
} else {
createDescriptionSection(rootElement);
}
} else if (getInput() instanceof DescriptionElementBase) {
- createDescriptionElementSection(rootElement);
+ Set<Marker> descriptionMarkers = ((DescriptionElementBase) getInput()).getInDescription().getMarkers();
+ MarkerType useMarkertype = (MarkerType) CdmStore.getService(ITermService.class).find(UsageTermCollection.uuidUseMarkerType);
+ Boolean isUseDescription = false;
+ for (Marker marker : descriptionMarkers) {
+ if (marker.getMarkerType().equals(useMarkertype)) {
+ isUseDescription = true;
+ }
+ }
+
+ if (isUseDescription == true && getInput() instanceof CategoricalData ) {
+ createUseRecordSection(rootElement);
+ }
+ else {
+ createDescriptionElementSection(rootElement);
+ }
} else if (getInput() instanceof Media) {
createMediaElementSection(rootElement);
layout();
}
+
/**
* @param rootElement
*/
fireSelectionChanged(selectionChangedEvent);
}
+ /**
+ * createTaxonSections(RootElement parent)
+ * @param parent
+ */
private void createTaxonSections(RootElement parent) {
destroySections();
addPart(parsingMessagesSection);
}
+ /**
+ * createNameSections
+ * @param parent
+ */
private void createNameSections(RootElement parent) {
destroySections();
NonViralNameDetailSection nonViralNameSection = (NonViralNameDetailSection) formFactory
addPart(nameRelationshipSection);
}
+ /**
+ * createReferenceSections
+ * @param parent
+ */
private void createReferenceSections(RootElement parent) {
destroySections();
addPart(referenceDetailSection);
}
+ /**
+ * createTeamOrPersonBaseDetailSection
+ * @param parent
+ */
private void createTeamOrPersonBaseDetailSection(RootElement parent) {
destroySections();
TeamOrPersonBaseDetailSection teamOrPersonBaseDetailSection = (TeamOrPersonBaseDetailSection) formFactory
addPart(teamOrPersonBaseDetailSection);
}
+ /**
+ * createTeamDetailSection
+ * @param parent
+ */
private void createTeamDetailSection(RootElement parent) {
destroySections();
TeamDetailSection teamDetailSection = (TeamDetailSection) formFactory
addPart(teamDetailSection);
}
-
+
+ /**
+ * createPersonDetailSection
+ * @param parent
+ */
private void createPersonDetailSection(RootElement parent) {
destroySections();
PersonDetailSection personDetailSection = (PersonDetailSection) formFactory
addPart(personDetailSection);
}
+ /**
+ * createDescriptionElementSection
+ * @param parent
+ */
private void createDescriptionElementSection(RootElement parent) {
destroySections();
addPart(descriptionElementMediaSection);
}
+ /**
+ * createDescriptionSection
+ * @param parent
+ */
private void createDescriptionSection(RootElement parent) {
destroySections();
DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
addPart(descriptionSourceSection);
addPart(scopeSection);
}
+
+ /**
+ * Creates the use Description section
+ * @param parent
+ */
+ private void createUseDescriptionSection(RootElement parent) {
+ destroySections();
+ DescriptionDetailSection descriptionDetailSection = (DescriptionDetailSection) formFactory
+ .createCdmDetailSection(DetailType.DESCRIPTION,
+ getConversationHolder(), parent, this, Section.TWISTIE
+ | Section.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ DescriptionSourceSection descriptionSourceSection = (DescriptionSourceSection) formFactory
+ .createEntityDetailSection(EntityDetailType.DESCRIPTIONSOURCE,
+ getConversationHolder(), parent, Section.TWISTIE
+ | Section.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ addPart(descriptionDetailSection);
+ addPart(descriptionSourceSection);
+
+ }
+
/**
* @param rootElement
addPart(descriptionDetailSection);
}
+
+ /**
+ * createMediaElementSection
+ * @param parent
+ */
private void createMediaElementSection(RootElement parent) {
destroySections();
addPart(mediaDetailSection);
}
+ /**
+ * createDerivedUnitBaseElementSection
+ * @param parent
+ */
private void createDerivedUnitBaseElementSection(RootElement parent) {
destroySections();
addPart(taxonomicScopeSection);
}
+ /**
+ * createPolytomousKeyNodeSection
+ * @param parent
+ */
private void createPolytomousKeyNodeSection(RootElement parent) {
destroySections();
addPart(polytomousKeyNodeDetailSection);
}
+
+ /**
+ * create the UseRecordSection
+ * @param parent
+ */
+ private void createUseRecordSection(RootElement parent) {
+ destroySections();
+
+ UseRecordDetailSection descriptionUseRecordSection = (UseRecordDetailSection) formFactory
+ .createCdmDetailSection(DetailType.USE_RECORD,
+ getConversationHolder(), parent, this, Section.TWISTIE
+ | Section.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ addPart(descriptionUseRecordSection);
+
+
+ }
+ /**
+ * createUserSection
+ * @param parent
+ */
private void createUserSection(RootElement parent) {
destroySections();
addPart(groupByUserDetailSection);
}
+ /**
+ * createTaxonRelationshipSection
+ * @param parent
+ */
private void createTaxonRelationshipSection(RootElement parent) {
destroySections();
addPart(termVocabularyDetailSection);
}
+ /**
+ * createDefinedTermSection
+ * @param parent
+ */
private void createDefinedTermSection(RootElement parent) {
destroySections();