Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java	(revision 2448)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java	(revision 2449)
@@ -28,7 +28,6 @@
 package org.txm.rcp.handlers.results;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
@@ -46,29 +45,22 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.internal.Workbench;
-import org.txm.Toolbox;
-import org.txm.core.engines.EngineType;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.TXMResult;
 import org.txm.objects.CorpusBuild;
 import org.txm.objects.Project;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.editors.ITXMResultEditor;
-import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.preferences.RCPPreferences;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.utils.SWTEditorsUtils;
 import org.txm.rcp.views.corpora.CorporaView;
-import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
-import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.utils.LogMonitor;
 import org.txm.utils.logger.Log;
 
@@ -79,25 +71,27 @@
  * 
  */
 public class DeleteObject extends AbstractHandler {
-
+	
 	private static boolean shouldRestartToolbox = false;
-
+	
 	private static boolean continueToDelete = true;
-
-
-	/* (non-Javadoc)
+	
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-
+		
 		final IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-
+		
 		if (!askContinueToDelete(selection)) {
 			return null;
 		}
-
+		
 		JobHandler job = new JobHandler("Deleting", true) {
+			
 			@Override
 			protected IStatus run(IProgressMonitor monitor) {
 				delete(selection);
@@ -107,13 +101,14 @@
 		job.schedule();
 		try {
 			job.join();
-		} catch (InterruptedException e) {
+		}
+		catch (InterruptedException e) {
 			e.printStackTrace();
 			return Status.CANCEL_STATUS;
 		}
 		return job.getResultObject();
 	}
-
+	
 	/**
 	 * 
 	 * @param selection
@@ -121,11 +116,12 @@
 	 */
 	public static synchronized boolean askContinueToDelete(final IStructuredSelection selection) {
 		continueToDelete = true;
-
+		
 		boolean showAlert = !RCPPreferences.getInstance().getBoolean(RCPPreferences.USER_ALERT_DELETE);
-
+		
 		if (showAlert) {
 			Display.getDefault().syncExec(new Runnable() {
+				
 				@Override
 				public void run() {
 					MessageBox messageBox = new MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
@@ -140,7 +136,7 @@
 		}
 		return continueToDelete;
 	}
-
+	
 	/**
 	 * Deletes.
 	 *
@@ -148,13 +144,13 @@
 	 */
 	public static HashSet<Object> delete(ISelection sel) {
 		IStructuredSelection selection = (IStructuredSelection) sel;
-
+		
 		if (selection.size() == 0) {
-			return new HashSet<Object>();
+			return new HashSet<>();
 		}
-
+		
 		HashSet<Object> objects = new HashSet<Object>(selection.toList());
-		HashSet<Object> hidden = new HashSet<Object>();
+		HashSet<Object> hidden = new HashSet<>();
 		for (Object o : objects) {
 			if (o != null && o instanceof TXMResult) {
 				TXMResult r = (TXMResult) o;
@@ -166,22 +162,22 @@
 			}
 		}
 		objects.addAll(hidden);
-		return delete(new ArrayList<Object>(objects));
+		return delete(new ArrayList<>(objects));
 	}
-
-
+	
+	
 	/**
 	 * Deletes.
 	 * 
 	 * TODO: select the parent object of the deleted object
 	 *
 	 * @param objects the objects to delete
-	 * @return 
+	 * @return
 	 */
 	public synchronized static HashSet<Object> delete(final List<Object> objects) {
 		StatusLine.setMessage(NLS.bind(TXMUIMessages.deletingP0, objects));
-
-		final HashSet<Object> allObjectDeleted = new HashSet<Object>();
+		
+		final HashSet<Object> allObjectDeleted = new HashSet<>();
 		shouldRestartToolbox = false;
 		while (objects.size() > 0) {
 			Object o = objects.get(0);
@@ -189,48 +185,51 @@
 				List<Object> deleted = delete(o);
 				allObjectDeleted.addAll(deleted);
 				if (deleted.size() == 0) {
-					StatusLine.setMessage(TXMUIMessages.errorColonDeleteReturnedFalse+" : "+o);
-					return new HashSet<Object>();
+					StatusLine.setMessage(TXMUIMessages.errorColonDeleteReturnedFalse + " : " + o);
+					return new HashSet<>();
 				}
 				// remove results already deleted
 				objects.removeAll(deleted);
-			} catch(Exception e) {
-				Log.severe(NLS.bind(TXMUIMessages.errorWhileDeletingP0ColonP1, o, e)); 
-				StatusLine.error(NLS.bind(TXMUIMessages.errorWhileDeletingP0ColonP1, o, e)); 
+			}
+			catch (Exception e) {
+				Log.severe(NLS.bind(TXMUIMessages.errorWhileDeletingP0ColonP1, o, e));
+				StatusLine.error(NLS.bind(TXMUIMessages.errorWhileDeletingP0ColonP1, o, e));
 				org.txm.utils.logger.Log.printStackTrace(e);
-				return new HashSet<Object>();
+				return new HashSet<>();
 			}
 		}
-
+		
 		if (allObjectDeleted.size() > 0) {
-
+			
 			if (shouldRestartToolbox) {
 				StatusLine.setMessage(TXMUIMessages.info_txmIsReady);
 			}
-
+			
 			Display.getDefault().syncExec(new Runnable() {
+				
 				@Override
 				public void run() {
 					try {
 						// FIXME: why this is commented? became useless? I needed to add the line below for the refresh CorporaView.refresh();
-						//						RestartTXM.reloadViews();
-
+						// RestartTXM.reloadViews();
+						
 						CorporaView.refresh();
-
-						//close corresponding editors
-						for(Object obj : allObjectDeleted) {
+						
+						// close corresponding editors
+						for (Object obj : allObjectDeleted) {
 							closeEditorOf(obj, false);
 						}
-					} catch(Exception e) {
 					}
+					catch (Exception e) {
+					}
 				}
 			});
 		}
-
+		
 		StatusLine.setMessage(""); //$NON-NLS-1$
 		return allObjectDeleted;
 	}
-
+	
 	/**
 	 * Deletes the specified object.
 	 * 
@@ -239,75 +238,45 @@
 	 * @param o the o
 	 * @return the list
 	 */
-	// FIXME: when TXMResult will be implemented, remove all unused code
 	public static List<Object> delete(Object o) {
-		ArrayList<Object> deleted = new ArrayList<Object>();
-		//		if (o instanceof TXMResult) {
-		//			Log.info(NLS.bind(TXMUIMessages.deletedColonP0, ((TXMResult) o).getName()));
-		//
-		//			try {
-		//				if (o instanceof CQPCorpus) {
-		//					CQPCorpus c = (CQPCorpus)o;
-		//					if (o instanceof MainCorpus) {
-		//						shouldRestartToolbox = true;
-		//					}
-		//					deleted.addAll(c.clearResults());
-		//					deleted.addAll(c.getSubcorpora());
-		//					deleted.addAll(c.getPartitions());
-		//
-		//					if (!((TXMResult) o).delete()) {
-		//						Log.info(TXMUIMessages.errorColonDeleteReturnedFalse);
-		//						return new ArrayList<Object>(0);
-		//					}
-		//				} else if (o instanceof Partition) {
-		//					Partition p = (Partition)o;
-		//					for (int i = 0 ; i < p.getChildren().size() ; i++) {
-		//						deleted.addAll(delete(p.getChildren().get(i)));
-		//						i--;
-		//					}
-		//					if (!((TXMResult) o).delete()) {
-		//						Log.info(TXMUIMessages.errorColonDeleteReturnedFalse);
-		//						return new ArrayList<Object>(0);
-		//					}
-		//				}
-		//			} catch (Exception e) {
-		//				org.txm.utils.logger.Log.printStackTrace(e);
-		//			}
-		//		}
-		//		// FIXME: when TXMResult will be implemented, only this code must be left
+		ArrayList<Object> deleted = new ArrayList<>();
 		if (o instanceof TXMResult) {
-			TXMResult r = (TXMResult)o;
+			TXMResult r = (TXMResult) o;
 			List<TXMResult> children = r.getDeepChildren();
 			if (r.isLocked()) return deleted;
-
+			
 			if (r instanceof MainCorpus) {
-				Project p = ((MainCorpus)o).getProject();
+				Project p = ((MainCorpus) o).getProject();
 				if (p != null) {
 					p.delete();
-				} else {
-					((MainCorpus)o).delete();
 				}
-			} else {
+				else {
+					((MainCorpus) o).delete();
+				}
+			}
+			else {
 				r.delete();
 			}
-			Log.info(NLS.bind(TXMUIMessages.deletedColonP0, o));
 			deleted.add(o);
 			deleted.addAll(children);
-		} else if (o instanceof IProject) {
+		}
+		else if (o instanceof IProject) {
 			try {
-				((IProject)o).delete(true, new LogMonitor());
+				((IProject) o).delete(true, new LogMonitor());
 				deleted.add(o);
-			} catch (CoreException e) {
+			}
+			catch (CoreException e) {
 				// TODO Auto-generated catch block
 				e.printStackTrace();
 			}
-		} else {
+		}
+		else {
 			Log.severe(TXMCoreMessages.bind("Can not delete: {0}.", o));
 		}
-
+		
 		return deleted;
 	}
-
+	
 	/**
 	 * Close the editors which uses an Object.
 	 *
@@ -318,9 +287,9 @@
 		if (!(o instanceof TXMResult)) {
 			return;
 		}
-
+		
 		TXMResult r = (TXMResult) o;
-		List<TXMResult> all = new ArrayList<TXMResult>();//r.getDeepChildren();
+		List<TXMResult> all = new ArrayList<>();// r.getDeepChildren();
 		all.add(r);
 		if (children) {
 			all.addAll(r.getDeepChildren());
@@ -328,13 +297,13 @@
 		ArrayList<ITXMResultEditor<?>> editors = SWTEditorsUtils.getEditors();
 		for (TXMResult tr : all) { // close editors of the result and its children
 			for (ITXMResultEditor<?> editor : editors) {
-				if (tr == editor.getResult())	{
+				if (tr == editor.getResult()) {
 					editor.getEditorSite().getPage().closeEditor(editor, true);
 				}
 			}
 		}
 	}
-
+	
 	/**
 	 * Gets the pages.
 	 *
@@ -346,4 +315,4 @@
 		}
 		return new IWorkbenchPage[0];
 	}
-}
\ No newline at end of file
+}
