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/group/authority/CdmAuthorityEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.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/handler/SaveAllHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodePropertyTester.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapterAssistant.java -text
+eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/dnd/TaxonNavigatorDragAdapterAssistant.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/CopyHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java -text
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/EditHandler.java -text
eu.etaxonomy.taxeditor.store/icons/newprj_wiz.gif -text
eu.etaxonomy.taxeditor.store/icons/nominval_nud_no_bg.gif -text
eu.etaxonomy.taxeditor.store/icons/open.gif -text
+eu.etaxonomy.taxeditor.store/icons/orphaned.gif -text
eu.etaxonomy.taxeditor.store/icons/orthovariant.gif -text
eu.etaxonomy.taxeditor.store/icons/orthovariant_no_bg.gif -text
eu.etaxonomy.taxeditor.store/icons/pic_not_found.PNG -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/dnd/CdmAuthorityTableDropTargetListener.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/dnd/transfer/TaxonNodeTransfer.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ISecuredEditor.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/ui/element/TimePeriodElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/ToggleableTextElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CRUDOperationChooser.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityComposite.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityCompositeViewer.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityRow.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grantedauthority/CdmAuthorityTableHeader.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/IOpenUrlEnabled.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlContentProvider.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/openurl/OpenUrlLabelProvider.java -text
import org.apache.log4j.Logger;
import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
+import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.GroupEditorInput;
/**
* <p>BulkEditorPropertyTester class.</p>
private static final Logger logger = Logger
.getLogger(BulkEditorPropertyTester.class);
+ private static final String GROUP = "isGroup";
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
BulkEditor bulkEditor = (BulkEditor) receiver;
+
if ("isMergingEnabled".equals(property)) {
IEditorInput input = bulkEditor.getEditorInput();
if (input instanceof AbstractBulkEditorInput) {
return ((AbstractBulkEditorInput) input).isMergingEnabled();
- }
+ }
+ }
+ if(GROUP.equals(property)){
+ return isGroup(bulkEditor);
}
// if (("isPublishFlagEditingEnabled").equals(property)) {
// IEditorInput input = bulkEditor.getEditorInput();
// }
return false;
}
+
+ private boolean isGroup(BulkEditor bulkEditor) {
+ IEditorInput input = bulkEditor.getEditorInput();
+ return (input instanceof GroupEditorInput) ? true : false;
+ }
}
-<?xml version="1.0" encoding="UTF-8"?>\r
-<classpath>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.7-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.7.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.3-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/poi-3.9.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/poi-3.9-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.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-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/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/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/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/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/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/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/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/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 exported="true" kind="lib" path="lib/spring-xml-1.5.6.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>\r
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT.jar"/>\r
- <classpathentry kind="output" path="bin"/>\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/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/spring-xml-1.5.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/identificationKeyAPI-1.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.1.4-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.1.4-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.1.4-SNAPSHOT-sources.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
id="eu.etaxonomy.taxeditor.editor.key.polytomous.list"
name="Polytomous Key List Editor">
</editor>
+ <editor
+ class="eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor"
+ default="false"
+ id="eu.etaxonomy.taxeditor.editor.group.authority"
+ name="Cdm Authority Editor">
+ </editor>
</extension>
<extension
point="org.eclipse.ui.views">
commandId="eu.etaxonomy.taxeditor.editor.name.changeAcceptedToSynonym"
label="Change Accepted Taxon to Synonym"
style="push">
- <visibleWhen
+ <!--visibleWhen
checkEnabled="true">
<reference
definitionId="isAcceptedAndHasNoHomotypicSynonyms">
</reference>
- </visibleWhen>
+ </visibleWhen-->
</command>
<menu
label="Change To">
style="push">
</command>
</menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:#BulkEditorContext?before=taxeditor-bulkeditor.separator1">
+ <command
+ commandId="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
+ label="Edit Authorities"
+ style="push">
+ <visibleWhen>
+ <reference
+ definitionId="isGroup">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
</extension>
<extension
point="org.eclipse.ui.handlers">
id="eu.etaxonomy.taxeditor.editor.view.concept.command.open"
name="Open Related Concept">
</command>
+ <category
+ id="eu.etaxonomy.taxeditor.bulkeditor.group.category"
+ name="-- Group">
+ </category>
+ <command
+ categoryId="eu.etaxonomy.taxeditor.bulkeditor.group.category"
+ defaultHandler="eu.etaxonomy.taxeditor.editor.group.authority.handler.EditCdmAuthoritiesHandler"
+ id="eu.etaxonomy.taxeditor.group.cdmauthorities.edit"
+ name="Edit CDM Authorities">
+ </command>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
</test>
</with>
</definition>
+ <definition
+ id="isGroup">
+ <with
+ variable="activeEditor">
+ <test
+ property="taxeditor-bulkeditor.propertyTester.isGroup">
+ </test>
+ </with>
+ </definition>
</extension>
<extension
point="org.eclipse.core.expressions.propertyTesters">
properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
+ <propertyTester
+ class="eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorPropertyTester"
+ id="taxeditor-bulkeditor.PropertyTester"
+ namespace="taxeditor-bulkeditor.propertyTester"
+ properties="isGroup"
+ type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
+ </propertyTester>
</extension>
<extension
point="org.eclipse.ui.bindings">
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.handlers.HandlerUtil;
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
throws PartInitException {
open(input, KeyEditor.ID);
}
+
+ public static void open(CdmAuthorityEditorInput input)
+ throws PartInitException {
+ open(input, CdmAuthorityEditor.ID);
+ }
/**
* Taxon Editors may be opened by supplying a taxon node uuid. Session gets
.NewInstance(polytomousKeyUuid);
open(input);
}
+
+ public static void openCdmAuthorities(UUID groupUuid)
+ throws Exception {
+ CdmAuthorityEditorInput input = CdmAuthorityEditorInput.NewInstance(groupUuid);
+ open(input);
+ }
}
TaxonEditorInput input = null;
TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid);
-
- if(taxonBase.isInstanceOf(Taxon.class)){
+ if(taxonBase.isOrphaned()) {
+ EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
+ }
+ else if(taxonBase.isInstanceOf(Taxon.class)){
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class);
if (taxon.isMisapplication()){
--- /dev/null
+/**
+* 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.group.authority;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.swt.layout.FillLayout;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityCompositeViewer;
+
+/**
+ * Editor responsible for editing authorities related to a particular {@link Group} entity.
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityEditor extends EditorPart implements IConversationEnabled, IDirtyMarkableSelectionProvider {
+
+ public static final String ID = "eu.etaxonomy.taxeditor.editor.group.authority"; //$NON-NLS-1$
+
+ private boolean dirty;
+ private ConversationHolder conversation;
+ private CdmAuthorityCompositeViewer viewer;
+
+ public CdmAuthorityEditor() {
+
+ }
+
+ /**
+ * Create contents of the editor part.
+ * @param parent
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NONE);
+ container.setLayout(new FillLayout(SWT.HORIZONTAL));
+
+ this.viewer = new CdmAuthorityCompositeViewer(container, this,((CdmAuthorityEditorInput) getEditorInput()).getGroup());
+
+ conversation = ((CdmAuthorityEditorInput) getEditorInput()).getConversationHolder();
+ setPartName(getEditorInput().getName());
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+ */
+ @Override
+ public void setFocus() {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ monitor.beginTask("Saving CDM Authority Editor", 1);
+ getConversationHolder().commit(true);
+ dirty = false;
+ firePropertyChange(PROP_DIRTY);
+ monitor.worked(1);
+ } finally {
+ monitor.done();
+ viewer.save();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+ */
+ @Override
+ public void doSaveAs() {
+ // Do the Save As operation
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input)
+ throws PartInitException {
+ setSite(site);
+ setInput(input);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+ */
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(java.lang.Object)
+ */
+ @Override
+ public void changed(Object element) {
+ //FIXME : should be optimised to split changes into adding / removing authorities
+ // vs updating authorites
+ dirty=true;
+ firePropertyChange(PROP_DIRTY);
+ // if the change has happened on the group then refresh the table
+ if(element instanceof Group) {
+
+ //FIXME: activating (setting focus) on the editor happens on every change
+ // This should be changed to only when the drop is successful
+ getSite().getPage().activate(this);
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+ */
+ @Override
+ public ConversationHolder getConversationHolder() {
+ return conversation;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
+ */
+ @Override
+ public void dispose() {
+ conversation.unregisterForDataStoreChanges(this);
+ conversation.close();
+ super.dispose();
+ }
+}
--- /dev/null
+/**
+* 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.group.authority;
+
+import java.util.UUID;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.api.service.IGroupService;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Editor input for the {@link CdmAuthorityEditor}.
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+public class CdmAuthorityEditorInput implements IEditorInput, IConversationEnabled {
+ private ConversationHolder conversation;
+ private Group group;
+
+ protected CdmAuthorityEditorInput(ConversationHolder conversation, Group group) {
+ this.conversation = conversation;
+ this.group = group;
+
+ }
+
+ /**
+ * Creates a new instance of the input for a given group.
+ *
+ * @param groupUuid
+ * @return
+ * @throws Exception
+ */
+ public static CdmAuthorityEditorInput NewInstance(UUID groupUuid) throws Exception{
+ ConversationHolder conversation = CdmStore.createConversation();
+ Group group = CdmStore.getService(IGroupService.class).load(groupUuid, null);
+ return new CdmAuthorityEditorInput(conversation, group);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == Group.class) {
+ return this.group;
+ }
+
+ return null;
+ }
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
+ */
+ @Override
+ public void update(CdmDataChangeMap changeEvents) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
+ */
+ @Override
+ public ConversationHolder getConversationHolder() {
+ return this.conversation;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ @Override
+ public boolean exists() {
+ return group != null;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ return group.getName();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ @Override
+ public IPersistableElement getPersistable() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ @Override
+ public String getToolTipText() {
+ return getName();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object object) {
+ if (object instanceof CdmAuthorityEditorInput
+ && getGroup() != null
+ && getGroup().equals(((CdmAuthorityEditorInput) object).getGroup())
+ ){
+ return true;
+ }
+ return super.equals(object);
+ }
+
+ /**
+ * Getter method for group member.
+ *
+ * @return
+ */
+ public Group getGroup() {
+ return this.group;
+ }
+}
--- /dev/null
+/**
+* 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.group.authority.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditor;
+import eu.etaxonomy.taxeditor.model.LineSelection;
+
+
+/**
+ * Handler which opens an instance of the {@link CdmAuthorityEditor} for a particluar group.
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+public class EditCdmAuthoritiesHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ BulkEditor editor = (BulkEditor) EditorUtil.getActiveEditor();
+
+ ISelection selection = editor.getSite().getSelectionProvider().getSelection();
+ if(selection instanceof LineSelection){
+
+ final LineSelection lineSelection = (LineSelection) selection;
+
+ Job job = new Job("Opening Cdm Authorities"){
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask("Opening Cdm Authorities", lineSelection.size());
+
+ for(final Object selectedObject : lineSelection.toArray()){
+ if(selectedObject instanceof Group){
+
+ Display.getDefault().asyncExec(new Runnable(){
+
+ @Override
+ public void run() {
+ try {
+ EditorUtil.openCdmAuthorities(((Group)selectedObject).getUuid());
+ } catch (Exception e) {
+ EditorUtil.warningDialog("Could not open CDM Authority Editor", EditorUtil.class, e.getMessage());
+ }
+ }
+
+ });
+ monitor.worked(1);
+ }
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
+ };
+
+ job.setPriority(Job.SHORT);
+ job.schedule();
+
+ }
+ return null;
+ }
+
+}
+
package eu.etaxonomy.taxeditor.editor.name.container;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
return enableFreetext;
}
+ /**
+ * Checks whether there are more than one, non-orphaned taxon bases
+ * attached to the taxon name
+ *
+ * @return
+ */
private boolean isNameUsedMultipleTimes() {
- if (getName().getTaxonBases().size() > 1) {
+
+ Set<TaxonBase> taxonBases = getName().getTaxonBases();
+ Iterator<TaxonBase> tbItr = taxonBases.iterator();
+ int nonOrphanedTaxonBaseCount = taxonBases.size();
+
+ while(tbItr.hasNext()) {
+ TaxonBase tb = tbItr.next();
+ if(tb.isOrphaned()) {
+ nonOrphanedTaxonBaseCount--;
+ }
+ }
+ if(nonOrphanedTaxonBaseCount > 1) {
return true;
}
return false;
// Choose new accepted taxon
List<UUID> excludeTaxa = new ArrayList<UUID>();
excludeTaxa.add(oldAcceptedTaxonNode.getUuid());
- TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), "Choose the accepted taxon", excludeTaxa, null, null);
+ TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
+ editor.getConversationHolder(),
+ "Choose the accepted taxon",
+ excludeTaxa,
+ null,
+ oldAcceptedTaxonNode.getClassification());
if (newAcceptedTaxonNode == null) {
return null;
newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, taxon, true, true, null, null);
} catch (HomotypicalGroupChangeException e) {
EditorUtil.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
+ return postExecute(null);
}
monitor.worked(20);
</property>
</options>
</viewer-->
+ <dragAssistant
+ class="eu.etaxonomy.taxeditor.navigation.navigator.dnd.TaxonNavigatorDragAdapterAssistant"
+ viewerId="eu.etaxonomy.taxeditor.navigation.navigator">
+ </dragAssistant>
</extension>
<extension
point="org.eclipse.ui.navigator.linkHelper">
--- /dev/null
+package eu.etaxonomy.taxeditor.navigation.navigator.dnd;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.ui.navigator.CommonDragAdapterAssistant;
+
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+
+public class TaxonNavigatorDragAdapterAssistant extends
+ CommonDragAdapterAssistant {
+
+ @Override
+ public Transfer[] getSupportedTransferTypes() {
+ return new Transfer[] { TaxonNodeTransfer.getInstance() };
+ }
+
+ @Override
+ public boolean setDragData(DragSourceEvent event,
+ IStructuredSelection selection) {
+ boolean setDataSuccess = false;
+ List<TaxonNode> taxonNodes = new ArrayList<TaxonNode>();
+ for (Object object : selection.toList()){
+ if(object instanceof TaxonNode){
+ taxonNodes.add(((TaxonNode) object));
+ setDataSuccess = true;
+ }
+
+ }
+ if (TaxonNodeTransfer.getInstance().isSupportedType(
+ event.dataType)) {
+ event.data = taxonNodes.toArray(new TaxonNode[taxonNodes.size()]);
+ }
+ return setDataSuccess;
+ }
+
+}
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
import eu.etaxonomy.cdm.model.taxon.Synonym;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.store.CdmStore;
/**
* <p>SearchResultLabelProvider class.</p>
// return ImageResources.getImage(ImageResources.MISAPPLIED_NAME_ICON);
// }else{
if(type == Taxon.class){
+ if(((UuidAndTitleCache) element).getIsOrphaned()) {
+ return ImageResources.getImage(ImageResources.ORPHANED_TAXON);
+ }
return ImageResources.getImage(ImageResources.BLACK_SQUARE_ICON);
}else if(type == Synonym.class){
return ImageResources.getImage(ImageResources.HETEROTYPIC_SYN_ICON);
eu.etaxonomy.cdm.database,
eu.etaxonomy.taxeditor.datasource,
eu.etaxonomy.taxeditor.datasource.wizard,
+ eu.etaxonomy.taxeditor.dnd.transfer,
eu.etaxonomy.taxeditor.editor,
eu.etaxonomy.taxeditor.editor.definedterm,
eu.etaxonomy.taxeditor.featuretree,
eu.etaxonomy.taxeditor.ui.dialog,
eu.etaxonomy.taxeditor.ui.dialog.selection,
eu.etaxonomy.taxeditor.ui.element,
+ eu.etaxonomy.taxeditor.ui.group.grantedauthority,
eu.etaxonomy.taxeditor.ui.section,
eu.etaxonomy.taxeditor.ui.section.agent,
eu.etaxonomy.taxeditor.ui.section.classification,
org.eclipse.jface.preference,
org.eclipse.jface.resource,
org.eclipse.jface.viewers,
+ org.eclipse.nebula.widgets.compositetable,
org.eclipse.swt,
org.eclipse.swt.graphics,
org.eclipse.swt.widgets,
--- /dev/null
+/**
+* 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.dnd;
+
+import java.awt.Cursor;
+import java.util.EnumSet;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityComposite;
+import eu.etaxonomy.taxeditor.ui.group.grantedauthority.CdmAuthorityCompositeViewer;
+
+/**
+ * Drop listener for the {@link CdmAuthorityComposite}.
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityTableDropTargetListener implements DropTargetListener {
+
+ private CdmAuthorityCompositeViewer viewer;
+
+
+ public CdmAuthorityTableDropTargetListener(CdmAuthorityCompositeViewer viewer) {
+ this.viewer = viewer;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ @Override
+ public void dragEnter(DropTargetEvent event) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragLeave(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ @Override
+ public void dragLeave(DropTargetEvent arg0) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ @Override
+ public void dragOperationChanged(DropTargetEvent arg0) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.DropTargetListener#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ @Override
+ public void dragOver(DropTargetEvent arg0) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ @Override
+ public void drop(DropTargetEvent dtevent) {
+ if(TaxonNodeTransfer.getInstance().isSupportedType(dtevent.currentDataType)) {
+ Object[] selectedCdmBases = (Object[])dtevent.data;
+
+ for (Object cdmBase : selectedCdmBases){
+ if(CdmBase.class.isAssignableFrom(cdmBase.getClass()) ) {
+ viewer.addCdmAuthority((CdmBase)cdmBase);
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.DropTargetListener#dropAccept(org.eclipse.swt.dnd.DropTargetEvent)
+ */
+ @Override
+ public void dropAccept(DropTargetEvent arg0) {
+ }
+
+}
--- /dev/null
+
+//$Id$
+/**
+* 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.dnd.transfer;
+
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.CdmObjectTransfer;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Drag / Drop Transfer object for Taxon Node
+ *
+ * @author c.mathew
+ * @created Mar 25, 2013
+ */
+public class TaxonNodeTransfer extends CdmObjectTransfer<TaxonNode> {
+
+ private static TaxonNodeTransfer instance = new TaxonNodeTransfer();
+ private static final String TYPE_NAME = "taxonNode-transfer-format";
+ private static final int TYPEID = registerType(TYPE_NAME);
+
+ public static synchronized TaxonNodeTransfer getInstance(){
+ return instance;
+ }
+
+ private TaxonNodeTransfer(){}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.Transfer#getTypeIds()
+ */
+ @Override
+ protected int[] getTypeIds() {
+ return new int[] { TYPEID };
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.dnd.Transfer#getTypeNames()
+ */
+ @Override
+ protected String[] getTypeNames() {
+ return new String[] { TYPE_NAME };
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.model.CdmObjectTransfer#loadElement(java.util.UUID)
+ */
+ @Override
+ public TaxonNode loadElement(UUID uuid) {
+ return CdmStore.getService(ITaxonNodeService.class).load(uuid, null);
+ }
+}
\ No newline at end of file
public static final String TWO_PRONGED_EQUAL = "2_pronged_equal";
/** Constant <code>MISAPPLIED_NAME="misapplied_name"</code> */
public static final String MISAPPLIED_NAME = "misapplied_name";
+ /** Constant <code>ORPHANED_TAXON="orphaned_taxon"</code> */
+ public static final String ORPHANED_TAXON = "orphaned_taxon";
/** Constant <code>EXPAND_ALL="expand_all"</code> */
public static final String EXPAND_ALL = "expand_all";
/** Constant <code>COLLAPSE_ALL="collapse_all"</code> */
registerImage(registry, TWO_PRONGED_EQUAL,
"2_pronged_equal_small.GIF");
registerImage(registry, MISAPPLIED_NAME,
- "ma_12x12.gif");
+ "ma_12x12.gif");
+ registerImage(registry, ORPHANED_TAXON,
+ "orphaned.gif");
registerImage(registry, EXPAND_ALL,
"expandAll.jpg");
registerImage(registry, COLLAPSE_ALL,
--- /dev/null
+/**
+* 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.ui.group.grantedauthority;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.RowLayout;
+
+import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+
+
+/**
+ * Widget for editing {@link Operation} objects, consisting of 4 checkboxes for CREATE, UPDATE, READ, DELETE operations.
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CRUDOperationChooser extends Composite {
+
+ private Button createCheckButton;
+ private Button readCheckButton;
+ private Button deleteCheckButton;
+ private Button updateCheckButton;
+
+ private CdmAuthorityRow caRow;
+ private GrantedAuthorityImpl grantedAuthorityI;
+ private CdmAuthority cdmAuthority;
+ private CdmAuthorityCompositeViewer viewer;
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public CRUDOperationChooser(final CdmAuthorityRow parent, int style) {
+ super(parent, style);
+ setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ RowLayout rowLayout = new RowLayout(SWT.HORIZONTAL);
+ rowLayout.justify = true;
+ setLayout(rowLayout);
+
+
+ this.caRow = parent;
+ createCheckButton = new Button(this, SWT.CHECK);
+ createCheckButton.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
+ createCheckButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent arg0) {
+ if(cdmAuthority.getOperation() != null) {
+ if(createCheckButton.getSelection()) {
+ cdmAuthority.getOperation().add(CRUD.CREATE);
+ } else {
+ cdmAuthority.getOperation().remove(CRUD.CREATE);
+ }
+ if(viewer != null) {
+ viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+ parent.setDirty(true);
+ }
+
+ }
+ }
+ });
+ createCheckButton.setText("C");
+
+ readCheckButton = new Button(this, SWT.CHECK);
+ readCheckButton.addMouseTrackListener(new MouseTrackAdapter() {
+ @Override
+ public void mouseHover(MouseEvent arg0) {
+ }
+ });
+ readCheckButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent arg0) {
+ if(cdmAuthority.getOperation() != null) {
+ if(readCheckButton.getSelection()) {
+ cdmAuthority.getOperation().add(CRUD.READ);
+ } else {
+ cdmAuthority.getOperation().remove(CRUD.READ);
+ }
+ if(viewer != null) {
+ viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+ parent.setDirty(true);
+ }
+
+ }
+
+ }
+ });
+ readCheckButton.setText("R");
+
+ deleteCheckButton = new Button(this, SWT.CHECK);
+ deleteCheckButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent arg0) {
+ if(cdmAuthority.getOperation() != null) {
+ if(deleteCheckButton.getSelection()) {
+ cdmAuthority.getOperation().add(CRUD.DELETE);
+ } else {
+ cdmAuthority.getOperation().remove(CRUD.DELETE);
+ }
+ if(viewer != null) {
+ viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+ parent.setDirty(true);
+ }
+
+ }
+ }
+ });
+ deleteCheckButton.setText("D");
+
+ updateCheckButton = new Button(this, SWT.CHECK);
+ updateCheckButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent arg0) {
+ if(cdmAuthority.getOperation() != null) {
+ if(updateCheckButton.getSelection()) {
+ cdmAuthority.getOperation().add(CRUD.UPDATE);
+ } else {
+ cdmAuthority.getOperation().remove(CRUD.UPDATE);
+ }
+ if(viewer != null) {
+ viewer.updateGrantedAuthority(grantedAuthorityI, cdmAuthority);
+ parent.setDirty(true);
+ }
+
+ }
+ }
+ });
+ updateCheckButton.setText("U");
+ updateView();
+ }
+
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ /**
+ * Set viewer, CDM Authority and corresponding GrantedAuthorityImpl object
+ *
+ * @param viewer
+ * @param grantedAuthorityI
+ * @param cdmAuthority
+ */
+ public void setAuthority(CdmAuthorityCompositeViewer viewer,
+ GrantedAuthorityImpl grantedAuthorityI,
+ CdmAuthority cdmAuthority) {
+ this.grantedAuthorityI = grantedAuthorityI;
+ this.cdmAuthority = cdmAuthority;
+ this.viewer = viewer;
+ updateView();
+ }
+
+
+
+ /**
+ * Update widget state.
+ */
+ private void updateView() {
+ createCheckButton.setSelection(false);
+ readCheckButton.setSelection(false);
+ deleteCheckButton.setSelection(false);
+ updateCheckButton.setSelection(false);
+
+
+ if(cdmAuthority!= null && cdmAuthority.getOperation() != null) {
+ if(cdmAuthority.getOperation().contains(CRUD.CREATE)) {
+ createCheckButton.setSelection(true);
+ }
+ if(cdmAuthority.getOperation().contains(CRUD.READ)) {
+ readCheckButton.setSelection(true);
+ }
+ if(cdmAuthority.getOperation().contains(CRUD.DELETE)) {
+ deleteCheckButton.setSelection(true);
+ }
+ if(cdmAuthority.getOperation().contains(CRUD.UPDATE)) {
+ updateCheckButton.setSelection(true);
+ }
+
+ }
+ }
+
+}
--- /dev/null
+/**
+* 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.ui.group.grantedauthority;
+
+import org.eclipse.nebula.widgets.compositetable.CompositeTable;
+import org.eclipse.nebula.widgets.compositetable.IRowContentProvider;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+
+import eu.etaxonomy.taxeditor.dnd.CdmAuthorityTableDropTargetListener;
+import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
+
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.layout.GridData;
+
+/**
+ * Composite class which consists of a {@link CompositeTable} built specifically
+ * for creating / editing CDM Authority objects
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+public class CdmAuthorityComposite extends Composite {
+
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+ private CompositeTable table;
+
+ private int numOfInitialCdmAuthorities;
+
+ private Label lblDragEntityInto;
+
+ private CdmAuthorityCompositeViewer viewer;
+
+
+ /**
+ * Creates the composite using the given parent, style and associated viewer.
+ *
+ * @param parent composite to use as parent of this composite
+ * @param style
+ * @param viewer viewer representing the model
+ */
+ public CdmAuthorityComposite(Composite parent, int style, final CdmAuthorityCompositeViewer viewer) {
+ super(parent, style);
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ toolkit.dispose();
+ }
+ });
+
+ this.viewer = viewer;
+
+ numOfInitialCdmAuthorities = viewer.getCdmAuthorities().size();
+ setLayout(new GridLayout(1, false));
+ Transfer[] transfers = new Transfer[] { TaxonNodeTransfer.getInstance() };
+
+ toolkit.adapt(this);
+ toolkit.paintBordersFor(this);
+
+ lblDragEntityInto = new Label(this, SWT.NONE);
+ toolkit.adapt(lblDragEntityInto, true, true);
+ lblDragEntityInto.setText("Drag Entity into table to add ...");
+ table = new CompositeTable(this, SWT.BORDER);
+ GridData gd_table = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_table.widthHint = 750;
+ gd_table.heightHint = 400;
+ table.setLayoutData(gd_table);
+ new CdmAuthorityTableHeader(table, SWT.NULL);
+ CdmAuthorityRow cdmAuthorityRow = new CdmAuthorityRow(table, SWT.NULL);
+
+ table.setRunTime(true);
+ table.setNumRowsInCollection(numOfInitialCdmAuthorities);
+ table.setLinesVisible(true);
+
+ DropTarget dropTarget = new DropTarget(table, DND.DROP_MOVE);
+ dropTarget.setTransfer(transfers);
+ dropTarget.addDropListener(new CdmAuthorityTableDropTargetListener(viewer));
+
+
+ table.addRowContentProvider(new IRowContentProvider() {
+ public void refresh(CompositeTable sender, int currentObjectOffset, Control rowControl) {
+ CdmAuthorityRow row = (CdmAuthorityRow) rowControl;
+ // add the newly created authority objects first and then the already existing ones.
+ // this ensures the newly 'dragged' in objects always remain at the top
+ if(currentObjectOffset < viewer.getNewCdmAuthorities().size()) {
+ row.setRowCdmAuthority(viewer,
+ viewer.getNewCdmAuthorities().get(currentObjectOffset),
+ true);
+ } else {
+ row.setRowCdmAuthority(viewer,
+ viewer.getCdmAuthorities().get(currentObjectOffset - viewer.getNewCdmAuthorities().size()),
+ false);
+ }
+ }
+ });
+ }
+
+ /**
+ * Refreshes the table with underlying data
+ */
+ public void refresh() {
+ numOfInitialCdmAuthorities = viewer.getNewCdmAuthorities().size() + viewer.getCdmAuthorities().size();
+ table.setNumRowsInCollection(numOfInitialCdmAuthorities);
+ table.refreshAllRows();
+ }
+}
--- /dev/null
+/**
+* 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.ui.group.grantedauthority;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.viewers.ContentViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.springframework.security.core.GrantedAuthority;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.common.Group;
+import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+
+
+
+/**
+ * Viewer class for the {@link CdmAuthorityComposite} used in the editing of CDM Authorities.
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+
+
+/**
+ * @author cmathew
+ * @date Apr 5, 2013
+ *
+ */
+
+//FIXME:move warning dialogs to the table class
+public class CdmAuthorityCompositeViewer extends ContentViewer {
+
+ private IDirtyMarkableSelectionProvider dirtyMarkerEditor;
+ private CdmAuthorityComposite cdmAuthorityComposite;
+ private Group group;
+ /**
+ * List which contains already existing authority objects.
+ */
+ private List<GrantedAuthorityImpl> cdmAuthorities;
+ /**
+ * List which contains newly added (unsaved) authority objects.
+ * Used to make sure that new authority objects are always added
+ * to the top of the table.
+ */
+ private List<GrantedAuthorityImpl> newCdmAuthorities;
+
+
+ /**
+ * Creates a viewer with a {@link CdmAuthorityComposite} table, {@link Group} object as input
+ *
+ * @param composite parent of generated {@link CdmAuthorityComposite}
+ * @param dirtyMarkerEditor provider to mark as dirty
+ * @param group input data object
+ */
+ public CdmAuthorityCompositeViewer(Composite composite,
+ IDirtyMarkableSelectionProvider dirtyMarkerEditor,
+ Group group) {
+ this.dirtyMarkerEditor = dirtyMarkerEditor;
+ this.group = group;
+ newCdmAuthorities = new ArrayList<GrantedAuthorityImpl>();
+ updateAuthorities();
+ this.cdmAuthorityComposite = new CdmAuthorityComposite(composite, SWT.NONE, this);
+ }
+
+ /**
+ * Gets the {@link CdmAuthorityComposite}
+ *
+ * @return {@link CdmAuthorityComposite} generated by this viewer
+ */
+ public CdmAuthorityComposite getCdmAuthorityComposite() {
+ return cdmAuthorityComposite;
+ }
+
+
+ /**
+ * Retrieves the {@link GrantedAuthorityImpl} objects of the group attached to this viewer
+ * creates a sub-list of only {@link CdmAuthority} objects.
+ *
+ * @return list of {@link CdmAuthority} objects belonging to the input group
+ */
+ public List<GrantedAuthorityImpl> updateAuthorities() {
+ // get all granted authorities
+ Set<GrantedAuthority> grantedAuthorities = group.getGrantedAuthorities();
+ cdmAuthorities = new ArrayList<GrantedAuthorityImpl>();
+
+ Iterator<GrantedAuthority> itr = grantedAuthorities.iterator();
+ while (itr.hasNext()) {
+ GrantedAuthority grantedAuthority = itr.next();
+ try {
+
+ if(grantedAuthority != null && grantedAuthority instanceof GrantedAuthorityImpl) {
+ // create a cdm authority from a granted authority
+ // this could fail in which case an exception is thrown
+ CdmAuthority cdmAuthority = CdmAuthority.fromGrantedAuthority(grantedAuthority);
+ cdmAuthorities.add((GrantedAuthorityImpl)grantedAuthority);
+ }
+ } catch (Exception e) {
+ // not a CdmAuthority
+ //e.printStackTrace();
+ }
+ }
+ return cdmAuthorities;
+ }
+
+ /**
+ * Adds a new {@link CdmAuthority} to the group attached to this viewer
+ * based on the input {@link CdmBase} object.
+ *
+ * @param cb {@link CdmBase} object used to construct the cdm authority
+ */
+ public void addCdmAuthority(CdmBase cb) {
+ // Default permission is to READ
+ EnumSet<CRUD> defaultOperation = EnumSet.noneOf(CRUD.class);
+ defaultOperation.add(CRUD.READ);
+ CdmAuthority cdma = new CdmAuthority(cb, defaultOperation, cb.getUuid());
+ GrantedAuthorityImpl gai;
+ try {
+ // create a granted authrity from a cdm authority
+ gai = cdma.asNewGrantedAuthority();
+ } catch (Exception e) {
+ StoreUtil.warningDialog("Parsing Error", this, "Could not parse authority string");
+ return;
+ }
+ //FIXME : this contains call will allow users to add authorities which differ only in CRUD operation choice.
+ // need to have a comparator which only checks permission class and uuid
+ if(cdmAuthorities.contains(gai)) {
+ StoreUtil.warningDialog("Duplicate CDM Authority", this, "Chosen CDM Authority is already attached to current group");
+ } else {
+ group.addGrantedAuthority(gai);
+ newCdmAuthorities.add(gai);
+ dirtyMarkerEditor.changed(group);
+ cdmAuthorityComposite.refresh();
+ }
+ }
+
+ /**
+ * Removes the given {@link GrantedAuthorityImpl} object from the list of
+ * granted authorities belonging to the group attached to this viewer.
+ *
+ * @param gai {@link GrantedAuthorityImpl} object to remove
+ */
+ public void removeCdmAuthority(GrantedAuthorityImpl gai) {
+ if(cdmAuthorities.contains(gai)) {
+ group.removeGrantedAuthority(gai);
+ newCdmAuthorities.remove(gai);
+ cdmAuthorities.remove(gai);
+ dirtyMarkerEditor.changed(group);
+ cdmAuthorityComposite.refresh();
+ } else {
+ StoreUtil.warningDialog("Unknown CDM Authority", this, "Chosen CDM Authority does not exist in current group");
+ }
+ }
+
+ /**
+ * Updates an existing {@link GrantedAuthorityImpl} object using a {@link CdmAuthority} object.
+ *
+ * @param grantedAuthorityI to update.
+ * @param cdmAuthority to use in updating the granted authority object.
+ */
+ public void updateGrantedAuthority(GrantedAuthorityImpl grantedAuthorityI, CdmAuthority cdmAuthority) {
+ if(grantedAuthorityI.getAuthority().equals(cdmAuthority.getAuthority())) {
+
+ } else {
+ try {
+ // since granted authority is just a wrapper object around a string
+ // we can't really 'update' the granted authority.
+ // so we first add the new authority (hope no exception) is thrown
+ // and then remove the old one.
+ group.addGrantedAuthority(cdmAuthority.asNewGrantedAuthority());
+ group.removeGrantedAuthority(grantedAuthorityI);
+ dirtyMarkerEditor.changed(grantedAuthorityI);
+ } catch(Exception e) {
+ // Not a CDM Authority
+ //e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * @return list of existing cdm authority objects
+ */
+ public List<GrantedAuthorityImpl> getCdmAuthorities() {
+ return cdmAuthorities;
+ }
+
+ /**
+ * @return list of newly added cdm authority objects
+ */
+ public List<GrantedAuthorityImpl> getNewCdmAuthorities() {
+ return newCdmAuthorities;
+ }
+
+
+ /**
+ * Empty the list of newly create autrity objects
+ */
+ public void clearNewCdmAuthorities() {
+ newCdmAuthorities.clear();
+ }
+
+
+ /**
+ *
+ *
+ */
+ public void save() {
+ clearNewCdmAuthorities();
+ refresh();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.Viewer#getControl()
+ */
+ @Override
+ public Control getControl() {
+ return cdmAuthorityComposite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.Viewer#getSelection()
+ */
+ @Override
+ public ISelection getSelection() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.Viewer#refresh()
+ */
+ @Override
+ public void refresh() {
+ updateAuthorities();
+ cdmAuthorityComposite.refresh();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
+ */
+ @Override
+ public void setSelection(ISelection selection, boolean reveal) {
+ // TODO Auto-generated method stub
+
+ }
+}
--- /dev/null
+/**
+* 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.ui.group.grantedauthority;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.layout.GridData;
+
+import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+
+
+/**
+ * Row widget for editing a single CDM Authority
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityRow extends Composite {
+
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+ private Label lblEntity;
+ private Label lblUuid;
+ private CRUDOperationChooser operationChooser;
+ private Button btnDelete;
+
+ private GrantedAuthorityImpl grantedAuthorityI;
+ private Label lblDirtyFlag;
+
+ private CdmAuthorityCompositeViewer cdmaModel;
+
+ /**
+ * Create the composite, made up of 5 elements :
+ * 1. '*' or depending on whether the row is being edited
+ * 2. Classname of entity (e.g. TAXONNODE)
+ * 3. Uuid of entity
+ * 4. CRUD operations edit widget (this is essentially 4 checkboxes to select the 4 possible operations)
+ * 5. Delete button (to delete the row)
+ *
+ * @param parent
+ * @param style
+ */
+ public CdmAuthorityRow(Composite parent, int style) {
+ super(parent, SWT.NONE);
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ toolkit.dispose();
+ }
+ });
+ toolkit.adapt(this);
+ toolkit.paintBordersFor(this);
+ setLayout(new GridLayout(5, false));
+
+
+
+ lblDirtyFlag = new Label(this, SWT.NONE);
+ lblDirtyFlag.setAlignment(SWT.CENTER);
+ GridData gd_lblDirtyFlag = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_lblDirtyFlag.widthHint = 15;
+ lblDirtyFlag.setLayoutData(gd_lblDirtyFlag);
+ toolkit.adapt(lblDirtyFlag, true, true);
+ lblDirtyFlag.setText("*");
+
+ lblEntity = new Label(this, SWT.BORDER);
+ GridData gd_lblEntity = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+ gd_lblEntity.heightHint = 30;
+ gd_lblEntity.widthHint = 200;
+ lblEntity.setLayoutData(gd_lblEntity);
+ lblEntity.setAlignment(SWT.CENTER);
+ toolkit.adapt(lblEntity, true, true);
+ lblEntity.setText("Entity");
+
+ lblUuid = new Label(this, SWT.BORDER);
+ GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+ gd_lblUuid.heightHint = 30;
+ gd_lblUuid.widthHint = 270;
+ lblUuid.setLayoutData(gd_lblUuid);
+ lblUuid.setAlignment(SWT.CENTER);
+ toolkit.adapt(lblUuid, true, true);
+ lblUuid.setText("Uuid");
+
+ operationChooser = new CRUDOperationChooser(this, SWT.BORDER);
+ operationChooser.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
+ toolkit.adapt(operationChooser);
+ toolkit.paintBordersFor(operationChooser);
+
+ btnDelete = new Button(this, SWT.NONE);
+
+ btnDelete.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
+ btnDelete.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
+ btnDelete.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseUp(MouseEvent arg0) {
+ if(cdmaModel != null) {
+ cdmaModel.removeCdmAuthority(grantedAuthorityI);
+ }
+ }
+ });
+
+ toolkit.adapt(btnDelete, true, true);
+
+ }
+
+ /**
+ * Sets the dirty flag for this row
+ *
+ * @param isDirty
+ */
+ public void setDirty(boolean isDirty) {
+ if(isDirty) {
+ lblDirtyFlag.setText("*");
+ } else {
+ lblDirtyFlag.setText(" ");
+ }
+ }
+
+ /**
+ * Create a {@link CdmAuthority} from a {@link GrantedAuthorityImpl} and create a row from it.
+ *
+ * @param cdmaModel
+ * @param grantedAuthorityI
+ * @param isDirty
+ */
+ public void setRowCdmAuthority(CdmAuthorityCompositeViewer cdmaModel, GrantedAuthorityImpl grantedAuthorityI, boolean isDirty) {
+ this.grantedAuthorityI = grantedAuthorityI;
+ this.cdmaModel = cdmaModel;
+
+ try {
+ CdmAuthority cdmAuthority = CdmAuthority.fromGrantedAuthority(grantedAuthorityI);
+
+ setDirty(isDirty);
+
+ String entityStr = (cdmAuthority.getPermissionClass() == null)?"":cdmAuthority.getPermissionClass().toString();
+ lblEntity.setText(entityStr);
+ String uuidStr = (cdmAuthority.getTargetUUID() == null)?"":cdmAuthority.getTargetUUID().toString();
+ lblUuid.setText(uuidStr);
+
+ operationChooser.setAuthority(cdmaModel, grantedAuthorityI, cdmAuthority);
+
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+}
--- /dev/null
+/**
+* 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.ui.group.grantedauthority;
+
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.custom.CLabel;
+
+/**
+ * Table header widget for {@link CdmAuthorityComposite}
+ *
+ * @author cmathew
+ * @created Mar 28, 2013
+ *
+ */
+public class CdmAuthorityTableHeader extends Composite {
+
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+
+ /**
+ * Create the composite, with 5 header fields.
+ *
+ * @param parent
+ * @param style
+ */
+ public CdmAuthorityTableHeader(Composite parent, int style) {
+ super(parent, SWT.NONE);
+ addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ toolkit.dispose();
+ }
+ });
+ toolkit.adapt(this);
+ toolkit.paintBordersFor(this);
+ setLayout(new GridLayout(4, false));
+
+ Label lblDirtyFlag = new Label(this, SWT.NONE);
+ GridData gd_lblDirtyFlag = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
+ gd_lblDirtyFlag.widthHint = 15;
+ lblDirtyFlag.setLayoutData(gd_lblDirtyFlag);
+
+ toolkit.adapt(lblDirtyFlag, true, true);
+
+ CLabel lblEntity = new CLabel(this, SWT.NONE);
+ lblEntity.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ lblEntity.setAlignment(SWT.CENTER);
+ GridData gd_lblEntity = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+ gd_lblEntity.widthHint = 200;
+ lblEntity.setLayoutData(gd_lblEntity);
+ toolkit.adapt(lblEntity);
+ toolkit.paintBordersFor(lblEntity);
+ lblEntity.setText("ENTITY");
+
+ CLabel lblUuid = new CLabel(this, SWT.NONE);
+ lblUuid.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ lblUuid.setAlignment(SWT.CENTER);
+ GridData gd_lblUuid = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+ gd_lblUuid.widthHint = 270;
+ lblUuid.setLayoutData(gd_lblUuid);
+ toolkit.adapt(lblUuid);
+ toolkit.paintBordersFor(lblUuid);
+ lblUuid.setText("UUID");
+
+ CLabel lblOperation = new CLabel(this, SWT.NONE);
+ lblOperation.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ lblOperation.setAlignment(SWT.CENTER);
+ GridData gd_lblOperation = new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1);
+ gd_lblOperation.widthHint = 150;
+ lblOperation.setLayoutData(gd_lblOperation);
+ toolkit.adapt(lblOperation);
+ toolkit.paintBordersFor(lblOperation);
+ lblOperation.setText("OPERATION");
+
+ }
+
+}