Merge branch 'develop' into LibrAlign
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 8 Sep 2015 14:00:45 +0000 (16:00 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 8 Sep 2015 14:00:45 +0000 (16:00 +0200)
43 files changed:
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/ConvertPerson2TeamHandler.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AgentEditorInput.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.editor.src/main/java/eu/etaxonomy/taxeditor/editor/name/container/RulerWithIcon.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java [moved from eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/SpecimenPropertyTester.java with 87% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientClassificationService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientOccurenceService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/DerivateViewContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/MoveDerivateOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
eu.etaxonomy.taxeditor.molecular/plugin.xml
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapter.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TreeNodeDropAdapterAssistant.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/MoveTaxonHandler.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/MoveTaxonOperation.java
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle_de.properties
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonNodeSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/ImageFileElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationPartElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchView.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java
eu.etaxonomy.taxeditor/rcp.target

index 720cd61578f40be821155fd125e1bf851df858f4..4c97dbfb51582f3a52d614059d26acf2f4b05d12 100644 (file)
@@ -42,6 +42,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+import eu.etaxonomy.taxeditor.bulkeditor.input.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
@@ -309,4 +310,9 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                menu.remove(ITextEditorActionConstants.SHIFT_LEFT);
                menu.remove(ITextEditorActionConstants.CONTEXT_PREFERENCES);
        }
+
+       @Override
+       public boolean canAttachMedia() {
+           return getEditorInput() instanceof TaxonEditorInput?true:false;
+       }
 }
