merge from trunk
authorCherian Mathew <c.mathew@bgbm.org>
Tue, 11 Feb 2014 15:30:51 +0000 (15:30 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Tue, 11 Feb 2014 15:30:51 +0000 (15:30 +0000)
25 files changed:
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteSynonymOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/operation/DeleteTaxonOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java
eu.etaxonomy.taxeditor.help/original_document/Taxonomic_Editor_User_Manual_Version_4.doc
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.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/ExcelNormalExplicitTaxaImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/ExternalReferenceServiceWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/parser/ParseHandler.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.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/vocabulary/DefinedTermDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/UpdateDataSourceHandler.java
eu.etaxonomy.taxeditor.store/src/main/resources/eu/etaxonomy/cdm/editorApplicationContext.xml

index f08c60f92954a3edc7d4aaa0a1e212547b988190..eb74e5e7504d89fc8c7a57738ac4b4f27fe61207 100644 (file)
@@ -20,12 +20,12 @@ import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.api.service.IReferenceService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation;
@@ -73,8 +73,8 @@ public class DeleteHandler extends AbstractHandler {
                                        LineAnnotation annotation = (LineAnnotation) model.getAnnotation(object);
                                                        
                                        try {
-                                               CdmApplicationController controller;
-                                               controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+                                               ICdmApplicationConfiguration controller;
+                                               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
                                                //persistenceService.delete(object);
                                                if (object instanceof SpecimenOrObservationBase){
                                                        
index fa2153544aad4f01f6b976f205dd2fb13393b25d..264bcaaff6a68b62c3f66cd94856652abad068db 100644 (file)
@@ -596,3 +596,4 @@ Bundle-ClassPath: .,
  lib/odfdom-0.8.jar,
  lib/h2mig_pagestore_addon.jar,
  lib/spring-security-remoting-3.1.3.RELEASE.jar
+Import-Package: eu.etaxonomy.cdm.api.application
index 25bef92d7760429f17f85696e4c2ddcd2e1cf151..9b3b1ada9941074997befda33422d1f7825a9cb9 100644 (file)
@@ -8,11 +8,13 @@ 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 org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.service.IPolytomousKeyNodeService;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -43,16 +45,20 @@ public class DeleteNodeOperation extends AbstractPostOperation {
        @Override
        public IStatus execute(IProgressMonitor monitor, IAdaptable info)
                        throws ExecutionException {
-
+               
                //parent.removeChild(node);
-               CdmApplicationController controller;
+               ICdmApplicationConfiguration controller;
                
-               controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
                
                IPolytomousKeyNodeService service = controller.getPolytomousKeyNodeService();
-               
-               service.delete(node, true);
-
+               if (node.getChildren().size()>0){
+                       if(! MessageDialog.openQuestion(null, "Confirm deletion of children", "The selected node has children, do you want to delete them, too?")) {
+                               service.delete(node, false);
+                       }
+               } else{
+                       service.delete(node, true);
+               }
                return postExecute(null);
        }
 
index 76e1b34f844e661a9c7cd5cfe02a3557055d6ace..159840d6531da0917db99d22f394842d580dc5ef 100644 (file)
@@ -17,11 +17,11 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
 import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -67,9 +67,9 @@ public class DeleteSynonymOperation extends AbstractPostOperation {
                                
                                // Remove synonym from taxon
                                
-                               CdmApplicationController controller;
+                               ICdmApplicationConfiguration controller;
                                
-                               controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();
+                               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();
                                
                                ITaxonService service = controller.getTaxonService();
                                if (synonym.getId() == 0){
index b1a365900c94e0b47157a72dc218af4ec425625d..ddc6e90bae234be2bb592e12da344646ecced197 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;\r
 import org.eclipse.ui.handlers.HandlerUtil;\r
 \r
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;\r
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
 import eu.etaxonomy.cdm.api.service.ITaxonService;\r
 import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;\r
@@ -28,6 +27,7 @@ import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.Synonym;\r
 import eu.etaxonomy.cdm.model.taxon.Taxon;\r
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;\r
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;\r
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
@@ -73,9 +73,9 @@ public class DeleteTaxonOperation extends DeleteTaxonBaseOperation{
                                bind();\r
                                \r
                                \r
-                               CdmApplicationController controller;\r
+                               ICdmApplicationConfiguration controller;\r
                                \r
-                               controller = (CdmApplicationController) CdmStore.getCurrentApplicationConfiguration();\r
+                               controller = (ICdmApplicationConfiguration) CdmStore.getCurrentApplicationConfiguration();\r
                                \r
                                ITaxonService service = controller.getTaxonService();\r
                                try {\r
index 4aa081d5c94a35a9dae38bad8ba35ba95d9dabec..ebebe817afdb9cef1fb6e6ec70e316b44004877b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -29,6 +29,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
 import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 
 /**
@@ -36,12 +37,12 @@ import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
  * @created Jan 24, 2011
  * @version 1.0
  */
-public class ConceptViewPart extends AbstractCdmEditorViewPart {
+public class ConceptViewPart extends AbstractCdmEditorViewPart implements IPartContentHasDetails{
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept";
-       
+
        private ListViewer viewer;
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
         */
@@ -51,17 +52,17 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart {
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof BulkEditor){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof AbstractGraphKeyEditor){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof MultiPageTaxonEditor){
                        if(! part.equals(this.part)){
                                IEditorInput input = ((IEditorPart) part).getEditorInput();
@@ -94,39 +95,39 @@ public class ConceptViewPart extends AbstractCdmEditorViewPart {
        @Override
        public void createViewer(Composite parent) {
                viewer = new ListViewer(parent);
-               
+
                viewer.setContentProvider(new ConceptContentProvider());
                viewer.setLabelProvider(new ConceptLabelProvider());
-               
-               
+
+
                viewer.setSorter(new ConceptViewerSorter());
-               
+
                getSite().setSelectionProvider(viewer);
-               
+
                createMenu();
-               
+
                createToolbar();
        }
-       
+
        private void createMenu(){
                MenuManager menuManager = new MenuManager();
                menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-               
+
                getSite().registerContextMenu(menuManager, viewer);
-               
+
                Control control = viewer.getControl();
                Menu menu = menuManager.createContextMenu(control);
-               
-               control.setMenu(menu);  
+
+               control.setMenu(menu);
        }
-       
+
        private void createToolbar() {
                IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
 //             toolBarManager.add();
 //             toolBarManager.add();
        }
 
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.view.AbstractCdmEditorViewPart#changed(java.lang.Object)
         */
index 30db42aed714313840fd633d7008222a9d05882f..dbd2cbbaac30e881931f82de080dd70ad69b695c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -62,9 +62,9 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
 
        /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
        public static final String ID = "eu.etaxonomy.taxeditor.editor.view.descriptive";
-       
+
        protected TreeViewer viewer;
-       
+
        protected Map<TaxonDescription, FeatureNodeContainerTree> featureNodeContainerCache = new HashMap<TaxonDescription, FeatureNodeContainerTree>();
 
        protected ToggleDescriptionAction showAllElementsAction;
@@ -72,13 +72,13 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
        protected ToggleDescriptionAction hideAllElementsAction;
 
        protected int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
-       
+
        /** {@inheritDoc} */
        @Override
        public void createViewer(Composite parent) {
                viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL
                                | SWT.V_SCROLL | SWT.FULL_SELECTION));
-               viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));           
+               viewer.setContentProvider(new DescriptiveContentProvider(featureNodeContainerCache));
                viewer.setLabelProvider(new DescriptiveLabelProvider());
                viewer.setSorter(new DescriptiveViewerSorter());
                viewer.setAutoExpandLevel(2);
@@ -87,24 +87,24 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                                this));
                viewer.addDropSupport(dndOperations, transfers,
                                new DescriptionElementDropAdapter(viewer));
-                                               
+
                // Propagate selection from viewer
                getSite().setSelectionProvider(viewer);
-               
-               showAllElementsAction = new ToggleDescriptionAction(false);             
+
+               showAllElementsAction = new ToggleDescriptionAction(false);
                hideAllElementsAction = new ToggleDescriptionAction(true);
-               
+
                // Add context menu to tree
                createMenu();
-               
+
                createToolbar();
-               
+
                // set initial input
 //             if(getEditor() != null){
 //                     viewer.setInput(getEditor().getEditorInput());
 //             }
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#getInitialSelection()
         */
@@ -113,8 +113,8 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
        protected ISelection getInitialSelection() {
                if(getEditor() != null){
                        return new StructuredSelection(getEditor().getEditorInput());
-               }       
-               
+               }
+
                return super.getInitialSelection();
        }
 
@@ -123,48 +123,49 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                toolBarManager.add(showAllElementsAction);
                toolBarManager.add(hideAllElementsAction);
        }
-       
+
        /*
         * TODO add to the views menu
         */
        protected void createMenu(){
                MenuManager menuManager = new MenuManager();
                menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-               
+
                getSite().registerContextMenu(menuManager, viewer);
 
                // FIXME for some reason this is not working
                menuManager.add(showAllElementsAction);
                menuManager.add(hideAllElementsAction);
-                               
+
                Control control = viewer.getControl();
                Menu menu = menuManager.createContextMenu(control);
-               
-               control.setMenu(menu);  
+
+               control.setMenu(menu);
        }
 
        /** {@inheritDoc} */
-       public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+       @Override
+    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
                if(EditorUtil.getActiveEditor() == null){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof BulkEditor){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof AbstractGraphKeyEditor){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof DefinedTermEditor){
                        showEmptyPage();
                        return;
                }
-               
+
                if(part instanceof MultiPageTaxonEditor){
                        if(! part.equals(this.part)){
                                IEditorInput input = ((IEditorPart) part).getEditorInput();
@@ -174,22 +175,22 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                        showViewer();
                }
        }
-       
+
        /**
-        * 
+        *
         * @author n.hoffmann
         * @created May 28, 2010
         * @version 1.0
         */
        protected class ToggleDescriptionAction extends Action{
-               private boolean expanded;
-               
+               private final boolean expanded;
+
                public ToggleDescriptionAction(boolean expand){
                        super(null, Action.AS_PUSH_BUTTON);
                        expanded = expand;
                        setImageAndTooltip();
                }
-               
+
                private void setImageAndTooltip(){
                        setImageDescriptor(new ImageDescriptor() {
                                @Override
@@ -199,11 +200,11 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                                        return ImageResources.getImage(resource).getImageData();
                                }
                        });
-                       
-                       String toolTipText = expanded ? "Collapse all" : "Show all descriptive data";
+
+                       String toolTipText = expanded ? "Collapse all" : "Show all factual data";
                        setToolTipText(toolTipText);
                }
-               
+
                @Override
                public void run() {
                        if(expanded){
@@ -228,15 +229,15 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
                        containerTree.buildTree();
                }
                viewer.refresh();
-               
+
                if(object instanceof DescriptionElementBase){
                        DescriptionElementBase descriptionElement = (DescriptionElementBase) object;
                        DescriptionBase description = descriptionElement.getInDescription();
                        FeatureNodeContainerTree containerTree = featureNodeContainerCache.get(description);
-                       
+
                        FeatureNodeContainer featureNodeContainer = containerTree.getFeatureNodeContainerForDescriptionElement(descriptionElement);
                        viewer.expandToLevel(featureNodeContainer, 1);
-                       
+
                }
 
                if(object != null){
@@ -258,7 +259,8 @@ public class DescriptiveViewPart extends AbstractCdmEditorViewPart implements IP
         *
         * @return a boolean.
         */
-       public boolean onComplete() {
+       @Override
+    public boolean onComplete() {
                return false;
        }
 }
index 310daf830ebbccddc7faebfdab874a8e24d4e31c..666434a4ecce04a6f691d5aaaa66a2233112531f 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.help/original_document/Taxonomic_Editor_User_Manual_Version_4.doc and b/eu.etaxonomy.taxeditor.help/original_document/Taxonomic_Editor_User_Manual_Version_4.doc differ
index 9fdb66b7acb266a0dcae034a2c7766d74e3b7150..db12603068cb6d992b1ee67e4379c0d78066cd96 100644 (file)
@@ -98,6 +98,7 @@ public class NavigationUtil extends AbstractUtility{
                        AbstractUtility.error(NavigationUtil.class, "Error opening the editor", e);
                } catch (Exception e) {
                        AbstractUtility.warningDialog("Could not create Taxon", NavigationUtil.class, e.getMessage());
+                       e.printStackTrace();
                }
        }
 
index 9cd017a222c44819d6cbb38fbc6bc7dcd39ec05a..d1737c14e031f03117b88f8bdb0989d60d33edef 100644 (file)
@@ -20,8 +20,6 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationController;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
@@ -34,6 +32,8 @@ import eu.etaxonomy.cdm.model.common.ITreeNode;
 import eu.etaxonomy.cdm.model.taxon.Classification;
 import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
 import eu.etaxonomy.taxeditor.store.CdmStore;
index 5b0d4fc6f1e2a33805ca03c3c93bab1f6fc58fb7..6bc1250bcbcac995634141f1b4c863127ec64c9f 100644 (file)
@@ -13,8 +13,8 @@ package eu.etaxonomy.taxeditor.io;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.ui.progress.IProgressConstants;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 
 /**
  * <p>
@@ -40,7 +40,7 @@ public abstract class AbstractIOManager<CONFIGURATOR extends IIoConfigurator> {
         * 
         * @param applicationController
         *            a
-        *            {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
+        *            {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
         *            object.
         * @param <CONFIGURATOR>
         *            a CONFIGURATOR object.
index 984b7697b94aec721f63f5b821d4be9a1e55dbf8..b19810b89d7ee4b1237978fe636194ea7833569e 100644 (file)
@@ -18,13 +18,13 @@ import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbenchPart;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.io.common.CdmDefaultExport;
 import eu.etaxonomy.cdm.io.common.IExportConfigurator;
 import eu.etaxonomy.cdm.io.common.IIoConfigurator;
 import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
 
@@ -54,7 +54,7 @@ public class ExportManager extends AbstractIOManager<IExportConfigurator> {
         * 
         * @param applicationConfiguration
         *            a
-        *            {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
+        *            {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
         *            object.
         * @return a {@link eu.etaxonomy.taxeditor.io.ExportManager} object.
         */
index 64e097cb349bda65d44fca07e5c0f1d378f50cf0..48246bfcf43c08f3ad271654c2002d6a14c72868 100644 (file)
@@ -17,7 +17,6 @@ import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator;
 import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
@@ -27,6 +26,7 @@ import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.StoreUtil;
@@ -56,7 +56,7 @@ public class ImportManager extends AbstractIOManager<IImportConfigurator> {
         * 
         * @param applicationConfiguration
         *            a
-        *            {@link eu.etaxonomy.cdm.api.application.CdmApplicationController}
+        *            {@link eu.etaxonomy.cdm.remote.api.application.CdmApplicationController}
         *            object.
         * @return a {@link eu.etaxonomy.taxeditor.io.ImportManager} object.
         */
index 5f6122b99416e7b4f7203283ec2444b64435df22..fec238815d0f770d2353a1c274d0a9bdeb0be151 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -32,7 +32,7 @@ public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<No
        private NormalExplicitImportConfigurator configurator;
 
        private ImportFromFileDataSourceWizardPage dataSourcePage;
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
         */
@@ -51,9 +51,9 @@ public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<No
                URI source = dataSourcePage.getUri();
                configurator.setSource(source);
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-               
+
                CdmStore.getImportManager().run(configurator);
-               
+
                return true;
        }
 
@@ -61,7 +61,8 @@ public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<No
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                super.init(workbench, selection);
                configurator =  CdmStore.getImportManager().NormalExplicitConfigurator();
        }
@@ -73,9 +74,9 @@ public class ExcelNormalExplicitTaxaImportWizard extends AbstractImportWizard<No
        @Override
        public void addPages() {
                super.addPages();
-               
-               dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose NormalExplicit", 
-                               "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xls"});
+
+               dataSourcePage = new ImportFromFileDataSourceWizardPage("Choose NormalExplicit",
+                               "Please choose an xls file in the NormalExplicit format.", new String[]{"*.xls" ,"*.xlsx", "*.*"});
                addPage(dataSourcePage);
        }
 }
index 1348b2a67726408c713dc58abe7c7268125a5392..0ddc337cdc4414bdd2f04123c097dbf2cfc13547 100644 (file)
@@ -27,11 +27,11 @@ import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Text;
 
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.ext.ipni.IIpniService;
 import eu.etaxonomy.cdm.ext.ipni.IpniService;
 import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
index 260beaf7b4b8f95707fa6d1d735561672e8d2340..0ccb5a341af8789ba530183667a1f4b102116822 100644 (file)
@@ -81,7 +81,7 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOr
                if(SpecimenOrObservationType.Media.equals(specOrObsType) ||
                        ((specOrObsType.getKindOf() != null) &&
                                specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
-                   return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
+                   return MediaSpecimen.NewInstance(specOrObsType);
                } else if (specOrObsType.equals(SpecimenOrObservationType.FieldUnit)) {
                    return FieldUnit.NewInstance();
                } else {
index 0ca07983aaf269d2acd64d8edb7b03239c6943d6..9616b0ff6225a672da3fdf892527cc88b7e7e09b 100644 (file)
@@ -162,7 +162,7 @@ public class ParseHandler{
                
                MatchMatrix matchMatrix = findMatches(parsedName);
                
-               resolveDuplicates(parsedName, matchMatrix);
+//             resolveDuplicates(parsedName, matchMatrix);
                
                return parsedName;
        }
@@ -329,13 +329,13 @@ public class ParseHandler{
         * @return      A <code>List</code> of possibly matching TaxonNameBase's.
         */
        private List<TaxonNameBase> findMatchingLatinNames(TaxonNameBase taxonNameBase) {
-
-               try {
-                       return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
-                       
-               } catch (MatchException e) {
-                       StoreUtil.error(this.getClass(), "Error finding matching names", e);
-               }
+//
+//             try {
+//                     return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
+//                     
+//             } catch (MatchException e) {
+//                     StoreUtil.error(this.getClass(), "Error finding matching names", e);
+//             }
                return null;
        }
 }
index 4066655d9a4a6bfd4532fc4499d19f79d6ba36f3..3eec36ec209fcd64034b4a86045f643bcd51506f 100644 (file)
@@ -1,8 +1,8 @@
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -49,7 +49,7 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
  * <p>
  * PreferencesUtil class.
  * </p>
- * 
+ *
  * @author p.ciardelli
  * @author n.hoffmann
  * @created 05.12.2008
@@ -58,7 +58,7 @@ import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 public class PreferencesUtil implements IPreferenceKeys {
 
        /**
-        * 
+        *
         */
        public static final String PREFERRED_TERMS_CHANGE = "preferred_terms";
 
@@ -66,7 +66,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * getPreferenceStore
         * </p>
-        * 
+        *
         * @return a {@link org.eclipse.jface.preference.IPreferenceStore} object.
         */
        public static IPreferenceStore getPreferenceStore() {
@@ -77,7 +77,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * setPreferredNomenclaturalCode
         * </p>
-        * 
+        *
         * @param preferredCode
         *            a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode}
         *            object.
@@ -92,7 +92,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * getPreferredNomenclaturalCode
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode} object.
         */
        public static NomenclaturalCode getPreferredNomenclaturalCode() {
@@ -110,7 +110,7 @@ public class PreferencesUtil implements IPreferenceKeys {
        /**
         * Get the match strategy for the given class that was stored in preferences
         * or the default strategy if it was not stored in preferences
-        * 
+        *
         * @param clazz
         *            a {@link java.lang.Class} object.
         * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
@@ -139,7 +139,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * Stores a matchStrategy into the preference store.
-        * 
+        *
         * @param matchStrategy
         *            a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy}
         *            object.
@@ -159,7 +159,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * Helper method to create the preference property for a match field.
-        * 
+        *
         * @param className
         * @param fieldName
         * @return
@@ -171,7 +171,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * Returns the default match strategy for a given class.
-        * 
+        *
         * @param clazz
         *            a {@link java.lang.Class} object.
         * @return a {@link eu.etaxonomy.cdm.strategy.match.IMatchStrategy} object.
@@ -184,7 +184,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * getDateFormatPattern
         * </p>
-        * 
+        *
         * @return a {@link java.lang.String} object.
         */
        public static String getDateFormatPattern() {
@@ -197,7 +197,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * addTermToPreferredTerms
         * </p>
-        * 
+        *
         * @param term
         *            a T object.
         * @param <T>
@@ -216,7 +216,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * Construct a unique key using the CdmBase object's uuid
-        * 
+        *
         * @param cdmBase
         * @return
         */
@@ -230,10 +230,10 @@ public class PreferencesUtil implements IPreferenceKeys {
                }
                return key;
        }
-       
+
        /**
         * Construct a unique key using the CdmBase object's uuid
-        * 
+        *
         * @param cdmBase
         * @return
         */
@@ -247,12 +247,12 @@ public class PreferencesUtil implements IPreferenceKeys {
                }
                return key;
        }
-       
-       
+
+
 
        /**
         * Construct a unique key using the CdmBase object's uuid
-        * 
+        *
         * @param cdmBase
         * @return
         */
@@ -269,7 +269,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * Retrieves search preferences from the preference store
-        * 
+        *
         * @return an {@link ITaxonServiceConfigurator} to pass to search methods
         */
        public static IFindTaxaAndNamesConfigurator getSearchConfigurator() {
@@ -289,7 +289,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * create new preferences, setting all search options to true
-        * 
+        *
         * @return a
         *         {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
         *         object.
@@ -323,7 +323,7 @@ public class PreferencesUtil implements IPreferenceKeys {
 
        /**
         * Store search preferences
-        * 
+        *
         * @param configurator
         *            a
         *            {@link eu.etaxonomy.cdm.api.service.config.ITaxonServiceConfigurator}
@@ -345,7 +345,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * firePreferencesChanged
         * </p>
-        * 
+        *
         * @param clazz
         *            a {@link java.lang.Class} object.
         */
@@ -362,7 +362,7 @@ public class PreferencesUtil implements IPreferenceKeys {
                getPreferenceStore().setDefault(TAXON_SERVICE_CONFIGURATOR_SYNONYMS,
                                true);
                getPreferenceStore().setDefault(EDIT_MAP_SERVICE_ACCES_POINT,
-                               "http://edit.br.fgov.be/edit_wp5/v1/areas.php");
+                               "http://edit.africamuseum.be/edit_wp5/v1.2/rest_gen.php");
                //FIXME : changed default for SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
                getPreferenceStore().setDefault(SHOULD_CONNECT_AT_STARTUP, false);
                getPreferenceStore().setDefault(OPENURL_ACCESS_POINT,
@@ -406,7 +406,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * getMapServiceAccessPoint
         * </p>
-        * 
+        *
         * @return a {@link java.lang.String} object.
         */
        public static String getMapServiceAccessPoint() {
@@ -417,18 +417,20 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * shouldConnectAtStartUp
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public static boolean shouldConnectAtStartUp() {
-               return getPreferenceStore().getBoolean(SHOULD_CONNECT_AT_STARTUP);
+               //FIXME :  force SHOULD_CONNECT_AT_STARTUP to false (ticket 3828) until resolution
+               //return getPreferenceStore().getBoolean(SHOULD_CONNECT_AT_STARTUP);
+               return false;
        }
 
        /**
         * <p>
         * getDefaultFeatureTreeForTextualDescription
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.model.description.FeatureTree} object.
         */
        public static FeatureTree getDefaultFeatureTreeForTextualDescription() {
@@ -442,7 +444,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * getDefaultFeatureTreeForStructuredDescription
         * </p>
-        * 
+        *
         * @return a {@link eu.etaxonomy.cdm.model.description.FeatureTree} object.
         */
        public static FeatureTree getDefaultFeatureTreeForStructuredDescription() {
@@ -456,7 +458,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * setSortRanksHierarchichally
         * </p>
-        * 
+        *
         * @param selection
         *            a boolean.
         */
@@ -468,7 +470,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * getSortRanksHierarchichally
         * </p>
-        * 
+        *
         * @return a boolean.
         */
        public static boolean getSortRanksHierarchichally() {
@@ -541,7 +543,7 @@ public class PreferencesUtil implements IPreferenceKeys {
         * <p>
         * setEditMarkerTypePreference
         * </p>
-        * 
+        *
         * @param input
         *            a {@link org.eclipse.ui.IEditorInput} object.
         * @param markerType
index 52282366470f862d91649b740a1a6a520cfa81f5..186242eb0ba6b32a9e1eee9fd4dee88323257c66 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -41,9 +41,9 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  * @version 1.0
  */
 public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<FeatureNodeContainer> {
-       
+
        private BrowserElement image;
-       
+
        /**
         * <p>Constructor for FeatureDistributionDetailElement.</p>
         *
@@ -72,7 +72,7 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                                String mapUriString = getMapUriString(getEntity());
                                image.setImageUriString(mapUriString);
                                formElement.getLayoutComposite().layout();
-                               message = mapUriString; 
+                               message = mapUriString;
                                return;
                        } else {
                                message = String.format("The service is not available: %s", serviceUriString);
@@ -80,7 +80,7 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
                } catch (URISyntaxException e) {
                        message = String.format("The URI has problems: %s", serviceUriString);
                }
-               
+
                Label label = formFactory.createLabel(getLayoutComposite(), message, SWT.WRAP);
                addControl(label);
                label.setLayoutData(LayoutConstants.FILL(2, 1));
@@ -93,31 +93,32 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
        /** {@inheritDoc} */
        @Override
        public void handleEvent(Object eventSource) {
-               // 
+               //
        }
 
        /**
         * @return
-        * @throws URISyntaxException 
+        * @throws URISyntaxException
         */
        private String getMapUriString(FeatureNodeContainer container){
                String accessPoint = PreferencesUtil.getMapServiceAccessPoint();
                Map<PresenceAbsenceTermBase<?>, java.awt.Color> presenceAbsenceTermColors = null;
                // FIXME due to a bug in the rest map service we have to ensure that width will always be an even number
-               // image.calculateWidth() % 2 == 1 ? image.calculateWidth() + 1 : 
+               // image.calculateWidth() % 2 == 1 ? image.calculateWidth() + 1 :
                int width = image.calculateWidth();
-               
-               String bbox = "-180,-90,180,90"; 
-               String backLayer = null;
+
+               String bbox = "-180,-90,180,90";
+               String backLayer = "earth";
 
                List<Language> languages = Arrays.asList(new Language[]{CdmStore.getDefaultLanguage()});
-               
-               String parameter = CdmStore.getGeoService().getDistributionServiceRequestParameterString(getTaxonDescriptions(), presenceAbsenceTermColors, width, 0, bbox, backLayer, languages);
-               
+
+               String parameter = CdmStore.getGeoService().getDistributionServiceRequestParameterString(getTaxonDescriptions(),
+                false, false, null, presenceAbsenceTermColors, width, 0, bbox, backLayer, languages);
+
                String mapUriString = String.format("%s?%s&ms=1000", accessPoint, parameter);
                return mapUriString;
        }
-       
+
        /**
         * @return
         */
index 39aa11e690566c5d5159883e339073cbd25e1485..3c191efe9b277a9099cd99da934e5bf4635d1dd9 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.ui.section.key;
 
@@ -9,15 +9,18 @@ import eu.etaxonomy.cdm.model.description.PolytomousKey;
 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.NumberWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
 
 /**
  * @author n.hoffmann
- * 
+ *
  */
 public class PolytomousKeyDetailElement extends
                AbstractIdentifiableEntityDetailElement<PolytomousKey> {
 
+    private NumberWithLabelElement numberStartNumber;
+
        public PolytomousKeyDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
@@ -29,15 +32,16 @@ public class PolytomousKeyDetailElement extends
             toggleable_cache = formFactory.createToggleableTextField(formElement,
                     "Title Cache", entity.getTitleCache(),
                     entity.isProtectedTitleCache(), SWT.NULL);
+            numberStartNumber = formFactory.createNumberTextWithLabelElement(formElement, "Start Number", entity.getStartNumber(), style);
        }
-       
+
        public String getText() {
            return toggleable_cache.getText();
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
         * .lang.Object)
@@ -45,6 +49,9 @@ public class PolytomousKeyDetailElement extends
        @Override
        public void handleEvent(Object eventSource) {
                handleToggleableCacheField();
+               if(eventSource==numberStartNumber){
+                   getEntity().setStartNumber(numberStartNumber.getInteger());
+               }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
 }
index 525d3ba3ff770f340f1f4562dd496fb69e94ee66..f3f9155f04f4a658414351118b14777e19a0cbf1 100644 (file)
@@ -97,9 +97,10 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                checkbox_doubtful = formFactory.createCheckbox(formElement,
                                entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
                
-               checkbox_published = formFactory.createCheckbox(formElement,
-                       "Taxon is published", ((TaxonBase) entity).isPublish(), style);
-
+               if (entity instanceof Taxon) {
+                       checkbox_published = formFactory.createCheckbox(formElement,
+                                       "Taxon is published", ((Taxon) entity).isPublish(), style);
+               }
        }
 
        /** {@inheritDoc} */
@@ -136,7 +137,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                } else if (eventSource == checkbox_unplaced) {
                    ((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
                } else if (eventSource == checkbox_published) {
-                   ((Taxon) getEntity()).setPublish(checkbox_published.getSelection());
+                   ((Taxon)getEntity()).setPublish(checkbox_published.getSelection());
                }
        }
 }
index 7b04da49ee4a53311788e35f97fabc2f7aa40265..9cdcf2ce6df306e49a7d95d786730010e285df1c 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -18,6 +18,7 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 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.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
@@ -30,9 +31,11 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<TaxonRelationship> {
 
        private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType;
-       
+
        private EntitySelectionElement<Taxon> selection_relatedTaxon;
-       
+
+       private CheckboxElement checkBoxDoubtful;
+
        public TaxonRelationshipDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
@@ -42,16 +45,17 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
        protected void createControls(ICdmFormElement formElement,
                        TaxonRelationship entity, int style) {
                combo_taxonRelationshipType = formFactory.createTermComboElement(
-                               TaxonRelationshipTypeInverseContainer.class, 
-                               formElement, "Relationship Type", 
+                               TaxonRelationshipTypeInverseContainer.class,
+                               formElement, "Relationship Type",
                                getTaxonRelationshipTypeInverseContainer(), style);
                combo_taxonRelationshipType.setEnabled(false);
                selection_relatedTaxon = formFactory.createSelectionElement(
-                               Taxon.class, getConversationHolder(), 
-                               formElement, "Related Taxon", getRelatedTaxon(), 
+                               Taxon.class, getConversationHolder(),
+                               formElement, "Related Taxon", getRelatedTaxon(),
                                EntitySelectionElement.SELECTABLE, style);
+               checkBoxDoubtful = formFactory.createCheckbox(formElement, "Relation is doubtful", entity.isDoubtful(), style);
        }
-       
+
        private Taxon getRelatedTaxon() {
                return TaxonRelationshipTypeInverseContainer.RelatedTaxon(getSourceTaxon(), getEntity());
        }
@@ -59,7 +63,7 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
        private TaxonRelationshipTypeInverseContainer getTaxonRelationshipTypeInverseContainer(){
                return TaxonRelationshipTypeInverseContainer.CreateFromSource(getSourceTaxon(), getEntity());
        }
-       
+
        private Taxon getSourceTaxon(){
                IEditorInput editorInput = StoreUtil.getActiveEditorInput();
                return (Taxon) editorInput.getAdapter(Taxon.class);
@@ -76,6 +80,9 @@ public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<Tax
                                getEntity().setToTaxon(relatedTaxon);
                        }
                }
+               else if(eventSource==checkBoxDoubtful){
+                   getEntity().setDoubtful(checkBoxDoubtful.getSelection());
+               }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
 }
index f6b7aeda6f3787a89ef3b90afc19030842955c5c..a049590217cf55cf36becb10de454b4e4ef8bd9b 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$\r
 /**\r
 * Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
 * http://www.e-taxonomy.eu\r
-* \r
+*\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
 */\r
@@ -13,6 +13,7 @@ import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;\r
 \r
 /**\r
  * @author l.morris\r
@@ -20,7 +21,9 @@ import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
  *\r
  */\r
 public class DefinedTermDetailElement<T extends DefinedTermBase> extends AbstractTermBaseDetailElement<T> {\r
-       \r
+\r
+    protected TextWithLabelElement textIdInVocabulary;\r
+\r
        /**\r
         * @param formFactory\r
         * @param formElement\r
@@ -30,12 +33,21 @@ public class DefinedTermDetailElement<T extends DefinedTermBase> extends Abstrac
                super(formFactory, formElement);\r
        }\r
 \r
+       @Override\r
+    protected void createControls(ICdmFormElement formElement, T entity, int style) {\r
+           super.createControls(formElement, entity, style);\r
+           textIdInVocabulary = formFactory.createTextWithLabelElement(formElement, "ID in vocabulary", entity.getIdInVocabulary(), style);\r
+       };\r
+\r
        /* (non-Javadoc)\r
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)\r
         */\r
        @Override\r
        public void handleEvent(Object eventSource) {\r
                handleRepresentation(eventSource);\r
+               if(eventSource==textIdInVocabulary){\r
+                   getEntity().setIdInVocabulary(textIdInVocabulary.getText());\r
+               }\r
        }\r
 \r
        /* (non-Javadoc)\r
index db4c250dc3ce0067c6fb6091ff9d1454ee7d9617..154dc12b923f49b450759a692ee94939534b5550 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.progress.IProgressConstants;
@@ -35,7 +36,7 @@ import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContaine
  * @version 1.0
  */
 public class UpdateDataSourceHandler extends AbstractDataSourceHandler {
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
         */
@@ -43,9 +44,11 @@ public class UpdateDataSourceHandler extends AbstractDataSourceHandler {
        @Override
        public boolean specificExecute(ExecutionEvent event) {
                final CdmMetaDataAwareDataSourceContainer container = getSelectedDataSourceContainer(event);
-               
+
                final Display display = Display.getCurrent();
-               if(! MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Confirm Deletion", "Are you sure you want to update the datasource?")){
+               if(! MessageDialog.open(MessageDialog.CONFIRM, HandlerUtil.getActiveShell(event), "Update Datasource", "WARNING!\n\n" +
+                               "This will change your data base structure! Be sure you have an up-to-date backup of your data before running the update! \n\n " +
+                               "Are you sure you want to update the datasource?", SWT.NONE)){
                        return false;
                }
                Job job = new Job("Updating datasource " + container.getDataSource().getName()){
@@ -54,19 +57,19 @@ public class UpdateDataSourceHandler extends AbstractDataSourceHandler {
                        protected IStatus run(IProgressMonitor monitor) {
                                CdmUpdater updater = new CdmUpdater();
                                IStatus status = null;
-                               
+
                                try{
                                        if(updater.updateToCurrentVersion(container.getDataSource(), CdmProgressMonitorAdapter.CreateMonitor(monitor))){
                                                display.asyncExec(new Runnable(){
 
                                                        @Override
                                                        public void run() {
-                                                               
+
                                                                CdmDataSourceViewPart view = (CdmDataSourceViewPart) StoreUtil.getView(CdmDataSourceViewPart.ID, false);
                                                                if(view != null){
                                                                        view.getViewer().update(new CdmMetaDataAwareDataSourceContainer[]{container}, null);
                                                                }
-                                                               
+
                                                        }
                                                });
                                                status = Status.OK_STATUS;
@@ -75,17 +78,17 @@ public class UpdateDataSourceHandler extends AbstractDataSourceHandler {
                                        status = new Status(IStatus.ERROR, TaxeditorStorePlugin.PLUGIN_ID, e.getMessage(), e);
                                        StoreUtil.errorDialog("Could not run updater", getClass(), status);
                                }
-                               
-                               
+
+
                                return status;
                        }
-                       
+
                };
-               
+
                job.setPriority(Job.BUILD);
                job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
                job.schedule();
-               
+
                return false;
        }
 }
index 718401b9236c3ece4d72216d4a8922fbdc25a693..eda9d21c496236d29992ff369c57c0fbdc0dd2ca 100644 (file)
@@ -17,6 +17,9 @@
   <!-- <bean id="remoteTermInitializer" class="eu.etaxonomy.cdm.remote.service.RemoteTermInitializer">    \r
   </bean> -->\r
   \r
\r
+\r
+    \r
   <import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/>\r
   <import resource="classpath:eu/etaxonomy/cdm/remote/json/jsonConfigurations.xml"/>\r
   \r