Remove double click listener #5758
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 1 Jun 2016 09:59:32 +0000 (11:59 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 1 Jun 2016 11:05:04 +0000 (13:05 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java

index dd2b91e414b4295b0e9c05ca454a6ea2b7a24548..3207029946f188c2725c276dfef390b30104870c 100644 (file)
@@ -14,20 +14,12 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.log4j.Logger;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.NotEnabledException;
-import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.GroupMarker;
 import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.StructuredViewer;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
@@ -43,8 +35,6 @@ import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.ui.IMemento;
 import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
 
@@ -53,9 +43,7 @@ import eu.etaxonomy.taxeditor.Messages;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.IContextListener;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>CdmDataSourceViewPart class.</p>
@@ -225,42 +213,6 @@ public class CdmDataSourceViewPart extends ViewPart{
                Menu menu = menuMgr.createContextMenu(control);
                control.setMenu(menu);
 
-               // connect on doubleclick
-               viewer.addDoubleClickListener(new IDoubleClickListener() {
-
-                       @Override
-            public void doubleClick(DoubleClickEvent event) {
-                               if (event.getSelection() instanceof StructuredSelection) {
-
-                                       Object element = ((StructuredSelection) event
-                                                       .getSelection()).getFirstElement();
-                                       if (element instanceof CdmMetaDataAwareDataSourceContainer) {
-                                               String commandId = "eu.etaxonomy.taxeditor.store.datasource.change"; //$NON-NLS-1$
-
-                                               ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class);
-
-                                               Command command = commandService.getCommand(commandId);
-                                               if(command.isEnabled()) {
-
-                                                       IHandlerService handlerService = (IHandlerService) StoreUtil.getService(IHandlerService.class);
-
-                                                       try {
-                                                               handlerService.executeCommand(commandId, null);
-                                                       } catch (ExecutionException e) {
-                                                               MessagingUtils.error(this.getClass(), e);
-                                                       } catch (NotDefinedException e) {
-                                                               MessagingUtils.error(this.getClass(), e);
-                                                       } catch (NotEnabledException e) {
-                                                               MessagingUtils.error(this.getClass(), e);
-                                                       } catch (NotHandledException e) {
-                                                               MessagingUtils.error(this.getClass(), e);
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               });
-
                refresh();
        }