Merge branch 'develop' into featureTreeEditor
authorPatrick Plitzner <p.plitzner@bgbm.org>
Sun, 18 Jun 2017 19:28:14 +0000 (21:28 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Sun, 18 Jun 2017 19:28:14 +0000 (21:28 +0200)
60 files changed:
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.editor/build.properties
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java [changed mode: 0644->0755]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/MisapplicationContainer.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/DeleteMediaOperation.java
eu.etaxonomy.taxeditor.molecular.lib/pom.xml
eu.etaxonomy.taxeditor.navigation/plugin.xml
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/fragment.e4xmi
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabaseRepairWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ITaxonEditor.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelDistributionUpdateWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/GenericConfiguratorWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ImportFromFileDataSourceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/NameHelper.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteMediaConfiguratorComposite.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RichTextWithLabelElement.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/TextWithLabelElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElementController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractIdentifiableEntityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java [changed mode: 0644->0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TextDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaMetaElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java [changed mode: 0644->0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferencingObjectsMessagesSection.java [new file with mode: 0755]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractReferencedEntityElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/DetailsViewer.java [changed mode: 0644->0755]
eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db
eu.etaxonomy.taxeditor.workbench/fragment.e4xmi
eu.etaxonomy.taxeditor.workbench/plugin.xml
eu.etaxonomy.taxeditor/rcp.target

index 6d4d10b8732c615a5c186a3f15ac4f25cabc2974..7c11f80a923880d73983e0f560f88a3b6c00f555 100644 (file)
       </viewCommandMapping>
    </extension>
    <extension
-         id="id1"
+         id="eu.etaxonomy.taxeditor.bulkeditor.workbench.model"
+         name="Bulk Editor Workbench Model"
          point="org.eclipse.e4.workbench.model">
       <fragment
             apply="always"
index 2ed1b2a9eada7169a1f9a118169b0206f0d16d08..b90ffdcaa5f01c478a999407339097dd0b5861f8 100644 (file)
@@ -217,23 +217,25 @@ public class DeleteHandler extends AbstractHandler {
                                                MessagingUtils.messageDialog("Delete not possible", getClass(), "The object could not be deleted. An exception occured.", null);
                                        }
                                }else if (model != null) {
-                                       int offset = selection.getOffset();
-                                       if (offset == 0){
-                                               offset = 1;
-                                       }
-                        Iterator iter = model.getAnnotationIterator(offset, selection.getLength(), true, true);
-                   //     Iterator<Annotation> iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
-                        while (iter.hasNext()) {
-                            Object next = iter.next();
-                            if (next instanceof LineAnnotation) {
-                                if (result.isOk()){
-                                    ((LineAnnotation)next).markAsDeleted(config);
-
-                                }
-
-                            }
-                        }
-                    }
+                                       annotation.markAsDeleted(config);
+                               }
+//                                     int offset = selection.getOffset();
+//                                     if (offset == 0){
+//                                             offset = 1;
+//                                     }
+//                        Iterator iter = model.getAnnotationIterator(offset, selection.getLength(), true, true);
+//                   //     Iterator<Annotation> iter = model.getAnnotationIterator(selection.getOffset(), selection.getLength(), true, true);
+//                        while (iter.hasNext()) {
+//                            Object next = iter.next();
+//                            if (next instanceof LineAnnotation) {
+//                                if (result.isOk()){
+//                                    ((LineAnnotation)next).markAsDeleted(config);
+//
+//                                }
+//
+//                            }
+//                        }
+//                    }
 
                            }
                        if (result.isOk() ){
index 4c503785dbe93d03e9ab426e9d11c21606108c82..7490fd9df63073de602f09537582029988a2b80f 100644 (file)
@@ -6,5 +6,6 @@ bin.includes = META-INF/,\
                icons/,\
                p2.inf,\
                OSGI-INF/,\
-               src/main/java/eu/etaxonomy/taxeditor/editor/l10n/
+               src/main/java/eu/etaxonomy/taxeditor/editor/l10n/,\
+               fragment.e4xmi
 bin.excludes = src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java
index 4c12d83c90fddde31587e2bfdb1e61eda771fd8e..623de6025bfe8eaff27eac31a2c59b113c436ac5 100644 (file)
       </viewCommandMapping>
     </extension>
    <extension
-         id="id1"
+         id="eu.etaxonomy.taxeditor.editor.workbench.model"
+         name="Editor Workbench Model"
          point="org.eclipse.e4.workbench.model">
       <fragment
-            apply="initial"
+            apply="always"
             uri="fragment.e4xmi">
       </fragment>
    </extension>
index 3452b541be0cd40225b101975f64d936168b2ce8..e07239987cc8d24647173229e426ec8d6909dadf 100644 (file)
@@ -32,6 +32,7 @@ import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
@@ -59,7 +60,7 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  */
 public class MultiPageTaxonEditor extends FormEditor implements
 IPartContentHasFactualData, IConversationEnabled, IPostOperationEnabled,
-IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
+IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia, ITaxonEditor {
 
     /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon"{trunked}</code> */
     public static final String ID = "eu.etaxonomy.taxeditor.editor.taxon"; //$NON-NLS-1$
@@ -334,6 +335,13 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
                 container.refresh();
             }
         }
+        if (element instanceof TaxonRelationship) {
+            TaxonNameEditor page = (TaxonNameEditor) getPage(Page.NAME);
+            AbstractGroupedContainer container = page.getContainer(((TaxonRelationship) element).getFromTaxon());
+            if (container != null) {
+                container.refresh();
+            }
+        }
         //refresh part title
         //TODO: refresh taxon node in taxon navigator
         setPartName();
index d515f18494899f8a3f7503efacb6c51a3c107fca..4cf1d5931024474ce9f0ac331d788867b2ea42b6 100644 (file)
@@ -202,7 +202,7 @@ OpenDerivativeEditorForDescriptionElement_NO_SPECIMENS_MESSAGE=Keine Specimens f
 OpenDerivativeEditorForTaxonNode_COULD_NOT_OPEN=Specimen-Editor konnte nicht geöffnet werden
 DeleteDescriptionElementOperation_DESC_NOT_FOUND=Beschreibung konnte nicht gefunden werden!
 DeleteHandler_CONFIRM_DELETION=Löschen bestätigen
-DeleteHandler_CONFIRM_DELETION_MESSAGE=Wollen sie wirklich das Medienobjekt löschen?
+DeleteHandler_CONFIRM_DELETION_MESSAGE=Wollen sie die Mediendaten wirklich löschen?
 DeleteHandler_DELETE=Löschen
 DeleteHandler_INVALID_SELECTION=Auswahl ungültig für den DeleteHandler
 DeleteHandler_SKIP=Überspringen
old mode 100644 (file)
new mode 100755 (executable)
index 6e640db..e438a48
@@ -209,14 +209,14 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                addListener();
        }
 
