Trim code
authorPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 5 Oct 2015 13:55:26 +0000 (15:55 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 6 Oct 2015 06:53:04 +0000 (08:53 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/handler/ChangeConnectionHandler.java

index 6edcd8fd80db4a7f56c096362b038fd530070596..fcb455583524ce33fa014339ae971f473f69c0fe 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
 * 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.
 */
 * 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.
 */
@@ -22,34 +22,30 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
 
 /**
 import eu.etaxonomy.taxeditor.view.datasource.CdmMetaDataAwareDataSourceContainer;
 
 /**
- * <p>ChangeConnectionHandler class.</p>
- *
  * @author n.hoffmann
  * @created 15.04.2009
  * @version 1.0
  */
 public class ChangeConnectionHandler extends AbstractHandler {
 
  * @author n.hoffmann
  * @created 15.04.2009
  * @version 1.0
  */
 public class ChangeConnectionHandler extends AbstractHandler {
 
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.store.datasource.handler.AbstractDataSourceHandler#specificExecute(org.eclipse.core.commands.ExecutionEvent)
-        */
        /** {@inheritDoc} */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) {
+       @Override
+    public Object execute(ExecutionEvent event) {
                ISelection selection = HandlerUtil.getCurrentSelection(event);
                ISelection selection = HandlerUtil.getCurrentSelection(event);
-               
+
                if(selection != null && selection instanceof IStructuredSelection){
                        CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement();
                if(selection != null && selection instanceof IStructuredSelection){
                        CdmMetaDataAwareDataSourceContainer container = (CdmMetaDataAwareDataSourceContainer) ((IStructuredSelection) selection).getFirstElement();
-                       
+
                        if(CdmStore.isConnecting()){
                                MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
                                return null;
                        }
                        if(CdmStore.isConnecting()){
                                MessagingUtils.warningDialog("Already connecting", this, "You are currently connecting to a different datasource already.");
                                return null;
                        }
-                       
+
                        try {
                                container.getCdmSource().checkConnection();
                                boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
                                                + container.getCdmSource().getName());
                        try {
                                container.getCdmSource().checkConnection();
                                boolean confirmed = MessagingUtils.confirmDialog("Confirm Datasource Connection", "Do you really want to connect to this datasource?\n\n"
                                                + container.getCdmSource().getName());
-                               
+
                                if(confirmed){
                                        CdmDataSourceRepository.changeDataSource(container.getCdmSource());
                                }
                                if(confirmed){
                                        CdmDataSourceRepository.changeDataSource(container.getCdmSource());
                                }
@@ -59,9 +55,9 @@ public class ChangeConnectionHandler extends AbstractHandler {
                                                "Please also make sure that you are connected to the network when trying to connect to a remote datasource.");
                                MessagingUtils.warn(getClass(), e);
                                return null;
                                                "Please also make sure that you are connected to the network when trying to connect to a remote datasource.");
                                MessagingUtils.warn(getClass(), e);
                                return null;
-                       } 
+                       }
                }
                }
-               
+
                return null;
        }
 }
                return null;
        }
 }