Index: TXM/trunk/org.txm.imports.metopes/plugin.xml
===================================================================
--- TXM/trunk/org.txm.imports.metopes/plugin.xml	(revision 3533)
+++ TXM/trunk/org.txm.imports.metopes/plugin.xml	(revision 3534)
@@ -4,7 +4,7 @@
    <extension
          point="org.eclipse.ui.menus">
       <menuContribution
-            locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
+            locationURI="menu:menu.file.import.corpus?before=menu.file.import.separator.software">
          <command
                commandId="org.txm.rcp.handlers.scripts.ExecuteImportScript"
                label="XML-TEI Metopes"
Index: TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java	(revision 3533)
+++ TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java	(revision 3534)
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.logging.Level;
@@ -403,18 +404,21 @@
 		return typedQuery.getResultList();
 	}
 	
-	public List<Annotation> getAnnotationsForMatches(List<Match> matches, List<Annotation> annotations, boolean overlap) {
+	public List<Annotation> getAnnotationsForMatches(List<Match> sortedMatches, List<Annotation> sortedAnnotations, boolean overlap) {
+		
 		List<Annotation> annotsList = new ArrayList<>();
-		
+//		matches = new ArrayList<>(matches);
+//		Collections.sort(matches);
 		int iMatch = 0;
 		int iAnnotation = 0;
-		int nMatch = matches.size();
-		int nAnnotations = annotations.size();
+		int nMatch = sortedMatches.size();
+		int nAnnotations = sortedAnnotations.size();
 		
 		Match match = null;
 		Annotation annotation = null;
 		while (iMatch < nMatch && iAnnotation < nAnnotations) {
-			match = matches.get(iMatch);
+			
+			match = sortedMatches.get(iMatch);
 			int start, end;
 			if (match.getTarget() >= 0) {
 				start = end = match.getTarget();
@@ -424,7 +428,7 @@
 				end = match.getEnd();
 			}
 			
-			annotation = annotations.get(iAnnotation);
+			annotation = sortedAnnotations.get(iAnnotation);
 			int astart = annotation.getStart(), aend = annotation.getEnd();
 			
 			if (overlap) {
@@ -460,7 +464,7 @@
 			}
 		}
 		
-		while (annotsList.size() < matches.size())
+		while (annotsList.size() < sortedMatches.size())
 			annotsList.add(null); // fill matches that were not process due to no more annotations
 			
 		return annotsList;
Index: TXM/trunk/org.txm.tigersearch.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.tigersearch.rcp/plugin.xml	(revision 3533)
+++ TXM/trunk/org.txm.tigersearch.rcp/plugin.xml	(revision 3534)
@@ -74,7 +74,7 @@
          </command>
       </menuContribution>
       <menuContribution
-            locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
+            locationURI="menu:menu.file.import.corpus?before=menu.file.import.separator.software">
          <command
                commandId="org.txm.rcp.handlers.scripts.ExecuteImportScript"
                icon="icons/functions/TS.png"
Index: TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java	(revision 3533)
+++ TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java	(revision 3534)
@@ -115,7 +115,7 @@
 	
 	protected AnnotationType tagAnnotationType; // the tag annotation type if annotation mode is simple
 	
-	protected TypedValue value_to_add;
+	//protected TypedValue value_to_add;
 	
 	protected Concordance concordance;
 	
@@ -124,6 +124,8 @@
 	private ConcordanceAnnotations annotations = null;
 	
 	private Button addTypedValueLink;
+
+	private TableViewerColumn annotationColumnViewer;
 	
 	@Override
 	public String getName() {
@@ -138,6 +140,7 @@
 		this.concordance = this.editor.getConcordance();
 		this.corpus = concordance.getCorpus();
 		this.annotations = new ConcordanceAnnotations(this.editor.getConcordance());
+		annotations.computeLines(this.editor.getConcordance().getLines()); // pre-compute the annotation lines ot avoid breaking the sort and co.
 		this.annotManager = KRAnnotationEngine.getAnnotationManager(corpus);
 		
 		TableViewer viewer = this.editor.getLineTableViewer();
@@ -148,7 +151,7 @@
 			position = 3 + extension.getNumberOfAnnotationArea(); // after keyword column and previous annotation columns
 		}
 		
-		TableViewerColumn annotationColumnViewer = new TableViewerColumn(viewer, SWT.CENTER, position);
+		this.annotationColumnViewer = new TableViewerColumn(viewer, SWT.CENTER, position);
 		annotationColumn = annotationColumnViewer.getColumn();
 		annotationColumn.setText(KRAnnotationUIMessages.category);
 		annotationColumn.setToolTipText(KRAnnotationUIMessages.keywordsAnnotation);
@@ -525,7 +528,8 @@
 			@Override
 			public void run() {
 				try {
-					editor.refresh(false);
+					notifyStartOfRefresh();
+					annotationColumnViewer.getViewer().refresh();
 				}
 				catch (Exception e) {
 					// TODO Auto-generated catch block
@@ -536,7 +540,7 @@
 	}
 	
 	protected void affectAnnotationValues(final List<? extends Match> matches, final AnnotationType type, final String svalue, JobHandler job) {
-		value_to_add = null; // reset
+		TypedValue value_to_add = null; // reset
 		if (matches == null || matches.size() == 0) {
 			Log.warning("No line selected. Aborting.");
 			return;
@@ -585,13 +589,15 @@
 						return;
 					}
 					else {
-						value_to_add = kr.addValue(svalue, svalue, type.getId());
+						kr.addValue(svalue, svalue, type.getId());
 						KRView.refresh();
 					}
 				}
 			});
 		}
 		