-       private void addListener() {
+       protected void addListener() {
                getNameViewer().getTextWidget().addModifyListener(
                                nameCompositeModifyListener);
                getNameViewer().getTextWidget().addFocusListener(
                                nameCompositeFocusListener);
        }
 
-       private void removeListener() {
+       protected void removeListener() {
                getNameViewer().getTextWidget().removeModifyListener(
                                nameCompositeModifyListener);
                getNameViewer().getTextWidget().removeFocusListener(
@@ -439,7 +439,7 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
        /**
         *
         */
-       private void enableFreeText() {
+       protected void enableFreeText() {
                setEnabled(isFreetextEditingAllowed());
        }
 
index 6c8e0d4719c27077bafa107f530ee55eafeecf39..3be30d737c8e73eeca33f476b24c9ad06f7e39b0 100644 (file)
@@ -9,11 +9,20 @@
 
 package eu.etaxonomy.taxeditor.editor.name.container;
 
+import javax.persistence.GenerationType;
+
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.swt.graphics.Font;
 
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
+import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor;
+import eu.etaxonomy.taxeditor.model.NameHelper;
 import eu.etaxonomy.taxeditor.preference.Resources;
 
 /**
@@ -24,6 +33,7 @@ import eu.etaxonomy.taxeditor.preference.Resources;
  * @version 1.0
  */
 public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
+       TaxonRelationship misapplication;
 
        /**
         * <p>Constructor for MisapplicationContainer.</p>
@@ -34,6 +44,7 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
         */
        public MisapplicationContainer(AbstractGroup group, Taxon misappliedName) {
                super(misappliedName);
+               
        }
 
 
@@ -45,7 +56,14 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
        protected void initializeComposite() {
                setIsDraggable(true);
                setFont(getViewerFont());
-
+               TaxonNameEditor editor = getEditor();
+               Taxon taxon = editor.getTaxon();
+               for (TaxonRelationship rel: taxon.getTaxonRelations(getMisappliedName())){
+                       if (rel.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())){
+                               misapplication = rel;
+                               break;
+                       }
+               }
                showSec();
 
                initTextViewer();
@@ -60,22 +78,34 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
                if (getMisappliedName() == null) {
                        return;
                }
-
-               if (getMisappliedName().getSec() == null) {
+               String title = "";
+               String author = "";
+               TaxonName misappliedNameName = HibernateProxyHelper.deproxy(getMisappliedName().getName(), TaxonName.class);
+               if (misappliedNameName.getAuthorshipCache() != null && !StringUtils.isBlank(misappliedNameName.getAuthorshipCache())&& getMisappliedName().getAppendedPhrase() == null){
+                       author = ", non " + misappliedNameName.getAuthorshipCache();
+               }
+               if (misapplication.getCitation() == null) {
                    if (getMisappliedName().getAppendedPhrase() != null ){
-                       setNonEditableInfo(getMisappliedName().getAppendedPhrase(), false);
+                       title = getMisappliedName().getAppendedPhrase();
                    }else{
-                       setNonEditableInfo("sec. ???", false); //$NON-NLS-1$
+                       title = "auct."; //$NON-NLS-1$
+                       
                    }
+                 
                } else {
-                       String title = getMisappliedName().getSec().getTitleCache();
-                       title = title.replace("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
-                       String sec = "sec. "; //$NON-NLS-1$
+                       String sec = " sensu "; //$NON-NLS-1$
                        if (getMisappliedName().getAppendedPhrase() != null ){
                            sec = getMisappliedName().getAppendedPhrase() + " "+sec; //$NON-NLS-1$
                        }
-                       setNonEditableInfo(sec + title, false);
+                       title += sec + misapplication.getCitation().getTitleCache();
+                       
+                       
+                       
+                       
                }
+               title += author;
+               title = title.replace("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
+               setNonEditableInfo(title, false);
        }
 
        /**
@@ -120,5 +150,58 @@ public class MisapplicationContainer extends AbstractGroupedContainer<Taxon> {
        protected void updateIndent() {
                setIndent(MISAPPLIEDNAME_INDENT);
        }
+       
+       /**
+        * <p>
+        * initTextViewer
+        * </p>
+        */
+       @Override
+       protected void initTextViewer() {
+
+               // showNameRelations();
+
+               updateIndent();
+
+               updateIcon();
+
+               String text = NameHelper.getDisplayNameCache(getData());
+
+               if (text.length() == 0) {
+                       initEmptyText();
+               } else {
+                       getNameViewer().setText(text);
+                       placeCursor();
+               }
+               calculateAnnotations();
+       }
+       
+       @Override
+    public void refresh() {
+               // showNameRelations();
+
+               String text = NameHelper.getDisplayNameCache(getData());
+
+               if (getNameViewer().getTextWidget() == null) {
+                       // we might get here via dnd. Look slike it can be ignored
+                       return;
+               }
+
+               if (text.length() == 0) {
+                       initEmptyText();
+               } else if (!getNameViewer().getTextWidget().getText().equals(text)) {
+                       removeListener();
+                       getNameViewer().getTextWidget().setText(text);
+                       addListener();
+               }
+
+               updateNonEditableInfo();
+
+               updateIcon();
+               // placeCursor();
+               updateIndent();
+
+               enableFreeText();
+       }
 
 }
index 1da0001b93d5f1eb7e75843c1e67b3d27fb8a7fa..7fa2b410ddf9ce8edf320c7ca6cab1648e4c13ba 100644 (file)
@@ -102,13 +102,15 @@ public class DeleteHandler extends AbstractHandler {
 
                                        // TODO use undo context specific to editor
                     MediaDeletionConfigurator config = new MediaDeletionConfigurator();
+                    config.setDeleteIfUsedInTaxonDescription(true);
+                    config.setOnlyRemoveFromGallery(false);
 
                     if (!DeleteConfiguratorDialog.openConfirmWithConfigurator(config, HandlerUtil.getActiveShell(event), Messages.DeleteHandler_CONFIRM_DELETION,  Messages.DeleteHandler_CONFIRM_DELETION_MESSAGE)){
                         return null;
                     }
 
 
-
+                    
                     if (config.isOnlyRemoveFromGallery() || ((Media)object).getId() == 0){
                         operations.add(new RemoveImageFromDescriptionElementOperation(label, undoContext,  (Media) object, imageGallery, postOperationEnabled));
                     }else{
index 66af4c76f332d614d21c87beba0dd7ba6a6447ee..98bbdf48ac78f9f0f6bb68aff1878eba6985a730 100644 (file)
@@ -37,9 +37,6 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>
- * DynamicFeatureMenu class.
- * </p>
  *
  * @author n.hoffmann
  * @created 17.04.2009
@@ -47,15 +44,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class DynamicFeatureMenu extends CompoundContributionItem {
 
-       private final ISelectionService selectionService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(ISelectionService.class);
-       private final IHandlerService handlerService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(IHandlerService.class);
-
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
-        */
        /** {@inheritDoc} */
        @Override
        protected IContributionItem[] getContributionItems() {
@@ -63,9 +51,9 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                return new IContributionItem[] { new ContributionItem() {
                        @Override
             public void fill(Menu menu, int index) {
+                           ISelectionService selectionService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getSelectionService();
 
-                               ISelection selection = selectionService
-                                               .getSelection(DescriptiveViewPart.ID);
+                               ISelection selection = selectionService.getSelection(DescriptiveViewPart.ID);
 
                                if (selection instanceof IStructuredSelection) {
                                        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
@@ -121,7 +109,7 @@ public class DynamicFeatureMenu extends CompoundContributionItem {
                                Event event = new Event();
                                event.data = deproxiedFeature;
                                try {
-                                       handlerService.executeCommand(
+                                   TaxeditorEditorPlugin.getDefault().getWorkbench().getService(IHandlerService.class).executeCommand(
                                                        CreateDescriptionElementOperation.ID, event);
                                } catch (Exception e) {
                                        MessagingUtils.error(getClass(), e);
index e0fe2077275fce5b8560ea6640c3adfd2c593b05..3d6d0664c390b856641a40d7019cd1c178454f0f 100644 (file)
@@ -9,17 +9,24 @@
 
 package eu.etaxonomy.taxeditor.editor.view.media.operation;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
+import eu.etaxonomy.cdm.api.service.DeleteResult;
 import eu.etaxonomy.cdm.api.service.IMediaService;
 import eu.etaxonomy.cdm.api.service.config.MediaDeletionConfigurator;
 import eu.etaxonomy.cdm.api.utility.ImagesUtility;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin;
+import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -67,7 +74,19 @@ public class DeleteMediaOperation extends AbstractPostTaxonOperation {
           // ImagesUtility.removeMediaFromGallery(description, media);
 
                monitor.worked(20);
-               CdmStore.getService(IMediaService.class).delete(media.getUuid(), config);
+               DeleteResult result = CdmStore.getService(IMediaService.class).delete(media.getUuid(), config);
+               String errorMessage = "The media ";
+               ImagesUtility.removeMediaFromGallery(description, media);
+               if (!result.isOk()){
+                       List<String> messages = new ArrayList<String>();
+                       int i = result.getExceptions().size();
+                       for (Exception e:result.getExceptions()){
+                               messages.add(e.getMessage());
+                       }
+                       errorMessage += "could not be deleted from database. ";
+                       //MessagingUtils.errorDialog("test", getClass(), "message", TaxeditorBulkeditorPlugin.PLUGIN_ID, result.getExceptions().iterator().next(),true);
+                       DeleteResultMessagingUtils.messageDialogWithDetails(result,errorMessage, TaxeditorBulkeditorPlugin.PLUGIN_ID);
+               }
                monitor.worked(40);
 
                return postExecute(null);
index 219bde00926045297a6d2574047d706db026b71b..f66f25d66a7ee040145f2f3f0c4228506fd1f311 100644 (file)
@@ -9,6 +9,9 @@
     <artifactId>taxeditor-parent</artifactId>
     <version>4.8.0-SNAPSHOT</version>
   </parent>
+  
+  <name>Molecular Library Dependencies Bundle</name>
+  <description>Plugin containing all the library dependencies</description>
 
   <build>
     <plugins>
index 130c92b0eb7f82c23e7be82cca24b2fac6078435..dcbb176eff5279258f07233aab6945ae595578ff 100644 (file)
       </definition>
    </extension>
    <extension
-         id="id1"
+         id="eu.etaxonomy.taxeditor.navigation.workbench.model"
+         name="Navigation Workbench Model"
          point="org.eclipse.e4.workbench.model">
       <fragment
             apply="always"
index 6a7863c81fa35ea4f9c607172953747c6a831d73..de4a8932b1f0d3ad37c13a824ff0dbd067dc2c13 100644 (file)
@@ -73,7 +73,6 @@ Require-Bundle: org.eclipse.osgi,
  org.eclipse.core.databinding.observable,
  org.eclipse.core.databinding.property,
  org.eclipse.jface.databinding,
  eu.etaxonomy.taxeditor.workbench,
  org.eclipse.e4.core.di.annotations;bundle-version="1.5.0",
  org.eclipse.e4.ui.di;bundle-version="1.1.100",
index 5fd93b07ee10f39ee1d10912741efe8ccdccce73..b5ab73a129c81e93f8deb155f6b6eeda74135866 100644 (file)
@@ -28,9 +28,5 @@
       <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_W-C-gCaJEeeTEd_pKXBflg" coreExpressionId="isCdmStoreConnected"/>
       <parameters xmi:id="_BylIUCZzEeeQLpuomSmVoQ" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"/>
     </elements>
-    <elements xsi:type="menu:HandledMenuItem" xmi:id="_VINAAEqgEeeN-dEYnw7m3g" elementId="eu.etaxonomy.taxeditor.store.showViewMenu.sessions" label="Feature Tree Editor" command="_bnVKsCZxEeeQLpuomSmVoQ">
-      <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_VINAAUqgEeeN-dEYnw7m3g" coreExpressionId="isCdmStoreConnected"/>
-      <parameters xmi:id="_VINAAkqgEeeN-dEYnw7m3g" elementId="eu.etaxonomy.taxeditor.store.showView.parameter.sessionView" name="eu.etaxonomy.taxeditor.workbench.commandparameter.partName" value="eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor"/>
-    </elements>
   </fragments>
 </fragment:ModelFragments>
index 2a188f2f0d7210972cce64306657adff5bc6463c..6c85ec1806fc3e88f157cd078fba7105ccf9c12c 100755 (executable)
    </viewCommandMapping>
 </extension>
 <extension
-      id="id1"
+      id="eu.etaxonomy.taxeditor.store.workbench.model"
+      name="Store Workbench Model"
       point="org.eclipse.e4.workbench.model">
    <fragment
          apply="always"
index 40c93ebf6b12090d70e3392dda23154d27b23813..578bdff85abfcc4f455caaf0b1335cd89eca56a8 100644 (file)
@@ -13,6 +13,7 @@ import org.eclipse.jface.wizard.Wizard;
 
 import eu.etaxonomy.cdm.config.ICdmSource;
 import eu.etaxonomy.cdm.io.common.CacheUpdaterConfigurator;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
 import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -52,10 +53,12 @@ public class DatabaseRepairWizard extends Wizard {
 
              }
             if (config.isDoFeatureNode() || config.isDoPolytomousKeyNode() || config.isDoTaxonNode()){
+               config.setCheck(CHECK.IMPORT_WITHOUT_CHECK);
                 Job updateJob = CdmStore.getImportManager().createIOServiceJob(config);
                 CdmStore.getImportManager().run(updateJob);
             }
             if (!cacheUpdaterConfig.getClassList().isEmpty()){
+               cacheUpdaterConfig.setCheck(CHECK.IMPORT_WITHOUT_CHECK);
                 Job updateJob2 = CdmStore.getImportManager().createIOServiceJob(cacheUpdaterConfig);
                 CdmStore.getImportManager().run(updateJob2);
             }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ITaxonEditor.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/ITaxonEditor.java
new file mode 100755 (executable)
index 0000000..dd8fa72
--- /dev/null
@@ -0,0 +1,13 @@
+package eu.etaxonomy.taxeditor.editor;
+
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+
+
+public interface ITaxonEditor {
+       /**
+        * 
+        * @return the @Taxon of the editor
+        * 
+        */
+       public abstract Taxon getTaxon();
+}
index 5acacce6c03100d083026b86898febc4f53254a7..1a893caf487136d1ef1504e9f08fee98f8cccf26 100644 (file)
@@ -63,6 +63,8 @@ public class DefinedTermMenu extends CompoundContributionItem {
                     new MenuManager("Others","eu.etaxonomy.taxeditor.store.term.other.menu");
             otherMenuManager.setVisible(true);
             dtMenuManager.add(otherMenuManager);
+            //FIXME E4: This should be removed during e4 migration. dynamic menu should be declared in model fragment
+            dtMenuManager.add(createFeatureTreeMenuItem());
 
             List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
             Collections.sort(ttList,new SortByTermTypeMessage());
@@ -142,21 +144,21 @@ public class DefinedTermMenu extends CompoundContributionItem {
 
        }
 
-       private CommandContributionItem createDefaultMenuItem(TermType termType) {
+       private CommandContributionItem createFeatureTreeMenuItem() {
 
                Map<String, String> params = new HashMap<String, String>();
-               params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
-                               termType.getUuid().toString());
+               params.put("eu.etaxonomy.taxeditor.workbench.commandparameter.partName",
+                               "eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor");
 
         CommandContributionItemParameter p = new CommandContributionItemParameter(
                 PlatformUI.getWorkbench(),
-                "",
-                "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
+                "eu.etaxonomy.taxeditor.featuretree.commandContributionItemParameter",
+                "eu.etaxonomy.taxeditor.command.openPart",
                 params,
                 null,
                 null,
                 null,
-                "Other " + termType.getMessage() + "s",
+                "Feature Tree",
                 "",
                 "",
                 SWT.PUSH,
@@ -170,6 +172,34 @@ public class DefinedTermMenu extends CompoundContributionItem {
 
        }
 
+       private CommandContributionItem createDefaultMenuItem(TermType termType) {
+
+           Map<String, String> params = new HashMap<String, String>();
+           params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid",
+                   termType.getUuid().toString());
+
+           CommandContributionItemParameter p = new CommandContributionItemParameter(
+                   PlatformUI.getWorkbench(),
+                   "",
+                   "eu.etaxonomy.taxeditor.store.openDefinedTermEditor",
+                   params,
+                   null,
+                   null,
+                   null,
+                   "Other " + termType.getMessage() + "s",
+                   "",
+                   "",
+                   SWT.PUSH,
+                   "",
+                   true);
+
+
+
+           CommandContributionItem item = new CommandContributionItem(p);
+           return item;
+
+       }
+
        private class SortByTermTypeMessage implements Comparator<TermType> {
            @Override
         public int compare(TermType t1, TermType t2) {
index f7b1a6d1422a84e38e727adbc9dbb8e78c418e17..af9ef8dadfc7746ac77300179ea32c9e8b906fe1 100644 (file)
@@ -16,9 +16,11 @@ import javax.inject.Inject;
 import javax.inject.Named;
 
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.e4.ui.di.Focus;
 import org.eclipse.e4.ui.di.Persist;
 import org.eclipse.e4.ui.model.application.ui.MDirtyable;
 import org.eclipse.e4.ui.services.IServiceConstants;
+import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -81,6 +83,10 @@ public class FeatureTreeEditor implements
     private Button btnOpenFeatureTree;
 
     private ConversationHolder conversation;
+
+    @Inject
+    private ESelectionService selService;
+
     @Inject
     private MDirtyable dirty;
 
@@ -97,15 +103,14 @@ public class FeatureTreeEditor implements
        /** {@inheritDoc} */
        @PostConstruct
        public void createControl(Composite parent, @Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
-           parent.setLayout(new GridLayout());
-               Composite composite = new Composite(parent, SWT.NULL);
-               composite.setLayout(new GridLayout());
-               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+           parent.setLayout(new GridLayout(2, false));
 
-               Composite composite_treeTitle = new Composite(composite, SWT.NULL);
+               Composite composite_treeTitle = new Composite(parent, SWT.NULL);
                composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
                                false));
-               composite_treeTitle.setLayout(new GridLayout(3, false));
+               GridLayout gl_composite_treeTitle = new GridLayout(2, false);
+               gl_composite_treeTitle.marginWidth = 0;
+               composite_treeTitle.setLayout(gl_composite_treeTitle);
 
                label_title = new Label(composite_treeTitle, SWT.NULL);
                label_title.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
@@ -114,31 +119,29 @@ public class FeatureTreeEditor implements
                text_title = new Text(composite_treeTitle, SWT.BORDER);
                text_title.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
 
-               btnOpenFeatureTree = new Button(composite_treeTitle, SWT.NONE);
+               btnOpenFeatureTree = new Button(parent, SWT.NONE);
+               btnOpenFeatureTree.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
                btnOpenFeatureTree.setToolTipText("Open Tree");
                btnOpenFeatureTree.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
 
-               Composite composite_treeContent = new Composite(composite, SWT.NULL);
-               composite_treeContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
-                               true, true));
-               composite_treeContent.setLayout(new GridLayout(2, false));
-
-               viewer = new TreeViewer(composite_treeContent);
+               viewer = new TreeViewer(parent);
                Tree tree = viewer.getTree();
                tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
                viewer.getControl().setLayoutData(
                                new GridData(SWT.FILL, SWT.FILL, true, true));
 
-               Composite composite_buttons = new Composite(composite_treeContent,
+               Composite composite_buttons = new Composite(parent,
                                SWT.NULL);
                composite_buttons.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false,
                                false));
                composite_buttons.setLayout(new GridLayout());
 
                button_add = new Button(composite_buttons, SWT.PUSH);
+               button_add.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
                button_add.setToolTipText("Add a feature to this feature tree.");
                button_add.setImage(ImageResources.getImage(ImageResources.ADD_EDIT));
                button_remove = new Button(composite_buttons, SWT.PUSH);
+               button_remove.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
                button_remove.setToolTipText("Remove a feature from this feature tree.");
                button_remove.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
 
@@ -207,6 +210,17 @@ public class FeatureTreeEditor implements
 
                button_add.setEnabled(selection.size() <= 1);
                button_remove.setEnabled(selection.size() > 0);
+               //propagate selection
+               IStructuredSelection isel = (IStructuredSelection) event.getSelection();
+               selService.setSelection((isel.size() == 1 ? isel.getFirstElement() : isel.toArray()));
+       }
+
+       @Focus
+       public void focus(){
+           viewer.getControl().setFocus();
+        if(conversation!=null && !conversation.isBound()){
+            conversation.bind();
+        }
        }
 
        @Persist
@@ -282,6 +296,7 @@ public class FeatureTreeEditor implements
                        if (event.detail == DND.DROP_MOVE) {
                                IStructuredSelection selection = (IStructuredSelection) viewer
                                                .getSelection();
+                               viewer.remove(selection);
                                viewer.refresh();
                        }
                }
@@ -365,6 +380,7 @@ public class FeatureTreeEditor implements
                                viewer.add(target, droppedNode);
                                viewer.reveal(droppedNode);
                        }
+            setDirty(true);
                        return true;
                }
 
index 506d96bc9fb1e8abb3038190b7526a5f042f0138..a44b41f1d81cb943aedcad54c7495de2f2d56f1a 100644 (file)
@@ -9,11 +9,20 @@
 
 package eu.etaxonomy.taxeditor.io;
 
+import java.util.List;
+
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.progress.IProgressConstants;
 
 import eu.etaxonomy.cdm.api.application.ICdmRepository;
+import eu.etaxonomy.cdm.common.IoResultBase;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
+import eu.etaxonomy.cdm.io.common.ImportResult;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
 
 /**
  * <p>
@@ -79,5 +88,44 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
         * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
         */
        protected abstract Job createIOJob(CONFIGURATOR configurator);
+       
+        /**
+     * @param configurator
+     * @param display
+     * @param importResult
+     */
+    protected void showResult(String importName, final Display display,
+            IoResultBase ioResult) {
+        StringBuffer reportTextTemp = ioResult.createReport();
+        final StringBuffer reportText;
+        if (StringUtils.isBlank(reportTextTemp.toString()) && ioResult instanceof ImportResult){
+            //reportTextTemp.append("No update result available");
+            //TODO: this is a workaround because the abcd import writes the report in the report part...
+               ImportResult importResult = (ImportResult)ioResult;
+            if (!importResult.getReports().isEmpty() && importResult.getReports().get(0) != null){
+                reportTextTemp = new StringBuffer();
+                if(importResult!=null){
+                    List<byte[]> reports = importResult.getReports();
+                    for (byte[] bs : reports) {
+                        if (bs != null){ reportTextTemp.append(new String(bs));}
+                    }
+                }
+            }
+        }
+        reportText = reportTextTemp;
+        if (StringUtils.isBlank(reportText.toString())){ return;}
+        display.asyncExec(new Runnable() {
+
+            @Override
+            public void run() {
+                // display reports with possibility to save
+                ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+                dialog.setTitle(importName+" Report");
+                dialog.setReportText(reportText.toString());
+                dialog.open();
+                CdmStore.getContextManager().notifyContextRefresh();
+            }
+        });
+    }
 
 }
index e518ddfa64c428bdb5e571545a9b71ecc056cdd7..14b1914496226ec4996c6223dcaf3752a81e3546 100644 (file)
@@ -9,8 +9,11 @@
 
 package eu.etaxonomy.taxeditor.io;
 
+import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -34,18 +37,15 @@ import eu.etaxonomy.cdm.io.common.ExportResult;
 import eu.etaxonomy.cdm.io.common.ExportResultType;
 import eu.etaxonomy.cdm.io.common.IExportConfigurator;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
-import eu.etaxonomy.cdm.common.IoResultBase;
-import eu.etaxonomy.cdm.common.IoResultBase.IoInfo;
+
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.outputmodel.OutputModelConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
 import eu.etaxonomy.cdm.io.service.IIOService;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
-import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
 
 /**
  * <p>
@@ -180,7 +180,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
        public Job createIOServiceJob(final IExportConfigurator configurator, final File exportFile) {
            Assert.isNotNull(configurator, "Configuration may not be null");
 
-          // final Display display = Display.getCurrent();
+           final Display display = Display.getCurrent();
 
            Job job = new Job("Export: " + configurator.getClass().getSimpleName()) { //$NON-NLS-1$
                @Override
@@ -217,7 +217,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                            logger.error(e.getStackTrace());
                        }
 
-
+                       showResult(configurator.getClass().getSimpleName(), display, result); 
 
 
                    } catch (Exception e) {
@@ -281,9 +281,8 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
      */
     public Job createIOServiceJob(OutputModelConfigurator configurator, String urlString) {
         Assert.isNotNull(configurator, "Configuration may not be null");
-
-        // final Display display = Display.getCurrent();
-
+        final Display display = Display.getDefault();
+        
          Job job = new Job("Export: " + configurator.getClass().getSimpleName()) { //$NON-NLS-1$
              @Override
              protected IStatus run(IProgressMonitor monitor) {
@@ -299,8 +298,12 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                              if(exportData != null){
                                  File file = new File(urlString);
                                  FileOutputStream stream = new FileOutputStream(file);
-                                 stream.write(exportData);
-                                 stream.close();
+                                 Writer out = new BufferedWriter(new OutputStreamWriter(
+                                               stream, "UTF8"));
+
+                               stream.write(exportData);
+                                out.flush();
+                                stream.close();
                              }
                          } else if (result.getExportData().getType().equals(ExportResultType.MAP_BYTE_ARRAY)){
                              Map<String, byte[]> resultMap = (Map<String, byte[]>)data.getExportData();
@@ -313,6 +316,8 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                                  }
                                  File file = new File(urlString+File.separator + key + fileEnding);
                                  FileOutputStream stream = new FileOutputStream(file);
+                                 Writer out = new BufferedWriter(new OutputStreamWriter(
+                                               stream, "UTF8"));
                                  stream.write(fileData);
                                  stream.close();
                              }
@@ -323,40 +328,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
                      } catch(Exception e){
                          logger.error(e.getStackTrace());
                      }
-                     final StringBuilder reportText = new StringBuilder();
-                     if(result!=null){
-                         List<IoInfo> reports = result.getErrors();
-                         reportText.append("Errors:\\r");
-                         for (IoInfo bs : reports) {
-                             reportText.append(bs.getMessage() + " - " +bs.getException().getStackTrace());
-                         }
-                         List<IoResultBase.IoInfo> warnings = result.getWarnings();
-                         reportText.append("Warnings:\\r");
-                         for (IoResultBase.IoInfo bs : warnings) {
-                             reportText.append(bs);
-                         }
-                         List<IoInfo> exceptions = result.getExceptions();
-                         reportText.append("Exceptions:\\r");
-                         for (IoInfo bs : exceptions) {
-                             reportText.append(bs.getMessage() + " - " +bs.getException().getStackTrace());
-                         }
-
-
-                     }
-                     final Display display = Display.getDefault();
-                     display.asyncExec(new Runnable() {
-
-                         @Override
-                         public void run() {
-                             // display reports with possibility to save
-                             ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
-                             dialog.setTitle(configurator.getClass().getSimpleName()+" Report");
-                             dialog.setReportText(reportText.toString());
-                             dialog.open();
-                             CdmStore.getContextManager().notifyContextRefresh();
-                         }
-                     });
-
+                     showResult(configurator.getClass().getSimpleName(), display, result);
 
 
                  } catch (Exception e) {
index 0a8856e9de522fe88d90542136f86a733d8434d0..b515f67232d162ba1a69d93c54ba6ab2ee74cf69 100644 (file)
@@ -562,42 +562,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> implem
 
 
 
-    /**
-     * @param configurator
-     * @param display
-     * @param importResult
-     */
-    private void showResult(String importName, final Display display,
-            ImportResult importResult) {
-        StringBuffer reportTextTemp = importResult.createReport();
-        final StringBuffer reportText;
-        if (StringUtils.isBlank(reportTextTemp.toString())){
-            reportTextTemp.append("No update result available");
-            //TODO: this is a workaround because the abcd import writes the report in the report part...
-            if (!importResult.getReports().isEmpty() && importResult.getReports().get(0) != null){
-                reportTextTemp = new StringBuffer();
-                if(importResult!=null){
-                    List<byte[]> reports = importResult.getReports();
-                    for (byte[] bs : reports) {
-                        if (bs != null){ reportTextTemp.append(new String(bs));}
-                    }
-                }
-            }
-        }
-        reportText = reportTextTemp;
-        display.asyncExec(new Runnable() {
-
-            @Override
-            public void run() {
-                // display reports with possibility to save
-                ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
-                dialog.setTitle(importName+" Report");
-                dialog.setReportText(reportText.toString());
-                dialog.open();
-                CdmStore.getContextManager().notifyContextRefresh();
-            }
-        });
-    }
+   
 
 
 
index 0c5d3c3b25cc6c4919168ea7356186b94b4015c2..54b302769260e2d89e99c18384e0ffaaf8b480d0 100755 (executable)
@@ -75,6 +75,7 @@ public class ExcelDistributionUpdateWizard extends AbstractImportWizard<ExcelDis
         UUID vocUuid = dataSourcePage.getVocUuid();
 
         configurator.setAreaVocabularyUuid(vocUuid);
+        //CdmStore.getImportManager().runMoniteredOperation(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
         Job job = CdmStore.getImportManager().createIOServiceJob(configurator);
         CdmStore.getImportManager().run(job);
 
index a0eab6142a2dd2bf08dedb6f5844d60e78f22437..46ab6ef20299348a40a61bb9cf950ca87e5bc6a9 100644 (file)
@@ -61,6 +61,7 @@ public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<No
                URI source = dataSourcePage.getUri();
                configurator.setSource(source);
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+               configurator.setSourceReferenceTitle(dataSourcePage.getTextReferenceString().getText());
                File file = new File(source);
                FileInputStream fis = null;
 
index e586392f062c6a8e0926d7f693a16bfd687ba14c..6651d3ecd32af560109448fcdef96467a77535bf 100644 (file)
@@ -162,13 +162,18 @@ public class GenericConfiguratorWizardPage extends WizardPage {
                 return result;
             }
         });
-
-        for (Method method : methods) {
-            if (!ignoreMethods.contains( method.getName())) {
-                createCheckbox(composite, method, configurator);
-            }
-        }
-
+        
+               for (Method method : methods) {
+                       if (ignoreMethods != null){
+                           if (!ignoreMethods.contains( method.getName())) {
+                               createCheckbox(composite, method, configurator);
+                           }
+                       }else{
+                               createCheckbox(composite, method, configurator);
+                       }
+                   
+               }
+       
         // scrolledComposite.setContent(composite);
 
         setControl(composite);
index 8b3f2dd80f20ef45f624613e97aabc940de6a596..8f26e25dc012a75dab978f436621a445fa1fcde8 100644 (file)
@@ -39,8 +39,7 @@ public class ImportFromFileDataSourceWizardPage extends AbcdSourceSelectionPage
        private String[] extensions = {"*.xml"};
 
        private FileDialog fileDialog;
-
-
+       private Text textReferenceString;
 
        protected ImportFromFileDataSourceWizardPage(String title, String description, String[] extensions) {
                super(PAGE_NAME);
@@ -95,13 +94,29 @@ public class ImportFromFileDataSourceWizardPage extends AbcdSourceSelectionPage
 
                });
 
-
+               Label labelRef = new Label(composite, SWT.NONE);
+        labelRef.setText("Default import souce reference");
+        labelRef.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
+        textReferenceString = new Text(composite, SWT.NONE);
+        textReferenceString.setEnabled(true);
+        GridData gd_textReferenceString = new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1);
+        gd_textReferenceString.widthHint = 229;
+        textReferenceString.setLayoutData(gd_textReferenceString);
                setControl(composite);
        }
 
        public File getFile() {
                return new File(text_source.getText());
        }
+       
+       public Text getTextReferenceString() {
+               return textReferenceString;
+       }
+
+       public void setTextReferenceString(Text textReferenceString) {
+               this.textReferenceString = textReferenceString;
+       }
+
 
        @Override
     public URI getUri() {
index 2c8232a3d30b57a478465a7a629523789fab23b6..f17123ae3049d6032f491b0c5f1db638fe193aec 100644 (file)
@@ -139,7 +139,7 @@ PresenceAbsenceTermDetailElement_LABEL_COLOR=Color
 DeleteConfiguration_media_removeFromGallery=Remove the media from the image gallery but leave it in database
 DeleteConfiguration_media_deleteIfUsedInTaxonDescription=Delete also if media is used in taxon description
 DeleteConfiguration_media_deleteIfUsedInSpecimenDescription=Delete also if media is used in specimen description        
-DeleteConfiguration_media_delete=Delete the media completely
+DeleteConfiguration_media_delete=Remove the media from the image gallery and delete the media completely, if possible
 
 NewGrantedAuthority_AlreadyInDb=The granted authority already exists.
 
index 88046cb1ce2bfe14687d2e46589cf98988779130..b6afaef66246b3e80c656b8ea6931c9f20e68581 100644 (file)
@@ -136,10 +136,10 @@ PresenceAbsenceTermDetailElement_CHOOSE_COLOR=Farbe w
 PresenceAbsenceTermDetailElement_COLOR_NOT_SET=Farbe konnte nicht gespeichert werden
 PresenceAbsenceTermDetailElement_LABEL_COLOR=Farbe
 
-DeleteConfiguration_media_removeFromGallery=Entferne Medienobjekt aus der Gallerie, aber behalte es in der Datenbank
-DeleteConfiguration_media_deleteIfUsedInTaxonDescription=Lösche das Medienobjekt, auch wenn es  Teil einer Taxonbeschreibung ist
-DeleteConfiguration_media_deleteIfUsedInSpecimenDescription=Lösche das Medienobjekt, auch wenn es Teil einer Specimenbeschreibung ist
-DeleteConfiguration_media_delete=Lösche das Medienobjekt
+DeleteConfiguration_media_removeFromGallery=Entferne Mediendaten aus der Gallerie, aber behalte es in der Datenbank
+DeleteConfiguration_media_deleteIfUsedInTaxonDescription=Lösche die Mediendaten, auch wenn es Teil einer Taxonbeschreibung ist
+DeleteConfiguration_media_deleteIfUsedInSpecimenDescription=Lösche die Mediendaten, auch wenn es Teil einer Specimenbeschreibung ist
+DeleteConfiguration_media_delete=Entferne die Mediendaten aus der Gallerie und lösche sie aus der Datenbank, wenn sie nicht anderweitig verwendet werden.
 
 NewGrantedAuthority_AlreadyInDb=Die GrantedAuthority ist bereits in der DB enthalten.
 
index 7c0b384181504588ff2f783b79b8b39a34365377..cefdb709e580d13b1b8b3460706e74f1fb4389c4 100644 (file)
@@ -166,6 +166,7 @@ public class ImageResources {
     public static final String CHARACTER_DATA_DERIVATE = "character_data_derivate";
 
     public static final String WEB = "web";
+    public static final String DATE = "dates";
 
 
        /***************************************************************************
@@ -397,6 +398,8 @@ public class ImageResources {
 
                registerImage(registry, WEB,
                        "web.gif");
+               registerImage(registry, DATE,
+                       "dates.gif");
 
        }
 
index 45e3282636807031898fe40fef9fd573abcbf37c..c97bc5c98b5dd164428d56f9848f5783f4f459fa 100644 (file)
@@ -33,6 +33,15 @@ public class NameHelper {
                return name.getTitleCache();
        }
        
+       /**
+        * <p>getDisplayName</p>
+        *
+        * @param name a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
+        * @return a {@link java.lang.String} object.
+        */
+       public static String getDisplayNameCache(TaxonBase taxon){
+               return taxon.getName().getNameCache();
+       }
        /**
         * <p>getDisplayName</p>
         *
index fadc0ad4c51e4851300fd48b401f95f3ea5b4097..11522e9cbece400d8d1d1a35d7229c058b12b177 100644 (file)
@@ -84,8 +84,8 @@ public class DeleteMediaConfiguratorComposite extends Composite {
 //            });
             btnRemoveFromImageGallery = new Button(this, SWT.RADIO);
             btnRemoveFromImageGallery.setText(Messages.DeleteConfiguration_media_removeFromGallery);
-            btnDelete.setSelection(!configurator.isOnlyRemoveFromGallery());
-               btnRemoveFromImageGallery.setSelection(configurator.isOnlyRemoveFromGallery());
+            btnRemoveFromImageGallery.setSelection(configurator.isOnlyRemoveFromGallery());
+               btnDelete.setSelection(configurator.isDeleteIfUsedInTaxonDescription());
         }
 
         m_bindingContext = initDataBindings();
index 1b3902221d338ab9c48432fe1109e80869f29650..7929518820b13354a963115611fd77fcaa988bbd 100644 (file)
@@ -11,10 +11,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.window.Window;
+//import org.eclipse.nebula.widgets.richtext.RichTextEditor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.events.FocusAdapter;
@@ -33,10 +35,12 @@ import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.IFormColors;
 import org.eclipse.ui.forms.widgets.ExpandableComposite;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.internal.forms.widgets.FormFonts;
 import org.joda.time.DateTime;
 import org.joda.time.Partial;
@@ -114,6 +118,7 @@ import eu.etaxonomy.taxeditor.ui.combo.VocabularyComboElement;
 import eu.etaxonomy.taxeditor.ui.dialog.CloneClassificationDetailElement;
 import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
 import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
+
 import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
 import eu.etaxonomy.taxeditor.ui.openurl.OpenUrlSelectorElement;
 import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
@@ -507,6 +512,7 @@ public class CdmFormFactory extends FormToolkit {
     @Override
     public void adapt(Composite composite) {
         composite.addMouseListener(selectionMouseHandler);
+       
         super.adapt(composite);
     }
 
@@ -2878,12 +2884,22 @@ public class CdmFormFactory extends FormToolkit {
         return labelElement;
     }
 
-    public DateElement createDateElement(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
-        Label label = new Label(formElement.getLayoutComposite(), style);
-        label.setText(labelText+" (yyyy-MM-dd)");
-        DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, style);
-        dateElement.initController(this, formElement);
-        return dateElement;
+//    public DateElementFormElement createDateElementForm(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
+//        Label label = new Label(formElement.getLayoutComposite(), style);
+//        label.setText(labelText+" (yyyy-MM-dd)");
+//        DateElementFormElement dateElement = new DateElementFormElement(this, dateTime, style, formElement.getLayoutComposite());
+//        dateElement.initInternalController();
+//        
+//        return dateElement;
+//    }
+    
+    public DateElement createDateElement(ICdmFormElement formElement, String labelText, DateTime dateTime, int style, boolean editableText){
+        Label label = new Label(formElement.getLayoutComposite(), style);
+         label.setText(labelText);
+         label.setLayoutData(new TableWrapData(TableWrapData.LEFT, TableWrapData.MIDDLE, 1, 1));
+         DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, style, editableText);
+         dateElement.initController(this, formElement);
+         return dateElement;
     }
 
     /**
@@ -2989,6 +3005,16 @@ public class CdmFormFactory extends FormToolkit {
         return section;
     }
 
+//     public RichTextWithLabelElement createRichTextLabelElement(ICdmFormElement parentElement, String labelString, String initialText, int textHeight, int style) {
+//              RichTextWithLabelElement element = new RichTextWithLabelElement(this, parentElement, labelString,
+//                              initialText, textHeight, style);
+//             adapt(element);
+//             parentElement.addElement(element);
+//             return element;
+//     }
+
+       
+
 
 
 
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RichTextWithLabelElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RichTextWithLabelElement.java
new file mode 100755 (executable)
index 0000000..ecad572
--- /dev/null
@@ -0,0 +1,306 @@
+/**
+ *
+ */
+package eu.etaxonomy.taxeditor.ui.element;
+
+import java.awt.Point;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.viewers.CellEditor.LayoutData;
+//import org.eclipse.nebula.widgets.richtext.RichTextEditor;
+//import org.eclipse.nebula.widgets.richtext.RichTextEditorConfiguration;
+//import org.eclipse.nebula.widgets.richtext.toolbar.ToolbarButton;
+//import org.eclipse.nebula.widgets.richtext.toolbar.ToolbarConfiguration;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.preference.Resources;
+
+/**
+ * @author n.hoffmann
+ * @version $Id: $
+ */
+public class RichTextWithLabelElement{ //extends AbstractCdmFormElement implements ModifyListener, IEnableableFormElement,
+   //     ISelectable {
+
+    
+    //protected RichTextEditor richtextEditor;
+    private Label label;
+    private boolean buttonVisible = true;
+
+    private final boolean isMultiLine;
+
+    public static final int MAX_HEIGHT = 0;
+    public static final int SINGLE = -1;
+
+    protected RichTextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, boolean isMultiLine) {
+      //  super(formFactory, parentElement);
+        this.isMultiLine = isMultiLine;
+    }
+
+    protected RichTextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
+            String initialText, Integer textHeight, int style) {
+        this(formFactory, parentElement, labelString, initialText, textHeight, null, true, style);
+    }
+
+    protected RichTextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
+            String initialText, Integer textHeight, boolean isMultiLine, int style) {
+        this(formFactory, parentElement, labelString, initialText, textHeight, null, isMultiLine, style);
+    }
+
+    protected RichTextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
+            String initialText, Integer textHeight, Integer textLimit, int style) {
+        this(formFactory, parentElement, labelString, initialText, textHeight, textLimit, false, style);
+    }
+
+    protected RichTextWithLabelElement(CdmFormFactory formFactory, ICdmFormElement parentElement, String labelString,
+            String initialText, Integer textHeight, Integer textLimit, boolean isMultiLine, int style) {
+      //  super(formFactory, parentElement);
+
+        this.isMultiLine = isMultiLine;
+
+       // initLabel(formFactory, labelString, isMultiLine, getLayoutComposite());
+
+   //     initText( initialText, textHeight, textLimit, isMultiLine, style, getLayoutComposite());
+    }
+
+    protected void initText(String initialText, Integer textHeight, Integer textLimit,
+            boolean isMultiLine, int style, Composite layoutComposite) {
+       layoutComposite.setLayout(new GridLayout(1, true));
+
+               
+//             ToolbarConfiguration toolBarConfig = new ToolbarConfiguration();
+//             
+//             RichTextEditorConfiguration config = new RichTextEditorConfiguration();
+//             config.setMinSize(800, 600);
+//             
+//             final RichTextEditor editor = new RichTextEditor(layoutComposite, config);
+//             GridDataFactory.fillDefaults().grab(true, true).applyTo(editor);
+//             //editor.setText(initialText);
+//             //editor.setEditable(true);
+
+               final Text htmlOutput = new Text(layoutComposite,
+                               SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY);
+               GridDataFactory.fillDefaults().grab(true, false).hint(SWT.DEFAULT, 100).applyTo(htmlOutput);
+               htmlOutput.setEditable(true);
+               
+               
+               
+//             editor.addModifyListener(new ModifyListener() {
+//
+//                     @Override
+//                     public void modifyText(ModifyEvent e) {
+//                             org.eclipse.swt.graphics.Point point = htmlOutput.getSelection();
+//                             htmlOutput.setText(htmlOutput.getText() + " - " + point.x + ":"+point.y);
+//                     }
+//             });
+
+//             editor.addKeyListener(new KeyAdapter() {
+//
+//                     @Override
+//                     public void keyPressed(KeyEvent e) {
+//                             org.eclipse.swt.graphics.Point point = htmlOutput.getSelection();
+//                             htmlOutput.setText(htmlOutput.getText() + " - " + point.x + ":"+point.y);
+//                     
+//                     }
+//             });
+
+//             editor.addToolbarButton(new ToolbarButton("jsButton",
+//                             "myScriptCommand", "Execute Javascript", "other,0",
+//                             null) {
+//                     @Override
+//                     public String getJavascriptToExecute() {
+//                             return "alert('Javascript call')";
+//                     }
+//             });
+
+               // add additional controls for showing interactions
+       
+//       createControlPanel(layoutComposite, editor, textHeight); 
+                
+    }
+    
+//    protected void createControlPanel(Composite parent, final RichTextEditor editor, int textHeight) { 
+//       Composite controlPanel = new Composite(parent, SWT.NONE); 
+//       TableWrapLayout layout;
+//       layout = LayoutConstants.LAYOUT(3, false);
+//       controlPanel.setLayout(layout); 
+//       GridDataFactory.fillDefaults().grab(true, false).applyTo(controlPanel); 
+//      
+//       Label inputLabel = new Label(controlPanel, SWT.NONE); 
+//       inputLabel.setText("Text to set:"); 
+//    //         GridDataFactory.fillDefaults().applyTo(inputLabel); 
+//      
+//       Text input = new Text(controlPanel, SWT.BORDER); 
+//       TableWrapData layoutData;
+//       if(isMultiLine){
+//              layoutData = LayoutConstants.FILL_HORIZONTALLY(2, 1);
+//          }
+//          else{
+//              layoutData = LayoutConstants.FILL();
+//          }
+//       input.setLayoutData(layoutData);
+//    //         GridDataFactory.fillDefaults().grab(true, false).applyTo(input); 
+//      
+//       input.addKeyListener(new KeyAdapter() { 
+//        @Override 
+//        public void keyPressed(KeyEvent e) { 
+//         if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) { 
+//          editor.setText(input.getText()); 
+//         } 
+//        } 
+//       }); 
+//      
+//       Button setButton = new Button(controlPanel, SWT.PUSH); 
+//       setButton.setText("Set Text"); 
+//     //  GridDataFactory.defaultsFor(setButton).applyTo(setButton); 
+//      
+//       setButton.addSelectionListener(new SelectionAdapter() { 
+//        @Override 
+//        public void widgetSelected(SelectionEvent e) { 
+//         editor.setText(input.getText()); 
+//        } 
+//       }); 
+//      
+//       Composite buttonPanel = new Composite(controlPanel, SWT.NONE); 
+//       buttonPanel.setLayout(new RowLayout()); 
+//      // GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(buttonPanel); 
+//      
+//       Button getButton = new Button(buttonPanel, SWT.PUSH); 
+//       getButton.setText("Get text"); 
+//       getButton.addSelectionListener(new SelectionAdapter() { 
+//        @Override 
+//        public void widgetSelected(SelectionEvent e) { 
+//         MessageDialog.openInformation(null, "Editor Input", 
+//           editor.getText()); 
+//        } 
+//       }); 
+//      
+//       final Button enableButton = new Button(buttonPanel, SWT.PUSH); 
+//       enableButton.setText("Disable"); 
+//       enableButton.addSelectionListener(new SelectionAdapter() { 
+//        @Override 
+//        public void widgetSelected(SelectionEvent e) { 
+//         boolean editable = editor.isEditable(); 
+//         editor.setEditable(!editable); 
+//      
+//         enableButton.setText(editable ? "Enable" : "Disable"); 
+//        } 
+//       }); 
+//      
+//       final Button updateButton = new Button(buttonPanel, SWT.PUSH); 
+//       updateButton.setText("Update Toolbar"); 
+//      
+//       final ToolbarButton button = new ToolbarButton("javaButton", 
+//         "myJavaCommand", "Execute Java", "other", 
+//         null) { 
+//      
+//        @Override 
+//        public Object execute() { 
+//         MessageDialog.openInformation(null, "Information", 
+//           "Java callback: " + editor.getSelectedHTML()); 
+//      
+//         editor.insertHTML("<em>" + editor.getSelectedHTML() + "</em>"); 
+//         return null; 
+//        } 
+//       }; 
+//      
+//       updateButton.addSelectionListener(new SelectionAdapter() { 
+//        @Override 
+//        public void widgetSelected(SelectionEvent e) { 
+//         if (!buttonVisible) { 
+//          editor.addToolbarButton(button); 
+//         } else { 
+//          editor.removeToolbarButton(button); 
+//         } 
+//         buttonVisible = !buttonVisible; 
+//         editor.updateToolbar(); 
+//        } 
+//       }); 
+//      
+//       Button setFocusButton = new Button(buttonPanel, SWT.PUSH); 
+//       setFocusButton.setText("Set Focus"); 
+//       setFocusButton.addSelectionListener(new SelectionAdapter() { 
+//        @Override 
+//        public void widgetSelected(SelectionEvent e) { 
+//         editor.setFocus(); 
+//        } 
+//       }); 
+//      
+//      } 
+//
+//    protected void initLabel(CdmFormFactory formFactory, String labelString, boolean isMultiLine, Composite layoutComposite) {
+//        if (labelString != null) {
+//            label = formFactory.createLabel(layoutComposite, CdmUtils.Nz(labelString), SWT.NULL);
+//            addControl(label);
+//            if(isMultiLine){
+//                label.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+//                ((TableWrapData)label.getLayoutData()).valign = TableWrapData.MIDDLE;
+//            }
+//            else{
+//                label.setLayoutData(LayoutConstants.LEFT());
+//                ((TableWrapData)label.getLayoutData()).valign = TableWrapData.MIDDLE;
+//            }
+//        }
+//    }
+//
+//   
+//    
+//
+//    /** {@inheritDoc} */
+//    @Override
+//    public void setBackground(Color color) {
+//        if (label != null) {
+//            label.setBackground(color);
+//        }
+//    }
+//
+//    @Override
+//    public void setSelected(boolean selected) {
+//        setBackground(selected ? SELECTED : getPersistentBackground());
+//    }
+//
+//     @Override
+//     public void setIrrelevant(boolean irrelevant) {
+//             // TODO Auto-generated method stub
+//             
+//     }
+//
+//     @Override
+//     public void setEnabled(boolean enabled) {
+//             // TODO Auto-generated method stub
+//             
+//     }
+//
+//     @Override
+//     public boolean isEnabled() {
+//             // TODO Auto-generated method stub
+//             return false;
+//     }
+//
+//     @Override
+//     public void modifyText(ModifyEvent e) {
+//             // TODO Auto-generated method stub
+//             
+//     }
+
+   
+}
index d9f351b191fc050808c552275c543c11582c8f87..22834daac24365cbf3e5227beab5a30d80455693 100644 (file)
@@ -9,6 +9,7 @@ import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
@@ -122,6 +123,7 @@ public class TextWithLabelElement extends AbstractCdmFormElement implements Modi
     protected void initLabel(CdmFormFactory formFactory, String labelString, boolean isMultiLine, Composite layoutComposite) {
         if (labelString != null) {
             label = formFactory.createLabel(layoutComposite, CdmUtils.Nz(labelString), SWT.NULL);
+           
             addControl(label);
             if(isMultiLine){
                 label.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
index 708d4b5ddff6b9eda554baf393dab2afbb029496..d70a87b6d29a5ea18a9174e56fe8c298c2a609da 100644 (file)
@@ -8,19 +8,42 @@
 */
 package eu.etaxonomy.taxeditor.ui.mvc.element;
 
+
+import java.awt.FontMetrics;
+import java.util.Calendar;
+import java.util.ConcurrentModificationException;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.viewers.CellEditor.LayoutData;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DateTime;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
-import org.joda.time.DateTime;
+//import org.joda.time.DateTime;
 
+import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.IPropertyChangeEmitter;
 import eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite;
 
 /**
@@ -28,18 +51,22 @@ import eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite;
  * @date 16.06.2014
  *
  */
-public class DateElement extends AbstractCdmComposite<DateElementController> {
+public class DateElement extends AbstractCdmComposite<DateElementController>  {
 
     private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
-    private final DateTime initialDateTime;
-    private final Text textDate;
+    private org.joda.time.DateTime initialDateTime;
+    private Text textDate;
+    private final Button openDateDialog;
+    
+    private static final String pattern = "yyyy-MM-dd HH:mm:ss";
+   
 
     /**
      * Create the composite.
      * @param parent
      * @param style
      */
-    public DateElement(Composite parent, DateTime initialDateTime, int style) {
+    public DateElement(Composite parent, org.joda.time.DateTime initialDateTime, int style, boolean editableText) {
         super(parent, style);
         this.initialDateTime = initialDateTime;
         addDisposeListener(new DisposeListener() {
@@ -60,9 +87,58 @@ public class DateElement extends AbstractCdmComposite<DateElementController> {
             tableWrapLayout.bottomMargin = 0;
             setLayout(tableWrapLayout);
         }
+     
+        Composite composite = new Composite (this, SWT.NONE);
+       GridLayout layout = new GridLayout ();
+    
+       layout.numColumns = 2;
+               
+       composite.setLayout(layout);
+       composite.setSize(400, composite.getSize().y);
+       int width = composite.getSize().x;
+       
+       // textDate = new Text(composite, SWT.BORDER|SWT.FILL);
+       textDate = toolkit.createText(composite, "yyyy-mm-dd HH:mm:ss", style);
+        textDate.setEditable(editableText);
+       
+        GridData gridData = new GridData();
+        gridData.minimumWidth = 200;
+     
+        
+        textDate.setLayoutData(gridData);
+        openDateDialog = new Button (composite, SWT.PUSH);
+        Image image = ImageResources.getImage(ImageResources.DATE);
+   //     openDateDialog.setText ("Open Date Dialog");
+        openDateDialog.setImage(image);
+       
+        openDateDialog.addSelectionListener (new SelectionAdapter() {
+               @Override
+               public void widgetSelected(SelectionEvent e){
+                       final Shell dialog = new Shell (parent.getShell(), SWT.DIALOG_TRIM);
+               
+                       dialog.setLayout (new GridLayout (3, false));
 
-        textDate = new Text(this, SWT.BORDER | SWT.WRAP);
-        textDate.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
+                       final DateTime calendar = new DateTime (dialog, SWT.CALENDAR | SWT.BORDER);
+                       final DateTime time = new DateTime (dialog, SWT.TIME | SWT.SHORT);
+
+                       new Label (dialog, SWT.NONE);
+                       new Label (dialog, SWT.NONE);
+                       Button ok = new Button (dialog, SWT.PUSH);
+                       ok.setText ("OK");
+                       ok.setLayoutData(new GridData (SWT.FILL, SWT.CENTER, false, false));
+                       ok.addSelectionListener (new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e){
+                               setData(makeJodaFromSWT(calendar, time));
+                               dialog.close ();
+                               }
+                       });
+                       dialog.setDefaultButton (ok);
+                       dialog.pack ();
+                       dialog.open ();
+               }
+        });
+       
         toolkit.adapt(textDate, true, true);
     }
 
@@ -71,10 +147,47 @@ public class DateElement extends AbstractCdmComposite<DateElementController> {
      */
     @Override
     protected void initInternalController(CdmFormFactory formFactory, ICdmFormElement parentElement) {
-        controller = new DateElementController(this, formFactory, parentElement, initialDateTime, SWT.NONE);
+        controller = new DateElementController(this, formFactory, parentElement, initialDateTime);
         formFactory.adapt(controller);
     }
     public Text getTextDate() {
         return textDate;
     }
+    
+   
+    
+       
+                 public static org.joda.time.DateTime makeJodaFromSWT(
+                                               org.eclipse.swt.widgets.DateTime widget, org.eclipse.swt.widgets.DateTime dateTime) {
+                   return new org.joda.time.DateTime(widget.getYear(),
+                                       widget.getMonth(),
+                                       widget.getDay(),
+                                       dateTime.getHours(),
+                                       dateTime.getMinutes(),
+                                       dateTime.getSeconds());
+                 }
+
+                 public static void updateSWTwithJoda(
+                                               org.eclipse.swt.widgets.DateTime widget,
+                                               org.joda.time.DateTime dateTime) {
+                   widget.setYear(dateTime.getYear());
+                   widget.setMonth(dateTime.getMonthOfYear());
+                   widget.setDay(dateTime.getDayOfMonth());
+                   widget.setHours(dateTime.getHourOfDay());
+                   widget.setMinutes(dateTime.getMinuteOfHour());
+                   widget.setSeconds(dateTime.getSecondOfMinute());
+                 }
+               
+         public void setData (org.joda.time.DateTime data) {
+                       this.initialDateTime = data;
+                       this.controller.setDateTime(data);
+                       this.textDate.setText(initialDateTime.toString(pattern));
+                       
+               }
+
+               
+               
+               
+         
+
 }
index 13644ea9ae2c08596a781f5812aef6d9c2f3c18f..825d4f7022d4024a0cdbfa547b9e6bcb902450ed 100644 (file)
@@ -13,6 +13,8 @@ import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.widgets.Text;
 import org.joda.time.DateTime;
 
+import com.sun.istack.logging.Logger;
+
 import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
@@ -37,13 +39,22 @@ public class DateElementController extends AbstractCdmFormElement implements IEn
      * @param initialDateTime
      * @param none
      */
-    public DateElementController(DateElement dateTimeElement, CdmFormFactory formFactory, ICdmFormElement parentElement, DateTime initialDateTime, int none) {
+    public DateElementController(DateElement dateTimeElement, CdmFormFactory formFactory, ICdmFormElement parentElement, DateTime initialDateTime) {
         super(formFactory, parentElement);
         this.textDate = dateTimeElement.getTextDate();
-        this.textDate.setText(initialDateTime!=null?initialDateTime.toString("yyyy-MM-dd"):"");
+        this.textDate.setText(initialDateTime!=null?initialDateTime.toString("yyyy-MM-dd HH:mm:ss"):"yyyy-mm-dd HH:mm:ss");
         addControl(textDate);
+        dateTime = initialDateTime;
         textDate.addModifyListener(this);
     }
+    
+//    public DateElementController(DateElementFormElement dateTimeElement, CdmFormFactory formFactory,  DateTime initialDateTime) {
+//        super(formFactory, dateTimeElement);
+//        this.textDate = dateTimeElement.getTextDate();
+//        this.textDate.setText(initialDateTime!=null?initialDateTime.toString("yyyy-MM-dd"):"");
+//        addControl(textDate);
+//        textDate.addModifyListener(this);
+//    }
 
     /* (non-Javadoc)
      * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
@@ -51,18 +62,21 @@ public class DateElementController extends AbstractCdmFormElement implements IEn
     @Override
     public void modifyText(ModifyEvent e) {
         try {
-            String text = textDate.getText();
-            DateTime parsedDateTime = DateTime.parse(text);
-            this.dateTime = parsedDateTime;
+//            String text = textDate.getText();
+//            DateTime parsedDateTime = DateTime.parse(text);
+//            this.dateTime = parsedDateTime;
             firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e));
         } catch (IllegalArgumentException iae) {
-            //nothing
+            System.err.println(iae.getMessage());
         }
     }
 
-    public DateTime getDateTime(){
+   public DateTime getDateTime(){
         return dateTime;
-    }
+    } 
+   public void setDateTime(DateTime date){
+       dateTime = date;
+   } 
 
     /* (non-Javadoc)
      * @see eu.etaxonomy.taxeditor.ui.element.IRelevantFormElement#setIrrelevant(boolean)
index 51cfa299a9743c3d658571ff48271820e4b1ecb3..0c2ba37276a6a37d77c486136113375d4037a0ff 100644 (file)
@@ -20,9 +20,12 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.name.TaxonName;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
@@ -36,6 +39,8 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LabelElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 
 /**
  *
@@ -49,6 +54,8 @@ public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement
        private boolean irrelevant;
 
        private boolean enabled;
+       
+       private LabelElement warnForReferencedObjects;
 
        private EnumSet<CRUD> requiredCrud = null;
 
@@ -295,4 +302,36 @@ public abstract class AbstractCdmDetailElement<T> extends AbstractCdmFormElement
         }
         setEnabled(getEntity() != null && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), requiredCrud), except);
     }
+
+       public LabelElement getWarnForReferencedObjects() {
+               return warnForReferencedObjects;
+       }
+
+       public void setWarnForReferencedObjects(LabelElement warnForReferencedObjects) {
+               this.warnForReferencedObjects = warnForReferencedObjects;
+       }
+       
+       public void setWarnForReferencingObjects(ICdmFormElement formElement){
+           if (getEntity() instanceof CdmBase){
+               CdmBase cdmBase = (CdmBase) getEntity();
+               if (cdmBase.getId() != 0){
+                       Integer referencingObjectsCount = CdmStore.getCommonService().getReferencingObjectsCount(cdmBase);
+       
+                       if (referencingObjectsCount > 1){
+                               setWarnForReferencedObjects(formFactory.createLabel(formElement, CdmUtils.Nz("The reference is referenced by " + referencingObjectsCount+ " objects, if you change it, it is changed for all these objects")));
+                               getWarnForReferencedObjects().setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+                               getWarnForReferencedObjects().setLayout(LayoutConstants.FILL(2, 3));
+                               getWarnForReferencedObjects().setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+                               
+                       }
+               }
+           }
+       }
+
+       public void setWarnForReferencingObjectsVisible(boolean isVisible){
+               if (getWarnForReferencedObjects() != null){
+                       getWarnForReferencedObjects().setVisible(isVisible);
+               }
+       }
+       
 }
index d8ef6945c726398f54e32ea9866e8abdb9bbec27..f555e44f0c07f4f278fa4b21419918abe888154d 100644 (file)
@@ -6,6 +6,10 @@ package eu.etaxonomy.taxeditor.ui.section;
 import java.util.Arrays;
 import java.util.EnumSet;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
@@ -14,6 +18,7 @@ import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
 import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
 
 /**
@@ -72,9 +77,7 @@ public abstract class AbstractIdentifiableEntityDetailElement<T extends IIdentif
         } else{
             isAdvancedView = true;
         }
-
-
-
     }
 
+    
 }
index 7b236f1b16fc6913dd4d94f1bf8908616e40baed..a9ffb6378446b426a4b5d0449eef9e94508e6202 100644 (file)
@@ -51,6 +51,8 @@ public class InstitutionDetailElement extends
        @Override
        protected void createControls(ICdmFormElement formElement,
                        Institution entity, int style) {
+               this.setWarnForReferencingObjects(formElement);
+                       
                text_name = formFactory.createTextWithLabelElement(formElement, "Name",
                                entity.getName(), style);
                text_code = formFactory.createTextWithLabelElement(formElement, "Code",
index 5bf295df5c39a98269c38ed783f5fd7beece3695..4a8ecc549125ca8e9d1fd28bfaa2552eeaa163db 100644 (file)
@@ -37,6 +37,7 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
        private TextWithLabelElement text_lastname;
        private TextWithLabelElement text_prefix;
        private TextWithLabelElement text_suffix;
+       private TextWithLabelElement text_initials;
 
        private Collection<Object> excludeFromIrrelevantToggleableObjects;
 
@@ -63,6 +64,7 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
        @Override
        protected void createControls(ICdmFormElement formElement, Person entity,
                        int style) {
+               setWarnForReferencingObjects(formElement);
                toggleable_cache = formFactory.createToggleableTextField(formElement,
                                "Title Cache", entity.getTitleCache(),
                                entity.isProtectedTitleCache(), SWT.NULL);
@@ -73,6 +75,9 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
 
                text_firstname = formFactory.createTextWithLabelElement(formElement,
                                "Firstname", entity.getFirstname(), SWT.NULL);
+               text_initials = formFactory.createTextWithLabelElement(formElement,
+                               "Initials", entity.getInitials(), SWT.NULL);
+               
                text_lastname = formFactory.createTextWithLabelElement(formElement,
                                "Lastname", entity.getLastname(), SWT.NULL);
 
@@ -105,7 +110,9 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
                                        .setNomenclaturalTitle(text_nomenclaturalTitle.getText());
                } else if (eventSource == text_firstname) {
                        getEntity().setFirstname(text_firstname.getText());
-               } else if (eventSource == text_lastname) {
+               }else if (eventSource == text_initials) {
+                       getEntity().setInitials(text_initials.getText());
+               }else if (eventSource == text_lastname) {
                        getEntity().setLastname(text_lastname.getText());
                } else if (eventSource == text_prefix) {
                        getEntity().setPrefix(text_prefix.getText());
index 759f3fda641f5ed3d16f27e93672b2d628b8c95f..1e123f582f2594789482c8ca1bd82e7125fa47f5 100644 (file)
@@ -62,7 +62,8 @@ public class TeamDetailElement extends AbstractIdentifiableEntityDetailElement<T
        /** {@inheritDoc} */
     @Override
     protected void createControls(ICdmFormElement formElement, Team entity, int style) {
-
+       
+       setWarnForReferencingObjects(formElement);
         toggleable_cache = formFactory.createToggleableTextField(formElement, "Title Cache", entity.getTitleCache(), entity.isProtectedTitleCache(), style);
         toggleable_nomenclaturalTitleCache = formFactory.createToggleableTextField(formElement, "Abbrev. Title", entity.getNomenclaturalTitle(), entity.isProtectedNomenclaturalTitleCache(), style);
         hasAdditionalMembers = formFactory.createCheckbox(formElement, "Additional Members", entity.isHasMoreMembers(), style);
index 022bdf4d7ed8d9279f9a7aeb746616a12b6d6ae1..827dafca93f33383710efbc6f99846afce2d7938 100644 (file)
@@ -11,10 +11,12 @@ package eu.etaxonomy.taxeditor.ui.section.description.detail;
 
 import org.eclipse.swt.SWT;
 
+import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.description.TextData;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
+import eu.etaxonomy.taxeditor.ui.element.RichTextWithLabelElement;
 
 /**
  * <p>TextDataDetailElement class.</p>
@@ -26,6 +28,8 @@ import eu.etaxonomy.taxeditor.ui.element.MultilanguageTextElement;
 public class TextDataDetailElement extends AbstractDetailedDescriptionDetailElement<TextData> {
 
        private MultilanguageTextElement multilanguageTextElement;
+       
+//     private RichTextWithLabelElement richtextTestElement;
 
        /**
         * <p>Constructor for TextDataDetailElement.</p>
@@ -45,6 +49,7 @@ public class TextDataDetailElement extends AbstractDetailedDescriptionDetailElem
        protected void createControls(ICdmFormElement formElement, TextData entity,
                        int style) {
                multilanguageTextElement = formFactory.createMultiLanguageTextElement(this, null, entity.getMultilanguageText(), 200, SWT.WRAP);
+               //richtextTestElement = formFactory.createRichTextLabelElement(this, null, entity.getMultilanguageText().get(Language.DEFAULT()).getText(), 200, SWT.WRAP);
        }
 
        /** {@inheritDoc} */
index c6fb2d920c173f1314a5ac27ff407829647c387f..22af41346b16906f3b089cbe616c546d12dc24e2 100644 (file)
@@ -9,8 +9,8 @@ import org.eclipse.jface.action.IAction;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
 
+import org.eclipse.swt.widgets.Button;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
@@ -27,6 +27,7 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.ISelectableElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.SelectionArbitrator;
+import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
@@ -42,6 +43,7 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
     private LanguageStringWithLabelElement text_description;
     private LanguageStringWithLabelElement text_title;
     private MediaDetailElement mediaDetailElement;
+    private DateElement mediaCreated;
     private SelectionArbitrator selectionArbitrator;
 
     public MediaMetaElement(CdmFormFactory cdmFormFactory,
@@ -72,7 +74,13 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
         text_title = formFactory.createLanguageStringWithLabelElement(element, "Title", null, style);
         selection_artist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), element, "Artist", null, EntitySelectionElement.ALL, style);
         addElement(selection_artist);
+        mediaCreated = formFactory.createDateElement(element, "Media Created", getEntity().getMediaCreated(), style, false);
+        addElement(mediaCreated.getController());
         text_description = formFactory.createLanguageStringWithLabelElement(element, "Description", null, 100, true, style);
+        
+    
+        
+        
         mediaDetailElement = formFactory.createMediaDetailElement(element);
         addElement(mediaDetailElement);
     }
@@ -102,6 +110,7 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
         }
 
         text_title.setLanguageString(title);
+     
 
     }
 
@@ -129,6 +138,9 @@ public class MediaMetaElement extends AbstractEntityCollectionElement<Media> imp
             if (getParentElement() instanceof AbstractCdmDetailSection) {
                 ((AbstractCdmDetailSection<?>) getParentElement()).updateTitle();
             }
+        } else if (eventSource == mediaCreated.getController()){
+               org.joda.time.DateTime date = mediaCreated.getController().getDateTime();
+               getEntity().setMediaCreated(date);
         }
     }
 
index a8f2837743910e4fcd36e913456acb8c687ee537..5577765d0c62fca46b8ca577371dd3f1b5c0edb8 100644 (file)
@@ -68,7 +68,7 @@ public class DnaQualityDetailElement extends AbstractCdmDetailElement<DnaSample>
         numberRatioOfAbsorbance260_230 = formFactory.createNumberTextWithLabelElement(formElement, "Ratio of absorbance 260-230", ratioOfAbsorbance260_230, style);
         numberConcentration = formFactory.createNumberTextWithLabelElement(formElement, "Concentration", concentration, style);
         comboQualityTerm = formFactory.createDefinedTermComboElement(TermType.DnaQualityType, formElement, "Quality Term", qualityTerm, style);
-        dateQualityCheck = formFactory.createDateElement(formElement, "Quality Check", dnaQuality.getQualityCheckDate(), style);
+        dateQualityCheck = formFactory.createDateElement(formElement, "Quality Check", dnaQuality.getQualityCheckDate(), style, false);
     }
 
     /*
index 7cb19069fdd473513893a8240d682a4cedfec6ef..6f24bb3123c725ee7013f495030001c20f1e9e71 100644 (file)
@@ -73,7 +73,7 @@ public class MediaSpecimenGeneralDetailElement extends AbstractCdmDetailElement<
             comboKindOfUnit = formFactory.createDefinedTermComboElement(mediaSpecimenVocabulary, formElement, "Kind of Media", entity.getKindOfUnit(), style);
             textTitleLanguageString = formFactory.createLanguageStringWithLabelElement(formElement, "Motif", media.getTitle(), style);
             selectionArtist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared by", media.getArtist(), EntitySelectionElement.ALL, style);
-            date = formFactory.createDateElement(formElement, "Preparation Date", entity.getMediaSpecimen().getMediaCreated(), style);
+            date = formFactory.createDateElement(formElement, "Preparation Date", entity.getMediaSpecimen().getMediaCreated(), style, true);
             textMethodLanguageString = formFactory.createLanguageStringWithLabelElement(formElement, "Method", media.getDescription(Language.getDefaultLanguage()), style);
             selection_collection = formFactory.createSelectionElement(Collection.class, getConversationHolder(), formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style);
             text_accessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style);
old mode 100644 (file)
new mode 100755 (executable)
index 8b1231c..11dd1fa
@@ -37,6 +37,7 @@ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
 import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
 import eu.etaxonomy.taxeditor.ui.element.UriWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
@@ -52,7 +53,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElement<Reference>
                implements IErrorIntolerableElement, IExceptionHandler {
 
-       private LabelElement warnForReferencedObjects;
+
 
     private ToggleableTextElement toggleableAbbrevCache;
 
@@ -71,6 +72,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
        private TextWithLabelElement text_abbrevTitle;
        private TextWithLabelElement text_title;
        private UriWithLabelElement text_uri;
+       private DateElement text_accessed;
        private EntitySelectionElement<AgentBase> selection_authorTeam;
        private TimePeriodElement element_timePeriod;
        private EntitySelectionElement<Reference> selection_inReference;
@@ -154,6 +156,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        if (referenceType.equals(ReferenceType.Generic)) {
                                createGenericControls(this, entity, SWT.NULL);
                                createPublicationControls(this, referenceType, entity, SWT.NULL);
+                               
                        } else {
                                if (referenceType.isPrintedUnit()) {
                                        createPrintedUnitControls(this, referenceType, entity,
@@ -169,6 +172,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                                if (referenceType.isSection()) {
                                        createSectionControls(this, entity, SWT.NULL);
                                }
+                               
                        }
                }
 
@@ -181,6 +185,11 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                handleToggleableCacheField();
        }
 
+       private void createWebPageControls(ReferenceDetailElement referenceDetailElement, Reference reference, int style) {
+                text_accessed = formFactory.createDateElement(referenceDetailElement, "Accessed", reference.getAccessed(), style, false);
+               
+       }
+
        /*
         * (non-Javadoc)
         *
@@ -274,6 +283,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                // pages
                text_pages = formFactory.createTextWithLabelElement(element, "Pages",
                                reference.getPages(), style);
+               
+               
        }
 
        /**
@@ -397,6 +408,9 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                // uri
                text_uri = formFactory.createUriWithLabelElement(element, "URI",
                                reference.getUri(), style);
+               if (reference.getType().equals(ReferenceType.WebPage)){
+                       createWebPageControls(this, reference, style);
+               }
                // abstract
                text_referenceAbstract = formFactory.createMultiLineTextWithLabel(
                                element, "Reference Abstract", 100, style);
@@ -465,6 +479,8 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
                        getEntity().setUri(text_uri.parseText());
                } else if (eventSource == text_volume) {
                        getEntity().setVolume(text_volume.getText());
+               }else if (eventSource == text_accessed.getController()) {
+                       getEntity().setAccessed(text_accessed.getController().getDateTime());
                }
 
                if (eventSource != text_title && eventSource != text_abbrevTitle) {
@@ -605,25 +621,7 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
            setIrrelevant(pushedState, except);
        }
 
-       public void setWarnForReferencingObjects(ICdmFormElement formElement){
-           if (getEntity().getId() != 0){
-               Integer referencingObjectsCount = CdmStore.getCommonService().getReferencingObjectsCount(getEntity());
-
-               if (referencingObjectsCount > 1){
-                       warnForReferencedObjects = formFactory.createLabel(formElement, CdmUtils.Nz("The reference is referenced by " + referencingObjectsCount+ " objects, if you change it, it is changed for all these objects"));
-                       warnForReferencedObjects.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-                       warnForReferencedObjects.setLayout(LayoutConstants.FILL(2, 3));
-
-                       warnForReferencedObjects.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
-               }
-           }
-       }
-
-       public void setWarnForReferencingObjectsVisible(boolean isVisible){
-               if (warnForReferencedObjects != null){
-                       warnForReferencedObjects.setVisible(isVisible);
-               }
-       }
+       
 
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferencingObjectsMessagesSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferencingObjectsMessagesSection.java
new file mode 100755 (executable)
index 0000000..978217b
--- /dev/null
@@ -0,0 +1,68 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.reference;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+
+/**
+ * @author k.luther
+ * @date 27.03.2017
+ *
+ */
+public class ReferencingObjectsMessagesSection extends AbstractFormSection {
+
+
+    Reference reference;
+    Label warnForReferencedObjects;
+
+
+    public ReferencingObjectsMessagesSection(CdmFormFactory formFactory, ICdmFormElement layoutComposite, int style, Reference reference){
+        super(formFactory, layoutComposite, style);
+        this.reference = reference;
+    }
+
+
+
+
+    private void displayReferencingObjectsMessage() {
+
+        if (reference.getId() != 0){
+            Integer referencingObjectsCount = CdmStore.getCommonService().getReferencingObjectsCount(reference);
+            Composite container;
+            if (referencingObjectsCount > 1){
+
+                    warnForReferencedObjects = formFactory.createLabel(getLayoutComposite(), CdmUtils.Nz("The reference is referenced by " + referencingObjectsCount+ " objects, if you change it, it is changed for all these objects"));
+                    warnForReferencedObjects.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+                    warnForReferencedObjects.setLayoutData(LayoutConstants.FILL(1, 1));
+                    warnForReferencedObjects.setForeground(Display.getCurrent().getSystemColor(
+                            SWT.COLOR_RED));
+
+
+                //warnForReferencedObjects.setVisible(false);
+            }
+        }
+
+
+
+    }
+
+
+
+}
index a3a02e647bc34fdb9d60d8645651a8781437e1b9..0e412090452326e10652705e380ea945d37bcd66 100644 (file)
@@ -32,7 +32,7 @@ public abstract class AbstractReferencedEntityElement<T extends ReferencedEntity
                extends AbstractEntityCollectionElement<T> implements ISelectableElement {
 
        private SelectionArbitrator selectionArbitrator;
-       
+
        protected EntitySelectionElement<Reference> selection_reference;
        protected TextWithLabelElement text_referenceDetail;
 
@@ -64,7 +64,7 @@ public abstract class AbstractReferencedEntityElement<T extends ReferencedEntity
                selection_reference.setEntity(entity.getCitation());
                text_referenceDetail.setText(entity.getCitationMicroReference());
        }
-       
+
        @Override
     public SelectionArbitrator getSelectionArbitrator() {
                return selectionArbitrator;
index 678014caf52cee566a00936371e4cc65ab694f71..5461f83acc2566535824a81b7cf3dd6435ccbb8f 100644 (file)
@@ -19,6 +19,8 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.Role;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
@@ -35,13 +37,13 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @version 1.0
  */
 public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElement<TaxonBase> {
-
+       
        private CheckboxElement checkbox_doubtful;
 
        private CheckboxElement checkbox_useNameCache;
 
        private EntitySelectionElement<Reference> selection_secundum;
-
+       private EntitySelectionElement<Reference> selection_sensu;
        private TextWithLabelElement text_secundum_microreference;
 
        private TextWithLabelElement text_appendedPhrase;
@@ -64,9 +66,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                                        "Title Cache", entity.getTitleCache(),
                                        entity.isProtectedTitleCache(), style);
 
-               //TODO RL
-               boolean rl=true;
-
+               
                text_appendedPhrase = formFactory.createTextWithLabelElement(
                                        formElement, "Appended Phrase", entity.getAppendedPhrase(),
                                        SWT.WRAP);
index 668907de30e2dfaafc13ef3ab45cd5570040ffe0..ab380db570005af3aa0723a1bb6cd11ae0bc3a9a 100644 (file)
@@ -8,8 +8,15 @@
 */
 package eu.etaxonomy.taxeditor.ui.section.taxon;
 
+import java.util.Arrays;
+
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
 import org.eclipse.ui.IEditorInput;
 
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.SynonymType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer;
@@ -19,6 +26,8 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
@@ -29,11 +38,23 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  */
 public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<TaxonRelationship> {
 
-       private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType;
-       
-       private EntitySelectionElement<Taxon> selection_relatedTaxon;
+//     private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType;
+//     
+//     private EntitySelectionElement<Taxon> selection_relatedTaxon;
+        protected ToggleableTextElement toggleable_cache;
+       private  EntitySelectionElement<Reference> secReference;
+       private  EntitySelectionElement<Reference> sensuReference;
+       private TextWithLabelElement text_sensu_microreference;
+       private CheckboxElement checkbox_doubtful;
+
+       private TextWithLabelElement text_secundum_microreference;
+
+       private TextWithLabelElement text_appendedPhrase;
+
+       private CheckboxElement checkbox_published;
        
-       private CheckboxElement checkBoxDoubtful;
+
+       private Taxon taxon; 
 
        public TaxonRelationshipDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
@@ -43,16 +64,55 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
        @Override
        protected void createControls(ICdmFormElement formElement,
                        TaxonRelationship entity, int style) {
-               combo_taxonRelationshipType = formFactory.createTermComboElement(
-                               TaxonRelationshipTypeInverseContainer.class, 
-                               formElement, "Relationship Type", 
-                               getTaxonRelationshipTypeInverseContainer(), style);
-               combo_taxonRelationshipType.setEnabled(false);
-               selection_relatedTaxon = formFactory.createSelectionElement(
-                               Taxon.class, getConversationHolder(), 
-                               formElement, "Related Taxon", getRelatedTaxon(), 
-                               EntitySelectionElement.SELECTABLE, style);
-               checkBoxDoubtful = formFactory.createCheckbox(formElement, "Relation is doubtful", entity.isDoubtful(), style);
+//             combo_taxonRelationshipType = formFactory.createTermComboElement(
+//                             TaxonRelationshipTypeInverseContainer.class, 
+//                             formElement, "Relationship Type", 
+//                             getTaxonRelationshipTypeInverseContainer(), style);
+//             combo_taxonRelationshipType.setEnabled(false);
+//             selection_relatedTaxon = formFactory.createSelectionElement(
+//                             Taxon.class, getConversationHolder(), 
+//                             formElement, "Related Taxon", getRelatedTaxon(), 
+//                             EntitySelectionElement.SELECTABLE, style);
+               taxon = entity.getFromTaxon();
+               toggleable_cache = formFactory.createToggleableTextField(formElement,
+                               "Title Cache", taxon.getTitleCache(),
+                               taxon.isProtectedTitleCache(), style);
+
+       text_appendedPhrase = formFactory.createTextWithLabelElement(
+                               formElement, "Appended Phrase", taxon.getAppendedPhrase(),
+                               SWT.WRAP);
+
+
+               sensuReference = formFactory.createSelectionElement(Reference.class,
+                       getConversationHolder(), formElement, "Sensu",
+                       getEntity().getCitation(), EntitySelectionElement.ALL,
+                       style);
+
+               text_sensu_microreference = formFactory.createTextWithLabelElement(
+                               formElement, "Detail",
+                               getEntity().getCitationMicroReference(),null,
+                               SWT.WRAP);
+
+               
+       
+       
+               checkbox_published = formFactory.createCheckbox(formElement,
+                                       "Published", taxon.isPublish(), style);
+                       
+                       
+               secReference = formFactory.createSelectionElement(Reference.class,
+                               getConversationHolder(), formElement, "Err. Secundum",
+                               taxon.getSec(), EntitySelectionElement.ALL,
+                               style);
+       
+               text_secundum_microreference = formFactory.createTextWithLabelElement(
+                   formElement, "Detail",
+                   taxon.getSecMicroReference(),null,
+                   SWT.WRAP);
+               checkbox_doubtful = formFactory.createCheckbox(formElement,
+                               " Misappl. doubtful", entity.isDoubtful(), style);
+
+               
        }
        
        private Taxon getRelatedTaxon() {
@@ -70,18 +130,63 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
 
        @Override
        public void handleEvent(Object eventSource) {
-               if (eventSource == selection_relatedTaxon){
-                       boolean inverse = getTaxonRelationshipTypeInverseContainer().isInverse();
-                       Taxon relatedTaxon = selection_relatedTaxon.getEntity();
-                       if(inverse){
-                               getEntity().setFromTaxon(relatedTaxon);
-                       }else{
-                               getEntity().setToTaxon(relatedTaxon);
-                       }
+               if (eventSource== toggleable_cache) {
+               handleToggleableCacheField();
+       } else if (eventSource == checkbox_doubtful) {
+               taxon.setDoubtful(checkbox_doubtful.getSelection());
+       }  else if (eventSource == secReference) {
+               taxon.setSec(secReference.getSelection());
+       } else if (eventSource == text_appendedPhrase) {
+               taxon.setAppendedPhrase(text_appendedPhrase.getText());
+       } else if (eventSource == text_secundum_microreference) {
+        taxon.setSecMicroReference(text_secundum_microreference.getText());
+       } else if (eventSource == checkbox_published) {
+           taxon.setPublish(checkbox_published.getSelection());
+       } else if (eventSource == text_sensu_microreference) {
+        getEntity().setCitationMicroReference(text_sensu_microreference.getText());
+       }else if (eventSource == sensuReference) {
+                getEntity().setCitation(sensuReference.getSelection());
+       }
+       }
+       
+       protected void handleToggleableCacheField() {
+        boolean pushedState = toggleable_cache.getState();
+
+        taxon.setTitleCache(toggleable_cache.getText(), pushedState);
+        setIrrelevant(pushedState, Arrays.asList(new Object[] { toggleable_cache, checkbox_published}));
+        updateToggleableCacheField();
+    }
+       
+        public void updateToggleableCacheField() {
+               if (toggleable_cache != null){
+                   if (!taxon.isProtectedTitleCache()) {
+                       toggleable_cache.setText(taxon.generateTitle());
+                   }
+               }
+           }
+        
+        @Override
+               protected void updateContent() {
+                       super.updateContent();
+                       toggleable_cache.setEnabled(taxon.isProtectedTitleCache());
+                       setIrrelevant(toggleable_cache.getState(),
+                                       Arrays.asList(new Object[] { toggleable_cache, checkbox_published}));
                }
-               else if(eventSource==checkBoxDoubtful){
-                   getEntity().setDoubtful(checkBoxDoubtful.getSelection());
+        @Override
+           protected void updateControlStates() {
+               super.updateControlStates();
+              
+           }
+        @Override
+               protected void handleTitleCacheRelevantChange(PropertyChangeEvent event) {
+                       String title = taxon.generateTitle();
+                       taxon.setTitleCache(title);
+                       super.handleTitleCacheRelevantChange(event);
                }
-               firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
-       }
+        
+       @Override
+       public void refresh(){
+                updateContent();
+                updateToggleableCacheField();
+        }
 }
index 94f6fbbd8e485fccd704d1c1b855abc012ea6ffd..618e98b228491ae6fbe15dd9a3d66470ba3740af 100644 (file)
@@ -11,18 +11,25 @@ package eu.etaxonomy.taxeditor.ui.section.taxon;
 import org.eclipse.jface.viewers.ISelectionProvider;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.name.TaxonName;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
  * @author n.hoffmann
  * @date Dec 1, 2011
  *
  */
-public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<TaxonRelationship>{
+public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<TaxonRelationship> implements ITaxonBaseDetailSection {
+       Taxon taxon;
+       TaxonName name;
 
        public TaxonRelationshipDetailSection(CdmFormFactory formFactory,
                        ConversationHolder conversation, ICdmFormElement parentElement,
@@ -32,7 +39,7 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
 
        @Override
        public String getHeading() {
-               return "Taxon Relationship";
+               return getEntity() != null ? getEntity().getType().getLabel(): "Taxon Relation";
        }
 
        /* (non-Javadoc)
@@ -43,4 +50,21 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
            return formFactory.createTaxonRelationshipDetailElement(parentElement);
        }
 
+       /** {@inheritDoc} */
+       @Override
+    public void setTaxonBase(TaxonBase taxon) {
+               this.taxon = (Taxon)taxon;
+               TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setName(name);
+       }
+
+       @Override
+       public TaxonBase getTaxonBase() {
+               return taxon;
+       }
+       
+       private void setName(TaxonName name){
+               this.name = name;
+       }
+
 }
index 8156aa823037742f9541197958fb63a3bc6f4654..596d7f9da133377ba3564067b73159094f1c3605 100644 (file)
@@ -22,6 +22,7 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.model.PolytomousKeyRelationship;
@@ -32,8 +33,16 @@ import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.PolytomousKeyDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.key.ScopeRestrictionSection;
 import eu.etaxonomy.taxeditor.ui.section.key.TaxonomicScopeSection;
+import eu.etaxonomy.taxeditor.ui.section.name.NameDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.name.NameRelationshipDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.name.NomenclaturalStatusSection;
+import eu.etaxonomy.taxeditor.ui.section.name.NonViralNameDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.name.ProtologueSection;
+import eu.etaxonomy.taxeditor.ui.section.name.TypeDesignationSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection;
 import eu.etaxonomy.taxeditor.ui.section.occurrence.IDerivedUnitFacadeDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.taxon.TaxonRelationshipDetailSection;
 
 /**
  * <p>
@@ -102,9 +111,39 @@ public class CdmSectionPart<T> extends SectionPart implements
                            formSection instanceof ScopeRestrictionSection ||
                            formSection instanceof TaxonomicScopeSection)) {
                input = ((PolytomousKeyNode)input).getKey();
-           }
-
+           } else if ((input instanceof TaxonRelationship)
+                               && (formSection instanceof NonViralNameDetailSection)) {
+                       ((NonViralNameDetailSection) formSection)
+                                       .setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
+                       return true;
+               }else if ((input instanceof TaxonRelationship)
+                               && (formSection instanceof NomenclaturalReferenceDetailSection)) {
+                       ((NomenclaturalReferenceDetailSection) formSection)
+                                       .setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
+                       return true;
+               }else if ((input instanceof TaxonRelationship)
+                               && (formSection instanceof NomenclaturalStatusSection)) {
+                       ((NomenclaturalStatusSection) formSection)
+                                       .setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
+                       return true;
+               }else if ((input instanceof TaxonRelationship)
+                               && (formSection instanceof ProtologueSection)) {
+                       ((ProtologueSection) formSection)
+                                       .setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
+                       return true;
+               }else if ((input instanceof TaxonRelationship)
+                               && (formSection instanceof TypeDesignationSection)) {
+                       ((TypeDesignationSection) formSection)
+                                       .setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
+                       return true;
+               }else if ((input instanceof TaxonRelationship)
+                               && (formSection instanceof NameRelationshipDetailSection)) {
+                       ((NameRelationshipDetailSection) formSection)
+                                       .setTaxonBase( ((TaxonRelationship)input).getFromTaxon());
+                       return true;
+               }
 
+               
                formSection.setEntity((T) input);
 
                return true;
index f6ff7123b8f4e478f67d2deb602da4caf3c5f755..e2eb0ff0a5144ed37bd35b3017d51a92bff6fd6a 100644 (file)
@@ -10,6 +10,7 @@
 package eu.etaxonomy.taxeditor.view.detail;
 
 import java.util.Collection;
+import java.util.Set;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.e4.ui.model.application.ui.basic.MPart;
@@ -19,6 +20,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IWorkbenchPart;
@@ -29,6 +31,10 @@ import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
@@ -227,7 +233,41 @@ public class DetailsViewPart extends AbstractCdmEditorViewPart implements IPartC
     @Override
     public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
     }
+    @Override
+    public void showViewer(Object part, IStructuredSelection selection){
+       this.part = part;
 
+        Object element = selection.getFirstElement();
+      //avoid widget is disposed exceptions
+        if (getViewer().getControl()==null || getViewer().getControl().isDisposed()){
+            return;
+        }
 
-
+        setPartName(createPartTitle(element));
+        if (element instanceof Taxon){
+               Taxon taxon = HibernateProxyHelper.deproxy(element, Taxon.class);
+               if (taxon.isMisapplication()){
+                       
+                       if (part instanceof ITaxonEditor){
+                               Taxon accepted= ((ITaxonEditor)part).getTaxon();
+                               Set<TaxonRelationship> rels =  taxon.getTaxonRelations(accepted); 
+                               
+                                if (rels.iterator().hasNext()){
+                                        TaxonRelationship rel = rels.iterator().next();
+                                        if (rel.getType().equals(TaxonRelationshipType.MISAPPLIED_NAME_FOR())){
+                                                getViewer().setInput(rel);
+                                                 showViewer();
+                                                 return;
+                                        }
+                                }
+                       }
+                       
+                       
+               }
+        }
+        getViewer().setInput(element);
+        showViewer();
+    }
 }
+
+
old mode 100644 (file)
new mode 100755 (executable)
index 55294d9..25fee3a
@@ -771,9 +771,47 @@ public class DetailsViewer extends AbstractCdmDataViewer {
 
         TaxonRelationshipDetailSection taxonRelationshipDetailSection = formFactory.createTaxonRelationshipDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
 
-        ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+       // ReferencedEntityDetailSection referencedEntityBaseDetailSection = formFactory.createReferencedEntityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
         addPart(taxonRelationshipDetailSection);
-        addPart(referencedEntityBaseDetailSection);
+     //   addPart(referencedEntityBaseDetailSection);
+        NonViralNameDetailSection nonViralNameSection = formFactory
+                .createNonViralNameDetailSection(getConversationHolder(), parent, this, true,
+                        ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        addPart(nonViralNameSection);
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+        //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_REFERENCE))){
+        NomenclaturalReferenceDetailSection referenceDetailSection = formFactory.createNomenclaturalReferenceDetailSection(getConversationHolder(), parent, this,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+        formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+        addPart(referenceDetailSection);
+
+        //if ( !PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NOMENCLATURAL_STATUS))){
+            NomenclaturalStatusSection nomenclaturalStatusSection = formFactory.createNomenclaturalStatusSection(getConversationHolder(), parent,
+                       ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+            formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+            addPart(nomenclaturalStatusSection);
+    //}
+
+       //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_PROTOLOGUE))){
+               ProtologueSection protologSection = formFactory.createProtologueSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               addPart(protologSection);
+       //}
+
+       //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) &&  PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION))){
+               TypeDesignationSection typeDesignationSection = formFactory.createTypeDesignationSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               addPart(typeDesignationSection);
+       //}
+
+       //if (!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) || (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION) && PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP))){
+               NameRelationshipDetailSection nameRelationshipSection = formFactory.createNameRelationshipDetailSection(getConversationHolder(), parent, ExpandableComposite.TWISTIE);
+               formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+               addPart(nameRelationshipSection);
+       //}
+
+        
+        //}
     }
 
     private void createTermVocabularySection(RootElement parent) {
index fece70f591f1344a5f45c5104761b535411eab58..ab859e91a04cfa09b87c5bb3f1675ef318dbba03 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db and b/eu.etaxonomy.taxeditor.test/src/test/resources/h2/cdmTest.h2.db differ
index 1514dcd8ab9b592447400ed3c99f732d139e990f..0b0ee6d572b47aa0971e7fd5458ca15ec9fdc6b7 100644 (file)
           <command href="../eu.etaxonomy.taxeditor.application/fragment.e4xmi#_TvLd8B62EeePLJ5to5QrXQ"/>
         </children>
       </children>
-      <children xsi:type="menu:Menu" xmi:id="_FaGntiQNEeen_7LZsZSNoA" elementId="eu.etaxonomy.taxeditor.workbench.menu.edit" toBeRendered="false" visible="false" label="%menu.label.0"/>
+      <children xsi:type="menu:Menu" xmi:id="_FaGntiQNEeen_7LZsZSNoA" elementId="eu.etaxonomy.taxeditor.workbench.menu.edit" label="%menu.label.0">
+        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_O7JxAFJ5EeeL4Lhic-6yjw" coreExpressionId="isCdmStoreConnected"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_19-hwFJ4EeeL4Lhic-6yjw" elementId="eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel8" label="%command.label.8" command="_PhIAwB7EEeeRW_RHu3JLqQ"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_7V-hMFJ4EeeL4Lhic-6yjw" elementId="eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel9" label="%command.label.9" command="_RxxNsB7EEeeRW_RHu3JLqQ"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="_9PVPgFJ4EeeL4Lhic-6yjw" elementId="eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel10" label="%command.label.10" command="_TmIHQB7EEeeRW_RHu3JLqQ"/>
+        <children xsi:type="menu:MenuSeparator" xmi:id="__NwEAFJ4EeeL4Lhic-6yjw" elementId="eu.etaxonomy.taxeditor.workbench.menuseparator.3"/>
+        <children xsi:type="menu:HandledMenuItem" xmi:id="__2Uf4FJ4EeeL4Lhic-6yjw" elementId="eu.etaxonomy.taxeditor.workbench.handledmenuitem.commandlabel11" label="%command.label.11" command="_WOTDYB7EEeeRW_RHu3JLqQ"/>
+      </children>
       <children xsi:type="menu:Menu" xmi:id="_FaGntyQNEeen_7LZsZSNoA" elementId="eu.etaxonomy.taxeditor.workbench.menu.window" label="%menu.label.1">
         <children xsi:type="menu:Menu" xmi:id="_DH_m0CkKEeeCvszP-_feIA" elementId="eu.etaxonomy.taxeditor.menu.showView" label="Show View"/>
         <children xsi:type="menu:MenuSeparator" xmi:id="_FaGnuCQNEeen_7LZsZSNoA" elementId="eu.etaxonomy.taxeditor.application.windowMenu.last"/>
index 8a49dfe4edf32b476d71c5b3720e6d61076e166c..45b80bdf05f7fd3acc8a3ae4831a410e3cbefc5a 100644 (file)
@@ -2,7 +2,8 @@
 <?eclipse version="3.4"?>
 <plugin>
    <extension
-         id="id2"
+         id="eu.etaxonomy.taxeditor.workbench.workbench.model"
+         name="Taxonomic Editor Application Model"
          point="org.eclipse.e4.workbench.model">
       <fragment
             apply="always"
index 5df9718429821e6a3afb4a4beb0ab3885125baa1..281e4239a763688d4514552e0fa235b609b34bc9 100644 (file)
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target includeMode="feature" name="Eclipse Neon Target" sequenceNumber="37">
-<locations>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.nebula.widgets.compositetable.feature.feature.group" version="1.0.0.201703081533"/>
-<repository location="http://download.eclipse.org/nebula/releases/latest"/>
-</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.e4.core.tools.feature.source.feature.group" version="4.5.100.v20170131-1452"/>
-<unit id="org.eclipse.equinox.p2.user.ui.source.feature.group" version="2.2.203.v20170131-1444"/>
-<unit id="org.eclipse.e4.rcp.feature.group" version="1.5.3.v20170228-0512"/>
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>
-<unit id="org.eclipse.swtbot.forms.feature.group" version="2.5.0.201609021837"/>
-<unit id="org.eclipse.help.feature.group" version="2.2.2.v20170301-0400"/>
-<unit id="org.eclipse.e4.core.tools.feature.feature.group" version="4.5.100.v20170131-1452"/>
-<unit id="org.eclipse.e4.rcp.source.feature.group" version="1.5.3.v20170228-0512"/>
-<unit id="org.eclipse.sdk.ide" version="4.6.3.M20170301-0400"/>
-<unit id="epp.package.modeling" version="4.6.3.20170314-1500"/>
-<unit id="org.eclipse.platform.sdk" version="4.6.3.M20170301-0400"/>
-<unit id="org.eclipse.jdt.feature.group" version="3.12.3.v20170301-0400"/>
-<unit id="org.eclipse.pde.source.feature.group" version="3.12.3.v20170301-0400"/>
-<unit id="org.eclipse.core.runtime.feature.feature.group" version="1.1.203.v20170209-1843"/>
-<unit id="org.eclipse.pde.feature.group" version="3.12.3.v20170301-0400"/>
-<unit id="org.eclipse.rcp.sdk.id" version="4.6.3.M20170301-0400"/>
-<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/>
-<unit id="org.eclipse.platform.feature.group" version="4.6.3.v20170301-0400"/>
-<repository location="http://download.eclipse.org/releases/neon"/>
-</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.zest.sdk.feature.group" version="1.7.0.201606061308"/>
-<repository location="http://download.eclipse.org/releases/neon"/>
-</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.oomph.setup.sdk.feature.group" version="1.7.0.v20170305-1123"/>
-<repository location="http://download.eclipse.org/releases/neon"/>
-</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.equinox.sdk.feature.group" version="3.12.0.v20170209-1843"/>
-<unit id="org.eclipse.equinox.p2.rcp.feature.feature.group" version="1.2.203.v20170131-1444"/>
-<unit id="org.eclipse.equinox.p2.extras.feature.feature.group" version="1.2.203.v20170131-1444"/>
-<unit id="org.eclipse.equinox.serverside.sdk.feature.group" version="3.12.3.v20170209-1843"/>
-<unit id="org.eclipse.equinox.compendium.sdk.feature.group" version="3.12.0.v20160815-1406"/>
-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.12.3.v20170209-1843"/>
-<unit id="org.eclipse.equinox.core.feature.feature.group" version="1.3.3.v20170209-1843"/>
-<unit id="org.eclipse.equinox.p2.core.feature.feature.group" version="1.3.203.v20170131-1444"/>
-<unit id="org.eclipse.equinox.p2.rcp.feature.source.feature.group" version="1.2.203.v20170131-1444"/>
-<unit id="org.eclipse.equinox.p2.core.feature.source.feature.group" version="1.3.203.v20170131-1444"/>
-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.9.203.v20170131-1444"/>
-<unit id="org.eclipse.objectteams.otequinox.feature.group" version="2.5.2.201612071657"/>
-<unit id="org.eclipse.equinox.p2.extras.feature.source.feature.group" version="1.2.203.v20170131-1444"/>
-<repository location="http://download.eclipse.org/releases/neon"/>
-</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.emf.ecore.xcore.sdk.feature.group" version="1.4.0.v20160526-0606"/>
-<unit id="org.eclipse.emf.ecore.feature.group" version="2.12.0.v20160420-0247"/>
-<unit id="org.eclipse.emf.ecore.xcore.lib.feature.group" version="1.2.100.v20160526-0606"/>
-<unit id="org.eclipse.emf.sdk.feature.group" version="2.12.0.v20160526-0356"/>
-<unit id="org.eclipse.emf.common.feature.group" version="2.12.0.v20160420-0247"/>
-<unit id="org.eclipse.emf.ecore.xcore.feature.group" version="1.4.0.v20160526-0606"/>
-<unit id="org.eclipse.emf.feature.group" version="2.12.0.v20160526-0356"/>
-<repository location="http://download.eclipse.org/releases/neon"/>
-</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="org.eclipse.e4.tools.event.spy.feature.source.feature.group" version="0.15.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.preference.spy.feature.feature.group" version="0.1.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.spies.feature.feature.group" version="0.17.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.css.spy.feature.feature.group" version="0.14.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.model.spy.feature.feature.group" version="0.1.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.event.spy.feature.feature.group" version="0.15.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.bundle.spy.feature.feature.group" version="0.1.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.context.spy.feature.feature.group" version="0.17.0.v20170110-2157"/>
-<unit id="org.eclipse.e4.tools.css.spy.feature.source.feature.group" version="0.14.0.v20170110-2157"/>
-<repository location="http://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest"/>
-</location>
-</locations>
-</target>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<?pde version="3.8"?><target includeMode="feature" name="Eclipse Neon Target" sequenceNumber="38">\r
+<locations>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.nebula.widgets.compositetable.feature.feature.group" version="1.0.0.201703081533"/>\r
+<repository location="http://download.eclipse.org/nebula/releases/latest"/>\r
+</location>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.e4.core.tools.feature.source.feature.group" version="4.5.100.v20170131-1452"/>\r
+<unit id="org.eclipse.equinox.p2.user.ui.source.feature.group" version="2.2.203.v20170131-1444"/>\r
+<unit id="org.eclipse.e4.rcp.feature.group" version="1.5.3.v20170228-0512"/>\r
+<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>\r
+<unit id="org.eclipse.swtbot.forms.feature.group" version="2.5.0.201609021837"/>\r
+<unit id="org.eclipse.help.feature.group" version="2.2.2.v20170301-0400"/>\r
+<unit id="org.eclipse.e4.core.tools.feature.feature.group" version="4.5.100.v20170131-1452"/>\r
+<unit id="org.eclipse.e4.rcp.source.feature.group" version="1.5.3.v20170228-0512"/>\r
+<unit id="org.eclipse.sdk.ide" version="4.6.3.M20170301-0400"/>\r
+<unit id="epp.package.modeling" version="4.6.3.20170314-1500"/>\r
+<unit id="org.eclipse.platform.sdk" version="4.6.3.M20170301-0400"/>\r
+<unit id="org.eclipse.jdt.feature.group" version="3.12.3.v20170301-0400"/>\r
+<unit id="org.eclipse.pde.source.feature.group" version="3.12.3.v20170301-0400"/>\r
+<unit id="org.eclipse.core.runtime.feature.feature.group" version="1.1.203.v20170209-1843"/>\r
+<unit id="org.eclipse.pde.feature.group" version="3.12.3.v20170301-0400"/>\r
+<unit id="org.eclipse.rcp.sdk.id" version="4.6.3.M20170301-0400"/>\r
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.5.0.201609021837"/>\r
+<unit id="org.eclipse.platform.feature.group" version="4.6.3.v20170301-0400"/>\r
+<repository location="http://download.eclipse.org/releases/neon"/>\r
+</location>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.zest.sdk.feature.group" version="1.7.0.201606061308"/>\r
+<repository location="http://download.eclipse.org/releases/neon"/>\r
+</location>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.oomph.setup.sdk.feature.group" version="1.7.0.v20170305-1123"/>\r
+<repository location="http://download.eclipse.org/releases/neon"/>\r
+</location>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.equinox.sdk.feature.group" version="3.12.0.v20170209-1843"/>\r
+<unit id="org.eclipse.equinox.p2.rcp.feature.feature.group" version="1.2.203.v20170131-1444"/>\r
+<unit id="org.eclipse.equinox.p2.extras.feature.feature.group" version="1.2.203.v20170131-1444"/>\r
+<unit id="org.eclipse.equinox.serverside.sdk.feature.group" version="3.12.3.v20170209-1843"/>\r
+<unit id="org.eclipse.equinox.compendium.sdk.feature.group" version="3.12.0.v20160815-1406"/>\r
+<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.12.3.v20170209-1843"/>\r
+<unit id="org.eclipse.equinox.core.feature.feature.group" version="1.3.3.v20170209-1843"/>\r
+<unit id="org.eclipse.equinox.p2.core.feature.feature.group" version="1.3.203.v20170131-1444"/>\r
+<unit id="org.eclipse.equinox.p2.rcp.feature.source.feature.group" version="1.2.203.v20170131-1444"/>\r
+<unit id="org.eclipse.equinox.p2.core.feature.source.feature.group" version="1.3.203.v20170131-1444"/>\r
+<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.9.203.v20170131-1444"/>\r
+<unit id="org.eclipse.objectteams.otequinox.feature.group" version="2.5.2.201612071657"/>\r
+<unit id="org.eclipse.equinox.p2.extras.feature.source.feature.group" version="1.2.203.v20170131-1444"/>\r
+<repository location="http://download.eclipse.org/releases/neon"/>\r
+</location>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.emf.ecore.xcore.sdk.feature.group" version="1.4.0.v20160526-0606"/>\r
+<unit id="org.eclipse.emf.ecore.feature.group" version="2.12.0.v20160420-0247"/>\r
+<unit id="org.eclipse.emf.ecore.xcore.lib.feature.group" version="1.2.100.v20160526-0606"/>\r
+<unit id="org.eclipse.emf.sdk.feature.group" version="2.12.0.v20160526-0356"/>\r
+<unit id="org.eclipse.emf.common.feature.group" version="2.12.0.v20160420-0247"/>\r
+<unit id="org.eclipse.emf.ecore.xcore.feature.group" version="1.4.0.v20160526-0606"/>\r
+<unit id="org.eclipse.emf.feature.group" version="2.12.0.v20160526-0356"/>\r
+<repository location="http://download.eclipse.org/releases/neon"/>\r
+</location>\r
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">\r
+<unit id="org.eclipse.e4.tools.context.spy.feature.feature.group" version="0.17.0.v20170601-1400"/>\r
+<unit id="org.eclipse.e4.tools.preference.spy.feature.feature.group" version="0.1.0.v20170601-0901"/>\r
+<unit id="org.eclipse.e4.tools.event.spy.feature.feature.group" version="0.15.0.v20170601-0901"/>\r
+<unit id="org.eclipse.e4.tools.spies.feature.feature.group" version="0.17.0.v20170601-1400"/>\r
+<unit id="org.eclipse.e4.tools.css.spy.feature.source.feature.group" version="0.14.0.v20170601-1400"/>\r
+<unit id="org.eclipse.e4.tools.bundle.spy.feature.feature.group" version="0.1.0.v20170601-1400"/>\r
+<unit id="org.eclipse.e4.tools.event.spy.feature.source.feature.group" version="0.15.0.v20170601-0901"/>\r
+<unit id="org.eclipse.e4.tools.css.spy.feature.feature.group" version="0.14.0.v20170601-1400"/>\r
+<unit id="org.eclipse.e4.tools.model.spy.feature.feature.group" version="0.1.0.v20170601-0901"/>\r
+<repository location="http://download.eclipse.org/e4/snapshots/org.eclipse.e4.tools/latest"/>\r
+</location>\r
+</locations>\r
+</target>\r