Index: TXM/trunk/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 3558)
+++ TXM/trunk/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 3559)
@@ -8,7 +8,6 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -2066,7 +2065,7 @@
 	 * @param all
 	 * @return
 	 */
-	protected TXMResult clone(TXMResult newParent, boolean all) {
+	public TXMResult clone(TXMResult newParent, boolean all) {
 		TXMResult clone = null;
 		try {
 			String newNodePath = this.getProject().getParametersNodeRootPath() + createUUID() + "_" + this.getClass().getSimpleName();
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3558)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3559)
@@ -487,7 +487,7 @@
 	 * @return
 	 */
 	@Override
-	protected TXMResult clone(TXMResult newParent, boolean all) {
+	public TXMResult clone(TXMResult newParent, boolean all) {
 		CQPCorpus c = (CQPCorpus) super.clone(newParent, all);
 		c.pID = "S" + getNextSubcorpusCounter();
 		return c;
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 3558)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 3559)
@@ -73,6 +73,7 @@
 import org.eclipse.ui.model.WorkbenchLabelProvider;
 import org.eclipse.ui.part.ViewPart;
 import org.txm.Toolbox;
+import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.results.TXMResult;
 import org.txm.objects.CorpusBuild;
 import org.txm.objects.Project;
@@ -83,7 +84,13 @@
 import org.txm.rcp.commands.workspace.OpenCorpus;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.handlers.files.CopyFile;
+import org.txm.rcp.handlers.files.CutFile;
+import org.txm.rcp.handlers.files.PasteFile;
+import org.txm.rcp.handlers.results.CopyTXMResultTree;
+import org.txm.rcp.handlers.results.CutTXMResultTree;
 import org.txm.rcp.handlers.results.DeleteObject;
+import org.txm.rcp.handlers.results.PasteTXMResultTree;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -438,8 +445,31 @@
 		treeViewer.getTree().addKeyListener(new KeyAdapter() {
 			
 			@Override
-			public void keyPressed(KeyEvent arg0) {
-				if (arg0.keyCode == SWT.DEL) {
+			public void keyPressed(KeyEvent e) {
+				
+				boolean expert = TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER);
+				
+				if (expert && (char) e.keyCode == 'c' & ((e.stateMask & SWT.CTRL) != 0)) {
+					Object o = treeViewer.getStructuredSelection().getFirstElement();
+					if (o != null && o instanceof TXMResult) {
+						CopyTXMResultTree.copy((IStructuredSelection) treeViewer.getSelection());
+					}
+					
+				}
+				else if (expert && (char) e.keyCode == 'x' & ((e.stateMask & SWT.CTRL) != 0)) {
+					Object o = treeViewer.getStructuredSelection().getFirstElement();
+					if (o != null && o instanceof TXMResult) {
+						CutTXMResultTree.cut((IStructuredSelection) treeViewer.getSelection());
+					}
+					
+				}
+				else if (expert && (char) e.keyCode == 'v' & ((e.stateMask & SWT.CTRL) != 0)) {
+					Object o = treeViewer.getStructuredSelection().getFirstElement();
+					if (o != null && o instanceof TXMResult) {
+						PasteTXMResultTree.paste((TXMResult) o);
+					}
+					
+				} else if (e.keyCode == SWT.DEL) {
 					final ISelection sel = treeViewer.getSelection();
 					if (sel instanceof IStructuredSelection) {
 						
@@ -464,8 +494,8 @@
 						try {
 							job.join();
 						}
-						catch (InterruptedException e) {
-							e.printStackTrace();
+						catch (InterruptedException ex) {
+							ex.printStackTrace();
 						}
 					}
 				}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResult.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResult.java	(revision 3558)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResult.java	(revision 3559)
@@ -1,197 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-//
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-//
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$
-//
-package org.txm.rcp.handlers.export;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.preferences.TBXPreferences;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.TXMResult;
-import org.txm.rcp.JobsTimer;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.handlers.files.EditFile;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.rcp.swt.dialog.LastOpened;
-import org.txm.rcp.utils.JobHandler;
-import org.txm.utils.ExecTimer;
-import org.txm.utils.logger.Log;
-
-/**
- * Exports a result by calling the function toTxt(File f) then opens or not the result in the text editor according to the preferences.
- * 
- * @author mdecorde, sjacquot
- */
-public class ExportResult extends AbstractHandler {
-	
-	private static final String ID = "org.txm.rcp.commands.function.ExportResult"; //$NON-NLS-1$
-	
-	/** The selection. */
-	private IStructuredSelection selection;
-	
-	/** The lastopenedfile. */
-	// private static String lastopenedfile;
-	
-	/**
-	 * Export a TXM result in a CSV file.
-	 *
-	 * @param event the event
-	 * @return the object
-	 * @throws ExecutionException the execution exception
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-		final Object s = selection.getFirstElement();
-		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
-		
-		// String txmhome = Toolbox.getTxmHomePath();
-		FileDialog dialog = new FileDialog(shell, SWT.SAVE);
-		
-		String extensions[] = { "*.csv" }; //$NON-NLS-1$
-		if (s instanceof TXMResult) {
-			extensions = ((TXMResult) s).getExportTXTExtensions();
-			dialog.setFileName(((TXMResult) s).getValidFileName());
-		}
-		dialog.setFilterExtensions(extensions);
-		
-		if (LastOpened.getFile(ID) != null) {
-			dialog.setFilterPath(LastOpened.getFolder(ID));
-		}
-		
-		if (dialog.open() != null) {
-			StatusLine.setMessage(TXMUIMessages.exportingResults);
-			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
-			if (!(filepath.endsWith(extensions[0].substring(1))))
-				filepath += extensions[0].substring(1);
-			
-			final File outfile = new File(filepath);
-			LastOpened.set(ID, outfile.getParent(), outfile.getName());
-			try {
-				outfile.createNewFile();
-			}
-			catch (IOException e1) {
-				Log.warning(NLS.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, outfile, e1));
-			}
-			if (!outfile.canWrite()) {
-				Log.warning(NLS.bind(TXMUIMessages.impossibleToReadP0, outfile));
-				return null;
-			}
-			if (!outfile.isFile()) {
-				Log.warning("Error: " + outfile + " is not a file"); //$NON-NLS-1$ //$NON-NLS-2$
-				return null;
-			}
-			
-			final String encoding = TBXPreferences.getInstance().getString(TBXPreferences.EXPORT_ENCODING);
-			String _colseparator = TBXPreferences.getInstance().getString(TBXPreferences.EXPORT_COL_SEPARATOR);
-			final String colseparator = _colseparator;
-			String _txtseparator = TBXPreferences.getInstance().getString(TBXPreferences.EXPORT_TXT_SEPARATOR);
-			final String txtseparator = _txtseparator;
-			
-			JobHandler jobhandler = new JobHandler(TXMUIMessages.exportingResults) {
-				
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					
-					// convert the monitor into sub-monitor
-					SubMonitor subMonitor = SubMonitor.convert(monitor, TXMUIMessages.exporting, 100);
-					
-					try {
-						
-						this.runInit(subMonitor);
-						
-						if (s instanceof TXMResult) {
-							TXMResult r = (TXMResult) s;
-							
-							// compute the result if needed
-							if (!r.isAltered() && r.isDirty()) {
-								r.compute(this);
-							}
-							Log.info(TXMUIMessages.bind(TXMUIMessages.exportingP0, r.getName()));
-							ExecTimer.start();
-							r.toTxt(outfile, encoding, colseparator, txtseparator);
-							Log.info(TXMUIMessages.bind(TXMUIMessages.doneInP0, ExecTimer.stop()));
-						}
-						else {
-							Log.warning(TXMUIMessages.TheExportedObjectIsNotATXMResultResult);
-							return Status.CANCEL_STATUS;
-						}
-						
-						if (outfile.exists()) {
-							// Open internal editor in the UI thread
-							if (TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPORT_SHOW)) {
-								this.syncExec(new Runnable() {
-									
-									@Override
-									public void run() {
-										EditFile.openfile(outfile.getAbsolutePath());
-									}
-								});
-							}
-						}
-						else {
-							Log.warning(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, outfile.getAbsolutePath()));
-						}
-					}
-					catch (ThreadDeath td) {
-						TXMResult r = (TXMResult) s;
-						r.resetComputingState();
-						return Status.CANCEL_STATUS;
-					}
-					catch (Exception e) {
-						Log.warning(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
-						org.txm.utils.logger.Log.printStackTrace(e);
-						return Status.CANCEL_STATUS;
-					}
-					finally {
-						subMonitor.done();
-						JobsTimer.stopAndPrint();
-					}
-					return Status.OK_STATUS;
-				}
-			};
-			
-			jobhandler.startJob();
-		}
-		return null;
-	}
-}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameters.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameters.java	(revision 3558)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameters.java	(revision 3559)
@@ -1,177 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-//
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-//
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$
-//
-package org.txm.rcp.handlers.export;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.HashSet;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.Toolbox;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.TXMResult;
-import org.txm.rcp.JobsTimer;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.rcp.swt.dialog.LastOpened;
-import org.txm.rcp.utils.JobHandler;
-import org.txm.utils.DeleteDir;
-import org.txm.utils.zip.Zip;
-
-// TODO: Auto-generated Javadoc
-/**
- * export a result of a result by calling the function toTxt(File f) then show
- * the result in the text editor @ author mdecorde.
- */
-public class ExportResultParameters extends AbstractHandler {
-	
-	private static final String ID = ExportResultParameters.class.getName();
-	
-	/**
-	 * Export a TXM result parameters in the preferences format
-	 *
-	 * @param event the event
-	 * @return the object
-	 * @throws ExecutionException the execution exception
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-		
-		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
-		
-		// String txmhome = Toolbox.getTxmHomePath();
-		FileDialog dialog = new FileDialog(shell, SWT.SAVE);
-		
-		String extensions[] = { "*.txmresults" }; //$NON-NLS-1$
-		dialog.setFilterExtensions(extensions);
-		dialog.setFileName("results_"+Toolbox.dateformat.format(Calendar.getInstance().getTime()) +".txmresults"); //$NON-NLS-1$
-		if (LastOpened.getFile(ID) != null) {
-			dialog.setFilterPath(LastOpened.getFolder(ID));
-		}
-		
-		if (dialog.open() != null) {
-			StatusLine.setMessage(TXMUIMessages.exportingResults);
-			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
-			if (!(filepath.endsWith(extensions[0].substring(1)))) {
-				filepath += extensions[0].substring(1);
-			}
-			
-			final File zipfile = new File(filepath+".tmp");
-			final File zipfiledir = new File(filepath); // temporary directory to setup the archive
-			LastOpened.set(ID, zipfiledir.getParent(), zipfiledir.getName()); 
-			zipfiledir.delete();
-			zipfiledir.mkdirs();
-			
-			JobHandler jobhandler = new JobHandler(TXMUIMessages.exportingResults) {
-				
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					
-					// convert the monitor into sub-monitor
-					SubMonitor subMonitor = SubMonitor.convert(monitor, TXMUIMessages.exporting, 100);
-					this.runInit(subMonitor);
-					
-					try {
-						
-						HashSet<TXMResult> toExport = new HashSet<TXMResult>();
-						for (Object o : selection.toList()) {
-							if (!(o instanceof TXMResult)) continue;
-							TXMResult r = (TXMResult)o;
-							toExport.add(r);
-							TXMResult parent = ((TXMResult)o).getParent();
-							
-							// add invisible parents to rebuild the result
-							while(parent != null && !parent.isVisible()) { // insivisble parent must be added to the exported results
-								
-								toExport.add(parent);
-								parent = parent.getParent();
-							}
-							
-							// add children 
-							for (TXMResult c : r.getDeepChildren()) {
-								toExport.add(c);
-							}
-						}
-						
-						ArrayList<File> files = new ArrayList<>();
-						for (TXMResult r : toExport) {
-							
-							if (r.isAltered()) {
-								System.out.println(TXMUIMessages.ExportResultParameters_WarningOnlyTheParametersAreExportedManualChangesAreNotTransfered);
-							}
-							else {
-								r.compute(subMonitor); // refresh result
-							}
-							
-							File outfile = new File(zipfiledir, (TXMPreferences.getNode(r.getParametersNodePath()).name()+".parameters"));
-							if (r.toParametersFile(outfile)) {
-								files.add(outfile);
-							}
-						}
-						
-						System.out.println(NLS.bind(TXMUIMessages.ExportResultParameters_ParametersExportedToTheP0File, zipfiledir));
-						Zip.compress(files.toArray(new File[files.size()]), zipfile, Zip.DEFAULT_LEVEL_COMPRESSION, null, null);
-						DeleteDir.deleteDirectory(zipfiledir);
-						zipfile.renameTo(zipfiledir);
-					}
-					catch (ThreadDeath td) {
-						
-						return Status.CANCEL_STATUS;
-					}
-					catch (Exception e) {
-						System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, selection.toList(), e));
-						org.txm.utils.logger.Log.printStackTrace(e);
-						return Status.CANCEL_STATUS;
-					}
-					finally {
-						subMonitor.done();
-						JobsTimer.stopAndPrint();
-					}
-					return Status.OK_STATUS;
-				}
-			};
-			
-			jobhandler.startJob();
-		}
-		return null;
-	}
-}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResult.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResult.java	(revision 3558)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResult.java	(revision 3559)
@@ -1,150 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-//
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-//
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$
-//
-package org.txm.rcp.handlers.export;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.core.preferences.TBXPreferences;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.TXMResult;
-import org.txm.rcp.JobsTimer;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.handlers.files.EditFile;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.rcp.swt.dialog.LastOpened;
-import org.txm.rcp.utils.JobHandler;
-import org.txm.rcp.views.corpora.CorporaView;
-
-// TODO: Auto-generated Javadoc
-/**
- * export a result of a result by calling the function toTxt(File f) then show
- * the result in the text editor @ author mdecorde.
- */
-public class ImportResult extends AbstractHandler {
-	
-	private static final String ID = ImportResult.class.getName();
-	
-	/**
-	 * Export a TXM result parameters in the preferences format
-	 *
-	 * @param event the event
-	 * @return the object
-	 * @throws ExecutionException the execution exception
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-		final Object s = selection.getFirstElement();
-		if (!(s instanceof TXMResult)) {
-			return null;
-		}
-		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
-		
-		// String txmhome = Toolbox.getTxmHomePath();
-		FileDialog dialog = new FileDialog(shell, SWT.OPEN);
-		
-		String extensions[] = { "*.parameters" }; //$NON-NLS-1$
-		dialog.setFilterExtensions(extensions);
-		
-		if (LastOpened.getFile(ID) != null) {
-			dialog.setFilterPath(LastOpened.getFolder(ID));
-		}
-		
-		if (dialog.open() != null) {
-			StatusLine.setMessage(TXMUIMessages.exportingResults);
-			String filepath = dialog.getFilterPath()
-					+ "/" + dialog.getFileName(); //$NON-NLS-1$
-			if (!(filepath.endsWith(extensions[0].substring(1))))
-				filepath += extensions[0].substring(1);
-			
-			final File outfile = new File(filepath);
-			LastOpened.set(ID, outfile.getParent(), outfile.getName());
-			try {
-				outfile.createNewFile();
-			}
-			catch (IOException e1) {
-				System.err.println(NLS.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, outfile, e1));
-			}
-			if (!outfile.canWrite()) {
-				System.out.println(NLS.bind(TXMUIMessages.impossibleToReadP0, outfile));
-				return null;
-			}
-			if (!outfile.isFile()) {
-				System.out.println("Error: " + outfile + " is not a file"); //$NON-NLS-1$ //$NON-NLS-2$
-				return null;
-			}
-			
-			JobHandler jobhandler = new JobHandler(TXMUIMessages.exportingResults) {
-				
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					try {
-						this.runInit(monitor);
-						monitor.beginTask(TXMUIMessages.exporting, 100);
-						
-						TXMResult parent = (TXMResult) s;
-						TXMResult r = parent.importResult(outfile);
-						CorporaView.refreshObject(r);
-						if (r != null) {
-							System.out.println(NLS.bind(TXMUIMessages.P0ResultsImportedFromTheP1File, r, outfile));
-						}
-					}
-					catch (ThreadDeath td) {
-						return Status.CANCEL_STATUS;
-					}
-					catch (Exception e) {
-						System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
-						org.txm.utils.logger.Log.printStackTrace(e);
-						return Status.CANCEL_STATUS;
-					}
-					finally {
-						monitor.done();
-						JobsTimer.stopAndPrint();
-					}
-					return Status.OK_STATUS;
-				}
-			};
-			
-			jobhandler.startJob();
-		}
-		return null;
-	}
-}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameters.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameters.java	(revision 3558)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameters.java	(revision 3559)
@@ -1,265 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-//
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-//
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-//
-//
-//
-// $LastChangedDate:$
-// $LastChangedRevision:$
-// $LastChangedBy:$
-//
-package org.txm.rcp.handlers.export;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Properties;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.osgi.framework.Bundle;
-import org.txm.Toolbox;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.TXMResult;
-import org.txm.rcp.JobsTimer;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.rcp.swt.dialog.LastOpened;
-import org.txm.rcp.utils.JobHandler;
-import org.txm.rcp.utils.SWTEditorsUtils;
-import org.txm.rcp.views.corpora.CorporaView;
-import org.txm.utils.DeleteDir;
-import org.txm.utils.io.IOUtils;
-import org.txm.utils.logger.Log;
-import org.txm.utils.zip.Zip;
-
-// TODO: Auto-generated Javadoc
-/**
- * export a result of a result by calling the function toTxt(File f) then show
- * the result in the text editor @ author mdecorde.
- */
-public class ImportResultParameters extends AbstractHandler {
-	
-	private static final String ID = ImportResultParameters.class.getName();
-	
-	/**
-	 * Export a TXM result parameters in the preferences format
-	 *
-	 * @param event the event
-	 * @return the object
-	 * @throws ExecutionException the execution exception
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-		final Object s = selection.getFirstElement();
-		if (!(s instanceof TXMResult)) {
-			return null;
-		}
-		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
-		
-		// String txmhome = Toolbox.getTxmHomePath();
-		FileDialog dialog = new FileDialog(shell, SWT.OPEN);
-		
-		String extensions[] = { "*.txmresults" }; //$NON-NLS-1$
-		dialog.setFilterExtensions(extensions);
-		
-		if (LastOpened.getFile(ID) != null) {
-			dialog.setFilterPath(LastOpened.getFolder(ID));
-		}
-		try {
-			if (dialog.open() != null) {
-				StatusLine.setMessage(TXMUIMessages.exportingResults);
-				String filepath = dialog.getFilterPath()+ "/" + dialog.getFileName(); //$NON-NLS-1$
-				
-				final File zipfile = new File(filepath);
-				File outdir = new File(Toolbox.getTxmHomePath(),  "results/import");
-				DeleteDir.deleteDirectory(outdir);
-				
-				Zip.decompress(zipfile, outdir, false);
-				
-				LinkedHashMap<File, Properties> fileToProperties = new LinkedHashMap<>(); // to retrieve a new result from its old uuid
-				HashMap<String, File> oldUUIDToPropertiesFile = new HashMap<>(); // to retrieve a new result from its old uuid
-				HashMap<String, String> oldUUIDToNewUUID = new HashMap<>(); // to retrieve a new result from its old uuid
-				HashMap<String, String> UUIDDependencies = new HashMap<>(); // to -> from, if from is null use the selected TXMResult as parent
-				
-				File[] files = outdir.listFiles();
-				Arrays.sort(files);
-				
-				for (File parametersFile : files) {
-					if (!parametersFile.getName().endsWith(".parameters")) continue;
-					
-					Properties props = new Properties();
-					BufferedReader r = IOUtils.getReader(parametersFile);
-					props.load(r);
-					r.close();
-					
-					fileToProperties.put(parametersFile, props);
-					String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
-					oldUUIDToPropertiesFile.put(UUID, parametersFile);
-				}
-				
-				for (File parametersFile : outdir.listFiles()) {
-					// if (TXMPreferences.PARENT_PARAMETERS_NODE_PATH.equals(ps)) continue;
-					//if (TXMPreferences.RESULT_PARAMETERS_NODE_PATH.equals(ps)) continue;
-					Properties props = fileToProperties.get(parametersFile);
-					String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
-					String parentUUID = props.getProperty(TXMPreferences.PARENT_PARAMETERS_NODE_PATH);
-					if (!oldUUIDToPropertiesFile.containsKey(parentUUID)) {
-						UUIDDependencies.put(UUID, null);
-					} else {
-						UUIDDependencies.put(UUID, parentUUID);
-					}
-				}
-				
-				JobHandler jobhandler = new JobHandler(TXMUIMessages.importStarted) {
-					
-					@Override
-					protected IStatus run(IProgressMonitor monitor) {
-						
-						for (File parametersFile: fileToProperties.keySet()) {
-							TXMResult importedResult = null;
-							try {
-								this.runInit(monitor);
-								monitor.beginTask(TXMUIMessages.exporting, 100);
-								
-								TXMResult defaultParentResult = (TXMResult) s;
-								
-								Properties props = fileToProperties.get(parametersFile);
-								String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
-								
-								String className = props.getProperty(TXMPreferences.CLASS, ""); //$NON-NLS-1$ //$NON-NLS-2$
-								if (className == null || className.length() == 0) {
-									Log.warning(NLS.bind("Warning: can not import object with no class name set with path={0}.", parametersFile)); //$NON-NLS-1$
-									continue;
-								}
-								String bundleId = props.getProperty(TXMPreferences.BUNDLE_ID, ""); //$NON-NLS-1$
-								if (bundleId == null || bundleId.length() == 0) {
-									Log.warning(NLS.bind("Warning: can not import {0} object with no bundle id set.", parametersFile)); //$NON-NLS-1$
-									continue;
-								}
-								Bundle bundle = Platform.getBundle(bundleId);
-								if (bundle == null) {
-									Log.warning(NLS.bind("Warning: can not import {0} object with bundle id={1}.", className, parametersFile)); //$NON-NLS-1$
-									continue;
-								}
-								
-								Class<?> cl = bundle.loadClass(className);
-								
-								String resultNodePath = defaultParentResult.getProject().getParametersNodeRootPath() + TXMResult.createUUID() + "_" + cl.getSimpleName();
-								Log.info("Importing a "+cl.getSimpleName()+" from "+resultNodePath);
-								TXMResult parent = defaultParentResult;
-								if (UUIDDependencies.get(UUID) != null) {
-									parent = TXMResult.getResult(oldUUIDToNewUUID.get(UUIDDependencies.get(UUID)));
-								}
-								
-								
-								
-								Constructor<?> cons = cl.getConstructor(String.class);
-								
-								// fill the preference node with the right parameter **and then** parent right parent node path 
-								for (Object p : props.keySet()) {
-									String ps = p.toString();
-									TXMPreferences.put(resultNodePath, ps, props.getProperty(ps, ""));
-								}
-								TXMPreferences.put(resultNodePath, TXMPreferences.PARENT_PARAMETERS_NODE_PATH, parent.getParametersNodePath());
-								
-								// this should create the right TXMResult, parameters string values are set
-								importedResult = (TXMResult) cons.newInstance(resultNodePath);
-								importedResult.autoLoadParametersFromAnnotations(); // update java parameters
-								importedResult.loadParameters();
-								
-								oldUUIDToNewUUID.put(UUID, resultNodePath);
-								
-								//						if (r.importParameters(outfile)) {
-								//							CorporaView.refreshObject(r);
-								//							System.out.println(NLS.bind("Parameter imported from the {0} file.", outfile)); //$NON-NLS-1$
-								//								
-								//							this.syncExec(new Runnable() {
-								//
-								//								@Override
-								//								public void run() {
-								//									SWTEditorsUtils.refreshEditors(r);
-								//								}
-								//							});
-								//						}
-							}
-							catch (ThreadDeath td) {
-								if (importedResult != null) {
-									importedResult.delete();
-								}
-								return Status.CANCEL_STATUS;
-							}
-							catch (Exception e) {
-								Log.info(NLS.bind("Error while loading result {0}: {1}", s, e));
-								org.txm.utils.logger.Log.printStackTrace(e);
-								if (importedResult != null) {
-									importedResult.delete();
-								}
-								//return Status.CANCEL_STATUS;
-							}
-							
-						}
-						monitor.done();
-						JobsTimer.stopAndPrint();
-						
-						this.syncExec(new Runnable() {
-							
-							@Override
-							public void run() {
-								
-								CorporaView.refresh();
-							}
-						});
-						return Status.OK_STATUS;
-					}
-				};
-				
-				jobhandler.startJob();
-			}
-			
-		}
-		catch (Exception e1) {
-			// TODO Auto-generated catch block
-			e1.printStackTrace();
-			return null;
-		}
-		return null;
-	}
-}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameter.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameter.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameter.java	(revision 3559)
@@ -0,0 +1,195 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.rcp.handlers.export;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.preferences.TBXPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.JobsTimer;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.handlers.files.EditFile;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.dialog.LastOpened;
+import org.txm.rcp.utils.JobHandler;
+import org.txm.utils.ExecTimer;
+import org.txm.utils.logger.Log;
+
+/**
+ * Exports a result by calling the function toTxt(File f) then opens or not the result in the text editor according to the preferences.
+ * 
+ * @author mdecorde, sjacquot
+ */
+public class ExportResultParameter extends AbstractHandler {
+	
+	private static final String ID = "org.txm.rcp.commands.function.ExportResult"; //$NON-NLS-1$
+	
+	/** The selection. */
+	private IStructuredSelection selection;
+	
+	/** The lastopenedfile. */
+	// private static String lastopenedfile;
+	
+	/**
+	 * Export a TXM result in a CSV file.
+	 *
+	 * @param event the event
+	 * @return the object
+	 * @throws ExecutionException the execution exception
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		final Object s = selection.getFirstElement();
+		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+		
+		// String txmhome = Toolbox.getTxmHomePath();
+		FileDialog dialog = new FileDialog(shell, SWT.SAVE);
+		
+		String extensions[] = { "*.csv" }; //$NON-NLS-1$
+		if (s instanceof TXMResult) {
+			extensions = ((TXMResult) s).getExportTXTExtensions();
+			dialog.setFileName(((TXMResult) s).getValidFileName());
+		}
+		dialog.setFilterExtensions(extensions);
+		
+		if (LastOpened.getFile(ID) != null) {
+			dialog.setFilterPath(LastOpened.getFolder(ID));
+		}
+		
+		if (dialog.open() != null) {
+			StatusLine.setMessage(TXMUIMessages.exportingResults);
+			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
+			if (!(filepath.endsWith(extensions[0].substring(1))))
+				filepath += extensions[0].substring(1);
+			
+			final File outfile = new File(filepath);
+			LastOpened.set(ID, outfile.getParent(), outfile.getName());
+			try {
+				outfile.createNewFile();
+			}
+			catch (IOException e1) {
+				Log.warning(NLS.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, outfile, e1));
+			}
+			if (!outfile.canWrite()) {
+				Log.warning(NLS.bind(TXMUIMessages.impossibleToReadP0, outfile));
+				return null;
+			}
+			if (!outfile.isFile()) {
+				Log.warning("Error: " + outfile + " is not a file"); //$NON-NLS-1$ //$NON-NLS-2$
+				return null;
+			}
+			
+			final String encoding = TBXPreferences.getInstance().getString(TBXPreferences.EXPORT_ENCODING);
+			String _colseparator = TBXPreferences.getInstance().getString(TBXPreferences.EXPORT_COL_SEPARATOR);
+			final String colseparator = _colseparator;
+			String _txtseparator = TBXPreferences.getInstance().getString(TBXPreferences.EXPORT_TXT_SEPARATOR);
+			final String txtseparator = _txtseparator;
+			
+			JobHandler jobhandler = new JobHandler(TXMUIMessages.exportingResults) {
+				
+				@Override
+				protected IStatus run(IProgressMonitor monitor) {
+					
+					// convert the monitor into sub-monitor
+					SubMonitor subMonitor = SubMonitor.convert(monitor, TXMUIMessages.exporting, 100);
+					
+					try {
+						
+						this.runInit(subMonitor);
+						
+						if (s instanceof TXMResult) {
+							TXMResult r = (TXMResult) s;
+							
+							// compute the result if needed
+							if (!r.isAltered() && r.isDirty()) {
+								r.compute(this);
+							}
+							Log.info(TXMUIMessages.bind(TXMUIMessages.exportingP0, r.getName()));
+							ExecTimer.start();
+							r.toTxt(outfile, encoding, colseparator, txtseparator);
+							Log.info(TXMUIMessages.bind(TXMUIMessages.doneInP0, ExecTimer.stop()));
+						}
+						else {
+							Log.warning(TXMUIMessages.TheExportedObjectIsNotATXMResultResult);
+							return Status.CANCEL_STATUS;
+						}
+						
+						if (outfile.exists()) {
+							// Open internal editor in the UI thread
+							if (TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPORT_SHOW)) {
+								this.syncExec(new Runnable() {
+									
+									@Override
+									public void run() {
+										EditFile.openfile(outfile.getAbsolutePath());
+									}
+								});
+							}
+						}
+						else {
+							Log.warning(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, outfile.getAbsolutePath()));
+						}
+					}
+					catch (ThreadDeath td) {
+						TXMResult r = (TXMResult) s;
+						r.resetComputingState();
+						return Status.CANCEL_STATUS;
+					}
+					catch (Exception e) {
+						Log.warning(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
+						org.txm.utils.logger.Log.printStackTrace(e);
+						return Status.CANCEL_STATUS;
+					}
+					finally {
+						subMonitor.done();
+						JobsTimer.stopAndPrint();
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			
+			jobhandler.startJob();
+		}
+		return null;
+	}
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultChain.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultChain.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultChain.java	(revision 3559)
@@ -0,0 +1,177 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.rcp.handlers.export;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashSet;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.Toolbox;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.JobsTimer;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.dialog.LastOpened;
+import org.txm.rcp.utils.JobHandler;
+import org.txm.utils.DeleteDir;
+import org.txm.utils.zip.Zip;
+
+// TODO: Auto-generated Javadoc
+/**
+ * export a result of a result by calling the function toTxt(File f) then show
+ * the result in the text editor @ author mdecorde.
+ */
+public class ExportResultChain extends AbstractHandler {
+	
+	private static final String ID = ExportResultChain.class.getName();
+	
+	/**
+	 * Export a TXM result parameters in the preferences format
+	 *
+	 * @param event the event
+	 * @return the object
+	 * @throws ExecutionException the execution exception
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		
+		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+		
+		// String txmhome = Toolbox.getTxmHomePath();
+		FileDialog dialog = new FileDialog(shell, SWT.SAVE);
+		
+		String extensions[] = { "*.txmresults" }; //$NON-NLS-1$
+		dialog.setFilterExtensions(extensions);
+		dialog.setFileName("results_"+Toolbox.dateformat.format(Calendar.getInstance().getTime()) +".txmresults"); //$NON-NLS-1$
+		if (LastOpened.getFile(ID) != null) {
+			dialog.setFilterPath(LastOpened.getFolder(ID));
+		}
+		
+		if (dialog.open() != null) {
+			StatusLine.setMessage(TXMUIMessages.exportingResults);
+			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
+			if (!(filepath.endsWith(extensions[0].substring(1)))) {
+				filepath += extensions[0].substring(1);
+			}
+			
+			final File zipfile = new File(filepath+".tmp");
+			final File zipfiledir = new File(filepath); // temporary directory to setup the archive
+			LastOpened.set(ID, zipfiledir.getParent(), zipfiledir.getName()); 
+			zipfiledir.delete();
+			zipfiledir.mkdirs();
+			
+			JobHandler jobhandler = new JobHandler(TXMUIMessages.exportingResults) {
+				
+				@Override
+				protected IStatus run(IProgressMonitor monitor) {
+					
+					// convert the monitor into sub-monitor
+					SubMonitor subMonitor = SubMonitor.convert(monitor, TXMUIMessages.exporting, 100);
+					this.runInit(subMonitor);
+					
+					try {
+						
+						HashSet<TXMResult> toExport = new HashSet<TXMResult>();
+						for (Object o : selection.toList()) {
+							if (!(o instanceof TXMResult)) continue;
+							TXMResult r = (TXMResult)o;
+							toExport.add(r);
+							TXMResult parent = ((TXMResult)o).getParent();
+							
+							// add invisible parents to rebuild the result
+							while(parent != null && !parent.isVisible()) { // insivisble parent must be added to the exported results
+								
+								toExport.add(parent);
+								parent = parent.getParent();
+							}
+							
+							// add children 
+							for (TXMResult c : r.getDeepChildren()) {
+								toExport.add(c);
+							}
+						}
+						
+						ArrayList<File> files = new ArrayList<>();
+						for (TXMResult r : toExport) {
+							
+							if (r.isAltered()) {
+								System.out.println(TXMUIMessages.ExportResultParameters_WarningOnlyTheParametersAreExportedManualChangesAreNotTransfered);
+							}
+							else {
+								r.compute(subMonitor); // refresh result
+							}
+							
+							File outfile = new File(zipfiledir, (TXMPreferences.getNode(r.getParametersNodePath()).name()+".parameters"));
+							if (r.toParametersFile(outfile)) {
+								files.add(outfile);
+							}
+						}
+						
+						System.out.println(NLS.bind(TXMUIMessages.ExportResultParameters_ParametersExportedToTheP0File, zipfiledir));
+						Zip.compress(files.toArray(new File[files.size()]), zipfile, Zip.DEFAULT_LEVEL_COMPRESSION, null, null);
+						DeleteDir.deleteDirectory(zipfiledir);
+						zipfile.renameTo(zipfiledir);
+					}
+					catch (ThreadDeath td) {
+						
+						return Status.CANCEL_STATUS;
+					}
+					catch (Exception e) {
+						System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, selection.toList(), e));
+						org.txm.utils.logger.Log.printStackTrace(e);
+						return Status.CANCEL_STATUS;
+					}
+					finally {
+						subMonitor.done();
+						JobsTimer.stopAndPrint();
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			
+			jobhandler.startJob();
+		}
+		return null;
+	}
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultChain.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameter.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameter.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameter.java	(revision 3559)
@@ -0,0 +1,150 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.rcp.handlers.export;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.preferences.TBXPreferences;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.JobsTimer;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.handlers.files.EditFile;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.dialog.LastOpened;
+import org.txm.rcp.utils.JobHandler;
+import org.txm.rcp.views.corpora.CorporaView;
+
+// TODO: Auto-generated Javadoc
+/**
+ * export a result of a result by calling the function toTxt(File f) then show
+ * the result in the text editor @ author mdecorde.
+ */
+public class ImportResultParameter extends AbstractHandler {
+	
+	private static final String ID = ImportResultParameter.class.getName();
+	
+	/**
+	 * Export a TXM result parameters in the preferences format
+	 *
+	 * @param event the event
+	 * @return the object
+	 * @throws ExecutionException the execution exception
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		final Object s = selection.getFirstElement();
+		if (!(s instanceof TXMResult)) {
+			return null;
+		}
+		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+		
+		// String txmhome = Toolbox.getTxmHomePath();
+		FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+		
+		String extensions[] = { "*.parameters" }; //$NON-NLS-1$
+		dialog.setFilterExtensions(extensions);
+		
+		if (LastOpened.getFile(ID) != null) {
+			dialog.setFilterPath(LastOpened.getFolder(ID));
+		}
+		
+		if (dialog.open() != null) {
+			StatusLine.setMessage(TXMUIMessages.exportingResults);
+			String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
+			if (!(filepath.endsWith(extensions[0].substring(1)))) {
+				filepath += extensions[0].substring(1);
+			}
+			
+			final File outfile = new File(filepath);
+			LastOpened.set(ID, outfile.getParent(), outfile.getName());
+			try {
+				outfile.createNewFile();
+			}
+			catch (IOException e1) {
+				System.err.println(NLS.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, outfile, e1));
+			}
+			if (!outfile.canWrite()) {
+				System.out.println(NLS.bind(TXMUIMessages.impossibleToReadP0, outfile));
+				return null;
+			}
+			if (!outfile.isFile()) {
+				System.out.println("Error: " + outfile + " is not a file"); //$NON-NLS-1$ //$NON-NLS-2$
+				return null;
+			}
+			
+			JobHandler jobhandler = new JobHandler(TXMUIMessages.exportingResults) {
+				
+				@Override
+				protected IStatus run(IProgressMonitor monitor) {
+					try {
+						this.runInit(monitor);
+						monitor.beginTask(TXMUIMessages.exporting, 100);
+						
+						TXMResult parent = (TXMResult) s;
+						TXMResult r = parent.importResult(outfile);
+						CorporaView.refreshObject(r);
+						if (r != null) {
+							System.out.println(NLS.bind(TXMUIMessages.P0ResultsImportedFromTheP1File, r, outfile));
+						}
+					}
+					catch (ThreadDeath td) {
+						return Status.CANCEL_STATUS;
+					}
+					catch (Exception e) {
+						System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
+						org.txm.utils.logger.Log.printStackTrace(e);
+						return Status.CANCEL_STATUS;
+					}
+					finally {
+						monitor.done();
+						JobsTimer.stopAndPrint();
+					}
+					return Status.OK_STATUS;
+				}
+			};
+			
+			jobhandler.startJob();
+		}
+		return null;
+	}
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultChain.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultChain.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultChain.java	(revision 3559)
@@ -0,0 +1,265 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+//
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+//
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+//
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+//
+//
+//
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$
+//
+package org.txm.rcp.handlers.export;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.nio.file.FileSystem;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Properties;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.osgi.framework.Bundle;
+import org.txm.Toolbox;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.JobsTimer;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.dialog.LastOpened;
+import org.txm.rcp.utils.JobHandler;
+import org.txm.rcp.utils.SWTEditorsUtils;
+import org.txm.rcp.views.corpora.CorporaView;
+import org.txm.utils.DeleteDir;
+import org.txm.utils.io.IOUtils;
+import org.txm.utils.logger.Log;
+import org.txm.utils.zip.Zip;
+
+// TODO: Auto-generated Javadoc
+/**
+ * export a result of a result by calling the function toTxt(File f) then show
+ * the result in the text editor @ author mdecorde.
+ */
+public class ImportResultChain extends AbstractHandler {
+	
+	private static final String ID = ImportResultChain.class.getName();
+	
+	/**
+	 * Export a TXM result parameters in the preferences format
+	 *
+	 * @param event the event
+	 * @return the object
+	 * @throws ExecutionException the execution exception
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		final Object s = selection.getFirstElement();
+		if (!(s instanceof TXMResult)) {
+			return null;
+		}
+		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
+		
+		// String txmhome = Toolbox.getTxmHomePath();
+		FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+		
+		String extensions[] = { "*.txmresults" }; //$NON-NLS-1$
+		dialog.setFilterExtensions(extensions);
+		
+		if (LastOpened.getFile(ID) != null) {
+			dialog.setFilterPath(LastOpened.getFolder(ID));
+		}
+		try {
+			if (dialog.open() != null) {
+				StatusLine.setMessage(TXMUIMessages.exportingResults);
+				String filepath = dialog.getFilterPath()+ "/" + dialog.getFileName(); //$NON-NLS-1$
+				
+				final File zipfile = new File(filepath);
+				File outdir = new File(Toolbox.getTxmHomePath(),  "results/import");
+				DeleteDir.deleteDirectory(outdir);
+				
+				Zip.decompress(zipfile, outdir, false);
+				
+				LinkedHashMap<File, Properties> fileToProperties = new LinkedHashMap<>(); // to retrieve a new result from its old uuid
+				HashMap<String, File> oldUUIDToPropertiesFile = new HashMap<>(); // to retrieve a new result from its old uuid
+				HashMap<String, String> oldUUIDToNewUUID = new HashMap<>(); // to retrieve a new result from its old uuid
+				HashMap<String, String> UUIDDependencies = new HashMap<>(); // to -> from, if from is null use the selected TXMResult as parent
+				
+				File[] files = outdir.listFiles();
+				Arrays.sort(files);
+				
+				for (File parametersFile : files) {
+					if (!parametersFile.getName().endsWith(".parameters")) continue;
+					
+					Properties props = new Properties();
+					BufferedReader r = IOUtils.getReader(parametersFile);
+					props.load(r);
+					r.close();
+					
+					fileToProperties.put(parametersFile, props);
+					String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
+					oldUUIDToPropertiesFile.put(UUID, parametersFile);
+				}
+				
+				for (File parametersFile : outdir.listFiles()) {
+					// if (TXMPreferences.PARENT_PARAMETERS_NODE_PATH.equals(ps)) continue;
+					//if (TXMPreferences.RESULT_PARAMETERS_NODE_PATH.equals(ps)) continue;
+					Properties props = fileToProperties.get(parametersFile);
+					String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
+					String parentUUID = props.getProperty(TXMPreferences.PARENT_PARAMETERS_NODE_PATH);
+					if (!oldUUIDToPropertiesFile.containsKey(parentUUID)) {
+						UUIDDependencies.put(UUID, null);
+					} else {
+						UUIDDependencies.put(UUID, parentUUID);
+					}
+				}
+				
+				JobHandler jobhandler = new JobHandler(TXMUIMessages.importStarted) {
+					
+					@Override
+					protected IStatus run(IProgressMonitor monitor) {
+						
+						for (File parametersFile: fileToProperties.keySet()) {
+							TXMResult importedResult = null;
+							try {
+								this.runInit(monitor);
+								monitor.beginTask(TXMUIMessages.exporting, 100);
+								
+								TXMResult defaultParentResult = (TXMResult) s;
+								
+								Properties props = fileToProperties.get(parametersFile);
+								String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
+								
+								String className = props.getProperty(TXMPreferences.CLASS, ""); //$NON-NLS-1$ //$NON-NLS-2$
+								if (className == null || className.length() == 0) {
+									Log.warning(NLS.bind("Warning: can not import object with no class name set with path={0}.", parametersFile)); //$NON-NLS-1$
+									continue;
+								}
+								String bundleId = props.getProperty(TXMPreferences.BUNDLE_ID, ""); //$NON-NLS-1$
+								if (bundleId == null || bundleId.length() == 0) {
+									Log.warning(NLS.bind("Warning: can not import {0} object with no bundle id set.", parametersFile)); //$NON-NLS-1$
+									continue;
+								}
+								Bundle bundle = Platform.getBundle(bundleId);
+								if (bundle == null) {
+									Log.warning(NLS.bind("Warning: can not import {0} object with bundle id={1}.", className, parametersFile)); //$NON-NLS-1$
+									continue;
+								}
+								
+								Class<?> cl = bundle.loadClass(className);
+								
+								String resultNodePath = defaultParentResult.getProject().getParametersNodeRootPath() + TXMResult.createUUID() + "_" + cl.getSimpleName();
+								Log.info("Importing a "+cl.getSimpleName()+" from "+resultNodePath);
+								TXMResult parent = defaultParentResult;
+								if (UUIDDependencies.get(UUID) != null) {
+									parent = TXMResult.getResult(oldUUIDToNewUUID.get(UUIDDependencies.get(UUID)));
+								}
+								
+								
+								
+								Constructor<?> cons = cl.getConstructor(String.class);
+								
+								// fill the preference node with the right parameter **and then** parent right parent node path 
+								for (Object p : props.keySet()) {
+									String ps = p.toString();
+									TXMPreferences.put(resultNodePath, ps, props.getProperty(ps, ""));
+								}
+								TXMPreferences.put(resultNodePath, TXMPreferences.PARENT_PARAMETERS_NODE_PATH, parent.getParametersNodePath());
+								
+								// this should create the right TXMResult, parameters string values are set
+								importedResult = (TXMResult) cons.newInstance(resultNodePath);
+								importedResult.autoLoadParametersFromAnnotations(); // update java parameters
+								importedResult.loadParameters();
+								
+								oldUUIDToNewUUID.put(UUID, resultNodePath);
+								
+								//						if (r.importParameters(outfile)) {
+								//							CorporaView.refreshObject(r);
+								//							System.out.println(NLS.bind("Parameter imported from the {0} file.", outfile)); //$NON-NLS-1$
+								//								
+								//							this.syncExec(new Runnable() {
+								//
+								//								@Override
+								//								public void run() {
+								//									SWTEditorsUtils.refreshEditors(r);
+								//								}
+								//							});
+								//						}
+							}
+							catch (ThreadDeath td) {
+								if (importedResult != null) {
+									importedResult.delete();
+								}
+								return Status.CANCEL_STATUS;
+							}
+							catch (Exception e) {
+								Log.info(NLS.bind("Error while loading result {0}: {1}", s, e));
+								org.txm.utils.logger.Log.printStackTrace(e);
+								if (importedResult != null) {
+									importedResult.delete();
+								}
+								//return Status.CANCEL_STATUS;
+							}
+							
+						}
+						monitor.done();
+						JobsTimer.stopAndPrint();
+						
+						this.syncExec(new Runnable() {
+							
+							@Override
+							public void run() {
+								
+								CorporaView.refresh();
+							}
+						});
+						return Status.OK_STATUS;
+					}
+				};
+				
+				jobhandler.startJob();
+			}
+			
+		}
+		catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+			return null;
+		}
+		return null;
+	}
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultChain.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResult.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResult.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResult.java	(revision 3559)
@@ -0,0 +1,72 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.rcp.handlers.results;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.utils.logger.Log;
+
+/**
+ * Clone the selected TXM result node.
+ * 
+ * @author sjacquot
+ * 
+ */
+public class CopyTXMResult extends BaseAbstractHandler {
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		//System.out.println("CloneTXMResult.execute(): clone tests.");
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		//System.out.println("CloneTXMResult.execute() selection class: " + selection);
+
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return super.logCanNotExecuteCommand(selection);
+		}
+
+		CopyTXMResultTree.srcNode =  ((TXMResult) selection.getFirstElement());
+		CopyTXMResultTree.all = false;
+		CopyTXMResultTree.cut = false;
+		
+		Log.info(NLS.bind("Copy {0}", selection.getFirstElement()));
+		return selection.getFirstElement();
+		
+	}
+	
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResult.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResultTree.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResultTree.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResultTree.java	(revision 3559)
@@ -0,0 +1,87 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.rcp.handlers.results;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.utils.logger.Log;
+
+/**
+ * Clone the selected TXM result node.
+ * 
+ * @author sjacquot
+ * 
+ */
+public class CopyTXMResultTree extends BaseAbstractHandler {
+
+	public static TXMResult srcNode;
+	public static boolean all;
+	public static boolean cut;
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		//System.out.println("CloneTXMResult.execute(): clone tests.");
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		//System.out.println("CloneTXMResult.execute() selection class: " + selection);
+
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return super.logCanNotExecuteCommand(selection);
+		}
+
+		return copy(selection);
+		
+	}
+
+	public static Object copy(IStructuredSelection selection) {
+		
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return null;
+		}
+
+		srcNode =  ((TXMResult) selection.getFirstElement());
+		all = true;
+		cut = false;
+		
+		Log.info(NLS.bind("Copy {0} and its children", selection.getFirstElement()));
+		return srcNode;
+	}
+	
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CopyTXMResultTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResult.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResult.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResult.java	(revision 3559)
@@ -0,0 +1,83 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.rcp.handlers.results;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.utils.logger.Log;
+
+/**
+ * Clone the selected TXM result node.
+ * 
+ * @author sjacquot
+ * 
+ */
+public class CutTXMResult extends BaseAbstractHandler {
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		//System.out.println("CloneTXMResult.execute(): clone tests.");
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		//System.out.println("CloneTXMResult.execute() selection class: " + selection);
+
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return super.logCanNotExecuteCommand(selection);
+		}
+
+		return cut(selection);
+		
+	}
+
+	public static Object cut(IStructuredSelection selection) {
+		
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return null;
+		}
+
+		CopyTXMResultTree.srcNode =  ((TXMResult) selection.getFirstElement());
+		CopyTXMResultTree.all = false;
+		CopyTXMResultTree.cut = true;
+		
+		Log.info(NLS.bind("Cut {0}", selection.getFirstElement()));
+		return selection.getFirstElement();
+	}
+	
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResult.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResultTree.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResultTree.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResultTree.java	(revision 3559)
@@ -0,0 +1,83 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.rcp.handlers.results;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.utils.logger.Log;
+
+/**
+ * Clone the selected TXM result node.
+ * 
+ * @author sjacquot
+ * 
+ */
+public class CutTXMResultTree extends BaseAbstractHandler {
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+
+		//System.out.println("CloneTXMResult.execute(): clone tests.");
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		//System.out.println("CloneTXMResult.execute() selection class: " + selection);
+
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return super.logCanNotExecuteCommand(selection);
+		}
+
+		return cut(selection);
+		
+	}
+
+	public static Object cut(IStructuredSelection selection) {
+		
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return null;
+		}
+
+		CopyTXMResultTree.srcNode =  ((TXMResult) selection.getFirstElement());
+		CopyTXMResultTree.all = true;
+		CopyTXMResultTree.cut = true;
+		
+		Log.info(NLS.bind("Cut {0} and its children", selection.getFirstElement()));
+		return selection.getFirstElement();
+	}
+	
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/CutTXMResultTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/PasteTXMResultTree.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/PasteTXMResultTree.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/PasteTXMResultTree.java	(revision 3559)
@@ -0,0 +1,112 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.rcp.handlers.results;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.views.corpora.CorporaView;
+import org.txm.utils.logger.Log;
+
+/**
+ * Clone the selected TXM result node.
+ * 
+ * @author sjacquot, mdecorde
+ * 
+ */
+public class PasteTXMResultTree extends BaseAbstractHandler {
+	
+	
+	
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		
+		if (!(selection.getFirstElement() instanceof TXMResult))	{
+			System.out.println(TXMUIMessages.OnlyATXMResultCanBeCloned);
+			return super.logCanNotExecuteCommand(selection);
+		}
+		
+		
+		
+		TXMResult newParent = (TXMResult) selection.getFirstElement();
+		
+		paste(newParent);
+		return null;
+	}
+	
+	public static Object paste(TXMResult newParent) {
+		
+		TXMResult srcNode =  CopyTXMResultTree.srcNode;
+		
+		if (srcNode == null) {
+			Log.info("Nothing to paste");
+			return null;
+		}
+		
+		if (newParent == srcNode) { // to duplicate the object
+			newParent = srcNode.getParent();
+		}
+		
+		if (!srcNode.getParent().getResultType().equals(newParent.getResultType())) {
+			newParent = srcNode.getParent();
+		}
+		
+		if (!srcNode.getParent().getResultType().equals(newParent.getResultType())) {
+			Log.warning(NLS.bind("New parent type ({0}) is different from the old parent type ({1})", newParent.getResultType(), srcNode.getParent().getResultType()));
+			return null;
+		}
+		
+		if (srcNode.isAltered()) {
+			Log.info(TXMUIMessages.WarningOnlyParametersAreClonedManualChangesAreNotTransfered);
+		}
+		
+		Log.info(NLS.bind("Paste {0} to {1}...", srcNode, newParent));
+		
+		TXMResult result = srcNode.clone(newParent, CopyTXMResultTree.all);
+		
+		if (CopyTXMResultTree.cut) {
+			srcNode.delete();
+			CopyTXMResultTree.srcNode = null;
+		}
+		
+		//CorporaView.refreshObject(newParent);
+		CorporaView.refresh();
+		CorporaView.reveal(result);
+		return result;
+	}
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/PasteTXMResultTree.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.rcp/plugin.xml	(revision 3558)
+++ TXM/trunk/org.txm.rcp/plugin.xml	(revision 3559)
@@ -2237,6 +2237,85 @@
                </visibleWhen>
             </command>
             <command
+                  commandId="org.txm.rcp.handlers.results.CopyTXMResult"
+                  label="Copy"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                     <not>
+                        <reference
+                              definitionId="OneMainCorpusSelected">
+                        </reference>
+                     </not>
+                     <reference
+                           definitionId="ExpertEnabled">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
+            <command
+                  commandId="org.txm.rcp.handlers.results.CopyTXMResultTree"
+                  label="Copy All"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                     <not>
+                        <reference
+                              definitionId="OneMainCorpusSelected">
+                        </reference>
+                     </not>
+                     <reference
+                           definitionId="ExpertEnabled">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
+            <command
+                  commandId="org.txm.rcp.handlers.results.CutTXMResultTree"
+                  label="Cut"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                     <not>
+                        <reference
+                              definitionId="OneMainCorpusSelected">
+                        </reference>
+                     </not>
+                     <reference
+                           definitionId="ExpertEnabled">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
+            <command
+                  commandId="org.txm.rcp.handlers.results.PasteTXMResultTree"
+                  label="Paste"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                     <reference
+                           definitionId="ExpertEnabled">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
+            <command
                   commandId="org.txm.rcp.handlers.results.CloneTXMResult"
                   label="%command.label.372"
                   style="push">
@@ -2729,12 +2808,12 @@
          point="org.eclipse.ui.commands">
 
       <command
-            defaultHandler="org.txm.rcp.handlers.export.ExportResult"
+            defaultHandler="org.txm.rcp.handlers.export.ExportResultParameter"
             id="org.txm.rcp.commands.function.ExportResult"
             name="%command.name.24">
       </command>
       <command
-            defaultHandler="org.txm.rcp.handlers.export.ExportResultParameters"
+            defaultHandler="org.txm.rcp.handlers.export.ExportResultChain"
             id="org.txm.rcp.handlers.export.ExportResultParameters"
             name="%command.name.35">
       </command>
@@ -2744,12 +2823,12 @@
             name="%command.name.34">
       </command>
       <command
-            defaultHandler="org.txm.rcp.handlers.export.ImportResult"
+            defaultHandler="org.txm.rcp.handlers.export.ImportResultParameter"
             id="org.txm.rcp.handlers.export.ImportResult"
             name="%command.name.39">
       </command>
       <command
-            defaultHandler="org.txm.rcp.handlers.export.ImportResultParameters"
+            defaultHandler="org.txm.rcp.handlers.export.ImportResultChain"
             id="org.txm.rcp.handlers.export.ImportResultParameters"
             name="%command.name.40">
       </command>
@@ -2962,6 +3041,26 @@
                   id="org.txm.rcp.commands.workspace.CloseCorpus"
                   name="%command.name.85">
             </command>
+            <command
+                  defaultHandler="org.txm.rcp.handlers.results.CopyTXMResult"
+                  id="org.txm.rcp.handlers.results.CopyTXMResult"
+                  name="Copy">
+            </command>
+            <command
+                  defaultHandler="org.txm.rcp.handlers.results.CopyTXMResultTree"
+                  id="org.txm.rcp.handlers.results.CopyTXMResultTree"
+                  name="Copy All">
+            </command>
+            <command
+                  defaultHandler="org.txm.rcp.handlers.results.PasteTXMResultTree"
+                  id="org.txm.rcp.handlers.results.PasteTXMResultTree"
+                  name="Paste">
+            </command>
+            <command
+                  defaultHandler="org.txm.rcp.handlers.results.CutTXMResultTree"
+                  id="org.txm.rcp.handlers.results.CutTXMResultTree"
+                  name="Cut All">
+            </command>
    </extension>
    <extension
          id="scripts"