+		value_to_add = kr.getValue(type, svalue);
+		
 		if (value_to_add == null && kr instanceof LocalKnowledgeRepository) return; // canceled
 		
 		if (value_to_add == null) {
@@ -653,7 +659,8 @@
 			@Override
 			public void run() {
 				try {
-					editor.refresh(false);
+					notifyStartOfRefresh();
+					annotationColumnViewer.getViewer().refresh();
 					CorporaView.refreshObject(corpus);
 				}
 				catch (Exception e) {
Index: TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java	(revision 3533)
+++ TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java	(revision 3534)
@@ -123,7 +123,7 @@
 	
 	protected Label equalLabel;
 	
-	protected TypedValue value_to_add;
+	//protected TypedValue value_to_add;
 	
 	protected Concordance concordance;
 	
@@ -132,6 +132,8 @@
 	private ConcordanceAnnotations annotations = null;
 	
 	ConcordanceEditor editor;
+
+	private TableViewerColumn annotationColumnViewer;
 	
 	public KRAnnotation() {
 		
@@ -150,6 +152,7 @@
 		this.concordance = this.editor.getConcordance();
 		this.corpus = concordance.getCorpus();
 		this.annotations = new ConcordanceAnnotations(this.editor.getConcordance());
+		annotations.computeLines(this.editor.getConcordance().getLines()); // pre-compute the annotation lines ot avoid breaking the sort and co.
 		this.annotManager = KRAnnotationEngine.getAnnotationManager(corpus);
 		
 		TableViewer viewer = this.editor.getLineTableViewer();
@@ -160,7 +163,7 @@
 			position = 3 + extension.getNumberOfAnnotationArea(); // after keyword column and previous annotation columns
 		}
 		
-		TableViewerColumn annotationColumnViewer = new TableViewerColumn(viewer, SWT.CENTER, position);
+		this.annotationColumnViewer = new TableViewerColumn(viewer, SWT.CENTER, position);
 		annotationColumn = annotationColumnViewer.getColumn();
 		annotationColumn.setText(KRAnnotationUIMessages.category);
 		annotationColumn.setToolTipText(KRAnnotationUIMessages.keywordsAnnotation);
@@ -199,9 +202,11 @@
 	}
 	
 	public boolean initialiseInput(ConcordanceEditor editor) throws Exception {
+		
 		this.editor = editor;
 		concordance = editor.getConcordance();
 		annotations = new ConcordanceAnnotations(concordance);
+		annotations.computeLines(this.editor.getConcordance().getLines()); // pre-compute the annotation lines ot avoid breaking the sort and co.
 		corpus = concordance.getCorpus();
 		
 		CQPCorpus corpus = editor.getCorpus();
@@ -336,7 +341,8 @@
 					annotations.setViewAnnotation(type);
 					annotations.setAnnotationOverlap(true);
 					try {
-						editor.refresh(false);
+						notifyStartOfRefresh();
+						annotationColumnViewer.getViewer().refresh();
 					}
 					catch (Exception e) {
 						// TODO Auto-generated catch block
@@ -483,6 +489,7 @@
 		});
 		
 		if (currentKnowledgeRepository instanceof LocalKnowledgeRepository) {
+			
 			addTypedValueLink = new Button(annotationArea, SWT.PUSH);
 			addTypedValueLink.setText("..."); //$NON-NLS-1$
 			addTypedValueLink.setToolTipText(KRAnnotationUIMessages.selectAValueAmongTheList);
@@ -714,14 +721,14 @@
 				if (addRemoveCombo.getSelectionIndex() == 0) { // add is default
 					
 					if (getSelectedAnnotationType() != null) {
+						
 						annotationValuesText.setEnabled(true);
-						
 						affectAnnotationButton.setEnabled(true);
 						affectCombo.setEnabled(true);
 					}
 					else {
+						
 						annotationValuesText.setEnabled(false);
-						
 						affectAnnotationButton.setEnabled(false);
 						affectCombo.setEnabled(false);
 					}
@@ -772,7 +779,7 @@
 			try {
 				if (annotManager != null && annotManager.deleteAnnotations(type, matches, job)) {
 					if (Log.getLevel().intValue() < Level.INFO.intValue()) annotManager.checkData();
-					concordance.reloadLines(editor.getTopLine(), editor.getBottomLine() + 1);
+					//concordance.reloadLines(editor.getTopLine(), editor.getBottomLine() + 1);
 				}
 				else {
 					return;
@@ -789,7 +796,8 @@
 				@Override
 				public void run() {
 					try {
-						editor.refresh(false);
+						notifyStartOfRefresh();
+						annotationColumnViewer.getViewer().refresh();
 					}
 					catch (Exception e) {
 						// TODO Auto-generated catch block
@@ -802,7 +810,8 @@
 	}
 	
 	protected void affectAnnotationValues(final List<? extends Match> matches, final AnnotationType type, final String svalue, JobHandler job) {
-		value_to_add = null; // reset
+		
+		TypedValue value_to_add = null; // reset
 		if (concordance == null) {
 			Log.info("No concordance done. Aborting.");
 			return;
@@ -855,13 +864,15 @@
 						return;
 					}
 					else {
-						value_to_add = kr.addValue(svalue, svalue, type.getId());
+						kr.addValue(svalue, svalue, type.getId());
 						KRView.refresh();
 					}
 				}
 			});
 		}
 		
+		value_to_add = kr.getValue(type, svalue); // re-initialize value_to_add if the value was created
+		
 		if (value_to_add == null && kr instanceof LocalKnowledgeRepository) return; // canceled
 		
 		if (value_to_add == null) {
@@ -913,7 +924,7 @@
 			if (Log.getLevel().intValue() < Level.INFO.intValue() && annotManager != null) {
 				annotManager.checkData();
 			}
-			concordance.reloadCurrentLines();
+			//concordance.reloadCurrentLines();
 		}
 		catch (Exception e1) {
 			Log.warning(NLS.bind(KRAnnotationUIMessages.errorWhileAffectionAnnotationColonP0, e1));
@@ -926,7 +937,8 @@
 			@Override
 			public void run() {
 				try {
-					editor.refresh(false);
+					notifyStartOfRefresh();
+					annotationColumnViewer.getViewer().refresh();
 					CorporaView.refreshObject(corpus);
 				}
 				catch (Exception e) {
Index: TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java	(revision 3533)
+++ TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java	(revision 3534)
@@ -125,7 +125,7 @@
 	
 	protected AnnotationType tagAnnotationType; // the tag annotation type if annotation mode is simple
 	
-	protected TypedValue value_to_add;
+	//protected TypedValue value_to_add;
 	
 	protected Concordance concordance;
 	
@@ -185,7 +185,7 @@
 	}
 	
 	protected void affectAnnotationValues(final List<? extends Match> matches, final AnnotationType type, final String svalue, JobHandler job) {
-		value_to_add = null; // reset
+		TypedValue value_to_add = null; // reset
 		if (matches == null || matches.size() == 0) {
 			Log.warning("No line selected. Aborting.");
 			return;
@@ -237,8 +237,9 @@
 		
 		// finally we can 'try' to create the annotations \o/
 		try {
+			System.out.println("CREATE ANNOTATIONS");
 			HashMap<Match, List<Annotation>> existingAnnots = annotManager.createAnnotations(type, value_to_add, matches, job);
-			
+			System.out.println("END OF CREATE ANNOTATIONS");
 			// did we had problems ?
 			if (existingAnnots != null && existingAnnots.size() > 0) {
 				String message = NLS.bind(KRAnnotationUIMessages.couldNotAnnotateTheValueP0OnCertainSequences, value_to_add.getStandardName());
@@ -282,8 +283,12 @@
 			@Override
 			public void run() {
 				try {
+					System.out.println("REFRESH ANNOTATIONS");
 					annotationColumn.setText("*" + annotations.getViewAnnotation().getName());
-					editor.refresh(false);
+					notifyStartOfRefresh();
+					System.out.println("END OF REFRESH ANNOTATIONS");
+					annotationColumnViewer.getViewer().refresh();
+					//editor.refresh(false);
 				}
 				catch (Exception e) {
 					// TODO Auto-generated catch block
@@ -364,7 +369,8 @@
 			public void run() {
 				try {
 					annotationColumn.setText("*" + annotations.getViewAnnotation().getName());
-					editor.refresh(false);
+					notifyStartOfRefresh();
+					annotationColumnViewer.getViewer().refresh();
 				}
 				catch (Exception e) {
 					// TODO Auto-generated catch block
@@ -410,6 +416,7 @@
 		this.concordance = this.editor.getConcordance();
 		this.corpus = concordance.getCorpus();
 		this.annotations = new ConcordanceAnnotations(this.editor.getConcordance());
+		//annotations.computeLines(this.editor.getConcordance().getLines()); // pre-compute the annotation lines ot avoid breaking the sort and co.
 		this.annotManager = KRAnnotationEngine.getAnnotationManager(corpus);
 		
 		TableViewer viewer = this.editor.getLineTableViewer();
@@ -830,8 +837,11 @@
 		});
 		
 		updateAnnotationWidgetStates();
+		
 		editor.layout(true);
+		
 //		ext.getSaveButton().setEnabled(true);
+//		viewer.refresh();
 		return true;
 	}
 	
@@ -856,7 +866,8 @@
 		annotations.setViewAnnotation(type);
 		annotations.setAnnotationOverlap(true);
 		try {
-			editor.refresh(false);
+			notifyStartOfRefresh();
+			annotationColumnViewer.getViewer().refresh();
 		}
 		catch (Exception e) {
 			// TODO Auto-generated catch block
@@ -997,6 +1008,7 @@
 		if (annotationArea.isDisposed()) return;
 		
 		List<Line> lines = concordance.getLines(concordance.getTopIndex(), concordance.getTopIndex() + concordance.getNLinePerPage());
+		//List<Line> lines = concordance.getLines();
 		annotations.computeLines(lines);
 		
 		updateAnnotationWidgetStates();
@@ -1010,6 +1022,8 @@
 		else {
 			annotationColumn.setWidth(0);
 		}
+		
+		annotationColumnViewer.getViewer().refresh();
 	}
 	
 	@Override
Index: TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java	(revision 3533)
+++ TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java	(revision 3534)
@@ -3,6 +3,7 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.TreeMap;
 
@@ -51,10 +52,30 @@
 
 		this.concordanceLines = concordanceLines;
 		
-		HashMap<Match, Line> matches = new HashMap<Match, Line>();
+//		HashMap<Match, Line> matches = new HashMap<Match, Line>();
+//		for (Line line : concordanceLines) {
+//			matches.put(line.getMatch(), line);
+//		}
+//		
+//		ArrayList<Match> sorted_matches = new ArrayList<Match>(matches.keySet());
+//		Collections.sort(sorted_matches);
+//		
+//		List<Annotation> ann = getAnnotationForMatches(sorted_matches, overlapAnnotation);
+//		lines = new HashMap<Line, AnnotationLine>();
+//		
+//		for (int i = 0 ; i < ann.size() ; i++) {
+//			Annotation a = ann.get(i);
+//			AnnotationLine aline = new AnnotationLine(a, getAnnotationTypedValue(a));
+//			lines.put(matches.get(sorted_matches.get(i)), aline);
+//		}
+//		
+//		return lines; // TODO find a way to add with lazy method
+		
+		LinkedHashMap<Match, Line> matches = new LinkedHashMap<Match, Line>();
 		for (Line line : concordanceLines) {
 			matches.put(line.getMatch(), line);
 		}
+		
 		ArrayList<Match> sorted_matches = new ArrayList<Match>(matches.keySet());
 		Collections.sort(sorted_matches);
 		
@@ -208,7 +229,7 @@
 
 	public void setViewAnnotation(AnnotationType type) {
 		viewAnnotation = type;
-		concordance.resetLines();
+		//concordance.resetLines();
 	}
 	
 	/**
Index: TXM/trunk/org.txm.analec.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.analec.rcp/plugin.xml	(revision 3533)
+++ TXM/trunk/org.txm.analec.rcp/plugin.xml	(revision 3534)
@@ -232,7 +232,7 @@
          </command>
       </menuContribution>
       <menuContribution
-            locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
+            locationURI="menu:menu.file.import.corpus?before=menu.file.import.separator.software">
          <command
                commandId="org.txm.annotation.urs.commands.ImportGlozzCorpus"
                style="push">
Index: TXM/trunk/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java
===================================================================
--- TXM/trunk/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 3533)
+++ TXM/trunk/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 3534)
@@ -1128,8 +1128,8 @@
 	
 	@Override
 	public LexicalTable getParent() {
-		
-		return (LexicalTable) this.parent;
+		if (parent instanceof LexicalTable) return (LexicalTable) this.parent;
+		return null;
 	}
 	
 	// // FIXME: SJ: fix to save the eigenvalues when the CA is saved
Index: TXM/trunk/org.txm.conllu.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.conllu.rcp/plugin.xml	(revision 3533)
+++ TXM/trunk/org.txm.conllu.rcp/plugin.xml	(revision 3534)
@@ -25,7 +25,7 @@
    <extension
          point="org.eclipse.ui.menus">
       <menuContribution
-            locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
+            locationURI="menu:menu.file.import.corpus?before=menu.file.import.separator.software">
          <command
                commandId="org.txm.rcp.handlers.scripts.ExecuteImportScript"
                icon="icons/functions/UD.png"
Index: TXM/trunk/org.txm.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.rcp/plugin.xml	(revision 3533)
+++ TXM/trunk/org.txm.rcp/plugin.xml	(revision 3534)
@@ -351,7 +351,11 @@
                   icon="platform:/plugin/org.eclipse.ui/icons/full/etool16/import_wiz.png"
                   id="menu.file.import"
                   label="%menu.label.0">
-               <command
+               <menu
+                     icon="icons/objects/corpus.png"
+                     id="menu.file.import.corpus"
+                     label="Corpus">
+                <command
                      commandId="org.txm.rcp.commands.ImportClipboardText"
                      label="%command.label.60"
                      style="push"
@@ -523,6 +527,7 @@
                      name="menu.file.import.separator.end"
                      visible="true">
                </separator>
+               </menu>
                <menu
                      id="menu.file.import.properties"
                      label="%menu.label.17">
@@ -542,6 +547,20 @@
                      id="menu.file.import.annotations"
                      label="%menu.label.15">
                </menu>
+               <command
+                     commandId="org.txm.rcp.handlers.export.ImportResultParameters"
+                     icon="icons/functions/import_parameters.png"
+                     label="Results..."
+                     style="push">
+                  <visibleWhen
+                        checkEnabled="false">
+                     <and>
+                        <reference
+                              definitionId="OneTXMResultSelected">
+                        </reference>
+                     </and>
+                  </visibleWhen>
+               </command>
             </menu>
             <menu
                   id="menu.file.load"
@@ -630,6 +649,25 @@
                      </and>
                   </visibleWhen>
                </command>
+               <command
+                     commandId="org.txm.rcp.handlers.export.ExportResultParameters"
+                     icon="icons/functions/export_parameters.png"
+                     label="Results..."
+                     style="push">
+                  <visibleWhen
+                        checkEnabled="false">
+                     <and>
+                        <reference
+                              definitionId="OneTXMResultSelected">
+                        </reference>
+                        <not>
+                           <reference
+                                 definitionId="OneMainCorpusSelected">
+                           </reference>
+                        </not>
+                     </and>
+                  </visibleWhen>
+               </command>
             </menu>
             <separator
                   name="menu.file.separator.file"
@@ -1489,6 +1527,20 @@
          <toolbar
                id="org.txm.rcp.toolbars.result">
             <command
+                  commandId="org.txm.rcp.handlers.export.ImportResultParameters"
+                  icon="icons/functions/import_parameters.png"
+                  label="Import results"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
+            <command
                   commandId="org.txm.rcp.commands.function.ExportResult"
                   icon="icons/functions/export_data.png"
                   label="%command.label.51"
@@ -1512,6 +1564,25 @@
                   </and>
                </visibleWhen>
             </command>
+            <command
+                  commandId="org.txm.rcp.handlers.export.ExportResultParameters"
+                  icon="icons/functions/export_parameters.png"
+                  label="Export results..."
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                     <not>
+                        <reference
+                              definitionId="OneMainCorpusSelected">
+                        </reference>
+                     </not>
+                  </and>
+               </visibleWhen>
+            </command>
          </toolbar>
          <separator
                name="org.txm.rcp.toolbar.separator1"
@@ -2055,7 +2126,40 @@
                         </and>
                      </visibleWhen>
                   </command>
+                  <command
+                        commandId="org.txm.rcp.handlers.export.ExportResultParameters"
+                        icon="icons/functions/export_parameters.png"
+                        label="Results..."
+                        style="push">
+                     <visibleWhen
+                           checkEnabled="false">
+                        <and>
+                           <reference
+                                 definitionId="OneTXMResultSelected">
+                           </reference>
+                           <not>
+                              <reference
+                                    definitionId="OneMainCorpusSelected">
+                              </reference>
+                           </not>
+                        </and>
+                     </visibleWhen>
+                  </command>
                </menu>
+            <command
+                  commandId="org.txm.rcp.handlers.export.ImportResultParameters"
+                  icon="icons/functions/import_parameters.png"
+                  label="Import results"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <and>
+                     <reference
+                           definitionId="OneTXMResultSelected">
+                     </reference>
+                  </and>
+               </visibleWhen>
+            </command>
             
             <separator
                   name="org.txm.rcp.corporaview.corpus"
@@ -2117,17 +2221,6 @@
                   </and>
                </visibleWhen>
             </command>
-            <command
-                  commandId="org.txm.rcp.commands.function.RenameResult"
-                  label="%command.label.26"
-                  style="push">
-               <visibleWhen
-                     checkEnabled="false">
-                  <reference
-                        definitionId="OneTXMResultSelected">
-                  </reference>
-               </visibleWhen>
-            </command>
             
             <command
                   commandId="org.txm.rcp.handlers.results.DeleteObject"
@@ -2143,6 +2236,17 @@
                </visibleWhen>
             </command>
             <command
+                  commandId="org.txm.rcp.commands.function.RenameResult"
+                  label="%command.label.26"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <reference
+                        definitionId="OneTXMResultSelected">
+                  </reference>
+               </visibleWhen>
+            </command>
+            <command
                   commandId="org.txm.rcp.handlers.results.CloneTXMResult"
                   label="%command.label.372"
                   style="push">
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 3533)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResultParameters.java	(revision 3534)
@@ -29,6 +29,8 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Calendar;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
@@ -43,6 +45,7 @@
 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.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMResult;
@@ -52,6 +55,8 @@
 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
 /**
@@ -72,46 +77,32 @@
 	@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.SAVE);
 		
-		String extensions[] = { "*.parameters" }; //$NON-NLS-1$
+		String extensions[] = { "*.txmresults" }; //$NON-NLS-1$
 		dialog.setFilterExtensions(extensions);
-		dialog.setFileName(((TXMResult) s).getValidFileName() + ".parameters"); //$NON-NLS-1$
+		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))))
+			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;
-			}
 			
+			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
@@ -119,48 +110,51 @@
 					
 					// convert the monitor into sub-monitor
 					SubMonitor subMonitor = SubMonitor.convert(monitor, TXMUIMessages.exporting, 100);
+					this.runInit(subMonitor);
 					
 					try {
 						
-						this.runInit(subMonitor);
-						
-						TXMResult r = (TXMResult) s;
-						if (r.isAltered()) {
-							System.out.println(TXMUIMessages.ExportResultParameters_WarningOnlyTheParametersAreExportedManualChangesAreNotTransfered);
+						ArrayList<TXMResult> toExport = new ArrayList<TXMResult>();
+						for (Object o : selection.toList()) {
+							if (!(o instanceof TXMResult)) continue;
+							TXMResult r = (TXMResult)o;
+							toExport.add(r);
+							TXMResult parent = ((TXMResult)o).getParent();
+							
+							while(parent != null && !parent.isVisible()) { // insivisble parent must be added to the exported results
+								
+								toExport.add(parent);
+								parent = parent.getParent();
+							}
 						}
-						else {
-							r.compute(subMonitor); // refresh result
-						}
-						if (r.toParametersFile(outfile)) {
-							System.out.println(NLS.bind(TXMUIMessages.ExportResultParameters_ParametersExportedToTheP0File, outfile));
-						}
 						
-						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());
-									}
-								});
+						ArrayList<File> files = new ArrayList<>();
+						for (TXMResult r : toExport) {
+							
+							if (r.isAltered()) {
+								System.out.println(TXMUIMessages.ExportResultParameters_WarningOnlyTheParametersAreExportedManualChangesAreNotTransfered);
 							}
+							else {
+								r.compute(subMonitor); // refresh result
+							}
 							
-							System.out.println(NLS.bind("", outfile.getAbsolutePath())); //$NON-NLS-1$
+							File outfile = new File(zipfiledir, (TXMPreferences.getNode(r.getParametersNodePath()).name()+".parameters"));
+							if (r.toParametersFile(outfile)) {
+								files.add(outfile);
+							}
 						}
-						else {
-							System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, outfile.getAbsolutePath()));
-						}
+						
+						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) {
-						if (s instanceof TXMResult) {
-							((TXMResult) s).clean();
-						}
+						
 						return Status.CANCEL_STATUS;
 					}
 					catch (Exception e) {
-						System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
+						System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, selection.toList(), e));
 						org.txm.utils.logger.Log.printStackTrace(e);
 						return Status.CANCEL_STATUS;
 					}
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 3533)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameters.java	(revision 3534)
@@ -27,14 +27,25 @@
 //
 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;
@@ -42,18 +53,21 @@
 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.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.editors.TXMEditor;
-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.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
 /**
@@ -83,70 +97,169 @@
 		// String txmhome = Toolbox.getTxmHomePath();
 		FileDialog dialog = new FileDialog(shell, SWT.OPEN);
 		
-		String extensions[] = { "*.parameters" }; //$NON-NLS-1$
+		String extensions[] = { "*.txmresults" }; //$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) {
+		try {
+			if (dialog.open() != null) {
+				StatusLine.setMessage(TXMUIMessages.exportingResults);
+				String filepath = dialog.getFilterPath()+ "/" + dialog.getFileName(); //$NON-NLS-1$
 				
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					try {
-						this.runInit(monitor);
-						monitor.beginTask(TXMUIMessages.exporting, 100);
+				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) {
 						
-						TXMResult r = (TXMResult) s;
-						if (r.importParameters(outfile)) {
-							CorporaView.refreshObject(r);
-							System.out.println(NLS.bind("Parameter imported from the {0} file.", outfile)); //$NON-NLS-1$
-							SWTEditorsUtils.refreshEditors(r);
+						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;
+							}
+							
 						}
-					}
-					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();
+						
+						this.syncExec(new Runnable() {
+							
+							@Override
+							public void run() {
+								
+								CorporaView.refresh();
+							}
+						});
+						return Status.OK_STATUS;
 					}
-					return Status.OK_STATUS;
-				}
-			};
+				};
+				
+				jobhandler.startJob();
+			}
 			
-			jobhandler.startJob();
 		}
+		catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+			return null;
+		}
 		return null;
 	}
 }
Index: TXM/trunk/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java
===================================================================
--- TXM/trunk/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java	(revision 3533)
+++ TXM/trunk/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java	(revision 3534)
@@ -189,7 +189,11 @@
 		
 		editor.getTopToolbar().setVisible(GROUP_NAME, true);
 		annotationAreas.add(aa);
-		editor.refresh(false); // refresh the concordance display
+		
+		aa.notifyStartOfCompute();
+		aa.notifyStartOfRefresh();
+		
+		//editor.refresh(false); // refresh the concordance display
 	}
 	
 	/**
