commit 6c0e98adacb888778452fd08043f8f4ccba2ba74
Author: Cherian Mathew <c.mathew@bgbm.org>
Date:   Tue Aug 19 11:16:38 2014 +0000

    eclipse preference changes

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
index 86f4a61a8..7e9ce6d15 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
@@ -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.
 */
@@ -47,10 +47,8 @@ import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.springframework.security.core.GrantedAuthority;
 
 import eu.etaxonomy.cdm.config.ICdmSource;
-import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.IContextListener;
@@ -66,9 +64,9 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class CdmDataSourceViewPart extends ViewPart{
-	
+
     private static final Logger logger = Logger.getLogger(CdmDataSourceViewPart.class);
-	
+
 	private class ContextListener extends ContextListenerAdapter{
 		/* (non-Javadoc)
 		 * @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
@@ -76,7 +74,7 @@ public class CdmDataSourceViewPart extends ViewPart{
 		@Override
 		public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
 			monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
-			viewer.refresh();	
+			viewer.refresh();
 		}
 
 		/* (non-Javadoc)
@@ -85,7 +83,7 @@ public class CdmDataSourceViewPart extends ViewPart{
 		@Override
 		public void contextStop(IMemento memento, IProgressMonitor monitor) {
 			monitor.subTask("Refreshing Datasource View"); //$NON-NLS-1$
-			viewer.refresh();	
+			viewer.refresh();
 		}
 
 		/* (non-Javadoc)
@@ -97,10 +95,10 @@ public class CdmDataSourceViewPart extends ViewPart{
 			viewer.refresh();
 		}
 	}
-	
+
 	private class DataSourceJob extends Job{
 
-		private List<ICdmSource> cdmSources;
+		private final List<ICdmSource> cdmSources;
 
 		/**
 		 * @param name
@@ -118,93 +116,105 @@ public class CdmDataSourceViewPart extends ViewPart{
 			try{
 				logger.debug("Begin of eclipse core runtime Job to Retrieve datasources"); //$NON-NLS-1$
 				monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);			 //$NON-NLS-1$
-				
+
 				final List<CdmMetaDataAwareDataSourceContainer> containers = new ArrayList<CdmMetaDataAwareDataSourceContainer>();
-				
+
 				for(ICdmSource cdmSource : cdmSources){
 					containers.add(new CdmMetaDataAwareDataSourceContainer(cdmSource));
 				}
-				
+
 				Display.getDefault().asyncExec(new Runnable() {
-					
+
 					@Override
 					public void run() {
 						viewer.setInput(containers);
 					}
 				});
 				monitor.worked(1);
-				
+
 				for(final CdmMetaDataAwareDataSourceContainer container : containers){
-					
-					
-					if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : next DataSourceContainer");						 //$NON-NLS-1$ //$NON-NLS-2$
+					if(logger.isDebugEnabled()) {
+                        logger.debug("  #" + container.hashCode() + " : next DataSourceContainer");						 //$NON-NLS-1$ //$NON-NLS-2$
+                    }
 					container.getMetaDataFromDataSource();
-					if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");	 //$NON-NLS-1$ //$NON-NLS-2$
+					if(logger.isDebugEnabled())
+                     {
+                        logger.debug("  #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");	 //$NON-NLS-1$ //$NON-NLS-2$
+                    }
 					Display.getDefault().asyncExec(new Runnable() {
-						
+
 						@Override
 						public void run() {
-							if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " starting sub thread to update ...");	 //$NON-NLS-1$ //$NON-NLS-2$
+							if(logger.isDebugEnabled())
+                             {
+                                logger.debug("  #" + container.hashCode() + " starting sub thread to update ...");	 //$NON-NLS-1$ //$NON-NLS-2$
+                            }
 							viewer.update(container, null);
-							if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " end of sub thread to update ...");	 //$NON-NLS-1$ //$NON-NLS-2$
+							if(logger.isDebugEnabled())
+                             {
+                                logger.debug("  #" + container.hashCode() + " end of sub thread to update ...");	 //$NON-NLS-1$ //$NON-NLS-2$
+                            }
 						}
 					});
-					if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " done");	 //$NON-NLS-1$ //$NON-NLS-2$
+					if(logger.isDebugEnabled())
+                     {
+                        logger.debug("  #" + container.hashCode() + " done");	 //$NON-NLS-1$ //$NON-NLS-2$
+                    }
 					monitor.worked(1);
 				}
-				
+
 			}finally{
 				monitor.done();
 			}
 			return Status.OK_STATUS;
 		}
 	}
-	
+
 	/** Constant <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code> */
 	public static String ID = "eu.etaxonomy.taxeditor.view.datasource"; //$NON-NLS-1$
-	
+
 	private TableViewer viewer;
 
 	private String partNameCache;
 
 	private IWorkbenchSiteProgressService service;
-	
+
 	private IContextListener contextListener;
 
 	private CdmDataSourceViewerComparator comparator;
-	
+
 	/**
 	 * <p>Constructor for CdmDataSourceViewPart.</p>
 	 */
 	public CdmDataSourceViewPart(){
 	}
-	
+
 	/** {@inheritDoc} */
 	@Override
 	public void createPartControl(Composite parent) {
 		service = (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);
 		contextListener = new ContextListener();
 		CdmStore.getContextManager().addContextListener(contextListener);
-		
+
 		// Create top composite
 		FillLayout fillLayout = new FillLayout();
 		fillLayout.marginWidth = 0;
 		fillLayout.marginHeight = 0;
-		fillLayout.type = SWT.VERTICAL;	
+		fillLayout.type = SWT.VERTICAL;
 		parent.setLayout(fillLayout);
-		
+
 		viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
 												| SWT.V_SCROLL | SWT.FULL_SELECTION);
 		getSite().setSelectionProvider(viewer);
-		
+
 		createColumns(viewer);
-		
+
 		viewer.setContentProvider(new CdmDataSourceContentProvider());
 		viewer.setLabelProvider(new CdmDataSourceLabelProvider());
 		comparator = new CdmDataSourceViewerComparator();
 		viewer.setComparator(comparator);
-		
-		
+
+
 		// register context menu
 		MenuManager menuMgr = new MenuManager();
 		menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
@@ -212,26 +222,27 @@ public class CdmDataSourceViewPart extends ViewPart{
 
 		Control control = viewer.getControl();
 		Menu menu = menuMgr.createContextMenu(control);
-		control.setMenu(menu);	
-		
+		control.setMenu(menu);
+
 		// connect on doubleclick
 		viewer.addDoubleClickListener(new IDoubleClickListener() {
 
-			public void doubleClick(DoubleClickEvent event) {
+			@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); 
+
+						Command command = commandService.getCommand(commandId);
 						if(command.isEnabled()) {
-						
+
 							IHandlerService handlerService = (IHandlerService) StoreUtil.getService(IHandlerService.class);
-							
+
 							try {
 								handlerService.executeCommand(commandId, null);
 							} catch (ExecutionException e) {
@@ -248,11 +259,11 @@ public class CdmDataSourceViewPart extends ViewPart{
 				}
 			}
 		});
-		
+
 		refresh();
 	}
 
-	
+
 	// This will create the columns for the table
 	private void createColumns(TableViewer viewer) {
 		Table table = viewer.getTable();
@@ -273,13 +284,13 @@ public class CdmDataSourceViewPart extends ViewPart{
 		table.setHeaderVisible(true);
 		table.setLinesVisible(true);
 		table.setSortDirection(SWT.UP);
-		
+
 	}
-	
+
 	/**
 	 * <p>refresh</p>
 	 */
-	public void refresh(){		
+	public void refresh(){
 		getService().schedule(new DataSourceJob(Messages.CdmDataSourceViewPart_1, CdmDataSourceRepository.getAll()), Job.LONG);
 	}
 
@@ -296,7 +307,7 @@ public class CdmDataSourceViewPart extends ViewPart{
 		viewer.getControl().setFocus();
 	}
 
-	
+
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
 	 */
@@ -332,7 +343,7 @@ public class CdmDataSourceViewPart extends ViewPart{
 	public IWorkbenchSiteProgressService getService() {
 		return service;
 	}
-	
+
 	private SelectionAdapter getSelectionAdapter(final TableColumn column,
 			final int index) {
 		SelectionAdapter selectionAdapter = new SelectionAdapter() {
