Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 1649)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 1650)
@@ -356,7 +356,7 @@
 			Log.severe("Error while closing CQP: "+e.getLocalizedMessage());
 			return false;
 		}
-		return true;
+		return !state;
 	}
 
 	/**
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 1649)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java	(revision 1650)
@@ -79,7 +79,7 @@
 
 	private static boolean continueToDelete = true;
 
-	
+
 	/* (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
@@ -87,11 +87,11 @@
 	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) {
@@ -116,9 +116,9 @@
 	 */
 	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
@@ -135,7 +135,7 @@
 		}
 		return continueToDelete;
 	}
-	
+
 	/**
 	 * Deletes.
 	 *
@@ -143,11 +143,11 @@
 	 */
 	public static HashSet<Object> delete(ISelection sel) {
 		IStructuredSelection selection = (IStructuredSelection) sel;
-		
+
 		if (selection.size() == 0) {
 			return new HashSet<Object>();
 		}
-		
+
 		HashSet<Object> objects = new HashSet<Object>(selection.toList());
 		HashSet<Object> hidden = new HashSet<Object>();
 		for (Object o : objects) {
@@ -163,8 +163,8 @@
 		objects.addAll(hidden);
 		return delete(new ArrayList<Object>(objects));
 	}
-	
 
+
 	/**
 	 * Deletes.
 	 * 
@@ -175,7 +175,7 @@
 	 */
 	public synchronized static HashSet<Object> delete(final List<Object> objects) {
 		StatusLine.setMessage(NLS.bind(TXMUIMessages.deletingP0, objects));
-		
+
 		final HashSet<Object> allObjectDeleted = new HashSet<Object>();
 		shouldRestartToolbox = false;
 		while (objects.size() > 0) {
@@ -196,26 +196,26 @@
 				return new HashSet<Object>();
 			}
 		}
-		
+
 		if (allObjectDeleted.size() > 0) {
-			
+
 			if (shouldRestartToolbox) {
-//				org.txm.Toolbox.restartWorkspace(null);
+				//				org.txm.Toolbox.restartWorkspace(null);
 				Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
-				
+
 				Log.info(TXMUIMessages.info_txmIsReady);
 				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) {
 							closeEditorOfSelection(obj);
@@ -241,43 +241,43 @@
 	// 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
+		//		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
 		if (o instanceof TXMResult) {
 			TXMResult r = (TXMResult)o;
 			if (r.isLocked()) return deleted;
-			
+
 			if (r instanceof MainCorpus) {
 				Project p = ((MainCorpus)o).getProject();
 				if (p != null) {
@@ -294,7 +294,7 @@
 		else {
 			Log.severe(TXMCoreMessages.bind("Can not delete: {0}.", o));
 		}
-		
+
 		return deleted;
 	}
 
@@ -304,16 +304,24 @@
 	 * @param o the object used by an editor
 	 */
 	public static void closeEditorOfSelection(Object o) {
-		for (IWorkbenchPage page : getPages()) {
-			for (IEditorReference editorref : page.getEditorReferences()) {
-				IEditorPart editor = editorref.getEditor(false);
 
-				if(editor instanceof TXMEditor)	{
-					if (o == ((TXMEditor)editor).getResult())	{
-						editor.getEditorSite().getPage().closeEditor(editor, true);
+		TXMResult r = (TXMResult) o;
+		List<TXMResult> all = r.getDeepChildren();
+		all.add(r);
+		
+		//FIXME use SWTEditorsUtils.getEditors()
+		for (TXMResult tr : all) { // close editors of the result and its children
+			for (IWorkbenchPage page : getPages()) {
+				for (IEditorReference editorref : page.getEditorReferences()) {
+					IEditorPart editor = editorref.getEditor(false);
+
+					if(editor instanceof TXMEditor && o instanceof TXMResult)	 {
+
+						if (tr == ((TXMEditor)editor).getResult())	{
+							editor.getEditorSite().getPage().closeEditor(editor, true);
+						}
 					}
 				}
-				
 			}
 		}
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java	(revision 1649)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java	(revision 1650)
@@ -4,6 +4,7 @@
 package org.txm.rcp.utils;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.e4.ui.model.application.ui.MUIElement;
@@ -65,14 +66,76 @@
 	 * @return all opened editors if there is at least one otherwise returns an empty list
 	 */
 	public static ArrayList<TXMEditor> getEditors() {
-		return getEditors(null);
+		ArrayList<TXMEditor> editors = new ArrayList<TXMEditor>();
+
+		IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+		for (IWorkbenchWindow window : windows) {
+			IWorkbenchPage[] pages = window.getPages();
+			for (IWorkbenchPage page : pages) {
+				for (IEditorReference reference : page.getEditorReferences()) {
+					IEditorPart tmpEditor = reference.getEditor(false);
+
+					if(tmpEditor instanceof TXMEditor)	{
+						editors.add((TXMEditor) tmpEditor);
+					}
+					else if(tmpEditor instanceof TXMMultiPageEditor)	{
+						TXMMultiPageEditor txmMultipageEditor = ((TXMMultiPageEditor)tmpEditor);
+						for (int i = 0; i < txmMultipageEditor.getEditors().size(); i++) {
+							if(txmMultipageEditor.getEditors().get(i) instanceof TXMEditor)	{
+								TXMEditor txmEditor = ((TXMEditor)txmMultipageEditor.getEditors().get(i));
+									editors.add(txmEditor);
+							}
+						}
+					}
+				}
+			}
+		}
+		return editors;
 	}
 
+	
 	/**
 	 * Gets all opened editors for the specified result.
 	 * @param result
 	 * @return all opened editors for the specified result if there is at least one otherwise returns an empty list
 	 */
+	public static ArrayList<TXMEditor> getEditors(HashSet<TXMResult> results)	{
+
+		ArrayList<TXMEditor> editors = new ArrayList<TXMEditor>();
+
+		IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+		for (IWorkbenchWindow window : windows) {
+			IWorkbenchPage[] pages = window.getPages();
+			for (IWorkbenchPage page : pages) {
+				for (IEditorReference reference : page.getEditorReferences()) {
+					IEditorPart tmpEditor = reference.getEditor(false);
+
+					if(tmpEditor instanceof TXMEditor && results.contains(((TXMEditor)tmpEditor).getResult()))	{
+						editors.add((TXMEditor) tmpEditor);
+					}
+					else if(tmpEditor instanceof TXMMultiPageEditor)	{
+						TXMMultiPageEditor txmMultipageEditor = ((TXMMultiPageEditor)tmpEditor);
+						for (int i = 0; i < txmMultipageEditor.getEditors().size(); i++) {
+							if(txmMultipageEditor.getEditors().get(i) instanceof TXMEditor)	{
+								TXMEditor txmEditor = ((TXMEditor)txmMultipageEditor.getEditors().get(i));
+								if(results.contains(((TXMEditor)tmpEditor).getResult()))	{
+									editors.add(txmEditor);
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+		return editors;
+	}
+	
+	/**
+	 * Gets all opened editors for the specified result.
+	 * @param result
+	 * @return all opened editors for the specified result if there is at least one otherwise returns an empty list
+	 */
 	public static ArrayList<TXMEditor> getEditors(TXMResult result)	{
 
 		ArrayList<TXMEditor> editors = new ArrayList<TXMEditor>();
@@ -103,7 +166,6 @@
 		}
 
 		return editors;
-
 	}
 
 	/**