index ee587aaa601eb440f9336f4fc9c8ec959bee1d50..a016571e2862abf02bffe9917525ea9a842af317 100644 (file)
@@ -46,9 +46,9 @@ public class ConvertPerson2TeamHandler extends AbstractHandler {
        @Override\r
        public Object execute(ExecutionEvent event) throws ExecutionException {\r
                ISelection selection = HandlerUtil.getCurrentSelection(event);\r
-               \r
+\r
                IEditorPart editor = HandlerUtil.getActiveEditor(event);\r
-               \r
+\r
                IEditorInput input = editor.getEditorInput();\r
                if (editor.isDirty()){\r
                        boolean proceed = MessageDialog.openQuestion(null,\r
@@ -60,17 +60,17 @@ public class ConvertPerson2TeamHandler extends AbstractHandler {
                        }\r
                }\r
                if((input instanceof IEntityPersistenceService) && (selection instanceof IStructuredSelection)){\r
-                       \r
-                       \r
+\r
+\r
                        IDocumentProvider provider = ((BulkEditor) editor).getDocumentProvider();\r
-                       LineAnnotationModel model = \r
+                       LineAnnotationModel model =\r
                                        (LineAnnotationModel) provider.getAnnotationModel(input);\r
-                       \r
-                       \r
+\r
+\r
                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;\r
-                       \r
+\r
                        IEntityPersistenceService persistenceService = (IEntityPersistenceService) input;\r
-               \r
+\r
                        Team team ;\r
                        for(Object object : structuredSelection.toList()){\r
                                LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);\r
@@ -82,12 +82,12 @@ public class ConvertPerson2TeamHandler extends AbstractHandler {
                                        } catch (IllegalArgumentException e) {\r
                                                MessagingUtils.errorDialog("Can not convert Person into a Team", null, e.getLocalizedMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID,e, true);\r
                                        } catch (MergeException e) {\r
-                                               MessagingUtils.errorDialog("Can not convert Person into a Team", null, e.getMessage(), TaxeditorBulkeditorPlugin.PLUGIN_ID,e, true);\r
+                                               MessagingUtils.informationDialog("Convert not possible", "Person can not be transformed into team as it is referenced in a way that does not allow converting");\r
                                        }\r
                                }else{\r
                                        MessagingUtils.informationDialog("Can not convert Person into a Team", "convert Person to Team can only be called on a person.");\r
                                }\r
-                               \r
+\r
                                if (team != null){\r
                                        ((BulkEditor) editor).removeAnnotatedLine(annotation);\r
                                        ((BulkEditor) editor).createAnnotatedLine(team);\r
index 36a7cc9bc78ea0695119e9c55e51114b4cf526d7..4c2dccc55e38157da4cff496d941179ebc5c4152 100644 (file)
@@ -82,7 +82,7 @@ public class AgentEditorInput extends AbstractBulkEditorInput<TeamOrPersonBase>
     public boolean merge(TeamOrPersonBase entity, TeamOrPersonBase mergeTarget) {
                if (entity instanceof IMergable) {
                        try {
-                               if(entity instanceof Person) {
+                               if(entity instanceof Person && mergeTarget instanceof Person) {
                                    IMergeStrategy strategy = DefaultMergeStrategy.NewInstance(Person.class);
                                    strategy.setMergeMode("institutionalMemberships", MergeMode.FIRST);
                                    CdmStore.getCommonService().merge(mergeTarget.getId(), entity.getId(), Person.class);
index ee3cd44efb078430a6d24fdee4cd1db9eb08a8a1..604f3874a6d788c0f879e2e7f6f6cf5d77648c06 100644 (file)
@@ -264,7 +264,7 @@ public class ReferencingObjectsView extends AbstractCdmViewPart{
                                }
                                showViewer();
                        }catch(Exception e){
-                               setContentDescription("Some Problems occured.");
+                               setContentDescription("The referencing objects view could not be loaded completely. Some Problems occured.");
                        }
 
                }
index 3962c23f1c5de34375a67cba740159cad84c22a5..5f958ce4af119eaecd27cb317134ea5e5d20692f 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.8.0-SNAPSHOT.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.8.0-SNAPSHOT.jar"/>
-       <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 kind="src" path="src/main/java"/>
-       <classpathentry kind="src" path="src/main/resources"/>
-       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.7.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.7.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/avro-1.6.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-anim-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-awt-util-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-bridge-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-css-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-dom-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-ext-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-extension-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-gvt-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-js-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-parser-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-script-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-svg-dom-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-svggen-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-transcoder-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.8.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-codec-20041127.091804.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.5.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/concurrent-1.3.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/doxia-core-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/doxia-logging-api-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/doxia-module-apt-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/doxia-module-xhtml-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/doxia-sink-api-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/easymock-3.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/easymockclassextension-2.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/ehcache-core-2.6.9.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/fop-1.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/guava-r05.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/h2-1.3.170.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hamcrest-core-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-c3p0-4.1.10.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-cglib-repack-2.1_3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-4.0.1.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-4.1.10.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-ehcache-4.1.10.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-entitymanager-4.1.10.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-4.1.10.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-4.2.0.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-analyzers-4.2.0.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-engine-4.2.0.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-orm-4.2.0.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.3.1.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/hsqldb-1.8.0.10.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/icu4j-2.6.1.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/itextpdf-5.4.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jackson-core-asl-1.8.8.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jackson-mapper-asl-1.8.8.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jakarta-regexp-1.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/javassist-3.17.1-GA.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.2.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.2-EA.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jaxb-xjc-2.2-EA.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jaxb1-impl-2.2-EA.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jboss-logging-3.1.3.GA.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jdbc4-2.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jdom-1.1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/joda-time-2.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.4-jdk15.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/junit-4.11.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/junit-benchmarks-0.5.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>
-       <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-analyzers-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-core-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-facet-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-grouping-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-highlighter-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-kuromoji-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-memory-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-misc-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-phonetic-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-queries-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-smartcn-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-spatial-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/lucene-stempel-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/mchange-commons-java-0.2.3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.1.24.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/objenesis-1.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/odfdom-java-0.8.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/ognl-2.6.9.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20110523.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.osgi.core-1.0.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.test-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/osgi-3.6.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/p6spy-1.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/paranamer-2.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/plexus-classworlds-1.2-alpha-9.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/plexus-container-default-1.0-alpha-30.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/plexus-utils-2.0.5.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.7.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/snappy-java-1.0.4.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/solr-analysis-extras-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/solr-core-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/solr-solrj-3.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-aop-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-beans-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-context-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-context-support-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-core-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-expression-3.2.2.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.1.3.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.1.3.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/stax-1.2.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/stax-api-1.0.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-core-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-database-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-dbmaintainer-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-dbunit-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-easymock-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-inject-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-mock-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-orm-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/unitils-spring-3.3.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/usertype.jodatime-2.0.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/usertype.spi-2.0.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/validation-api-1.0.0.GA.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xalan-2.6.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.11.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.0.b2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xml-apis-ext-1.3.04.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xml-resolver-1.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.5.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xmlParserAPIs-2.6.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xmlpull-1.1.3.1.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xmlunit-1.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xstream-1.4.4.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/yjp-controller-api-redist-9.0.8.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/h2mig_pagestore_addon.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jena-core-2.11.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/jena-iri-1.0.2.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/poi-3.10-FINAL.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-3.10-FINAL.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-schemas-3.10-FINAL.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/swagger-annotations-1.3.5.jar"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.8.0-SNAPSHOT.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.8.0-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.8.0-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 kind="src" path="src/main/java"/>\r
+       <classpathentry kind="src" path="src/main/resources"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/activation-1.1.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/antlr-2.7.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/aopalliance-1.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.7.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/aspectjweaver-1.7.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/avro-1.6.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-anim-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-awt-util-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-bridge-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-css-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-dom-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-ext-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-extension-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-gvt-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-js-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-parser-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-script-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-svg-dom-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-svggen-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-transcoder-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.8.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-codec-20041127.091804.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-dbcp-1.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-lang-2.6.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.5.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/concurrent-1.3.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/doxia-core-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/doxia-logging-api-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/doxia-module-apt-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/doxia-module-xhtml-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/doxia-sink-api-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/dozer-5.3.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/easymock-3.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/easymockclassextension-2.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/ehcache-core-2.6.9.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/ezmorph-1.0.6.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/fop-1.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/guava-r05.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/h2-1.3.170.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hamcrest-core-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-c3p0-4.1.10.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-cglib-repack-2.1_3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-4.0.1.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-core-4.1.10.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-ehcache-4.1.10.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-entitymanager-4.1.10.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-4.1.10.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-4.2.0.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-analyzers-4.2.0.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-engine-4.2.0.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-search-orm-4.2.0.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hibernate-validator-4.3.1.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/hsqldb-1.8.0.10.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/httpclient-4.2.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/httpcore-4.2.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/icu4j-2.6.1.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/itextpdf-5.4.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jackson-core-asl-1.8.8.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jackson-mapper-asl-1.8.8.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jakarta-regexp-1.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/javassist-3.17.1-GA.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-api-2.2.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-impl-2.2-EA.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jaxb-xjc-2.2-EA.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jaxb1-impl-2.2-EA.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jaxen-1.1.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jboss-logging-3.1.3.GA.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jdbc4-2.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jdom-1.1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/joda-time-2.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/json-lib-2.4-jdk15.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jsr250-api-1.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jtds-1.3.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/junit-4.11.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/junit-benchmarks-0.5.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>\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-analyzers-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-core-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-facet-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-grouping-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-highlighter-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-kuromoji-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-memory-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-misc-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-phonetic-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-queries-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-smartcn-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-spatial-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-spellchecker-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/lucene-stempel-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/mchange-commons-java-0.2.3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/mysql-connector-java-5.1.24.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/objenesis-1.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/odfdom-java-0.8.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/ognl-2.6.9.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/opencsv-2.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.equinox.common-3.6.0.v20110523.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.osgi.core-1.0.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.oxm-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.test-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/org.springframework.web.servlet-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/osgi-3.6.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/p6spy-1.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/paranamer-2.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/plexus-classworlds-1.2-alpha-9.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/plexus-container-default-1.0-alpha-30.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/plexus-utils-2.0.5.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/postgresql-9.1-901.jdbc4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/sanselan-0.97-incubator.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/servlet-api-2.5.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.7.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/snappy-java-1.0.4.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/solr-analysis-extras-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/solr-core-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/solr-solrj-3.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-aop-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-beans-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-context-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-context-support-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-core-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-expression-3.2.2.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-modules-cache-0.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.1.3.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.1.3.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/stax-1.2.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/stax-api-1.0.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-core-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-database-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-dbmaintainer-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-dbunit-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-easymock-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-inject-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-mock-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-orm-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/unitils-spring-3.3.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/usertype.jodatime-2.0.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/usertype.spi-2.0.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/validation-api-1.0.0.GA.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xalan-2.6.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xercesImpl-2.11.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xml-apis-1.0.b2.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-resolver-1.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xmlgraphics-commons-1.5.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xmlParserAPIs-2.6.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xmlpull-1.1.3.1.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xmlunit-1.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xom-1.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xpp3_min-1.1.4c.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xpp3-1.1.4c.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xstream-1.4.4.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/yjp-controller-api-redist-9.0.8.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/google-api-translate-java-0.92.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/odfdom-0.8.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/h2mig_pagestore_addon.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jena-core-2.11.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/jena-iri-1.0.2.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/poi-3.10-FINAL.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-3.10-FINAL.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/poi-ooxml-schemas-3.10-FINAL.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/swagger-annotations-1.3.5.jar"/>\r
+       <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
diff --git a/eu.etaxonomy.taxeditor.editor.src/main/java/eu/etaxonomy/taxeditor/editor/name/container/RulerWithIcon.java b/eu.etaxonomy.taxeditor.editor.src/main/java/eu/etaxonomy/taxeditor/editor/name/container/RulerWithIcon.java
new file mode 100644 (file)
index 0000000..db44161
--- /dev/null
@@ -0,0 +1,660 @@
+/**
+* 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.name.container;
+
+import java.util.Iterator;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.IViewportListener;
+import org.eclipse.jface.text.JFaceTextUtil;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationAccess;
+import org.eclipse.jface.text.source.IAnnotationAccessExtension;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModelListener;
+import org.eclipse.jface.text.source.IAnnotationPresentation;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.IVerticalRulerExtension;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+
+/**
+ * 99% of the code in this class was copied from org.eclipse.jface.text.source.VerticalRuler,
+ * which allows neither access to its paint methods nor subclassing to do same.
+ * <p>
+ * Changes made in method doubleBufferPaint(doubleBufferPaint(GC dest)).
+ *
+ * @see org.eclipse.jface.text.source.VerticalRuler
+ * @author p.ciardelli
+ * @created 27.01.2009
+ * @version 1.0
+ */
+public class RulerWithIcon implements IVerticalRuler, IVerticalRulerExtension {
+       private static final Logger logger = Logger.getLogger(RulerWithIcon.class);
+
+       /**
+        * Internal listener class.
+        */
+       class InternalListener implements IViewportListener, IAnnotationModelListener, ITextListener {
+
+               /*
+                * @see IViewportListener#viewportChanged(int)
+                */
+               public void viewportChanged(int verticalPosition) {
+                       if (verticalPosition != fScrollPos)
+                               redraw();
+               }
+
+               /*
+                * @see IAnnotationModelListener#modelChanged(IAnnotationModel)
+                */
+               public void modelChanged(IAnnotationModel model) {
+                       update();
+               }
+
+               /*
+                * @see ITextListener#textChanged(TextEvent)
+                */
+               public void textChanged(TextEvent e) {
+                       if (fTextViewer != null && e.getViewerRedrawState())
+                               redraw();
+               }
+       }
+
+       /** The vertical ruler's text viewer */
+       private ITextViewer fTextViewer;
+       /** The ruler's canvas */
+       private Canvas fCanvas;
+       /** The vertical ruler's model */
+       private IAnnotationModel fModel;
+       /** Cache for the actual scroll position in pixels */
+       private int fScrollPos;
+       /** The buffer for double buffering */
+       private Image fBuffer;
+       /** The line of the last mouse button activity */
+       private int fLastMouseButtonActivityLine= -1;
+       /** The internal listener */
+       private InternalListener fInternalListener= new InternalListener();
+       /** The width of this vertical ruler */
+       private int fWidth;
+       /**
+        * The annotation access of this vertical ruler
+        * @since 3.0
+        */
+       private IAnnotationAccess fAnnotationAccess;
+       private Image icon;
+
+       /**
+        * Constructs a vertical ruler with the given width.
+        *
+        * @param width the width of the vertical ruler
+        */
+       public RulerWithIcon(int width) {
+               this(width, null);
+       }
+
+       /**
+        * Constructs a vertical ruler with the given width and the given annotation
+        * access.
+        *
+        * @param width the width of the vertical ruler
+        * @param annotationAcccess the annotation access
+        * @since 3.0
+        */
+       public RulerWithIcon(int width, IAnnotationAccess annotationAcccess) {
+               fWidth= width;
+               fAnnotationAccess= annotationAcccess;
+       }
+
+       /*
+        * @see IVerticalRuler#getControl()
+        */
+       /**
+        * <p>getControl</p>
+        *
+        * @return a {@link org.eclipse.swt.widgets.Control} object.
+        */
+       public Control getControl() {
+               return fCanvas;
+       }
+
+       /*
+        * @see IVerticalRuler#createControl(Composite, ITextViewer)
+        */
+       /** {@inheritDoc} */
+       public Control createControl(Composite parent, ITextViewer textViewer) {
+
+               fTextViewer= textViewer;
+
+               fCanvas= new Canvas(parent, SWT.NO_BACKGROUND);
+
+               TableWrapData layout = new TableWrapData(TableWrapData.LEFT);
+               layout.heightHint = 20;
+               layout.maxWidth = fWidth;
+               fCanvas.setLayoutData(layout);          
+               
+               fCanvas.addPaintListener(new PaintListener() {
+                       public void paintControl(PaintEvent event) {
+                               if (fTextViewer != null)
+                                       doubleBufferPaint(event.gc);
+                       }
+               });
+
+               fCanvas.addDisposeListener(new DisposeListener() {
+                       public void widgetDisposed(DisposeEvent e) {
+                               handleDispose();
+                               fTextViewer= null;
+                       }
+               });
+
+               fCanvas.addMouseListener(new MouseListener() {
+                       public void mouseUp(MouseEvent event) {
+                       }
+
+                       public void mouseDown(MouseEvent event) {
+                               fLastMouseButtonActivityLine= toDocumentLineNumber(event.y);
+                       }
+
+                       public void mouseDoubleClick(MouseEvent event) {
+                               fLastMouseButtonActivityLine= toDocumentLineNumber(event.y);
+                       }
+               });
+
+               if (fTextViewer != null) {
+                       fTextViewer.addViewportListener(fInternalListener);
+                       fTextViewer.addTextListener(fInternalListener);
+               }
+
+               return fCanvas;
+       }
+
+       /**
+        * Disposes the ruler's resources.
+        */
+       private void handleDispose() {
+
+               if (fTextViewer != null) {
+                       fTextViewer.removeViewportListener(fInternalListener);
+                       fTextViewer.removeTextListener(fInternalListener);
+                       fTextViewer= null;
+               }
+
+               if (fModel != null)
+                       fModel.removeAnnotationModelListener(fInternalListener);
+
+               if (fBuffer != null) {
+                       fBuffer.dispose();
+                       fBuffer= null;
+               }
+       }
+
+
+       /**
+        * Double buffer drawing.
+        *
+        * @param dest the GC to draw into
+        */
+       private void doubleBufferPaint(GC dest) {
+
+               Point size= fCanvas.getSize();
+
+               if (size.x <= 0 || size.y <= 0)
+                       return;
+
+               if (fBuffer != null) {
+                       Rectangle r= fBuffer.getBounds();
+                       if (r.width != size.x || r.height != size.y) {
+                               fBuffer.dispose();
+                               fBuffer= null;
+                       }
+               }
+               if (fBuffer == null)
+                       fBuffer= new Image(fCanvas.getDisplay(), size.x, size.y);
+
+               GC gc= new GC(fBuffer);
+               gc.setFont(fTextViewer.getTextWidget().getFont());
+               try {
+                       gc.setBackground(fCanvas.getBackground());
+                       gc.fillRectangle(0, 0, size.x, size.y);
+
+                       // Code added to VerticalRuler starts here
+                       if (icon != null) {
+                               
+                               Rectangle r = icon.getBounds();
+                               
+                               if (r.width > size.x || r.height > size.y) {
+                                       logger.warn(r.width + "x" + r.height + " icon too big for " + size.x + "x" + size.y + " Canvas.");
+                               } else {
+
+                                       // Set destination coordinates to center icon
+                                       int x = (size.x - r.width) / 2;
+                                       int y = (size.y - r.height) / 2;
+                                       
+                                       gc.drawImage(icon, 0, 0, r.width, r.height, x, y, r.width, r.height);
+                               }                               
+                       }
+                       // Code added to VerticalRuler ends here
+                       
+                       if (fTextViewer instanceof ITextViewerExtension5)
+                               doPaint1(gc);
+                       else
+                               doPaint(gc);
+
+               } finally {
+                       gc.dispose();
+               }
+
+               dest.drawImage(fBuffer, 0, 0);
+       }
+
+       /**
+        * Returns the document offset of the upper left corner of the
+        * widgets view port, possibly including partially visible lines.
+        *
+        * @return the document offset of the upper left corner including partially visible lines
+        * @since 2.0
+        */
+       private int getInclusiveTopIndexStartOffset() {
+
+               StyledText textWidget= fTextViewer.getTextWidget();
+               if (textWidget != null && !textWidget.isDisposed()) {
+                       int top= JFaceTextUtil.getPartialTopIndex(fTextViewer);
+                       try {
+                               IDocument document= fTextViewer.getDocument();
+                               return document.getLineOffset(top);
+                       } catch (BadLocationException x) {
+                       }
+               }
+
+               return -1;
+       }
+
+
+
+       /**
+        * Draws the vertical ruler w/o drawing the Canvas background.
+        *
+        * @param gc  the GC to draw into
+        */
+       protected void doPaint(GC gc) {
+
+               if (fModel == null || fTextViewer == null)
+                       return;
+
+               IAnnotationAccessExtension annotationAccessExtension= null;
+               if (fAnnotationAccess instanceof IAnnotationAccessExtension)
+                       annotationAccessExtension= (IAnnotationAccessExtension) fAnnotationAccess;
+
+               StyledText styledText= fTextViewer.getTextWidget();
+               IDocument doc= fTextViewer.getDocument();
+
+               int topLeft= getInclusiveTopIndexStartOffset();
+               int bottomRight= fTextViewer.getBottomIndexEndOffset();
+               int viewPort= bottomRight - topLeft;
+
+               Point d= fCanvas.getSize();
+               fScrollPos= styledText.getTopPixel();
+
+               int topLine= -1, bottomLine= -1;
+               try {
+                       IRegion region= fTextViewer.getVisibleRegion();
+                       topLine= doc.getLineOfOffset(region.getOffset());
+                       bottomLine= doc.getLineOfOffset(region.getOffset() + region.getLength());
+               } catch (BadLocationException x) {
+                       return;
+               }
+
+               // draw Annotations
+               Rectangle r= new Rectangle(0, 0, 0, 0);
+               int maxLayer= 1;        // loop at least once though layers.
+
+               for (int layer= 0; layer < maxLayer; layer++) {
+                       Iterator<?> iter= fModel.getAnnotationIterator();
+                       while (iter.hasNext()) {
+                               IAnnotationPresentation annotationPresentation= null;
+                               Annotation annotation= (Annotation) iter.next();
+
+                               int lay= IAnnotationAccessExtension.DEFAULT_LAYER;
+                               if (annotationAccessExtension != null)
+                                       lay= annotationAccessExtension.getLayer(annotation);
+                               else if (annotation instanceof IAnnotationPresentation) {
+                                       annotationPresentation= (IAnnotationPresentation)annotation;
+                                       lay= annotationPresentation.getLayer();
+                               }
+                               maxLayer= Math.max(maxLayer, lay+1);    // dynamically update layer maximum
+                               if (lay != layer)       // wrong layer: skip annotation
+                                       continue;
+
+                               Position position= fModel.getPosition(annotation);
+                               if (position == null)
+                                       continue;
+
+                               if (!position.overlapsWith(topLeft, viewPort))
+                                       continue;
+
+                               try {
+
+                                       int offset= position.getOffset();
+                                       int length= position.getLength();
+
+                                       int startLine= doc.getLineOfOffset(offset);
+                                       if (startLine < topLine)
+                                               startLine= topLine;
+
+                                       int endLine= startLine;
+                                       if (length > 0)
+                                               endLine= doc.getLineOfOffset(offset + length - 1);
+                                       if (endLine > bottomLine)
+                                               endLine= bottomLine;
+
+                                       startLine -= topLine;
+                                       endLine -= topLine;
+
+                                       r.x= 0;
+                                       r.y= JFaceTextUtil.computeLineHeight(styledText, 0, startLine, startLine)  - fScrollPos;
+                                       
+                                       r.width= d.x;
+                                       int lines= endLine - startLine;
+                                       
+                                       r.height= JFaceTextUtil.computeLineHeight(styledText, startLine, endLine + 1, (lines+1));
+
+                                       if (r.y < d.y && annotationAccessExtension != null)  // annotation within visible area
+                                               annotationAccessExtension.paint(annotation, gc, fCanvas, r);
+                                       else if (annotationPresentation != null)
+                                               annotationPresentation.paint(gc, fCanvas, r);
+
+                               } catch (BadLocationException e) {
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Draws the vertical ruler w/o drawing the Canvas background. Uses
+        * <code>ITextViewerExtension5</code> for its implementation. Will replace
+        * <code>doPaint(GC)</code>.
+        *
+        * @param gc  the GC to draw into
+        */
+       protected void doPaint1(GC gc) {
+
+               if (fModel == null || fTextViewer == null)
+                       return;
+
+               IAnnotationAccessExtension annotationAccessExtension= null;
+               if (fAnnotationAccess instanceof IAnnotationAccessExtension)
+                       annotationAccessExtension= (IAnnotationAccessExtension) fAnnotationAccess;
+
+               ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer;
+               StyledText textWidget= fTextViewer.getTextWidget();
+
+               fScrollPos= textWidget.getTopPixel();
+               Point dimension= fCanvas.getSize();
+
+               // draw Annotations
+               Rectangle r= new Rectangle(0, 0, 0, 0);
+               int maxLayer= 1;        // loop at least once through layers.
+
+               for (int layer= 0; layer < maxLayer; layer++) {
+                       Iterator<?> iter= fModel.getAnnotationIterator();
+                       while (iter.hasNext()) {
+                               IAnnotationPresentation annotationPresentation= null;
+                               Annotation annotation= (Annotation) iter.next();
+
+                               int lay= IAnnotationAccessExtension.DEFAULT_LAYER;
+                               if (annotationAccessExtension != null)
+                                       lay= annotationAccessExtension.getLayer(annotation);
+                               else if (annotation instanceof IAnnotationPresentation) {
+                                       annotationPresentation= (IAnnotationPresentation)annotation;
+                                       lay= annotationPresentation.getLayer();
+                               }
+                               maxLayer= Math.max(maxLayer, lay+1);    // dynamically update layer maximum
+                               if (lay != layer)       // wrong layer: skip annotation
+                                       continue;
+
+                               Position position= fModel.getPosition(annotation);
+                               if (position == null)
+                                       continue;
+
+                               IRegion widgetRegion= extension.modelRange2WidgetRange(new Region(position.getOffset(), position.getLength()));
+                               if (widgetRegion == null)
+                                       continue;
+
+                               int startLine= extension.widgetLineOfWidgetOffset(widgetRegion.getOffset());
+                               if (startLine == -1)
+                                       continue;
+
+                               int endLine= extension.widgetLineOfWidgetOffset(widgetRegion.getOffset() + Math.max(widgetRegion.getLength() -1, 0));
+                               if (endLine == -1)
+                                       continue;
+
+                               r.x= 0;
+                               r.y= JFaceTextUtil.computeLineHeight(textWidget, 0, startLine, startLine)  - fScrollPos;
+                               
+                               r.width= dimension.x;
+                               int lines= endLine - startLine;
+                               
+                               r.height= JFaceTextUtil.computeLineHeight(textWidget, startLine, endLine + 1, lines+1);
+
+                               if (r.y < dimension.y && annotationAccessExtension != null)  // annotation within visible area
+                                       annotationAccessExtension.paint(annotation, gc, fCanvas, r);
+                               else if (annotationPresentation != null)
+                                       annotationPresentation.paint(gc, fCanvas, r);
+                       }
+               }
+       }
+
+       /**
+        * Thread-safe implementation.
+        * Can be called from any thread.
+        */
+       /*
+        * @see IVerticalRuler#update()
+        */
+       public void update() {
+               if (fCanvas != null && !fCanvas.isDisposed()) {
+                       Display d= fCanvas.getDisplay();
+                       if (d != null) {
+                               d.asyncExec(new Runnable() {
+                                       public void run() {
+                                               redraw();
+                                       }
+                               });
+                       }
+               }
+       }
+
+       /**
+        * Redraws the vertical ruler.
+        */
+       private void redraw() {
+               if (fCanvas != null && !fCanvas.isDisposed()) {
+                       GC gc= new GC(fCanvas);
+                       doubleBufferPaint(gc);
+                       gc.dispose();
+               }
+       }
+
+       /*
+        * @see IVerticalRuler#setModel(IAnnotationModel)
+        */
+       /** {@inheritDoc} */
+       public void setModel(IAnnotationModel model) {
+               if (model != fModel) {
+
+                       if (fModel != null)
+                               fModel.removeAnnotationModelListener(fInternalListener);
+
+                       fModel= model;
+
+                       if (fModel != null)
+                               fModel.addAnnotationModelListener(fInternalListener);
+
+                       update();
+               }
+       }
+
+       /*
+        * @see IVerticalRuler#getModel()
+        */
+       /**
+        * <p>getModel</p>
+        *
+        * @return a {@link org.eclipse.jface.text.source.IAnnotationModel} object.
+        */
+       public IAnnotationModel getModel() {
+               return fModel;
+       }
+
+       /*
+        * @see IVerticalRulerInfo#getWidth()
+        */
+       /**
+        * <p>getWidth</p>
+        *
+        * @return a int.
+        */
+       public int getWidth() {
+               return fWidth;
+       }
+
+       /*
+        * @see IVerticalRulerInfo#getLineOfLastMouseButtonActivity()
+        */
+       /**
+        * <p>getLineOfLastMouseButtonActivity</p>
+        *
+        * @return a int.
+        */
+       public int getLineOfLastMouseButtonActivity() {
+               return fLastMouseButtonActivityLine;
+       }
+
+       /*
+        * @see IVerticalRulerInfo#toDocumentLineNumber(int)
+        */
+       /** {@inheritDoc} */
+       public int toDocumentLineNumber(int y_coordinate) {
+               if (fTextViewer == null  || y_coordinate == -1)
+                       return -1;
+
+               StyledText text= fTextViewer.getTextWidget();
+               int line= text.getLineIndex(y_coordinate);
+               
+               if (line == text.getLineCount() - 1) {
+                       // check whether y_coordinate exceeds last line
+                       if (y_coordinate > text.getLinePixel(line + 1))
+                               return -1;
+               }
+               
+               return widgetLine2ModelLine(fTextViewer, line);
+       }
+
+       /**
+        * Returns the line of the viewer's document that corresponds to the given widget line.
+        *
+        * @param viewer the viewer
+        * @param widgetLine the widget line
+        * @return the corresponding line of the viewer's document
+        * @since 2.1
+        */
+       protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) {
+
+               if (viewer instanceof ITextViewerExtension5) {
+                       ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
+                       return extension.widgetLine2ModelLine(widgetLine);
+               }
+
+               try {
+                       IRegion r= viewer.getVisibleRegion();
+                       IDocument d= viewer.getDocument();
+                       return widgetLine += d.getLineOfOffset(r.getOffset());
+               } catch (BadLocationException x) {
+               }
+               return widgetLine;
+       }
+
+       /*
+        * @see IVerticalRulerExtension#setFont(Font)
+        * @since 2.0
+        */
+       /** {@inheritDoc} */
+       public void setFont(Font font) {
+       }
+
+       /*
+        * @see IVerticalRulerExtension#setLocationOfLastMouseButtonActivity(int, int)
+        * @since 2.0
+        */
+       /** {@inheritDoc} */
+       public void setLocationOfLastMouseButtonActivity(int x, int y) {
+               fLastMouseButtonActivityLine= toDocumentLineNumber(y);
+       }
+
+       /**
+        * Adds the given mouse listener.
+        *
+        * @param listener the listener to be added
+        * @deprecated will be removed
+        * @since 2.0
+        */
+       public void addMouseListener(MouseListener listener) {
+               if (fCanvas != null && !fCanvas.isDisposed())
+                       fCanvas.addMouseListener(listener);
+       }
+
+       /**
+        * Removes the given mouse listener.
+        *
+        * @param listener the listener to be removed
+        * @deprecated will be removed
+        * @since 2.0
+        */
+       public void removeMouseListener(MouseListener listener) {
+               if (fCanvas != null && !fCanvas.isDisposed())
+                       fCanvas.removeMouseListener(listener);
+       }
+
+       /**
+        * <p>Setter for the field <code>icon</code>.</p>
+        *
+        * @param icon a {@link org.eclipse.swt.graphics.Image} object.
+        */
+       public void setIcon(Image icon) {
+               this.icon = icon;
+               redraw();
+       }
+}
+       
index 6cd6141ef5b525ed27680172a1be94707b1ec035..d4471b24e77cb6f4e5a656b8fcce88e8d1df0757 100644 (file)
@@ -9,6 +9,7 @@ Bundle-Localization: OSGI-INF/l10n/plugin
 Export-Package: eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.editor.handler,
  eu.etaxonomy.taxeditor.editor.internal,
+ eu.etaxonomy.taxeditor.editor.key.polytomous,
  eu.etaxonomy.taxeditor.editor.name,
  eu.etaxonomy.taxeditor.editor.name.handler,
  eu.etaxonomy.taxeditor.editor.view.concept,
index b9a3d50db54a0e6946d6ef4b413333c62c4b3d6a..66def47309837982fcbfaea4fa1efb79fc917fc0 100644 (file)
                   <reference
                         definitionId="isFeatureNodeContainer">
                   </reference>
-               </or>
+                   <reference
+                        definitionId="isDescriptionElement">
+                  </reference>
+              </or>
             </visibleWhen>
          </command>
          <separator
             </test>
          </with>
       </definition>
+      <definition
+            id="isSequence">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSequence">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isSingleRead">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleRead">
+            </test>
+         </with>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.core.expressions.propertyTesters">
             properties="isGroupEditor"
             type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
       </propertyTester>
+      <propertyTester
+            class="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
+            id="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
+            namespace="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
+            properties="isSequence,isSingleRead"
+            type="org.eclipse.jface.viewers.IStructuredSelection">
+      </propertyTester>
    </extension>
    <extension
          point="org.eclipse.ui.bindings">   
index c9350145261000221c842ae1127f8c5d96779a32..e87142c40ea62fbe582d74221d87aa1d5b932a1a 100644 (file)
@@ -168,7 +168,9 @@ public class EditorUtil extends AbstractUtility {
         }
                TaxonEditorInput input = TaxonEditorInput
                                .NewInstanceFromTaxonBase(taxonBaseUuid);
-               open(input);
+               if(input!=null){
+                   open(input);
+               }
        }
 
        /**
index 94107c24aa62579a0771388f9ed03a5724d1d099..74e264dc5ec66cf1fb4a4b8ac7ed7e2c1dcb6cc8 100644 (file)
@@ -86,11 +86,6 @@ public class MultiPageTaxonEditor extends FormEditor implements
                super.dispose();
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
-        */
        /** {@inheritDoc} */
        @Override
        protected void addPages() {
@@ -173,28 +168,11 @@ public class MultiPageTaxonEditor extends FormEditor implements
                firePropertyChange(PROP_DIRTY);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see org.eclipse.ui.part.MultiPageEditorPart#isDirty()
-        */
-       /**
-        * <p>
-        * isDirty
-        * </p>
-        *
-        * @return a boolean.
-        */
        @Override
     public boolean isDirty() {
                return dirty;
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see org.eclipse.ui.forms.editor.FormEditor#editorDirtyStateChanged()
-        */
        /** {@inheritDoc} */
        @Override
        public void editorDirtyStateChanged() {
@@ -210,11 +188,6 @@ public class MultiPageTaxonEditor extends FormEditor implements
         * place before passing property change along to
         * <code>super.handlePropertyChange(int propertyId)</code>.
         */
-       /*
-        * (non-Javadoc)
-        *
-        * @see org.eclipse.ui.part.MultiPageEditorPart#handlePropertyChange(int)
-        */
        @Override
     protected void handlePropertyChange(int propertyId) {
                if (propertyId == PROP_DIRTY) {
@@ -312,9 +285,6 @@ public class MultiPageTaxonEditor extends FormEditor implements
         setPartName();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
-     */
     @Override
     public void forceDirty() {
         changed(null);
@@ -329,60 +299,19 @@ public class MultiPageTaxonEditor extends FormEditor implements
                return input.getTaxon();
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
-        * ()
-        */
-       /**
-        * <p>
-        * getConversationHolder
-        * </p>
-        *
-        * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *         object.
-        */
        @Override
     public ConversationHolder getConversationHolder() {
                return conversation;
        }
 
-       /**
-        * <p>
-        * setConversationHolder
-        * </p>
-        *
-        * @param conversation
-        *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
-        *            object.
-        */
        public void setConversationHolder(ConversationHolder conversation) {
                this.conversation = conversation;
        }
 
-       /**
-        * <p>
-        * Getter for the field <code>undoContext</code>.
-        * </p>
-        *
-        * @return a {@link org.eclipse.core.commands.operations.IUndoContext}
-        *         object.
-        */
        public IUndoContext getUndoContext() {
                return undoContext;
        }
 
-       /**
-        * <p>
-        * Setter for the field <code>undoContext</code>.
-        * </p>
-        *
-        * @param undoContext
-        *            a {@link org.eclipse.core.commands.operations.IUndoContext}
-        *            object.
-        */
        public void setUndoContext(IUndoContext undoContext) {
                this.undoContext = undoContext;
        }
@@ -397,14 +326,7 @@ public class MultiPageTaxonEditor extends FormEditor implements
                getActiveEditor().setFocus();
        }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu
-     * .etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
-     */
-    /** {@inheritDoc} */
+       /** {@inheritDoc} */
     @Override
     public void update(CdmDataChangeMap events) {
         if (dataChangeBehavior == null) {
@@ -414,13 +336,6 @@ public class MultiPageTaxonEditor extends FormEditor implements
         DataChangeBridge.handleDataChange(events, dataChangeBehavior);
     }
 
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation
-     * ()
-     */
     /** {@inheritDoc} */
     @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
@@ -496,13 +411,6 @@ public class MultiPageTaxonEditor extends FormEditor implements
                return editorPage != null && editorPage.redraw(focus);
        }
 
-       /**
-        * <p>
-        * onComplete
-        * </p>
-        *
-        * @return a boolean.
-        */
        @Override
     public boolean onComplete() {
                return false;
@@ -549,4 +457,9 @@ public class MultiPageTaxonEditor extends FormEditor implements
                }
                return true;
        }
+
+       @Override
+       public boolean canAttachMedia() {
+           return true;
+       }
 }
@@ -1,4 +1,4 @@
-package eu.etaxonomy.taxeditor.molecular.handler;
+package eu.etaxonomy.taxeditor.editor.handler;
 
 
 import org.eclipse.core.expressions.PropertyTester;
@@ -24,10 +24,6 @@ public class SpecimenPropertyTester extends PropertyTester {
 
     public SpecimenPropertyTester() {}
 
-
-    /* (non-Javadoc)
-     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
-     */
     /** {@inheritDoc} */
     @Override
     public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
@@ -46,12 +42,10 @@ public class SpecimenPropertyTester extends PropertyTester {
         return false;
     }
 
-
        private boolean isSequence(Object object) {
        return (object instanceof Sequence);
        }
 
-
        private boolean isSingleReadAlignment(Object object) {
        return (object instanceof SingleRead);
     }
index 9459d7799f9fdfe5181c62f31fd2f922f27e7e78..07fdcf242c6dcb7a32a98cd34f2f451152bed0e9 100644 (file)
@@ -245,22 +245,6 @@ public class TransientClassificationService implements IClassificationService {
         return defaultService.getPreviousAuditEvent(t);
     }
 
-    /**
-     * @param classification
-     * @param rank
-     * @param limit
-     * @param start
-     * @param propertyPaths
-     * @return
-     * @deprecated
-     * @see eu.etaxonomy.cdm.api.service.IClassificationService#loadRankSpecificRootNodes(eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer, java.util.List)
-     */
-    @Deprecated
-    @Override
-    public List<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List<String> propertyPaths) {
-        return defaultService.loadRankSpecificRootNodes(classification, rank, limit, start, propertyPaths);
-    }
-
     /**
      * @param clazz
      * @return
@@ -966,4 +950,6 @@ public class TransientClassificationService implements IClassificationService {
         return defaultService.merge(arg0);
     }
 
+
+
 }
index 82964c8ff74d5228171838c0928f968c8bc21706..4b5d0106a9ccb5add07c05655a1f249ba7dccfa3 100644 (file)
@@ -29,6 +29,7 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
@@ -864,13 +865,9 @@ public class TransientOccurenceService implements IOccurrenceService {
                 maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
     }
 
-    @Override
-    public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to, DerivedUnit derivate) {
-        return defaultService.moveDerivate(from, to, derivate);
-    }
 
     @Override
-    public boolean moveSequence(DnaSample from, DnaSample to, Sequence sequence) {
+    public UpdateResult moveSequence(DnaSample from, DnaSample to, Sequence sequence) {
         return defaultService.moveSequence(from, to, sequence);
     }
 
@@ -1032,5 +1029,29 @@ public class TransientOccurenceService implements IOccurrenceService {
         return defaultService.deleteSingleRead(arg0, arg1);
     }
 
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(java.util.UUID, java.util.UUID, java.util.UUID)
+     */
+    @Override
+    public UpdateResult moveDerivate(UUID arg0, UUID arg1, UUID arg2) {
+        return defaultService.moveDerivate(arg0, arg1, arg2);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.DerivedUnit)
+     */
+    @Override
+    public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to, DerivedUnit derivate) {
+        return defaultService.moveDerivate(from, to, derivate);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveSequence(java.util.UUID, java.util.UUID, java.util.UUID)
+     */
+    @Override
+    public UpdateResult moveSequence(UUID arg0, UUID arg1, UUID arg2) {
+        return defaultService.moveSequence(arg0, arg1, arg2);
+    }
+
 
 }
index a7845395ed1b783ac5bb80dc3a0cf5d933986ed5..c805c6f165e7a4d70d2fd3c172b7b67a8a8e2606 100644 (file)
@@ -79,9 +79,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
     public DerivateView() {
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-     */
     @Override
     public void createPartControl(Composite parent) {
         viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
@@ -123,9 +120,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.addDropSupport(dndOperations, transfers, new DerivateDropListener(this));
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void doSave(IProgressMonitor monitor) {
         String taskName = "Saving hierarchy";
@@ -150,16 +144,10 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         refreshTree();
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#doSaveAs()
-     */
     @Override
     public void doSaveAs() {
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#getTitleToolTip()
-     */
     @Override
     public String getTitleToolTip() {
         if(getEditorInput() instanceof DerivateViewEditorInput){
@@ -169,9 +157,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return "Derivative Editor";
     }
 
-    /* (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);
@@ -183,9 +168,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#isDirty()
-     */
     @Override
     public boolean isDirty() {
         return isDirty;
@@ -198,18 +180,11 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         this.isDirty = isDirty;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
-     */
     @Override
     public boolean isSaveAsAllowed() {
         return false;
     }
 
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
-     */
     @Override
     public void setFocus() {
         viewer.getControl().setFocus();
@@ -219,16 +194,10 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-     */
     @Override
     public void update(CdmDataChangeMap changeEvents) {
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
-     */
     @Override
     public ConversationHolder getConversationHolder() {
         return conversation;
@@ -241,9 +210,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return viewer;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(java.lang.Object)
-     */
     @Override
     public void changed(Object element) {
         setDirty(true);
@@ -251,9 +217,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.refresh();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
-     */
     @Override
     public void forceDirty() {
         changed(null);
@@ -281,7 +244,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.refresh();
     }
 
-
     private void generateMultiLinkSingleReads() {
         Set<SingleRead> multiLinkSingleReads = new HashSet<SingleRead>();
         for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
@@ -299,9 +261,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return this.multiLinkSingleReads;
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
-     */
     @Override
     public void selectionChanged(SelectionChangedEvent event) {
         this.selection  = event.getSelection();
@@ -315,9 +274,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return labelProvider;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.operation.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
-     */
     @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
         refreshTree();
@@ -327,12 +283,14 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         return true;
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.operation.IPostOperationEnabled#onComplete()
-     */
     @Override
     public boolean onComplete() {
         return true;
     }
 
+    @Override
+    public boolean canAttachMedia() {
+        return true;
+    }
+
 }
index b04582f5e453ad17148e2868bbd88099a3846f0d..e62783ae4bed2908fa2688196f9c3a1e83b496f7 100644 (file)
@@ -37,9 +37,6 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.MediaSelectionDialog;
  */
 public class CreateDerivateContextMenu extends CompoundContributionItem {
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
-     */
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
@@ -115,9 +112,6 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
             MenuItem existingMediaItem = new MenuItem(mediaMenu, SWT.NONE);
             existingMediaItem.setText("Media Specimen with existing media");
             existingMediaItem.addSelectionListener(new SelectionAdapter() {
-                /* (non-Javadoc)
-                 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-                 */
                 @Override
                 public void widgetSelected(SelectionEvent e) {
                     //select media
@@ -173,9 +167,6 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
             this.derivationEventType = derivationEventType;
         }
 
-        /* (non-Javadoc)
-         * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-         */
         @Override
         public void widgetSelected(SelectionEvent e) {
             DerivateView derivateView = null;
index b03172f35d895bb0de2fd1efece6f638ec2cd076..17d95b1976ecb4531358069717fe7b26b50c4dac 100644 (file)
@@ -5,9 +5,6 @@ import org.eclipse.ui.actions.CompoundContributionItem;
 
 public class DerivateViewContextMenu extends CompoundContributionItem  {
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
-     */
     @Override
     protected IContributionItem[] getContributionItems() {
         IContributionItem[] contributionItems = new IContributionItem[] {
index 9931904ff8478df078fe61513974fef264703074..e7bfe694f565d2a18d89b8a5848860145a0a04ba 100644 (file)
@@ -109,7 +109,7 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
         else if(draggedNodeValue instanceof SingleRead && targetNodeValue instanceof Sequence){
             SingleRead singleRead = (SingleRead) draggedNodeValue;
             if(fromParentSpecimen instanceof Sequence){
-                return CdmStore.getService(ISequenceService.class).moveSingleRead((Sequence)fromParentSpecimen, (Sequence)targetNodeValue, singleRead);
+                return CdmStore.getService(ISequenceService.class).moveSingleRead((Sequence)fromParentSpecimen, (Sequence)targetNodeValue, singleRead).isOk();
             }
         }
 
@@ -117,7 +117,7 @@ public class MoveDerivateOperation extends AbstractPostOperation<CdmBase>  {
         else if(draggedNodeValue instanceof Sequence && targetNodeValue instanceof DnaSample && ((SpecimenOrObservationBase<?>) targetNodeValue).getRecordBasis()==SpecimenOrObservationType.DnaSample){
             Sequence sequence = (Sequence)draggedNodeValue;
             if(fromParentSpecimen instanceof DnaSample && ((SpecimenOrObservationBase<?>) targetNodeValue).getRecordBasis()==SpecimenOrObservationType.DnaSample){
-                return occurrenceService.moveSequence((DnaSample)fromParentSpecimen, (DnaSample)targetNodeValue, sequence);
+                return occurrenceService.moveSequence((DnaSample)fromParentSpecimen, (DnaSample)targetNodeValue, sequence).isOk();
             }
         }
         return false;
index 9a801a4d412797995c6899f6ae3f8c6045152438..3c1fee4fb25fe4fedafaefdb96797c876f3bb951 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -25,7 +25,6 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
-import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.AnnotationType;
@@ -34,13 +33,13 @@ import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
+import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.Page;
 import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
-import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.MoveDescriptionElementsOperation;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -48,7 +47,6 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonBaseSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
 
 
@@ -65,31 +63,31 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
         */
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
-               
+
 //             ConversationHolder conversation = CdmStore.createConversation();
                editor = (TaxonNameEditor) EditorUtil.getActiveEditorPage(Page.NAME);
                ISelection selection = HandlerUtil.getCurrentSelection(event);
-               
+               Taxon actualTaxon= null;
                if(selection instanceof IStructuredSelection){
 
                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
-                       
+
                        List<DescriptionElementBase> elements = new ArrayList<DescriptionElementBase>();
-                       
+
                        for(Object element : structuredSelection.toArray()){
                                if(element instanceof DescriptionElementBase){
                                        UUID uuid = ((DescriptionElementBase) element).getUuid();
-                                       
+
                                        elements.add(CdmStore.getService(IDescriptionService.class).loadDescriptionElement(uuid, null));
                                } else if(element instanceof FeatureNodeContainer){
                                        for(DescriptionElementBase de : ((FeatureNodeContainer)element).getDescriptionElements()){
                                                elements.add(
-                                                               (DescriptionElementBase)CdmStore.getService(IDescriptionService.class).loadDescriptionElement(de.getUuid(), null)
+                                                               CdmStore.getService(IDescriptionService.class).loadDescriptionElement(de.getUuid(), null)
                                                        );
                                        }
                                }
                        }
-                       
+
                        if(elements.size() == 0){
                                return null;
                        }
@@ -97,45 +95,51 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
                        List<UUID> excludeTaxa = new ArrayList<UUID>();
                        if (description.isInstanceOf(TaxonDescription.class)){
                                TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class);
-                               Taxon actualTaxon = taxonDescription.getTaxon();
+                               actualTaxon = taxonDescription.getTaxon();
                                excludeTaxa.add(actualTaxon.getUuid());
                        }
-                       
-                       
+                       Classification classification = null;
+                       if (actualTaxon != null){
+                           if (!actualTaxon.getTaxonNodes().isEmpty() && actualTaxon.getTaxonNodes().size() ==1){
+                               classification = actualTaxon.getTaxonNodes().iterator().next().getClassification();
+                           }
+                       }
                        TaxonNode newAcceptedTaxonNode = TaxonNodeSelectionDialog.select(HandlerUtil.getActiveShell(event),
                                        editor.getConversationHolder(),
                                        "Choose the accepted taxon",
                                        excludeTaxa,
-                                       null,
-                                       null);
-                       Taxon targetTaxon = newAcceptedTaxonNode.getTaxon();
-                       
-                       if(targetTaxon == null){
-                               // canceled
-                               return null;
-                       }
-                       newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();                      
-                       TaxonDescription targetDescription = TaxonDescription.NewInstance(targetTaxon);
-                       String moveMessage = String.format("Elements moved from %s", EditorUtil.getActiveMultiPageTaxonEditor().getTaxon());
-                       targetDescription.setTitleCache(moveMessage, true);
-                       Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
-                       annotation.setAnnotationType(AnnotationType.TECHNICAL());
-                       targetDescription.addAnnotation(annotation);
-                       
-                       try {
-                               AbstractPostOperation operation = new MoveDescriptionElementsOperation(
-                                               event.getCommand().getName(), EditorUtil.getUndoContext(), 
-                                               targetDescription, elements, false, this);
-                               
-                               EditorUtil.executeOperation(operation);
-                               
-                               //CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
-                               
-                       } catch (NotDefinedException e) {
-                               MessagingUtils.error(getClass(), e);
+                                       null,classification
+                                       );
+                       if (newAcceptedTaxonNode != null){
+                       Taxon targetTaxon = newAcceptedTaxonNode.getTaxon();
+
+                       if(targetTaxon == null){
+                               // canceled
+                               return null;
+                       }
+                       newAcceptedTaxonNodeUuid = newAcceptedTaxonNode.getUuid();
+                       TaxonDescription targetDescription = TaxonDescription.NewInstance(targetTaxon);
+                       String moveMessage = String.format("Elements moved from %s", EditorUtil.getActiveMultiPageTaxonEditor().getTaxon());
+                       targetDescription.setTitleCache(moveMessage, true);
+                       Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
+                       annotation.setAnnotationType(AnnotationType.TECHNICAL());
+                       targetDescription.addAnnotation(annotation);
+
+                       try {
+                               AbstractPostOperation operation = new MoveDescriptionElementsOperation(
+                                               event.getCommand().getName(), EditorUtil.getUndoContext(),
+                                               targetDescription, elements, false, this);
+
+                               EditorUtil.executeOperation(operation);
+
+                               //CdmStore.getService(ITaxonService.class).saveOrUpdate(targetTaxon);
+
+                       } catch (NotDefinedException e) {
+                               MessagingUtils.error(getClass(), e);
+                       }
                        }
                }
-               
+
                return null;
        }
 
@@ -145,11 +149,12 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
        /** {@inheritDoc} */
        @Override
     public boolean postOperation(CdmBase objectAffectedByOperation) {
-               
+
                editor.getConversationHolder().bind();
                editor.getConversationHolder().commit(true);
                Display.getDefault().asyncExec(new Runnable(){
-                       
+
+            @Override
             public void run() {
                                //AbstractUtility.close(editor.getMultiPageTaxonEditor());
 
@@ -178,5 +183,5 @@ public class MoveDescriptionElementsHandler extends AbstractHandler implements I
                // TODO Auto-generated method stub
                return false;
        }
-       
+
 }
index 07cbd473dc5f8a3dd3f4f78d1e2b1bd17d2e64ce..f3c171437b0dbc43a0d7a84bba5871bb49badb24 100644 (file)
@@ -112,7 +112,7 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
             return;
         }
 
-               if(part instanceof IPartContentHasMedia){
+               if(part instanceof IPartContentHasMedia && ((IPartContentHasMedia) part).canAttachMedia()){
                    if(part instanceof MultiPageTaxonEditor){
                        IEditorInput input = ((IEditorPart) part).getEditorInput();
                        showViewer(part, new StructuredSelection(input));
index 73690842934e25cdeea9f2377ef3960817ce6701..bbd575d4f5967503855d575fe4720c91500e80f3 100644 (file)
             </activeWhen>
          </handler>
       </extension>
-      <extension
-            point="org.eclipse.core.expressions.definitions">
-         <definition
-               id="isSequence">
-            <with
-                  variable="selection">
-               <test
-                     property="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester.isSequence">
-               </test>
-            </with>
-         </definition>
-         <definition
-               id="isSingleRead">
-            <with
-                  variable="selection">
-               <test
-                     property="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester.isSingleRead">
-               </test>
-            </with>
-         </definition>
-      </extension>
-      <extension
-            point="org.eclipse.core.expressions.propertyTesters">
-         <propertyTester
-               class="eu.etaxonomy.taxeditor.molecular.handler.SpecimenPropertyTester"
-               id="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester"
-               namespace="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester"
-               properties="isSequence,isSingleRead"
-               type="org.eclipse.jface.viewers.IStructuredSelection">
-         </propertyTester>
-      </extension>
       <extension
             point="org.eclipse.ui.bindings">
          <scheme
index 86609245a3571b0d1283dfd2b75e6977e441a567..9d828fb455d36b9a94c4fbefd695a12d73f2c5d5 100644 (file)
                   commandId="eu.etaxonomy.taxeditor.navigation.command.create.taxonNode"
                   label="%command.label.2"
                   style="push">
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="selection">
+                     <count
+                           value="+">
+                     </count>
+                  </with>
+               </visibleWhen>
             </command>
             <separator
                   name="eu.etaxonomy.navigation.menu.new.separator1"
                            definitionId="isSynonymNode">
                      </reference>
                   </not>
+                  <with
+                        variable="selection">
+                     <count
+                           value="+">
+                     </count>
+                  </with>
                </and>
             </visibleWhen>
          </command>
index faf141c73ba8ded1c2a973b3a72100bbf6fd2c64..449a661f0835530b985a3910961d8153e197905b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -17,9 +17,14 @@ import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart;
@@ -33,28 +38,31 @@ import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
  */
 public class DeleteHandler extends AbstractHandler {
 
+    protected IWorkbenchPage activePage;
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException {
                IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-               
+               activePage =  HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
                List<PolytomousKey> keys = selection.toList();
-               
+
                if(keys.isEmpty()){
                        return null;
                }
-               
-               boolean confirmation = MessagingUtils.confirmDialog("Confirm deletaion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
-               
+               for (PolytomousKey key : keys){
+                   closeObsoleteEditor(key);
+               }
+               boolean confirmation = MessagingUtils.confirmDialog("Confirm deletion", "Do you want to delete the selected key" + (keys.size() == 1 ? "" : "s") + "?");
+
                if(confirmation){
-               
+
                        for(PolytomousKey key : keys){
                                try {
                                        AbstractPostOperation operation = new DeleteOperation(
                                                        event.getCommand().getName(),
-                                                       NavigationUtil.getUndoContext(), key, 
+                                                       NavigationUtil.getUndoContext(), key,
                                                        (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false),
                                                        (PolytomousKeyViewPart) NavigationUtil.getView(PolytomousKeyViewPart.ID, false));
                                        NavigationUtil.executeOperation(operation);
@@ -63,8 +71,30 @@ public class DeleteHandler extends AbstractHandler {
                                }
                        }
                }
-               
+
                return null;
        }
 
+
+       protected boolean closeObsoleteEditor(PolytomousKey key){
+        boolean result = true;
+        for (IEditorReference ref : activePage.getEditorReferences()) {
+            try {
+
+                IEditorInput input = ref.getEditorInput();
+                if (input instanceof PolytomousKeyEditorInput) {
+                    PolytomousKey pKey = ((PolytomousKeyEditorInput)input).getKey();
+                    //if node is a child of taxonNode then close the editor
+                    if(key.equals(pKey)){
+                    //if (taxonNode.equals(node)) {
+                        result &= activePage.closeEditor(ref.getEditor(false), true);
+
+                    }
+                }
+            } catch (PartInitException e) {
+                continue;
+            }
+        }
+        return result;
+    }
 }
index 448da0521067fee3efd86d3a35e88dde36c16959..e0f8a056682c00baa38a17452a86ab1df8f46d55 100644 (file)
@@ -14,37 +14,25 @@ import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IconAndMessageDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerDropAdapter;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTargetEvent;
 import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.navigator.CommonDropAdapter;
-import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
-import org.eclipse.ui.navigator.CommonViewer;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.OrderedTermBase;
-import eu.etaxonomy.cdm.model.common.TermBase;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
-import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
@@ -67,9 +55,9 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
        protected TreeNodeDropAdapter(TaxonNavigatorViewer navigatorViewer) {
                super(navigatorViewer);
                this.navigatorViewer = navigatorViewer;
-               
+
        }
-       
+
        private final TaxonNavigatorViewer navigatorViewer;
        private static final Logger logger = Logger.getLogger(TreeNodeDropAdapter.class);
 
@@ -77,9 +65,9 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
        public static final String ID = "eu.etaxonomy.taxeditor.navigation.navigator.dropassistant"; //$NON-NLS-1$
 
        private static final EnumSet<CRUD> UPDATE = EnumSet.of(CRUD.UPDATE);
-       
-       
-       
+
+
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.navigator.CommonDropAdapterAssistant#handleDrop(org.eclipse.ui.navigator.CommonDropAdapter, org.eclipse.swt.dnd.DropTargetEvent, java.lang.Object)
         */
@@ -87,7 +75,7 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
        @Override
        public boolean performDrop(Object target) {
 
-               
+
                if (target instanceof ITaxonTreeNode) {
                        Set<TaxonNode> taxonNodes = getSelectedTaxa();
                        ITaxonTreeNode targetTreeNode = (ITaxonTreeNode) target;
@@ -97,7 +85,7 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                        }
                        if(taxonNodes != null) {
                                if (taxonNodes.size() == 1){
-                                       return moveTaxon(taxonNodes.iterator().next(), targetTreeNode);
+                                       return moveTaxon(taxonNodes, targetTreeNode);
                                } else{
                                        if( MessageDialog.openConfirm(null, "Moving taxon", "The operation move accepted taxon to other parent is available only for a single taxon.")){
                                                return true;
@@ -105,7 +93,7 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                                }
             }
                }
-               
+
                return false;
        }
 
@@ -135,9 +123,9 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
        @Override
        public boolean validateDrop(Object target, int operation,
                        TransferData transferType) {
-               
+
                if (target instanceof ITaxonTreeNode) {
-                       
+
                    // check users permissions with target taxonnode and taxon
                    if (target instanceof TaxonNode) {
                        TaxonNode targetNode = (TaxonNode)target;
@@ -187,7 +175,7 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
         * @param parentTaxon
         * @return
         */
-       private boolean moveTaxon(TaxonNode taxonNode, ITaxonTreeNode targetITaxonTreeNode) {
+       private boolean moveTaxon(Set<TaxonNode> taxonNodes, ITaxonTreeNode targetITaxonTreeNode) {
 
                TaxonNavigator taxonNavigator;
                taxonNavigator = (TaxonNavigator) NavigationUtil.showView(TaxonNavigator.ID);
@@ -203,17 +191,24 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                        }
 
                }
+               Iterator<TaxonNode> taxIterator = taxonNodes.iterator();
+        Set<UUID> uuids = new HashSet<UUID>();
+        TaxonNode node = null;
+        while(taxIterator.hasNext()){
+            node = taxIterator.next();
+            uuids.add(node.getUuid());
+        }
                if (!PreferencesUtil.getSortNodesNaturally()){
                        IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
                        if (workspaceUndoContext == null) {
                                logger.error("Workspace undo context is null. DND operation cancelled");
                                return false;
                        }
-       
+
                        AbstractPostOperation operation = new MoveTaxonOperation
-                                       ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+                                       ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
                        NavigationUtil.executeOperation(operation);
-                       
+
                        logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                        return true;
                }else{
@@ -227,11 +222,11 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                                        logger.error("Workspace undo context is null. DND operation cancelled");
                                        return false;
                                }
-               
+
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
                                NavigationUtil.executeOperation(operation);
-                               
+
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                                return true;
                        }else if (returnCode == 1){
@@ -240,18 +235,19 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
                                        logger.error("Workspace undo context is null. DND operation cancelled");
                                        return false;
                                }
-               
+                               TaxonNode targetNode = (TaxonNode) targetITaxonTreeNode;
+
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, false);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode.getParent(), this, taxonNavigator, false);
                                NavigationUtil.executeOperation(operation);
-                               
+
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                                return true;
                        } else{
                                return false;
                        }
-                       
-                       
+
+
                }
        }
 
@@ -278,7 +274,7 @@ public class TreeNodeDropAdapter extends ViewerDropAdapter implements IPostOpera
        public void dragOver(DropTargetEvent event) {
                super.dragOver(event);
                event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_INSERT_AFTER;
-               
+
        }
-       
+
 }
index 86eb9506f926fd1267fbb4f1a23972d0ff3d4663..289d9d1b99596249b0fc4da64faf594532475e2a 100644 (file)
@@ -14,21 +14,18 @@ import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IconAndMessageDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.TreeSelection;
 import org.eclipse.swt.dnd.DropTargetEvent;
 import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.navigator.CommonDropAdapter;
 import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
 
@@ -69,7 +66,7 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
        public IStatus handleDrop(CommonDropAdapter dropAdapter,
                        DropTargetEvent dropTargetEvent, Object target) {
 
-               
+
                if (target instanceof ITaxonTreeNode) {
                        Set<TaxonNode> taxonNodes = getSelectedTaxa();
                        ITaxonTreeNode targetTreeNode = (ITaxonTreeNode) target;
@@ -77,17 +74,17 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                targetTreeNode = ((Classification)targetTreeNode).getRootNode();
                                targetTreeNode = HibernateProxyHelper.deproxy(targetTreeNode, TaxonNode.class);
                        }
-                       if(taxonNodes != null) {
-                               if (taxonNodes.size() == 1){
-                                       return moveTaxon(taxonNodes.iterator().next(), targetTreeNode);
-                               } else{
+                       //if(taxonNodes != null) {
+                               if (taxonNodes.size() >= 1){
+                                       return moveTaxon(taxonNodes, targetTreeNode);
+                               /*} else{
                                        if( MessageDialog.openConfirm(null, "Moving taxon", "The operation move accepted taxon to other parent is available only for a single taxon.")){
                                                return null;
                                        }
-                               }
+                               }*/
             }
                }
-               
+
                return Status.CANCEL_STATUS;
        }
 
@@ -168,7 +165,7 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
         * @param parentTaxon
         * @return
         */
-       private IStatus moveTaxon(TaxonNode taxonNode, ITaxonTreeNode targetITaxonTreeNode) {
+       private IStatus moveTaxon(Set<TaxonNode> taxonNodes, ITaxonTreeNode targetITaxonTreeNode) {
 
                TaxonNavigator taxonNavigator;
                taxonNavigator = (TaxonNavigator) NavigationUtil.showView(TaxonNavigator.ID);
@@ -184,17 +181,24 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                        }
 
                }
+               Iterator<TaxonNode> taxIterator = taxonNodes.iterator();
+        Set<UUID> uuids = new HashSet<UUID>();
+        TaxonNode node = null;
+        while(taxIterator.hasNext()){
+            node = taxIterator.next();
+            uuids.add(node.getUuid());
+        }
                if (!PreferencesUtil.getSortNodesNaturally()){
                        IUndoContext workspaceUndoContext = NavigationUtil.getWorkbenchUndoContext();
                        if (workspaceUndoContext == null) {
                                logger.error("Workspace undo context is null. DND operation cancelled");
                                return Status.CANCEL_STATUS;
                        }
-       
+
                        AbstractPostOperation operation = new MoveTaxonOperation
-                                       ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+                                       ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
                        NavigationUtil.executeOperation(operation);
-                       
+
                        logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                        return Status.OK_STATUS;
                }else{
@@ -208,11 +212,11 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                        logger.error("Workspace undo context is null. DND operation cancelled");
                                        return Status.CANCEL_STATUS;
                                }
-               
+
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, true);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetITaxonTreeNode, this, taxonNavigator, true);
                                NavigationUtil.executeOperation(operation);
-                               
+
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                                return Status.OK_STATUS;
                        }else if (returnCode == 1){
@@ -221,18 +225,18 @@ public class TreeNodeDropAdapterAssistant extends CommonDropAdapterAssistant imp
                                        logger.error("Workspace undo context is null. DND operation cancelled");
                                        return Status.CANCEL_STATUS;
                                }
-               
+                               TaxonNode targetNode = (TaxonNode) targetITaxonTreeNode;
                                AbstractPostOperation operation = new MoveTaxonOperation
-                                               ("Move Taxon", workspaceUndoContext, taxonNode, targetITaxonTreeNode, this, taxonNavigator, false);
+                                               ("Move Taxon", workspaceUndoContext, uuids, targetNode.getParent(), this, taxonNavigator, false);
                                NavigationUtil.executeOperation(operation);
-                               
+
                                logger.info("Moved taxa to new parent " + targetITaxonTreeNode);
                                return Status.OK_STATUS;
                        } else{
                                return Status.CANCEL_STATUS;
                        }
-                       
-                       
+
+
                }
        }
 
index 5a8650098b30cf91fe380d90fb7f994e7be7fc87..f8e789caf1eb1b506a52ed9e2f6d577a481374f2 100644 (file)
@@ -125,7 +125,7 @@ public class DeleteHandler extends AbstractHandler{
                                        }else{
                                                if(!DeleteConfiguratorDialog.openConfirmWithConfigurator(configNodes, HandlerUtil.getActiveShell(event), "Confirm Deletion", "Do you really want to delete the selected node?")){
                                                        return null;
-                                               } 
+                                               }
                                                config.setTaxonNodeConfig(configNodes);
                                        }
                                }
@@ -146,6 +146,8 @@ public class DeleteHandler extends AbstractHandler{
 
                        } catch (NotDefinedException e) {
                                MessagingUtils.warn(getClass(), "Command name not set");
+                       } catch (Exception e){
+                           MessagingUtils.error(getClass(), e);
                        }
                } else{
                        try{
@@ -161,7 +163,9 @@ public class DeleteHandler extends AbstractHandler{
                                }
                        }catch (NotDefinedException e) {
                                MessagingUtils.warn(getClass(), "Command name not set");
-                       }
+                       } catch (Exception e){
+                MessagingUtils.error(getClass(), e);
+            }
                }
                return null;
        }
index 4c84b0197943fbdcd70f5ab5564839119aa1cef6..a761433ad4462b238d487c9d39d809ea973cc21b 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* 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.
 */
@@ -19,32 +19,21 @@ import java.util.UUID;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.EvaluationContext;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
-import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.ITreeNode;
-import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
-import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
 import eu.etaxonomy.taxeditor.navigation.NavigationUtil;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 import eu.etaxonomy.taxeditor.navigation.navigator.operation.MoveTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog;
-import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionNaturalOrderDialog;
 
 /**
  * <p>MoveTaxonHandler class.</p>
@@ -61,35 +50,41 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
                activePage = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
                TaxonNavigator taxonNavigator = (TaxonNavigator)NavigationUtil.showView(TaxonNavigator.ID);
-               
+
                TreeSelection selection = (TreeSelection) HandlerUtil.getCurrentSelection(event);
-               
+
                Iterator selectionIterator = selection.iterator();
-               TaxonNode taxonNode = null;
-               UUID taxonNodeUUID = null;
+               Set<TaxonNode> taxonNodes = new HashSet<TaxonNode>();
+               TaxonNode taxonNode= null;
+               Set<UUID> taxonNodeUUIDs = new HashSet<UUID>();
                // do not show the current selection
                List<UUID> excludeTaxa = new ArrayList<UUID>();
-               
-               if (selection.size() == 1){
+
+               //if (selection.size() == 1){
+
+               while (selectionIterator.hasNext()){
                        Object object = selectionIterator.next();
                        if(object instanceof TaxonNode){
-                               taxonNode = HibernateProxyHelper.deproxy(object,TaxonNode.class);
-                               taxonNodeUUID = taxonNode.getUuid();
+                           taxonNode = HibernateProxyHelper.deproxy(object,TaxonNode.class);
+                               taxonNodes.add(taxonNode);
+                               taxonNodeUUIDs.add(taxonNode.getUuid());
                                excludeTaxa.add(taxonNode.getTaxon().getUuid());
                        }
-               } else{
+               }
+               /*} else{
                        if( MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Moving taxon", "The operation move accepted taxon to other parent is available only for a single taxon.")){
                                return null;
                        }
-               }
-               
-               
+               }*/
+
+
 //             TaxonNode taxonNode = (TaxonNode) selection.getFirstElement();
-               if (taxonNode != null){
-                       boolean moveToNewParent = true; 
+               if (taxonNodes.size() >= 1){
+                       boolean moveToNewParent = true;
                        if (PreferencesUtil.getSortNodesNaturally()){
                                if(!MessageDialog.openQuestion(null, "Target node", "The choosen target node should be the parent?")){
                                        moveToNewParent = false;
@@ -104,13 +99,13 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
                                                        "changes in the parent taxon. Please save first.");
                                        return null;
                                }
-                               
+
                                AbstractPostOperation operation = new MoveTaxonOperation
                                                ("Move taxon to new parent", NavigationUtil.getUndoContext(),
-                                                               taxonNode, parentTaxonNode, taxonNavigator, taxonNavigator, moveToNewParent); //$NON-NLS-1$
+                                                               taxonNodeUUIDs, parentTaxonNode, taxonNavigator, taxonNavigator, moveToNewParent); //$NON-NLS-1$
                                NavigationUtil.executeOperation(operation);
                                taxonNavigator.refresh();
-                       
+
                        }
                }
                return null;
@@ -120,7 +115,8 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
         * @see eu.etaxonomy.taxeditor.operations.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
         */
        /** {@inheritDoc} */
-       public boolean postOperation(CdmBase objectAffectedByOperation) {
+       @Override
+    public boolean postOperation(CdmBase objectAffectedByOperation) {
                return true;
        }
 
@@ -129,10 +125,11 @@ public class MoveTaxonHandler extends AbstractHandler implements IPostOperationE
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                return false;
        }
-       
-       
-       
+
+
+
 }
index 0471420414d1b0506c810a3593dbdb46c45d273a..5e78bd2ddb6ff8da75c17075ec28f1443afec236 100644 (file)
@@ -29,6 +29,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -107,10 +108,14 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
                                } else if (!result.getExceptions().isEmpty()){
                                        String separator = ", ";
                                    String exceptionString = "";
+                                   int count = 1;
                                    for (Exception exception : result.getExceptions()) {
-                                   exceptionString += exception.getLocalizedMessage()+separator;
+                                       exceptionString += exception.getLocalizedMessage();
+                                       if (count < result.getExceptions().size()){
+                                           exceptionString += separator;
+                                       }
                                }
-                                       MessageDialog.openInformation(null, "Delete of the node was successful but the taxon could not be deleted.", exceptionString);
+                                       MessagingUtils.informationDialog("Delete of the node was successful but the taxon could not be deleted.", exceptionString);
                                }
 
 
@@ -124,8 +129,12 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
 
                                DeleteResult result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree);
                                if (result.isError() && !result.getExceptions().isEmpty()){
-                                       //TODO:Error message!
-                                       MessageDialog.openError(null, "Delete failed", result.getExceptions().iterator().next().getMessage());
+                                   String separator = ", ";
+                    String exceptionString = "";
+                    for (Exception exception : result.getExceptions()) {
+                        exceptionString += exception.getLocalizedMessage()+separator;
+                    }
+                                   MessagingUtils.error(null, exceptionString, result.getExceptions().iterator().next());
                                }
 
                                /*}else{
@@ -139,8 +148,12 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
 
                                DeleteResult result =service.deleteTaxonNodes(treeNodes, config);
                                if (result.isError() && !result.getExceptions().isEmpty()){
-                                       //TODO:Error message!
-                                       MessageDialog.openError(null, "Delete failed", result.getExceptions().iterator().next().getMessage());
+                                   String separator = ", ";
+                    String exceptionString = "";
+                    for (Exception exception : result.getExceptions()) {
+                        exceptionString += exception.getLocalizedMessage()+separator;
+                    }
+                    MessagingUtils.error(null, exceptionString, result.getExceptions().iterator().next());
                                }
                        }
 
index bd2b57db5ecb6f2daebf24ad111b936ad3e5ad93..830d572a4cb9088551fbeca75738c0cfdec9846b 100644 (file)
@@ -9,9 +9,6 @@
 
 package eu.etaxonomy.taxeditor.navigation.navigator.operation;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
@@ -22,13 +19,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
-import eu.etaxonomy.cdm.model.taxon.IllegalAncestryException;
-import eu.etaxonomy.cdm.model.taxon.TaxonNode;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -46,14 +40,14 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
        /**
         * A reference to the new taxonomical parent.
         */
-       private ITaxonTreeNode newParentTreeNode;
+       private final ITaxonTreeNode newParentTreeNode;
        /**
         * A reference to the former taxonomical parents
         */
        //private Map<TaxonNode, ITaxonTreeNode> oldParentTreeNodes;
 
-       private TaxonNode taxonNode;
-       private boolean moveToParentNode;
+       private final Set<UUID> taxonNodesUuid;
+       private final boolean moveToParentNode;
        /**
         * <p>Constructor for MoveTaxonOperation.</p>
         *
@@ -65,18 +59,18 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
         * @param conversationEnabled a {@link eu.etaxonomy.cdm.api.conversation.IConversationEnabled} object.
         */
        public MoveTaxonOperation(String label, IUndoContext undoContext,
-                       TaxonNode taxonNodeToMove, ITaxonTreeNode newParentTreeNode, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled, boolean moveToParentNode) {
+                       Set<UUID> taxonNodesUUIDToMove, ITaxonTreeNode newParentTreeNode, IPostOperationEnabled postOperationEnabled, IConversationEnabled conversationEnabled, boolean moveToParentNode) {
                super(label, undoContext, postOperationEnabled, conversationEnabled);
-               
-               this.taxonNode = taxonNodeToMove;
+
+               this.taxonNodesUuid = taxonNodesUUIDToMove;
                /*for (TaxonNode node:taxonNodes){
                        this.taxonNodes.add(service.load(node.getUuid()));
                }*/
-               
+
                this.newParentTreeNode = newParentTreeNode;
                this.moveToParentNode = moveToParentNode;
                // Save old parent ITaxonTreeNodes for undo
-               
+
                //this.parentNode = taxonNode.getParent();
        }
 
@@ -90,13 +84,13 @@ public class MoveTaxonOperation extends AbstractPersistentPostOperation {
                bind();
                monitor.worked(20);
 
-               UpdateResult result = CdmStore.getService(ITaxonNodeService.class).moveTaxonNode(this.taxonNode.getUuid(),newParentTreeNode.getUuid(), moveToParentNode);
+               UpdateResult result = CdmStore.getService(ITaxonNodeService.class).moveTaxonNodes(this.taxonNodesUuid,newParentTreeNode.getUuid());
 //             try {
 //                     for (TaxonNode taxonNode : taxonNodes){
 //                             TaxonNode newTaxonNode = newParentTreeNode.addChildNode(taxonNode,
 //                                             newParentTreeNode.getReference(), newParentTreeNode.getMicroReference());
 //                             //taxonNodes.add(newTaxonNode);
-//                             
+//
 //                             monitor.worked(2);
 //                     }
 //             } catch(IllegalAncestryException e) {
index a13d96793be297842565f4adad8c6dd84442ae23..14ce99859929ece86fb1049e56f92d4939cc4ab5 100644 (file)
@@ -155,4 +155,7 @@ extension-point.name = Cdm Viewer
 Bundle-Vendor = EDIT\r
 Bundle-Name = DataStore Bundle\r
 command.name.13 = delete\r
-command.name.14 = delete
\ No newline at end of file
+command.name.14 = delete\r
+page.name.32 = TaxonNavigator\r
+page.name.33 = Sort of Taxonnodes\r
+command.name.15 = Open
\ No newline at end of file
index 28fb041ac8601f9408ed20a1a97425661483ef05..fdc32d0692732090b3a5cdbd64382a4a76178335 100644 (file)
@@ -129,5 +129,7 @@ page.name.27 = Media
 page.name.28 = Checklisten Editor
 page.name.29 = Editor Profil
 page.name.30 = Sprache
+page.name.32 = TaxonNavigator
+page.name.33 = Sortierung im TaxonNavigator
 command.label.clone = Klonen
 command.label.openInSpecimenEditor = \u00d6ffnen im Specimen-Editor
\ No newline at end of file
index 51409eb7ab32f33627d760f932108590391f33eb..1241f571fe803e28d4d546f5c2394032b890f7a1 100644 (file)
@@ -1,21 +1,21 @@
-CdmDataSourceViewPart_1=Datenquelle wird geladen\r
-CdmDataSourceViewPart_10=Server\r
-CdmDataSourceViewPart_11=Name\r
-CdmDataSourceViewPart_12=Verbunden\r
-CdmDataSourceViewPart_2=Notizen\r
-CdmDataSourceViewPart_3=Kompatibel\r
-CdmDataSourceViewPart_4=CDM Version\r
-CdmDataSourceViewPart_5=Erstellt\r
-CdmDataSourceViewPart_6=Nomenklaturcode\r
-CdmDataSourceViewPart_7=Datenquelle\r
-CdmDataSourceViewPart_8=Typ\r
-CdmDataSourceViewPart_9=Verf\u00FCgbar\r
-LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte wählen Sie die Standardsprache für den Taxonomischen Editor aus.\r
-LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten?\r
-LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten\r
-LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.\r
-OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.\r
-UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\!\r
-UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnt nicht geöffnet werden. URL is ung\u00FCtlig.\r
-UriWithLabelElement_INVALID_URL=Ung\u00FCltiger URL\r
+CdmDataSourceViewPart_1=Datenquelle wird geladen
+CdmDataSourceViewPart_10=Server
+CdmDataSourceViewPart_11=Name
+CdmDataSourceViewPart_12=Verbunden
+CdmDataSourceViewPart_2=Notizen
+CdmDataSourceViewPart_3=Kompatibel
+CdmDataSourceViewPart_4=CDM Version
+CdmDataSourceViewPart_5=Erstellt
+CdmDataSourceViewPart_6=Nomenklaturcode
+CdmDataSourceViewPart_7=Datenquelle
+CdmDataSourceViewPart_8=Typ
+CdmDataSourceViewPart_9=Verf\u00FCgbar
+LanguageEditorPreferencePage_ChooseDefaultLanguage=Bitte wählen Sie die Standardsprache für den Taxonomischen Editor aus.
+LanguageEditorPreferencePage_EditorHasToRestart=Der Anwendung muss neu gestartet werden, um die Sprache zu wechseln.\nWollen Sie jetzt neu starten?
+LanguageEditorPreferencePage_PleaseRestart=Bitte neu starten
+LanguageEditorPreferencePage_RestartRequired=Nach dem Wechsel der Standardsprache ist ein Neustart erforderlich.
+OrderPreferencePage_NewNavigatorWindowRequired=Nach dem Ändern der Taxon Sortierung, ist das Schließen und erneute Öffnen des taxon Navigators erforderlich.
+UriWithLabelElement_URL_NOT_SAVED=URL wird nicht gespeichert\! 
+UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnt nicht geöffnet werden. URL is ung\u00FCtlig.
+UriWithLabelElement_INVALID_URL=Ung\u00FCltiger URL
 UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Im Browser öffnen 
\ No newline at end of file
index 41a4ad279bcfe7f014dca98ed5648424dd114637..320968a8ba32cac8b9abdb71a6e7b08e4d0451ce 100644 (file)
             id="eu.etaxonomy.taxeditor.preference.defaultlanguagepditorpreferencePage"
             name="%page.name.30">
       </page>
-      <page
+       <page
             category="eu.etaxonomy.taxeditor.preferences.general"
             class="eu.etaxonomy.taxeditor.preference.OrderPreferences"
-            id="eu.etaxonomy.taxeditor.preference.OrderPreferencesPage"
-            name="%page.name.31">
+            id="eu.etaxonomy.taxeditor.preference.TaxonNavigator"
+            name="%page.name.32">
       </page>
    </extension>
    <extension
       <command
             defaultHandler="eu.etaxonomy.taxeditor.handler.OpenHandler"
             id="eu.etaxonomy.taxeditor.store.open"
-            name="Open">
+            name="%command.name.15">
       </command>
    </extension>
    <extension
index 3b6997e0ae28ff2cf8ad487fe3c4816c733b05e3..42bd4714e1306cb938c6b5a9a0016b57ff21963f 100644 (file)
@@ -1,20 +1,20 @@
 // $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.
-*/
+ * 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.model;
 
-
 /**
  *
- * Clients implementing this interface indicate, that the data they present is suitable for the media view
- * and that the media view should handle selection from the implementing part.
+ * Clients implementing this interface indicate, that the data they present is
+ * suitable for the media view and that the media view should handle selection
+ * from the implementing part.
  *
  * @author pplitzner
  * @date Sep 16, 2014
@@ -22,4 +22,12 @@ package eu.etaxonomy.taxeditor.model;
  */
 public interface IPartContentHasMedia {
 
+    /**
+     * Return <code>true</code> if media can be attached to the editor input and
+     * <code>false</code> otherwise
+     *
+     * @return true or false depending on the input of the implementing part
+     */
+    public boolean canAttachMedia();
+
 }
index e2e864bceb5333cfeadf8bea5f2734f12d3accff..a5a3ba167148fc74c4b2b8f07fdfc31fc3fcba42 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.dialog.selection;
 
@@ -31,8 +31,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @author p.ciardelli
  * @version $Id: $
  */
-public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNode> implements SelectionListener{      
-       
+public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelectionDialog<TaxonNode> implements SelectionListener{
+
        /**
         * <p>select</p>
         *
@@ -44,7 +44,7 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
         * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
         */
        public static TaxonNode select(Shell shell, ConversationHolder conversation, String title, List<UUID> excludeTaxa, TaxonNode node, Classification classification) {
-               TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell, 
+               TaxonNodeSelectionDialog dialog = new TaxonNodeSelectionDialog(shell,
                                conversation,
                                title,
                                excludeTaxa,
@@ -57,8 +57,8 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
        private Combo classificationSelectionCombo;
 
        private List<Classification> classifications;
-       
-       private Classification selectedClassification;  
+
+       private Classification selectedClassification;
 
        /**
         * <p>Constructor for FilteredTaxonNodeSelectionDialog.</p>
@@ -72,12 +72,12 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
         */
        protected TaxonNodeSelectionDialog(Shell shell, ConversationHolder conversation, String title, List<UUID> excludeTaxa, boolean multi, TaxonNode node, Classification classification) {
                super(shell, conversation, title, multi, TaxonNodeSelectionDialog.class.getCanonicalName(), node);
-               
+
                ILabelProvider labelProvider = new FilteredCdmResourceLabelProvider();
 
                setListLabelProvider(labelProvider);
                setDetailsLabelProvider(labelProvider);
-               
+
                if(classification != null){
                        selectedClassification = classification;
                }
@@ -92,36 +92,37 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
        protected Control createExtendedContentArea(Composite parent) {
                return createClassificationSelectionCombo(parent);
        }
-       
+
        /*
         * currently disabled tree selection composite
         */
        private Control createClassificationSelectionCombo(Composite parent){
 //             classifications = CdmStore.getTaxonTreeService().list(null, null, null, null, null);
-               
+
                Composite classificationSelection = new Composite(parent, SWT.NULL);
                classificationSelection.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-               
+
                GridLayout layout = new GridLayout();
                classificationSelection.setLayout(layout);
-               
+
                Label label = new Label(classificationSelection, SWT.NULL);
                // TODO not working is not really true but leave it here to remind everyone that this is under construction
-               label.setText("Select Classification (experimental)");
+               label.setText("Select Classification");
                classificationSelectionCombo = new Combo(classificationSelection, SWT.BORDER | SWT.READ_ONLY);
                classificationSelectionCombo.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
-               
+
                for(Classification tree : classifications){
                        classificationSelectionCombo.add(tree.getName().getText(), classifications.indexOf(tree));
+
                }
-               
+
                classificationSelectionCombo.select(classifications.indexOf(selectedClassification));
-               
+
                // TODO remember last selection
                classificationSelectionCombo.addSelectionListener(this);
-               
-               
-               
+
+
+
                return classificationSelection;
        }
 
@@ -131,10 +132,10 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
                if(taxonNode != null && taxonNode.getTaxon() != null){
                        return taxonNode.getTaxon().getTitleCache();
                }
-               
+
                return "";
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
         */
@@ -150,15 +151,15 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
        /** {@inheritDoc} */
        @Override
        protected void initModel() {
-               // default to first tree 
-               // TODO this will be problematic and can only be seen as workaround 
-               
-               
+               // default to first tree
+               // TODO this will be problematic and can only be seen as workaround
+
+
                if(classifications == null){
                        classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
                        selectedClassification = classifications.iterator().next();
                }
-               
+
                model = CdmStore.getService(IClassificationService.class).getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(selectedClassification);
        }
 
@@ -173,17 +174,19 @@ public class TaxonNodeSelectionDialog extends AbstractFilteredCdmResourceSelecti
        protected String getNewWizardLinkText() {
                return null;
        }
-       
+
        /** {@inheritDoc} */
-       public void widgetSelected(SelectionEvent e) {
+       @Override
+    public void widgetSelected(SelectionEvent e) {
                selectedClassification = classifications.get(classificationSelectionCombo.getSelectionIndex());
-               
+
 //             refresh();
                setPattern(null);
        }
 
        /** {@inheritDoc} */
-       public void widgetDefaultSelected(SelectionEvent e) {}
+       @Override
+    public void widgetDefaultSelected(SelectionEvent e) {}
 
 
 }
index 40a55fa89e2dedeffbd42715786802e66a2a43d4..1c39870fe93ccd9d53970220541f63d7eb6e4267 100644 (file)
@@ -52,6 +52,7 @@ public class UriWithLabelElement extends TextWithLabelElement {
 
         //composite(uri + button)
         Composite textAndButton = formFactory.createComposite(getLayoutComposite(), style);
+        addControl(textAndButton);
         textAndButton.setLayout(LayoutConstants.LAYOUT(2, false));
         textAndButton.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
 
index b490669bde950bd45557e405db00ea62fba42d4a..cce5f0c6eccfe395abb85cddb5c3c46a383e345f 100644 (file)
@@ -54,7 +54,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
        private EntitySelectionElement<Reference> selection_SecRef;
 
        private Taxon taxon;
-       
+
        private Reference secReference;
 
        private TextWithLabelElement textNewTaxonName;
@@ -166,16 +166,17 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                                        setTaxon(selection_reuseExistingTaxon.getEntity());
                                }
                                complete = !textNewTaxonName.getText().isEmpty();
-                        
-                       
+
+
                } else if (eventSource == selection_reuseExistingName) {
                        boolean enabled = selection_reuseExistingName.getEntity() == null;
                        selection_reuseExistingTaxon.setEnabled(enabled);
                        textNewTaxonName.setEnabled(enabled);
 
                        setTaxon(selection_reuseExistingName.getEntity());
+                       complete = !textNewTaxonName.getText().isEmpty();
                } else if (eventSource == textNewTaxonName) {
-                       boolean enabled = CdmUtils.isEmpty(textNewTaxonName.getText());
+                       boolean enabled = CdmUtils.isBlank(textNewTaxonName.getText());
                        selection_reuseExistingTaxon.setEnabled(enabled);
                        selection_reuseExistingName.setEnabled(enabled);
 
@@ -246,7 +247,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
                        this.parentTreeNode = selection_classification.getEntity();
                }
        }
-       
+
        private void setSecReference(Reference secRef){
                this.secReference = secRef;
                setTaxon(textNewTaxonName.getText());
@@ -255,7 +256,7 @@ public class TaxonNodeDetailElement extends AbstractCdmDetailElement<ITaxonTreeN
        private void setTaxon(Taxon taxon) {
                this.taxon = taxon;
                textNewTaxonName.setText(taxon.getName().getTitleCache());
-               
+               this.secReference = taxon.getSec();
        }
 
        private void setTaxon(String taxonNameString) {
index fbde0b7e0ed056e51d0b6d809db9aa24e4a535ac..9d016cb3175be5d881d8eb238c4c495ff5b1410d 100644 (file)
@@ -119,7 +119,13 @@ public class ImageFileElement extends MediaRepresentationPartElement<ImageFile>
                        try {
                            URI uri = text_uri.getUri();
                                getEntity().setUri(uri);
-
+                               if(uri==null){
+                                   //buffer URI if parsing error occurred
+                                   MediaDetailElement parentMediaDetailElement = getParentMediaDetailElement();
+                                   if(parentMediaDetailElement!=null){
+                                       parentMediaDetailElement.setUriBuffer(text_uri.getText());
+                                   }
+                               }
 
                                loadImage(getEntity().getUri(), true);
 
index e05ed4064260e68d770df99dec3a5c11e950a8bd..1c27665647713fdd53c267767588114f683fb708 100644 (file)
@@ -9,6 +9,7 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.media;
 
+import java.net.URI;
 import java.util.List;
 import java.util.Set;
 
@@ -16,6 +17,7 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.cdm.model.media.MediaRepresentation;
 import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
 import eu.etaxonomy.cdm.model.media.MediaUtils;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
@@ -39,6 +41,11 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
     private ICdmFormElement parentFormElement;
     private int style;
 
+    /**
+     * Used to store the URI even if it is invalid and thus cannot be stored in CDM
+     */
+    private String uriBuffer;
+
     public MediaDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
         super(formFactory, formElement);
     }
@@ -63,11 +70,25 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
     public void handleEvent(Object eventSource){
         if(eventSource==textUri){
             textUri.setBackground(getPersistentBackground());
-            singleMediaRepresentationPart.setUri(textUri.getUri());
+            URI uri = textUri.getUri();
+            singleMediaRepresentationPart.setUri(uri);
+            if(uri==null){
+                uriBuffer=textUri.getText();
+            }
         }
     }
 
-    public void toggleAdvancedMediaView(){
+    public void toggleAdvancedMediaView() {
+        if (getEntity().getRepresentations() != null
+                && (getEntity().getRepresentations().size() > 1 ||
+                        (getEntity().getRepresentations().size() == 1
+                        && getEntity().getRepresentations().iterator().next().getParts().size() > 1))) {
+            MessagingUtils.informationDialog("Toggling not possible",
+                    "Media has consists of multiple representations or representatio parts");
+            // toggling is only possible if there are no more than one
+            // MediaRepresentation resp. MediaRepresentationParts
+            return;
+        }
         isAdvancedMediaView = !isAdvancedMediaView;
         showAdvancedView();
         reflowParentScrolledForm(true);
@@ -81,13 +102,23 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
             section_mediaRepresentation = formFactory.createMediaRepresentationSection(getConversationHolder(), parentFormElement, style);
             section_mediaRepresentation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
             section_mediaRepresentation.setEntity(getEntity());
+            //set buffered uri as text if uri had parsing problems in simple view
+            if(uriBuffer!=null){
+                section_mediaRepresentation.getLayoutComposite().getChildren();
+            }
         }
         else{
             if(section_mediaRepresentation!=null){
                 removeElementsAndControls(section_mediaRepresentation);
             }
             textUri = formFactory.createUriWithLabelElement(parentFormElement, "Media URI", null, style);
-            textUri.setUri(singleMediaRepresentationPart.getUri());
+            URI uri = singleMediaRepresentationPart.getUri();
+            textUri.setUri(uri);
+            //set buffered uri as text if uri had parsing problems in advanced view
+            if(uri==null && uriBuffer!=null){
+                textUri.setText(uriBuffer);
+                textUri.getUri();
+            }
             textUri.getLayoutComposite().layout();
         }
     }
@@ -116,4 +147,12 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
         return isAdvancedMediaView;
     }
 
+    public void setUriBuffer(String uriBuffer) {
+        this.uriBuffer = uriBuffer;
+    }
+
+    public String getUriBuffer() {
+        return uriBuffer;
+    }
+
 }
index 5a295254788c851528ec31c0a1eb5e141f4d2b17..663848da419d2bef3ba02e2b78c73f4c0911f147 100644 (file)
@@ -58,8 +58,14 @@ public class MediaRepresentationPartElement<T extends MediaRepresentationPart> e
                        text_size.setText(FileUtils.byteCountToDisplaySize(entity.getSize()));
                }
                if(entity.getUri() != null){
-                       text_uri.setText(entity.getUri().toString());
-               }
+                       text_uri.setUri(entity.getUri());
+               } else {
+            String uriBuffer = getParentMediaDetailElement().getUriBuffer();
+            if(uriBuffer!=null){
+                text_uri.setText(uriBuffer);
+                text_uri.getUri();//just to update the error label
+            }
+        }
        }
 
        @Override
@@ -67,8 +73,27 @@ public class MediaRepresentationPartElement<T extends MediaRepresentationPart> e
                if(eventSource == text_uri){
                    URI uri = text_uri.getUri();
                    getEntity().setUri(uri);
+                   if(uri==null){
+                //buffer URI if parsing error occurred
+                MediaDetailElement parentMediaDetailElement = getParentMediaDetailElement();
+                if(parentMediaDetailElement!=null){
+                    parentMediaDetailElement.setUriBuffer(text_uri.getText());
+                }
+            }
+
                    firePropertyChangeEvent(this);
                }
        }
 
+    protected MediaDetailElement getParentMediaDetailElement() {
+        ICdmFormElement parentElement = getParentElement();
+        while(parentElement!=null){
+            parentElement = parentElement.getParentElement();
+            if(parentElement instanceof MediaDetailElement){
+                return (MediaDetailElement) parentElement;
+            }
+        }
+        return null;
+    }
+
 }
index d913442dbe169b9969b31c31ad15e9a16dbd782f..1213418a592094bbbe9977831a7c19553513e8a0 100644 (file)
@@ -26,10 +26,6 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 
 /**
- * <p>
- * NonViralNameDetailElement class.
- * </p>
- *
  * @author n.hoffmann
  * @created May 20, 2010
  * @version 1.0
@@ -42,67 +38,40 @@ public class NonViralNameDetailElement extends
        private EnumComboElement<NomenclaturalCode> combo_nomenclaturalCode;
        private HybridDetailSection section_hybrid;
 
-       /**
-        * <p>
-        * Constructor for NonViralNameDetailElement.
-        * </p>
-        *
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param formElement
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
-        *            object.
-        */
        public NonViralNameDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
-        * (eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement,
-        * eu.etaxonomy.cdm.model.common.AnnotatableEntity, int)
-        */
        /** {@inheritDoc} */
        @Override
     protected void createControls(ICdmFormElement formElement, final NonViralName entity, int style) {
-           //name can be null in rare cases. Temporary solution for #4221. May be obsolete when
-           //#4393 (Make changing name of a taxon possible in details view) is implemented.
-           if(entity==null){
-               formFactory.createEmptyElement(formElement, "No name associated with this taxon.");
+           toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
+
+           combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
+           combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
+
+           //TODO RL
+           if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               toggleable_cache.setVisible(false);
+               combo_nomenclaturalCode.setVisible(false);
            }
-           else {
-               toggleable_cache = formFactory.createToggleableTextField(formElement, "Cache", entity.getTitleCache(), entity.isProtectedTitleCache() || entity.isProtectedFullTitleCache(), style);
-
-               combo_nomenclaturalCode = formFactory.createEnumComboElement(NomenclaturalCode.class, formElement, style);
-               combo_nomenclaturalCode.setSelection(entity.getNomenclaturalCode());
-
-               //TODO RL
-               if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
-                   toggleable_cache.setVisible(false);
-                   combo_nomenclaturalCode.setVisible(false);
-               }
-
-               section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-               section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_name);
-               addElement(section_name);
-               section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
-               section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-               addControl(section_author);
-               addElement(section_author);
-
-               //TODO RL
-               if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
-                   section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
-                   section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-                   addControl(section_hybrid);
-                   addElement(section_hybrid);
-               }
+
+           section_name = formFactory.createNameDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_name.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           addControl(section_name);
+           addElement(section_name);
+           section_author = formFactory.createAuthorshipDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+           section_author.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+           addControl(section_author);
+           addElement(section_author);
+
+           //TODO RL
+           if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.IS_RL)){
+               section_hybrid = formFactory.createHybridDetailSection(getConversationHolder(), formElement, null, ExpandableComposite.TWISTIE);
+               section_hybrid.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+               addControl(section_hybrid);
+               addElement(section_hybrid);
            }
     }
 
@@ -156,13 +125,6 @@ public class NonViralNameDetailElement extends
                }
        }
 
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
-        * .lang.Object)
-        */
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
index 9f950fa3fbffe21c7aedfb871b02b86ab3cd00b1..93c229adfd2e2cfda5114ab9c7f341b36b3aa86b 100644 (file)
@@ -39,9 +39,6 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         CdmStore.getContextManager().addContextListener(this);
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-     */
     @Override
     public void createPartControl(Composite parent) {
         derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
@@ -56,9 +53,6 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         control.setMenu(menu);
     }
 
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
-     */
     @Override
     public void setFocus() {
         derivateSearchCompositeController.setFocus();
@@ -68,33 +62,21 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextStop(IMemento memento, IProgressMonitor monitor) {
         derivateSearchCompositeController.setEnabled(false);
         derivateSearchCompositeController.reset();
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextStart(IMemento memento, IProgressMonitor monitor) {
         derivateSearchCompositeController.setEnabled(true);
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void contextRefresh(IProgressMonitor monitor) {
         initConversation();
@@ -107,20 +89,24 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
         }
     }
 
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
-     */
     @Override
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
 
-    /**
-     * @return the conversationHolder
-     */
     public ConversationHolder getConversationHolder() {
         if(CdmStore.isActive() && conversationHolder==null){
             initConversation();
         }
         return conversationHolder;
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void dispose() {
+        if(conversationHolder!=null){
+            conversationHolder.close();
+        }
+    }
 }
index 04bb9207f815a4499f01a543ce4c244d61ee157c..4856e3ff7f3ef99b55c64f1914f782c6273d5368 100644 (file)
@@ -204,7 +204,12 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         destroySections();
         if (input instanceof TaxonBase) {
-            createTaxonSections(rootElement);
+            if(((TaxonBase) input).getName()==null){
+                createEmptySection(rootElement);
+            }
+            else{
+                createTaxonSections(rootElement);
+            }
 
         } else if (input instanceof NonViralName) {
             createNameSections(rootElement);
index 7f4ff50a288107431b864d2422441790a2c8318a..f01bba3f6dd65d2f0a926478271edc218b458b37 100644 (file)
@@ -20,6 +20,7 @@
 <unit id="org.eclipse.rcp.sdk.id" version="3.7.2.M20120208-0800"/>
 <unit id="org.eclipse.equinox.sdk.feature.group" version="3.7.1.R37x_v20110907-7M7W8i8eNV4WsRkue-4Vq4J6pCyW"/>
 <unit id="org.eclipse.zest.sdk.feature.group" version="1.3.0.v20110425-2050-67C18COMPIAKSVKGQaRTQTiSN8WP"/>
+<unit id="org.eclipse.pde.feature.group" version="3.7.2.v20120120-1420-7b7rFUOFEx2Xnqafnpz0E--0"/>
 <repository location="http://download.eclipse.org/releases/indigo"/>
 </location>
 <location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">