Index: trunk/org.txm.texts.rcp/src/org/txm/texts/rcp/TextsViewEditor.java
===================================================================
--- trunk/org.txm.texts.rcp/src/org/txm/texts/rcp/TextsViewEditor.java	(revision 3440)
+++ trunk/org.txm.texts.rcp/src/org/txm/texts/rcp/TextsViewEditor.java	(revision 3441)
@@ -18,6 +18,7 @@
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.TableColumn;
 import org.txm.core.results.Parameter;
 import org.txm.edition.rcp.handlers.OpenEdition;
@@ -36,6 +37,9 @@
 	@Parameter(key = "columns")
 	PropertiesSelector<StructuralUnitProperty> propertiesSelector;
 	
+	@Parameter(key = "negativeFilters")
+	org.eclipse.swt.widgets.Text negativeFiltersText;
+	
 	TableViewer viewer;
 //	HashMap<String, TableViewerColumn> columns = new HashMap<String, TableViewerColumn>();
 	
@@ -44,6 +48,8 @@
 		
 		this.getParent().setLayout(new GridLayout(1, true));
 		
+		this.getMainParametersComposite().getLayout().numColumns = 10;
+		
 		propertiesSelector = new PropertiesSelector<>(this.getMainParametersComposite());
 		ArrayList<StructuralUnitProperty> properties = new ArrayList<>(getResult().getCorpus().getStructuralUnitProperties("text"));
 		for (int i = 0 ; i < properties.size() ; i++) {
@@ -56,6 +62,14 @@
 		ComputeSelectionListener computeSelectionListener = new ComputeSelectionListener(this);
 		propertiesSelector.addSelectionListener(computeSelectionListener);
 		
+		new Label(this.getMainParametersComposite(), SWT.NONE).setText("Negative filters (p1=v1;p2=v2)");
+		
+		negativeFiltersText = new org.eclipse.swt.widgets.Text(this.getMainParametersComposite(), SWT.BORDER);
+		negativeFiltersText.addSelectionListener(computeSelectionListener);
+		GridData gdata = new GridData(GridData.FILL, GridData.CENTER, true, false);
+		gdata.minimumWidth = 300;
+		negativeFiltersText.setLayoutData(gdata);
+		
 		viewer = new TableViewer(this.getResultArea(), SWT.NONE);
 		viewer.getTable().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 		viewer.getTable().setHeaderVisible(true);
@@ -159,7 +173,13 @@
 			
 		}
 		//
-		viewer.setInput(getResult().getCorpus().getProject().getTexts());
+		ArrayList<Text> texts = new ArrayList<>();
+		for (Text text : getResult().getCorpus().getProject().getTexts()) {
+			if (this.getResult().getLines().containsKey(text.getName())) {
+				texts.add(text);
+			}
+		}
+		viewer.setInput(texts);
 		
 		viewer.addDoubleClickListener(new IDoubleClickListener() {
 			
Index: trunk/org.txm.texts.core/src/org/txm/texts/core/TextsView.java
===================================================================
--- trunk/org.txm.texts.core/src/org/txm/texts/core/TextsView.java	(revision 3440)
+++ trunk/org.txm.texts.core/src/org/txm/texts/core/TextsView.java	(revision 3441)
@@ -3,6 +3,7 @@
 import java.io.File;
 import java.io.PrintWriter;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.List;
 
@@ -23,12 +24,18 @@
 	@Parameter(key = "columns")
 	ArrayList<StructuralUnitProperty> pColumns;
 	
+//	@Parameter(key = "positiveFilters")
+//	ArrayList<String> positiveFilters;
+	
+	@Parameter(key = "negativeFilters")
+	String negativeFilters;
+	
 	private LinkedHashMap<String, ArrayList<String>> result;
 	
 	public MainCorpus getCorpus() {
 		return (MainCorpus)parent;
 	}
-
+	
 	public TextsView(MainCorpus corpus) {
 		
 		super(corpus);
@@ -40,14 +47,16 @@
 	}
 	
 	
-
+	
 	@Override
 	public boolean saveParameters() throws Exception {
 		
 		this.saveParameter("columns", StringUtils.join(pColumns, "\t"));
+//		this.saveParameter("positiveFilters", StringUtils.join(positiveFilters, "\t"));
+		this.saveParameter("negativeFilters", negativeFilters);
 		return true;
 	}
-
+	
 	@Override
 	public boolean loadParameters() throws Exception {
 		
@@ -65,14 +74,26 @@
 			this.pColumns = new ArrayList(Property.stringToProperties(getCorpus(), v));
 		}
 		
+		v = this.getStringParameterValue("negativeFilters").toString();
+		if (v.contains("=")) {
+			this.negativeFilters = v;
+		} else {
+			this.negativeFilters = "";
+		}
+		
+//		v = this.getStringParameterValue("positiveFilters").toString();
+//		if (v.contains("=")) {
+//			this.positiveFilters = new ArrayList<>(Arrays.asList(v.split("\t")));
+//		} else {
+//			this.positiveFilters = new ArrayList<>();
+//		}
+		
 		return pColumns != null;
 	}
-
+	
 	@Override
 	public boolean setParameters(TXMParameters parameters) throws Exception {
 		
-		
-		
 		if (parameters.get("columns") != null) {
 			
 			Object o = parameters.get("columns");
@@ -90,36 +111,36 @@
 		}
 		return false;
 	}
-
+	
 	@Override
 	public String getName() {
 		
 		return "Texts ("+pColumns.toString()+")";
 	}
-
+	
 	@Override
 	public String getSimpleName() {
 		
 		return "Texts";
 	}
-
+	
 	@Override
 	public String getDetails() {
 		
 		return getName();
 	}
-
+	
 	@Override
 	public void clean() {
 		
 	}
-
+	
 	@Override
 	public boolean canCompute() throws Exception {
-
+		
 		return pColumns != null;
 	}
-
+	
 	@Override
 	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
 		
@@ -128,6 +149,7 @@
 		// preset arrays
 		String[] texts = getCorpus().getCorpusTextIdsList();
 		for (String t : texts) {
+			
 			ArrayList<String> values = new ArrayList<String>();
 			result.put(t, values);
 			
@@ -152,9 +174,32 @@
 			}
 		}
 		
+		if (negativeFilters.length() > 0 && pColumns.size() > 0) {
+			
+			ArrayList<String> columnNames = new ArrayList<>(pColumns.size());
+			for (StructuralUnitProperty p : pColumns) columnNames.add(p.getName());
+			
+			String[] filters = negativeFilters.split(";");
+			
+			ArrayList<String> keys = new ArrayList<>(result.keySet());
+			for (String text : keys) {
+				
+				for (String negativeFilter : filters) {
+					String[] split = negativeFilter.split("=", 2);
+					if (split.length == 2 
+							&& columnNames.contains(split[0]) 
+							&& result.get(text).get(columnNames.indexOf(split[0])).matches(split[1])) {
+						// remove this line
+						result.remove(text);
+						break;
+					}
+				}
+			}
+		}
+		
 		return true;
 	}
-
+	
 	@Override
 	protected boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
 		
@@ -168,7 +213,7 @@
 		writer.close();
 		return false;
 	}
-
+	
 	@Override
 	public String getResultType() {
 		return "TextView";
@@ -177,7 +222,7 @@
 	public LinkedHashMap<String, ArrayList<String>> getLines() {
 		return result;
 	}
-
+	
 	public List<StructuralUnitProperty> getColumns() {
 		
 		return pColumns;
Index: TXM/trunk/org.txm.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.rcp/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.rcp/plugin.xml	(revision 3441)
@@ -352,7 +352,7 @@
                   id="menu.file.import"
                   label="%menu.label.0">
                <command
-                     commandId="org.txm.rcp.commands.ImportSelectedText"
+                     commandId="org.txm.rcp.commands.ImportClipboardText"
                      label="%command.label.60"
                      style="push"
                      tooltip="%command.tooltip.27">
@@ -363,7 +363,7 @@
                      style="push"
                      tooltip="%command.tooltip.45">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="txt/txtLoader.groovy">
                   </parameter>
                </command>
@@ -373,7 +373,7 @@
                      style="push"
                      tooltip="%command.tooltip.66">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="doc/docLoader.groovy">
                   </parameter>
                </command>
@@ -387,7 +387,7 @@
                      style="push"
                      tooltip="%command.tooltip.44">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="xml/xmlLoader.groovy">
                   </parameter>
                </command>
@@ -397,7 +397,7 @@
                      style="push"
                      tooltip="%command.tooltip.88">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="xtz/xtzLoader.groovy">
                   </parameter>
                </command>
@@ -407,7 +407,7 @@
                      style="push"
                      tooltip="%command.tooltip.8">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="bfm/bfmLoader.groovy">
                   </parameter>
                </command>
@@ -417,7 +417,7 @@
                      style="push"
                      tooltip="%command.tooltip.9">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="frantext/frantextLoader.groovy">
                   </parameter>
                </command>
@@ -427,7 +427,7 @@
                      style="push"
                      tooltip="%command.tooltip.11">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="xmltxm/xmltxmLoader.groovy">
                   </parameter>
                </command>
@@ -437,7 +437,7 @@
                      style="push"
                      tooltip="%command.tooltip.5">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="transcriber/transcriberLoader.groovy">
                   </parameter>
                </command>
@@ -447,7 +447,7 @@
                      style="push"
                      tooltip="%command.tooltip.1">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="factiva/factivaLoader.groovy">
                   </parameter>
                </command>
@@ -457,7 +457,7 @@
                      style="push"
                      tooltip="%command.tooltip.24">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="tmx/tmxLoader.groovy">
                   </parameter>
                </command>
@@ -471,7 +471,7 @@
                      style="push"
                      tooltip="%command.tooltip.22">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="factiva/factivamailLoader.groovy">
                   </parameter>
                </command>
@@ -481,7 +481,7 @@
                      style="push"
                      tooltip="%command.tooltip.28">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="discours/discoursLoader.groovy">
                   </parameter>
                </command>
@@ -491,7 +491,7 @@
                      style="push"
                      tooltip="%command.tooltip.30">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="alceste/alcesteLoader.groovy">
                   </parameter>
                </command>
@@ -501,7 +501,7 @@
                      style="push"
                      tooltip="%command.tooltip.29">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="hyperbase/hyperbaseLoader.groovy">
                   </parameter>
                </command>
@@ -515,7 +515,7 @@
                      style="push"
                      tooltip="%command.tooltip.25">
                   <parameter
-                        name="org.txm.rcp.commands.commandParameter3"
+                        name="org.txm.rcp.commands.importscript"
                         value="cqp/cqpLoader.groovy">
                   </parameter>
                </command>
@@ -1085,8 +1085,7 @@
                   commandId="org.txm.rcp.commands.workspace.UpdateCorpus"
                   icon="icons/functions/update.png"
                   label="%command.name.98"
-                  style="push"
-                  tooltip="%command.tooltip.6">
+                  style="push">
                <visibleWhen
                      checkEnabled="false">
                   <or>
@@ -1097,25 +1096,6 @@
                </visibleWhen>
             </command>
             <command
-                  commandId="org.txm.rcp.commands.workspace.UpdateCorpus"
-                  icon="icons/functions/update.png"
-                  label="%command.name.981"
-                  style="push"
-                  tooltip="%command.tooltip.46">
-               <visibleWhen
-                     checkEnabled="false">
-                  <or>
-                     <reference
-                           definitionId="OneMainCorpusSelected">
-                     </reference>
-                  </or>
-               </visibleWhen>
-               <parameter
-                     name="org.txm.rcp.commands.workspace.UpdateCorpus.force"
-                     value="true">
-               </parameter>
-            </command>
-            <command
                   commandId="org.txm.rcp.handlers.results.DeleteObject"
                   icon="icons/functions/Delete.png"
                   style="push">
@@ -2473,10 +2453,20 @@
             id="org.txm.rcp.handlers.scripts.ExecuteImportScript"
             name="%command.name.22">
          <commandParameter
-               id="org.txm.rcp.commands.commandParameter3"
+               id="org.txm.rcp.commands.importscript"
                name="%commandParameter.name.1"
                optional="true">
          </commandParameter>
+         <commandParameter
+               id="org.txm.rcp.commands.importupdatemode"
+               name="Update mode true or false"
+               optional="true">
+         </commandParameter>
+         <commandParameter
+               id="org.txm.rcp.commands.usecorporaselection"
+               name="Update mode true or false"
+               optional="true">
+         </commandParameter>
       </command>
       
       <command
@@ -2503,8 +2493,8 @@
       </command>
       
       <command
-            defaultHandler="org.txm.rcp.commands.ImportSelectedText"
-            id="org.txm.rcp.commands.ImportSelectedText"
+            defaultHandler="org.txm.rcp.commands.ImportClipboardText"
+            id="org.txm.rcp.commands.ImportClipboardText"
             name="%command.name.28">
       </command>
       <command
@@ -2523,6 +2513,16 @@
                name="%commandParameter.name.2"
                optional="false">
          </commandParameter>
+         <commandParameter
+               id="org.txm.rcp.commands.importupdatemode"
+               name="Update mode true or false"
+               optional="false">
+         </commandParameter>
+         <commandParameter
+               id="org.txm.rcp.commands.usecorporaselection"
+               name="Update mode true or false"
+               optional="true">
+         </commandParameter>
       </command>
       <command
             defaultHandler="org.txm.rcp.commands.workspace.ConvertCorpus"
Index: TXM/trunk/org.txm.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- TXM/trunk/org.txm.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3440)
+++ TXM/trunk/org.txm.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3441)
@@ -138,7 +138,7 @@
 command.label.26        = Renommer...
 command.label.27        = Supprimer
 command.label.28        = S\u00E9lectionner tout
-command.label.29        = Sauver sous...
+command.label.29        = Enregistrer sous...
 command.label.3         = XML Transcriber + CSV
 command.label.30        = Encodage des caract\u00E8res
 command.label.31        = Nils
@@ -292,7 +292,7 @@
 command.name.64         = Changer le r\u00E9pertoire de travail...
 command.name.65         = Corpus au format XML-TXM (.xml)...
 command.name.66         = Ex\u00E9cuter un fichier Groovy
-command.name.67         = Sauver Sous
+command.name.67         = Enregistrer Sous
 command.name.68         = Supprimer fichier
 command.name.69         = Copier fichier
 command.name.7          = Cloner le r\u00E9sultat
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java	(revision 3441)
@@ -86,20 +86,34 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		String filename = null, filepath = null;
-		if (event.getParameters().containsKey("org.txm.rcp.commands.commandParameter3")) {
-			filename = event.getParameter("org.txm.rcp.commands.commandParameter3"); //$NON-NLS-1$
+		File script = null;
+		Boolean updateMode = false;
+		if (event.getParameters().containsKey("org.txm.rcp.commands.importscript")) {
+			filename = event.getParameter("org.txm.rcp.commands.importscript"); //$NON-NLS-1$
 			filepath = "scripts/groovy/user/org/txm/scripts/importer/" + filename; //$NON-NLS-1$
 		}
+		else if (event.getParameters().containsKey("org.txm.rcp.commands.usecorporaselection")) {
+			boolean useCorporaSelection = "true".equals(event.getParameter("org.txm.rcp.commands.usecorporaselection")); //$NON-NLS-1$
+			//filepath = "scripts/groovy/user/org/txm/scripts/importer/" + filename; //$NON-NLS-1$
+		} 
 		else {
 			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
 			FileDialog dialog = new FileDialog(shell, SWT.SAVE);
 			dialog.setFilterPath(Toolbox.getTxmHomePath() + "/scripts/groovy/user/org/txm/scripts/importer");
 			filepath = dialog.open();
+			
+			if (filepath == null) {
+				Log.warning("No Groovy entry point script selected. Aborted.);");
+				return null;
+			}
+			script = new File(filepath);
 		}
 		
-		if (filepath == null) return null;
+		if (event.getParameters().containsKey("org.txm.rcp.commands.importupdatemode")) {
+			updateMode = "true".equals(event.getParameter("org.txm.rcp.commands.importupdatemode"));
+		}
 		
-		OpenImportForm.openfile(filepath);
+		OpenImportForm.open(script, updateMode);
 		return null;
 	}
 	
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java	(revision 3441)
@@ -57,6 +57,8 @@
 	/** The txtseparators. */
 	private ComboFieldEditor txtseparators;
 	
+	private BooleanFieldEditor askdefaultlang;
+	
 	private StringFieldEditor defaultlang;
 	
 	private StringFieldEditor empty_code;
@@ -135,9 +137,11 @@
 		rlayout.marginHeight = 5;
 		langGroup.setLayout(rlayout);
 		
-		defaultlang = new StringFieldEditor(TBXPreferences.IMPORT_DEFAULT_LANG, TXMUIMessages.defaultLanguage, langGroup);
+		defaultlang = new StringFieldEditor(TBXPreferences.CLIPBOARD_IMPORT_DEFAULT_LANG, TXMUIMessages.defaultLanguage, langGroup);
 		defaultlang.setEmptyStringAllowed(false);
 		
+		askdefaultlang = new BooleanFieldEditor(TBXPreferences.CLIPBOARD_IMPORT_ASK_LANG, "Ask lang when importing from clipboard", langGroup);
+		
 		Label l = new Label(langGroup, SWT.NONE);
 		l.setText(TXMUIMessages.noteColonUseValueToGuess);
 		GridData ldata = new GridData(SWT.FILL, SWT.FILL, true, false);
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/RCPPreferences.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/RCPPreferences.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/RCPPreferences.java	(revision 3441)
@@ -38,6 +38,8 @@
 	 * To auto compute result and refresh editor when a form computing parameter is modified.
 	 */
 	public static final String AUTO_UPDATE_EDITOR = "auto_update_editor"; //$NON-NLS-1$
+	
+	public static final String AUTO_UPDATE_SUBRESULTS = "auto_update_subresults"; //$NON-NLS-1$
 	// public static final String AUTO_COMPUTE_ON_EDITOR_OPEN = "auto_compute_editor"; //$NON-NLS-1$
 	
 	public static final String SHOW_SEVERE_DIALOG = "show_severe_dialog";
@@ -88,6 +90,7 @@
 		preferences.put(UPDATE_LEVEL, "STABLE"); //$NON-NLS-1$
 		
 		preferences.putBoolean(AUTO_UPDATE_EDITOR, false);
+		preferences.putBoolean(AUTO_UPDATE_SUBRESULTS, false);
 		// preferences.putBoolean(AUTO_COMPUTE_ON_EDITOR_OPEN, true);
 		preferences.putBoolean(SHOW_SEVERE_DIALOG, false);
 		preferences.putBoolean(USER_ALERT_DELETE, false);
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java	(revision 3441)
@@ -58,6 +58,9 @@
 		this.addField(new BooleanFieldEditor(RCPPreferences.AUTO_UPDATE_EDITOR, TXMUIMessages.automaticRecomputingWhenChangingAParameter, BooleanFieldEditor.SEPARATE_LABEL, this
 				.getFieldEditorParent()));
 		
+		// Auto compute the result when a parameter changes
+		this.addField(new BooleanFieldEditor(RCPPreferences.AUTO_UPDATE_SUBRESULTS, "Automatically update sub-results", BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
+		
 		// this.addField(new BooleanFieldEditor(RCPPreferences.AUTO_COMPUTE_ON_EDITOR_OPEN, "Compute when opening its window", BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
 		
 		// Auto save each result after computing and auto load them at startup
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties	(revision 3441)
@@ -85,7 +85,7 @@
 
 allCriteria = Tous les critères ensembles (&&)
 
-alwaysSaveBeforeLaunching = Toujours sauvegarder avant de lancer
+alwaysSaveBeforeLaunching = Toujours enregistrer avant de lancer
 
 ampContextsDisplayOptions = Options d'affichage des &contextes
 
@@ -149,7 +149,7 @@
 
 cannotReadTheFileP0 = ** Impossible de lire le fichier {0}.
 
-cannotSaveImportConfigurationNoSourceFolderSelected = ** Impossible de sauvegarder les paramètres d'import : pas de dossier source sélectionné.
+cannotSaveImportConfigurationNoSourceFolderSelected = ** Impossible d'enregistrer les paramètres d'import : pas de dossier source sélectionné.
 
 cannotStartImportConfigurationNoSourceFolderSelected = ** Impossible de commencer l'import : pas de dossier source sélectionné.
 
@@ -231,7 +231,7 @@
 
 copiedLinesColon = Lignes copiées : \n{0}
 
-corporaBackupedColonP0 = Corpus sauvegardés dans : {0}.
+corporaBackupedColonP0 = Corpus enregistré dans : {0}.
 
 corporaOfPreviousTXMP0 = Corpus de la version précédente de TXM {0}
 
@@ -249,7 +249,7 @@
 
 corpusNameOnlyCapsAndNoDigitAtBeginning = Nom du corpus* (majuscules, pas de chiffre au début)
 
-couldNotCreateBackupDirectoryColon = ** Échec : le dossier de sauvegarde des corpus {0} n''a pas pu être créé.
+couldNotCreateBackupDirectoryColon = ** Échec : le dossier d'enregistrement des corpus {0} n''a pas pu être créé.
 
 couldNotFindDirectoryColonP0 = ** Répertoire {0} introuvable
 
@@ -331,7 +331,7 @@
 
 doneTheCreatedBinaryFileIsP0 = Terminé, le fichier binaire créé est {0}
 
-dontSaveAndRun = Ne pas sauver et lancer
+dontSaveAndRun = Ne pas enregistrer et lancer
 
 downloading = Téléchargement en cours...
 
@@ -349,7 +349,7 @@
 
 elisionCharacters = Caractères d'élision
 
-enableAutomaticSaveOfAllResultsPersistence = Sauvegarder tous les résultats par défaut (persistance)
+enableAutomaticSaveOfAllResultsPersistence = Enregistrer tous les résultats par défaut (persistance)
 
 endOfColumnMerge = Fin de la fusion des colonnes.
 
@@ -459,7 +459,7 @@
 
 extractingBinaryCorpus = Extraction du corpus binaire
 
-failedToBackupExistingCorporaColon = ** Impossible de sauvegarder les corpus existants : {0}.
+failedToBackupExistingCorporaColon = ** Impossible d'enregistrer les corpus existants : {0}.
 
 failedToCancel = Impossible d'annuler  
 
@@ -491,9 +491,9 @@
 
 failedToRename = ** Échec du renommage
 
-failedToSaveAs = ** Échec de la sauvegarde du fichier {0} (erreur : {1}).
+failedToSaveAs = ** Échec de l'enregistrement du fichier {0} (erreur : {1}).
 
-failedToSavePreferencesColonP0 = ** Échec de la sauvegarde des préférences : {0}.
+failedToSavePreferencesColonP0 = ** Échec de l'enregistrement des préférences : {0}.
 
 fileColon = Fichier :
 
@@ -853,7 +853,7 @@
 
 sampleCorporaOfCurrentTXMP0 = Corpus exemples de la version courante de TXM {0}
 
-saveAndRun = Sauver et lancer
+saveAndRun = Enregistrer et lancer
 
 saveBeforeExecution = Enregistrer avant l'exécution ?
 
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportFormEditor.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportFormEditor.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportFormEditor.java	(revision 3441)
@@ -42,8 +42,11 @@
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 import org.txm.Toolbox;
+import org.txm.objects.CorpusBuild;
+import org.txm.objects.Project;
 import org.txm.rcp.editors.input.ImportFormEditorInput;
 import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.views.corpora.CorporaView;
 
 /**
  * display&edit the import parameters 
@@ -54,8 +57,8 @@
 	/** The Constant ID. */
 	public static final String ID = "org.txm.rcp.editors.imports.ImportFormEditor"; //$NON-NLS-1$
 
-	/** The groovyscript. */
-	private File groovyscript;
+	/** The import Name to run. */
+	private String importName;
 
 	/** The toolkit. */
 	private FormToolkit toolkit;
@@ -70,7 +73,11 @@
 	MetadataPage meta;
 
 	private ImportFormEditorInput finput;
+
+	private Boolean updateMode;
 	
+	protected Project project;
+	
 	/**
 	 * Instantiates a new import form editor.
 	 */
@@ -129,16 +136,47 @@
 		setInput(input);
 		finput = ((ImportFormEditorInput) input);
 		String txmhome = Toolbox.getTxmHomePath();
+		
 		File f = finput.getGroovyFile();
-		String filepath = f.getPath();
-		this.setGroovyscript(new File(txmhome, filepath));
+		if (f != null) {
+			String filepath = f.getPath();
+			String importName = ImportModuleCustomization.getName(new File(txmhome, filepath).getName());
+			this.setImportName(importName);
+		} else { // use the corpora view selection
+			
+			Object o = CorporaView.getFirstSelectedObject();
+			
+			if (o instanceof CorpusBuild) {
+				o = ((CorpusBuild)o).getProject();
+			}
+			
+			if (o instanceof Project) {
+				Project p = (Project)o;
+				this.setImportName(p.getImportModuleName());
+				this.project = p;
+			}
+		}
 		
+		this.setUpdateMode(finput.getUpdateMode());
+		
+		
+		
 		//ExecuteImportScript.getImportScriptFromToolboxPlugin(getGroovyscript()); // always update if script from Toolbox is more recent
 		
-		if (!getGroovyscript().exists()) // just a warning message
-			System.out.println(NLS.bind(TXMUIMessages.warningColonTheImportScriptIsMissingColonP0, getGroovyscript()));
+//		if (!getGroovyscript().exists()) // just a warning message
+//			System.out.println(NLS.bind(TXMUIMessages.warningColonTheImportScriptIsMissingColonP0, getGroovyscript()));
 	}
 
+	public void setUpdateMode(Boolean updateMode) {
+		
+		this.updateMode = updateMode;
+	}
+	
+	public Boolean getUpdateMode() {
+		
+		return this.updateMode;
+	}
+
 	/**
 	 * Checks if is dirty.
 	 *
@@ -191,10 +229,15 @@
 	 */
 	@Override
 	public String getPartName() {
-		if (main != null && main.getProject() != null) {
-			return TXMUIMessages.bind(TXMUIMessages.p0ImportWithP1,main.getProject().getName(),ImportModuleCustomization.getName(groovyscript.getName()));
+		
+		if (main != null && project != null) {
+			if (updateMode) {
+				return TXMUIMessages.bind("Update {0} ({1} import)", project.getName(), importName);
+			} else {
+				return TXMUIMessages.bind(TXMUIMessages.p0ImportWithP1, project.getName(), importName);
+			}
 		} else {
-			return TXMUIMessages.bind(TXMUIMessages.p0Import,ImportModuleCustomization.getName(groovyscript.getName()));
+			return TXMUIMessages.bind(TXMUIMessages.p0Import, importName);
 		}
 	}
 	
@@ -223,26 +266,11 @@
 		return meta;
 	}
 	
-	/**
-	 * Gets the groovy script.
-	 *
-	 * @return the groovy script
-	 */
-	public File getGroovyScript() {
-		return getGroovyscript();
+	public String getImportName() {
+		return importName;
 	}
-
-	/**
-	 * @return the groovyscript
-	 */
-	public File getGroovyscript() {
-		return groovyscript;
+	
+	public void setImportName(String importName) {
+		this.importName = importName;
 	}
-
-	/**
-	 * @param groovyscript the groovyscript to set
-	 */
-	public void setGroovyscript(File groovyscript) {
-		this.groovyscript = groovyscript;
-	}
 }
\ No newline at end of file
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/CommandsSection.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/CommandsSection.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/CommandsSection.java	(revision 3441)
@@ -122,7 +122,7 @@
 			}
 		}
 		else {
-			if ("txtLoader.groovy".equals(editor.getGroovyscript().getName())) {
+			if ("txt".equals(editor.getImportName())) {
 				referencePatternText.setText("text_id,l_n");
 				referencePatternProperties.setText("%s, %s");
 			} else {
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java	(revision 3441)
@@ -57,9 +57,9 @@
 	 * @param stylesave
 	 * 
 	 * @param moduleParams
-	 * @param scriptName temporary parameter to detect if import module is xtzLoader.groovy
+	 * @param importName temporary parameter to detect if import module is xtzLoader.groovy
 	 */
-	public EditionSection(ImportFormEditor editor, FormToolkit toolkit2, ScrolledForm form2, Composite parent, int style, HashMap<String, Boolean> moduleParams, String scriptName) {
+	public EditionSection(ImportFormEditor editor, FormToolkit toolkit2, ScrolledForm form2, Composite parent, int style, HashMap<String, Boolean> moduleParams, String importName) {
 		super(editor, toolkit2, form2, parent, style, "edition");
 		
 		this.section.setText(TXMUIMessages.editions);
@@ -128,7 +128,7 @@
 			pageBreakText.setLayoutData(gdata);
 		}
 		
-		if (scriptName.startsWith("xtz")) {
+		if (importName.startsWith("xtz")) {
 			
 			Label tmpLabel3 = toolkit.createLabel(sectionClient, "Note elements");
 			tmpLabel3.setToolTipText("Note elements that encodes ponctual notes");
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java	(revision 3441)
@@ -60,6 +60,7 @@
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 import org.txm.objects.Project;
 import org.txm.rcp.IImageKeys;
+import org.txm.rcp.commands.workspace.UpdateCorpus;
 import org.txm.rcp.corpuswizard.ImportWizard;
 import org.txm.rcp.editors.imports.sections.CommandsSection;
 import org.txm.rcp.editors.imports.sections.EditionSection;
@@ -76,6 +77,7 @@
 import org.txm.rcp.handlers.scripts.ExecuteImportScript;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.utils.SWTEditorsUtils;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.utils.logger.Log;
 import org.xml.sax.SAXException;
 
@@ -146,7 +148,7 @@
 	
 	TableViewer pattributesViewer;
 	
-	private Project project;
+	//private Project project;
 	
 	/**
 	 * Instantiates a new main page.
@@ -160,7 +162,7 @@
 	}
 	
 	private int createEditionsSection() {
-		editionSection = new EditionSection(editor, toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE, moduleParams, editor.getGroovyScript().getName());
+		editionSection = new EditionSection(editor, toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE, moduleParams, editor.getImportName());
 		return editionSection.getSectionSize();
 	}
 	
@@ -199,7 +201,7 @@
 		
 		createToolbar();
 		
-		String importName = editor.getGroovyscript().getName();
+		String importName = editor.getImportName();
 		moduleParams = ImportModuleCustomization.getParameters(importName);
 		
 		// CREATE THE SECTIONS
@@ -263,6 +265,10 @@
 		
 		form.layout(true);
 		managedForm.reflow(true);
+		
+		if (editor.project != null) { // the project is already set, all the select sources widget are disable
+			initializeProjectSettings();
+		}
 	}
 	
 	private int createTextualPlansSection() {
@@ -281,7 +287,8 @@
 	}
 	
 	private int createAdditionalSection() {
-		String importName = editor.getGroovyscript().getName();
+		String importName = editor.getImportName();
+		
 		if (ImportModuleCustomization.getAdditionalSection(importName) != null) {
 			Class<? extends ImportEditorSection> clazz = ImportModuleCustomization.getAdditionalSection(importName);
 			
@@ -733,26 +740,28 @@
 		
 		Label titleLabel = toolkit.createLabel(hyperlinks, "", SWT.WRAP); //$NON-NLS-1$
 		titleLabel.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.TOP));
-		titleLabel.setText(NLS.bind(TXMUIMessages.importParametersOfP0,
-				ImportModuleCustomization.getName(editor.getGroovyScript().getName())));
+		titleLabel.setText(NLS.bind(TXMUIMessages.importParametersOfP0, editor.getImportName()));
 		FontData[] fD = titleLabel.getFont().getFontData();
 		fD[0].setHeight(16);
 		titleLabel.setFont(new Font(titleLabel.getDisplay(), fD[0]));
 		
-		HyperlinkAdapter selectDirHListener = new HyperlinkAdapter() {
-			
-			@Override
-			public void linkActivated(HyperlinkEvent e) {
-				// System.out.println("Opening...");
-				selectSourceDir();
-			}
-		};
+		HyperlinkAdapter selectDirHListener = null;
+		if (editor.project == null) {
+			selectDirHListener = new HyperlinkAdapter() {
+				
+				@Override
+				public void linkActivated(HyperlinkEvent e) {
+					// System.out.println("Opening...");
+					selectSourceDir();
+				}
+			};
+		}
 		
 		HyperlinkAdapter saveHListener = new HyperlinkAdapter() {
 			
 			@Override
 			public void linkActivated(HyperlinkEvent e) {
-				if (project != null) {
+				if (editor.project != null) {
 					saveConfig();
 				}
 				else {
@@ -766,8 +775,8 @@
 			@Override
 			public void linkActivated(HyperlinkEvent e) {
 				// System.out.println("Starting...");
-				if (project != null) {
-					project.setDirty();
+				if (editor.project != null) {
+					editor.project.setDirty();
 					if (saveConfig()) {
 						startImport();
 					}
@@ -778,10 +787,12 @@
 			}
 		};
 		
-		ImageHyperlink openImportLink = toolkit.createImageHyperlink(hyperlinks, SWT.NULL);
-		openImportLink.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.MIDDLE));
-		openImportLink.setImage(IImageKeys.getImage(IImageKeys.FOLDER));
-		openImportLink.addHyperlinkListener(selectDirHListener);
+		if (editor.project == null) {
+			ImageHyperlink openImportLink = toolkit.createImageHyperlink(hyperlinks, SWT.NULL);
+			openImportLink.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.MIDDLE));
+			openImportLink.setImage(IImageKeys.getImage(IImageKeys.FOLDER));
+			openImportLink.addHyperlinkListener(selectDirHListener);
+		}
 		
 		ImageHyperlink saveImportLink = toolkit.createImageHyperlink(hyperlinks, SWT.NULL);
 		saveImportLink.setLayoutData(new TableWrapData(TableWrapData.FILL, TableWrapData.MIDDLE));
@@ -793,31 +804,34 @@
 		startImportLink.setImage(IImageKeys.getImage(IImageKeys.START));
 		startImportLink.addHyperlinkListener(startImportListener);
 		
+		int n = 1;
+		if (editor.project == null) {
+			
+			Composite line1 = toolkit.createComposite(form.getBody());
+			gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL, 2, 1);
+			gdata.colspan = 2;
+			line1.setLayoutData(gdata);
+			RowLayout hLayout = new RowLayout();
+			hLayout.center = true;
+			line1.setLayout(hLayout);
+			toolkit.createLabel(line1, ""+(n++)+".", SWT.WRAP);
+			
+			Hyperlink hyperlink1 = toolkit.createHyperlink(line1, TXMUIMessages.selectTheSourceDirectory, SWT.WRAP);
+			hyperlink1.addHyperlinkListener(selectDirHListener);
+
+			ImageHyperlink openImportLink2 = toolkit.createImageHyperlink(line1, SWT.WRAP);
+			openImportLink2.setImage(IImageKeys.getImage(IImageKeys.FOLDER));
+			openImportLink2.addHyperlinkListener(selectDirHListener);
+		}
 		
-		Composite line1 = toolkit.createComposite(form.getBody());
-		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL, 2, 1);
-		gdata.colspan = 2;
-		line1.setLayoutData(gdata);
-		RowLayout hLayout = new RowLayout();
-		hLayout.center = true;
-		line1.setLayout(hLayout);
-		toolkit.createLabel(line1, TXMUIMessages._1, SWT.WRAP);
-		
-		Hyperlink hyperlink1 = toolkit.createHyperlink(line1, TXMUIMessages.selectTheSourceDirectory, SWT.WRAP);
-		hyperlink1.addHyperlinkListener(selectDirHListener);
-		
-		ImageHyperlink openImportLink2 = toolkit.createImageHyperlink(line1, SWT.WRAP);
-		openImportLink2.setImage(IImageKeys.getImage(IImageKeys.FOLDER));
-		openImportLink2.addHyperlinkListener(selectDirHListener);
-		
 		Composite line2 = toolkit.createComposite(form.getBody());
 		gdata = new TableWrapData(TableWrapData.LEFT, TableWrapData.FILL, 2, 1);
 		gdata.colspan = 2;
 		line2.setLayoutData(gdata);
-		hLayout = new RowLayout();
+		RowLayout hLayout = new RowLayout();
 		hLayout.center = true;
 		line2.setLayout(hLayout);
-		toolkit.createLabel(line2, TXMUIMessages._2, SWT.WRAP);
+		toolkit.createLabel(line2, ""+(n++)+".", SWT.WRAP);
 		toolkit.createLabel(line2, TXMUIMessages.setImportParametersInTheSectionsBelow, SWT.WRAP);
 		
 		Composite line4 = toolkit.createComposite(form.getBody());
@@ -827,7 +841,7 @@
 		hLayout = new RowLayout();
 		hLayout.center = true;
 		line4.setLayout(hLayout);
-		toolkit.createLabel(line4, TXMUIMessages._3);
+		toolkit.createLabel(line4, ""+(n++)+".", SWT.WRAP);
 		Hyperlink hyperlink3 = toolkit.createHyperlink(line4, TXMUIMessages.startCorpusImport, SWT.WRAP);
 		hyperlink3.addHyperlinkListener(startImportListener);
 		ImageHyperlink startImportLink2 = toolkit.createImageHyperlink(line4, SWT.NULL);
@@ -851,58 +865,58 @@
 	public void loadParams() throws ParserConfigurationException, SAXException, IOException {
 		
 		Log.fine(NLS.bind(TXMUIMessages.moduleUIParametersColonP0, moduleParams));
-		this.setPartName(project.getName());
+		this.setPartName(editor.project.getName());
 		
 		if (infosSection != null && !infosSection.isDisposed()) {
 			infosSection.setEnabled(true);
-			infosSection.update(project);
+			infosSection.update(editor.project);
 		}
 		if (langSection != null && !langSection.isDisposed()) {
 			langSection.setEnabled(true);
-			langSection.update(project);
+			langSection.update(editor.project);
 		}
 		if (xsltSection != null && !xsltSection.isDisposed()) {
 			xsltSection.setEnabled(true);
-			xsltSection.update(project);
+			xsltSection.update(editor.project);
 		}
 		if (tokenizerSection != null && !tokenizerSection.isDisposed()) {
 			tokenizerSection.setEnabled(true);
-			tokenizerSection.update(project);
+			tokenizerSection.update(editor.project);
 		}
 		if (uiSection != null && !uiSection.isDisposed()) {
 			uiSection.setEnabled(true);
-			uiSection.update(project);
+			uiSection.update(editor.project);
 		}
 		if (encodingSection != null && !encodingSection.isDisposed()) {
 			encodingSection.setEnabled(true);
-			encodingSection.update(project);
+			encodingSection.update(editor.project);
 		}
 		if (editionSection != null && !editionSection.isDisposed()) {
 			editionSection.setEnabled(true);
-			editionSection.update(project);
+			editionSection.update(editor.project);
 		}
 		if (fontSection != null && !fontSection.isDisposed()) {
 			fontSection.setEnabled(true);
-			fontSection.update(project);
+			fontSection.update(editor.project);
 		}
 		if (textualPlansSection != null && !textualPlansSection.isDisposed()) {
 			textualPlansSection.setEnabled(true);
-			textualPlansSection.update(project);
+			textualPlansSection.update(editor.project);
 		}
 		
 		if (structuresSection != null && !structuresSection.isDisposed()) {
 			structuresSection.setEnabled(true);
-			structuresSection.update(project);
+			structuresSection.update(editor.project);
 		}
 		
 		if (optionsSection != null && !optionsSection.isDisposed()) {
 			optionsSection.setEnabled(true);
-			optionsSection.update(project);
+			optionsSection.update(editor.project);
 		}
 		
 		if (additionalSection != null && !additionalSection.isDisposed()) {
 			additionalSection.setEnabled(true);
-			additionalSection.update(project);
+			additionalSection.update(editor.project);
 		}
 		
 		/*
@@ -932,7 +946,7 @@
 	public boolean saveConfig() {
 		Log.info(TXMUIMessages.savingImportParameters);
 		
-		if (project == null || project.getRCPProject() == null || !project.getRCPProject().exists()) {
+		if (editor.project == null || editor.project.getRCPProject() == null || !editor.project.getRCPProject().exists()) {
 			Log.warning("The corpus has been deleted since. Please re-open the import form.");
 			this.getEditor().close(false);
 			return false;
@@ -991,45 +1005,45 @@
 		// SAVE ALL SECTIONS
 		boolean successfulSave = true;
 		if (infosSection != null && !infosSection.isDisposed()) {
-			successfulSave = successfulSave & infosSection.save(project);
+			successfulSave = successfulSave & infosSection.save(editor.project);
 		}
 		if (langSection != null && !langSection.isDisposed()) {
-			successfulSave = successfulSave & langSection.save(project);
+			successfulSave = successfulSave & langSection.save(editor.project);
 		}
 		if (xsltSection != null && !xsltSection.isDisposed()) {
-			successfulSave = successfulSave & xsltSection.save(project);
+			successfulSave = successfulSave & xsltSection.save(editor.project);
 		}
 		if (tokenizerSection != null && !tokenizerSection.isDisposed()) {
-			successfulSave = successfulSave & tokenizerSection.save(project);
+			successfulSave = successfulSave & tokenizerSection.save(editor.project);
 		}
 		if (uiSection != null && !uiSection.isDisposed()) {
-			successfulSave = successfulSave & uiSection.save(project);
+			successfulSave = successfulSave & uiSection.save(editor.project);
 		}
 		if (encodingSection != null && !encodingSection.isDisposed()) {
-			successfulSave = successfulSave & encodingSection.save(project);
+			successfulSave = successfulSave & encodingSection.save(editor.project);
 		}
 		if (editionSection != null && !editionSection.isDisposed()) {
-			successfulSave = successfulSave & editionSection.save(project);
+			successfulSave = successfulSave & editionSection.save(editor.project);
 		}
 		if (fontSection != null && !fontSection.isDisposed()) {
-			successfulSave = successfulSave & fontSection.save(project);
+			successfulSave = successfulSave & fontSection.save(editor.project);
 		}
 		if (textualPlansSection != null && !textualPlansSection.isDisposed()) {
-			successfulSave = successfulSave & textualPlansSection.save(project);
+			successfulSave = successfulSave & textualPlansSection.save(editor.project);
 		}
 		if (structuresSection != null && !structuresSection.isDisposed()) {
-			successfulSave = successfulSave & structuresSection.save(project);
+			successfulSave = successfulSave & structuresSection.save(editor.project);
 		}
 		if (optionsSection != null && !optionsSection.isDisposed()) {
-			successfulSave = successfulSave & optionsSection.save(project);
+			successfulSave = successfulSave & optionsSection.save(editor.project);
 		}
 		if (additionalSection != null && !additionalSection.isDisposed()) {
-			successfulSave = successfulSave & additionalSection.save(project);
+			successfulSave = successfulSave & additionalSection.save(editor.project);
 		}
 		
 		if (successfulSave) {
 			try {
-				project.save();
+				editor.project.save();
 				// DomUtils.save(params.root.getOwnerDocument(), paramFile);
 			}
 			catch (Exception e1) {
@@ -1052,14 +1066,20 @@
 		WizardDialog wdialog = new WizardDialog(this.getEditor().getSite().getShell(), wiz);
 		wdialog.open();
 		
-		project = wiz.getProject();
-		if (project == null) {
+		editor.project = wiz.getProject();
+		
+		initializeProjectSettings();
+	}
+	
+	private void initializeProjectSettings() {
+		
+		if (editor.project == null) {
 			// System.out.println("Error: no project created");
 			return;
 		}
-		// TODO currently the script directory is the same as the import name
-		project.setImportModuleName(editor.getGroovyScript().getParentFile().getName());
 		
+		editor.project.setImportModuleName(editor.getImportName());
+		
 		try {
 			loadParams();
 			
@@ -1073,23 +1093,27 @@
 	
 	public void startImport() {
 		// TODO: test all sections here
-		project.setDirty();
-		project.setDoUpdate(false, false);
-		project.setNeedToBuild();
-		
-		if (project.getChildren().size() > 0) {
-			boolean b = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), TXMUIMessages.warning, NLS.bind(TXMUIMessages.theP0CorpusDirectoryAlreadyExistsDoYouWantToReplaceIt, project
-					.getName()));
-			if (!b) {
-				Log.info(TXMUIMessages.abort);
-				return;
+		editor.project.setDirty();
+		if (editor.getUpdateMode()) {
+			UpdateCorpus.update((MainCorpus)(editor.project.getCorpusBuild(editor.project.getName(), MainCorpus.class)));
+		} else {
+			editor.project.setDoUpdate(false, false);
+			editor.project.setNeedToBuild();
+			
+			if (editor.project.getChildren().size() > 0) {
+				boolean b = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), TXMUIMessages.warning, NLS.bind(TXMUIMessages.theP0CorpusDirectoryAlreadyExistsDoYouWantToReplaceIt, editor.project.getName()));
+				if (!b) {
+					Log.info(TXMUIMessages.abort);
+					return;
+				}
 			}
+			
+			SWTEditorsUtils.closeEditors(editor.project, true);
+			
+			ExecuteImportScript.executeScript(editor.project);
 		}
 		
-		SWTEditorsUtils.closeEditors(project, true);
 		
-		ExecuteImportScript.executeScript(project);
-		
 	}
 	
 	// private void updateEditionsSection() {
@@ -1158,12 +1182,12 @@
 	// }
 	//
 	public String getRootDir() {
-		if (project == null) return null;
-		if (project.getSrcdir() == null) return null;
-		return project.getSrcdir().getAbsolutePath();
+		if (editor.project == null) return null;
+		if (editor.project.getSrcdir() == null) return null;
+		return editor.project.getSrcdir().getAbsolutePath();
 	}
 	
-	public Project getProject() {
-		return project;
-	}
+//	public Project getProject() {
+//		return project;
+//	}
 }
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportModuleCustomization.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportModuleCustomization.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportModuleCustomization.java	(revision 3441)
@@ -53,11 +53,11 @@
 	
 	public static final String IMPORT_NAME = "import_name";
 	
-	public static HashMap<String, HashMap<String, Boolean>> sectionsPerImportModule = new HashMap<>();
+	protected static HashMap<String, HashMap<String, Boolean>> sectionsPerImportModule = new HashMap<>();
 	
-	public static HashMap<String, Class<? extends ImportEditorSection>> additionalSections = new HashMap<>();
+	protected static HashMap<String, Class<? extends ImportEditorSection>> additionalSections = new HashMap<>();
 	
-	public static HashMap<String, String> names = new HashMap<>();
+	protected static HashMap<String, String> names = new HashMap<>();
 	
 	static { // init import module
 		HashMap<String, Boolean> params = new HashMap<>();
@@ -370,6 +370,9 @@
 		if (sectionsPerImportModule.containsKey(importscript)) {
 			return sectionsPerImportModule.get(importscript);
 		}
+		else if (sectionsPerImportModule.containsKey(importscript+"Loader.groovy")) {
+			return sectionsPerImportModule.get(importscript+"Loader.groovy");
+		} 
 		else {
 			HashMap<String, Boolean> params = new HashMap<>();
 			params.put(PARALLEL, true);
@@ -396,7 +399,9 @@
 		if (sectionsPerImportModule.containsKey(importscript)) {
 			return names.get(importscript);
 		}
-		else {
+		if (sectionsPerImportModule.containsKey(importscript+"Loader.groovy")) {
+			return names.get(importscript+"Loader.groovy");
+		}else {
 			return importscript;
 		}
 	}
@@ -407,6 +412,14 @@
 	 * @return a ImportEditorSection class if any for a given import module name
 	 */
 	public static Class<? extends ImportEditorSection> getAdditionalSection(String importName) {
+		if (!additionalSections.containsKey(importName)) {
+			return additionalSections.get(importName+"Loader.groovy");
+		}
 		return additionalSections.get(importName);
 	}
+
+	public static void addAdditionalSections(String name, Class<? extends ImportEditorSection> clazz) {
+		
+		additionalSections.put(name, clazz);
+	}
 }
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3441)
@@ -949,14 +949,12 @@
 									setCanceled(true);
 								}
 								// popup alert to inform user that children results will be recomputed
-								if (!TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER)
-										&& TXMEditor.this.getResult().hasVisibleChild() && !MessageDialog.openQuestion(getShell(), TXMCoreMessages.common_warning,
-												TXMUIMessages.warning_popup_allDescendantResultsWillBeUpdated)) {
+								if (!TBXPreferences.getInstance().getBoolean(RCPPreferences.AUTO_UPDATE_SUBRESULTS)
+										&& TXMEditor.this.getResult().hasVisibleChild() 
+										&& !MessageDialog.openQuestion(getShell(), TXMCoreMessages.common_warning, TXMUIMessages.warning_popup_allDescendantResultsWillBeUpdated)) {
 									setCanceled(true);
 								}
 								
-								
-								
 								// subclasses manual result updating from editor fields
 								Log.finest("TXMEditor.compute(): " + TXMEditor.this.getClass().getSimpleName() + ": manually updating result from editor."); //$NON-NLS-1$
 								updateResultFromEditor();
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/input/ImportFormEditorInput.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/input/ImportFormEditorInput.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/input/ImportFormEditorInput.java	(revision 3441)
@@ -44,15 +44,17 @@
 public class ImportFormEditorInput implements IEditorInput {
 	
 	/** The xmlfile. */
-	File xmlfile;
+	File scriptFile;
 	
+	Boolean updateMode;
+	
 	/**
 	 * Instantiates a new import form editor input.
 	 *
 	 * @param xmlfile the xmlfile
 	 */
 	public ImportFormEditorInput(File xmlfile) {
-		this.xmlfile = xmlfile;
+		this.scriptFile = xmlfile;
 	}
 
 	/* (non-Javadoc)
@@ -69,8 +71,12 @@
 	 */
 	@Override
 	public String getName() {
-		String name = ImportModuleCustomization.getName(xmlfile.getName());
-		return name;
+		if (scriptFile != null) {
+			String name = ImportModuleCustomization.getName(scriptFile.getName());
+			return name;
+		} else {
+			return "";
+		}
 	}
 	
 	/* (non-Javadoc)
@@ -104,7 +110,7 @@
 	 */
 	public File getGroovyFile()
 	{
-		return xmlfile;
+		return scriptFile;
 	}
 
 	/* (non-Javadoc)
@@ -114,4 +120,14 @@
 	public boolean exists() {
 		return false;
 	}
+
+	public Boolean getUpdateMode() {
+		
+		return updateMode;
+	}
+
+	public void setUpdateMode(boolean updateMode) {
+		
+		this.updateMode = updateMode;
+	}
 }
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/TextDialog.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/TextDialog.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/TextDialog.java	(revision 3441)
@@ -61,6 +61,7 @@
 
 		GridLayout layout = (GridLayout) comp.getLayout();
 		layout.numColumns = 1;
+		layout.verticalSpacing = 5;
 		
 		GridData data = new GridData(GridData.FILL_HORIZONTAL);
 
@@ -68,7 +69,8 @@
 		questionLabel.setText(question);
 		questionLabel.setLayoutData(data);
 
-		textField = new Text(comp, SWT.SINGLE);
+		textField = new Text(comp, SWT.SINGLE|SWT.BORDER);
+		data = new GridData(GridData.FILL_HORIZONTAL);
 		textField.setLayoutData(data);
 		if(this.text != null)	{
 			textField.setText(this.text);
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/UpdateCorpusDialog.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/UpdateCorpusDialog.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/UpdateCorpusDialog.java	(revision 3441)
@@ -0,0 +1,172 @@
+package org.txm.rcp.swt.dialog;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+public class UpdateCorpusDialog extends Dialog {
+
+	protected String title = "Update corpus";
+	protected String topMessage = "Update the corpus from its XML-TXM files";
+	protected String bottomMessage = "All editors using this corpus will be closed. And the corpus will be update.\n\nContinue?";
+	
+	protected Button openCorpusParameters;
+	protected Button updateEditionsCheck;
+	protected Button forceUpdateCheck;
+	
+	public boolean doOpenCorpusParameters = false;
+	public boolean doUpdateEditions = false;
+	public boolean doForceUpdate = false;
+	
+	public UpdateCorpusDialog(Shell parentShell) {
+		
+		super(parentShell);
+	}
+	
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText(title);
+	}
+	
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite comp = (Composite) super.createDialogArea(parent);
+
+		GridLayout layout = (GridLayout) comp.getLayout();
+		layout.numColumns = 1;
+		layout.verticalSpacing = 20;
+		layout.marginWidth = 15;
+		
+		createTopMessageArea(comp);
+		
+		createButtonsArea(comp);
+		
+		createBottomMessageArea(comp);
+		
+		return comp;
+	}
+	
+	protected void createButtonsArea(Composite comp) {
+		
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		
+		openCorpusParameters = new Button(comp, SWT.CHECK);
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		openCorpusParameters.setLayoutData(data);
+		openCorpusParameters.setText("Open more update parameters before updating");
+		openCorpusParameters.setToolTipText("Use this to change the corpus parameters before updating the corpus");
+		openCorpusParameters.setSelection(doOpenCorpusParameters);
+
+		updateEditionsCheck = new Button(comp, SWT.CHECK);
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		updateEditionsCheck.setLayoutData(data);
+		updateEditionsCheck.setText("update the edition pages");
+		updateEditionsCheck.setToolTipText("If not checked, the edition pages are not updated and might not reflect exactly the corpus content.");
+		updateEditionsCheck.setSelection(doUpdateEditions);
+		
+		forceUpdateCheck = new Button(comp, SWT.CHECK);
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		forceUpdateCheck.setLayoutData(data);
+		forceUpdateCheck.setText("Force update of non-modified texts");
+		forceUpdateCheck.setToolTipText("when checked this option make TXM update all indexes & editions of all texts even if their XML-TXM file is not modified (it takes more time to update).");
+		forceUpdateCheck.setSelection(doForceUpdate);
+	}
+
+	protected void createTopMessageArea(Composite comp) {
+		
+		Label mainMessage = new Label(comp, SWT.WRAP);
+		mainMessage.setText(topMessage);
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		mainMessage.setLayoutData(data);
+	}
+	
+	protected void createBottomMessageArea(Composite comp) {
+		
+		Label mainMessage = new Label(comp, SWT.WRAP);
+		mainMessage.setText(bottomMessage);
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		mainMessage.setLayoutData(data);
+	}
+
+	@Override
+	protected void buttonPressed(int buttonId) {
+		if (buttonId == Dialog.OK) {
+			doUpdateEditions = updateEditionsCheck.getSelection();
+			doForceUpdate = forceUpdateCheck.getSelection();
+		}
+		
+		super.buttonPressed(buttonId);
+	}
+
+	/**
+	 * 
+	 * @return the update edition button value AFTER this dialog is closed
+	 */
+	public boolean getDoUpdateEdition() {
+		
+		return doUpdateEditions;
+	}
+	
+	/**
+	 * 
+	 * @return the force update button value AFTER this dialog is closed
+	 */
+	public boolean getDoForceUpdate() {
+		
+		return doForceUpdate;
+	}
+	
+	/**
+	 * 
+	 * @return the update edition button value AFTER this dialog is closed
+	 */
+	public void setDoUpdateEdition(boolean doUpdateEditions) {
+		
+		this.doUpdateEditions = doUpdateEditions;
+	}
+	
+	/**
+	 * 
+	 * @return the force update button value AFTER this dialog is closed
+	 */
+	public void setDoForceUpdate(boolean doForceUpdate) {
+		
+		this.doForceUpdate = doForceUpdate;
+	}
+
+	public boolean getDoOpenCorpusParameters() {
+		
+		return doOpenCorpusParameters;
+	}
+	
+	public void setDoOpenCorpusParameters(boolean doOpenCorpusParameters) {
+		
+		this.doOpenCorpusParameters = doOpenCorpusParameters;
+	}
+
+	public void setMessages(String topMessage, String bottomMessage) {
+		
+		this.topMessage = topMessage;
+		this.bottomMessage = bottomMessage;
+	}
+	
+	public String getTopMessage() {
+		return topMessage;
+	}
+	
+	public String getBottomMessage() {
+		return bottomMessage;
+	}
+	
+	public void setTitle(String title) {
+		
+		this.title = title;
+	}
+}

Property changes on: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/UpdateCorpusDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java	(revision 3441)
@@ -1,172 +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.commands;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Locale;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Shell;
-import org.txm.Toolbox;
-import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.preferences.TBXPreferences;
-import org.txm.objects.Project;
-import org.txm.objects.Workspace;
-import org.txm.rcp.handlers.scripts.ExecuteImportScript;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.searchengine.cqp.ReferencePattern;
-import org.txm.searchengine.cqp.corpus.CorpusManager;
-import org.txm.treetagger.core.preferences.TreeTaggerPreferences;
-import org.txm.utils.LangDetector;
-
-/**
- * Import the text in the Clipboard as a corpus. The loader used is the QuickLoader.
- * 
- * The Clipboard is saved in the clipoard directory and then imported as TXT.
- * 
- * @author mdecorde
- * 
- */
-public class ImportSelectedText extends AbstractHandler {
-
-	/** The nextclipcorpus. */
-	static public int nextclipcorpus = 1;
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		String result = org.txm.rcp.utils.IOClipboard.read();
-		if (result == null || result.length() == 0) {
-			System.out.println("No copied text. Aborting.");
-			return null;
-		}
-		System.out.println(TXMUIMessages.importClipboardText);
-
-		try {
-			String corpusName = TXMUIMessages.clipboard_2.toUpperCase()+(nextclipcorpus++);
-			File wl = Toolbox.workspace.getLocation();
-			if (wl == null) {
-				System.err.println("Error: Toolbox is not correctly initialized. Clipboard import aborted.");
-				return null;
-			}
-			while (new File(wl, corpusName).exists()) {
-				corpusName = TXMUIMessages.clipboard_2.toUpperCase()+(nextclipcorpus++);
-			}
-			importText(result, corpusName);
-			
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			org.txm.utils.logger.Log.printStackTrace(e);
-		}
-		return null;
-	}
-
-	/**
-	 * Import text.
-	 *
-	 * @param text the text
-	 * @param corpusname the basename
-	 * @return the object
-	 * @throws Exception 
-	 */
-	public static Object importText(String text, String corpusname) throws Exception {
-		corpusname = corpusname.toUpperCase();
-		if (text.length() == 0) {
-			System.err.println(TXMUIMessages.clipboardIsEmpty);
-			return null;
-		}
-		String txmhome = Toolbox.getTxmHomePath();
-		new File(txmhome, "clipboard").mkdir(); //$NON-NLS-1$
-		File clipboardDirectory = new File(txmhome, "clipboard/" + corpusname); //$NON-NLS-1$
-		
-		if (CorpusManager.getCorpusManager().hasCorpus(clipboardDirectory.getName())) {
-			Shell shell = new Shell();
-			boolean b = MessageDialog.openConfirm(shell,
-					TXMUIMessages.confirm, NLS.bind(TXMUIMessages.theCorpusAndTheCorpusP0WillBeDeleted, clipboardDirectory.getName()));
-			if (!b)
-				return null;
-		}
-		
-		org.txm.utils.DeleteDir.deleteDirectory(clipboardDirectory);
-		clipboardDirectory.mkdirs();
-		
-		File quicksrc = new File(clipboardDirectory, corpusname + ".txt"); //$NON-NLS-1$
-		try {
-			Writer writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(quicksrc)), "UTF-8"); //$NON-NLS-1$ 
-			writer.write(text.replace("\t", "    ")); //$NON-NLS-1$ //$NON-NLS-2$
-			writer.close();
-		} catch (Exception e) {
-			org.txm.utils.logger.Log.printStackTrace(e);
-			return null;
-		}
-		
-		
-		// configure project
-		Workspace w = Toolbox.workspace;
-		Project project = w.getProject(clipboardDirectory.getName());
-		if (project == null) {	
-			project = new Project(w, clipboardDirectory.getName());
-		}
-		project.setSourceDirectory(clipboardDirectory.getAbsolutePath());
-		project.setImportModuleName("txt"); //$NON-NLS-1$
-		project.setEncoding("UTF-8"); //$NON-NLS-1$
-		project.getEditionDefinition("default").setBuildEdition(true); //$NON-NLS-1$
-		project.getCommandPreferences("concordance").set("view_reference_pattern", 
-				ReferencePattern.referenceToString(Arrays.asList("lbn"), null));
-		
-		String lang = TBXPreferences.getInstance().getString(TBXPreferences.IMPORT_DEFAULT_LANG);
-		if (lang.length() == 0) lang = Locale.getDefault().getLanguage();
-		if ("??".equals(lang)) { //$NON-NLS-1$
-			LangDetector detector = new LangDetector(quicksrc);
-			lang = detector.getLang();
-			System.out.println(TXMCoreMessages.bind(TXMUIMessages.identifiedLanguage, lang));
-		}
-		project.setLang(lang); //$NON-NLS-1$
-		System.out.println(TXMCoreMessages.bind(TXMUIMessages.usingLanguage, project.getLang()));
-		
-		String ttpath = TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.INSTALL_PATH);
-		
-		if (ttpath != null && ttpath.length() > 0 && new File(ttpath, "bin").isDirectory()) {
-			project.setAnnotate(true);
-		}
-		
-		ExecuteImportScript.executeScript(project); 
-		return null;
-	}
-}
\ No newline at end of file
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportClipboardText.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportClipboardText.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportClipboardText.java	(revision 3441)
@@ -0,0 +1,181 @@
+// 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.commands;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.Arrays;
+import java.util.Locale;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.Toolbox;
+import org.txm.core.messages.TXMCoreMessages;
+import org.txm.core.preferences.TBXPreferences;
+import org.txm.objects.Project;
+import org.txm.objects.Workspace;
+import org.txm.rcp.handlers.scripts.ExecuteImportScript;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.dialog.TextDialog;
+import org.txm.searchengine.cqp.ReferencePattern;
+import org.txm.searchengine.cqp.corpus.CorpusManager;
+import org.txm.treetagger.core.preferences.TreeTaggerPreferences;
+import org.txm.utils.LangDetector;
+
+/**
+ * Import the text in the Clipboard as a corpus. The loader used is the QuickLoader.
+ * 
+ * The Clipboard is saved in the clipoard directory and then imported as TXT.
+ * 
+ * @author mdecorde
+ * 
+ */
+public class ImportClipboardText extends AbstractHandler {
+
+	/** The nextclipcorpus. */
+	static public int nextclipcorpus = 1;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String result = org.txm.rcp.utils.IOClipboard.read();
+		if (result == null || result.length() == 0) {
+			System.out.println("No copied text. Aborting.");
+			return null;
+		}
+		System.out.println(TXMUIMessages.importClipboardText);
+
+		try {
+			String corpusName = TXMUIMessages.clipboard_2.toUpperCase()+(nextclipcorpus++);
+			File wl = Toolbox.workspace.getLocation();
+			if (wl == null) {
+				System.err.println("Error: Toolbox is not correctly initialized. Clipboard import aborted.");
+				return null;
+			}
+			while (new File(wl, corpusName).exists()) {
+				corpusName = TXMUIMessages.clipboard_2.toUpperCase()+(nextclipcorpus++);
+			}
+			
+			String lang = TBXPreferences.getInstance().getString(TBXPreferences.CLIPBOARD_IMPORT_DEFAULT_LANG);
+			boolean askLang = TBXPreferences.getInstance().getBoolean(TBXPreferences.CLIPBOARD_IMPORT_ASK_LANG);
+			TextDialog dialog = new TextDialog(HandlerUtil.getActiveShell(event), "Select the import language to use", "What language must be used to import the clipboard content?", lang);
+			if (askLang) {
+				if (dialog.open() == TextDialog.CANCEL) return null;
+				lang = dialog.getText();
+			}
+			importText(result, corpusName, lang);
+			
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			org.txm.utils.logger.Log.printStackTrace(e);
+		}
+		return null;
+	}
+
+	/**
+	 * Import text.
+	 *
+	 * @param text the text
+	 * @param corpusname the basename
+	 * @return the object
+	 * @throws Exception 
+	 */
+	public static Object importText(String text, String corpusname, String lang) throws Exception {
+		corpusname = corpusname.toUpperCase();
+		if (text.length() == 0) {
+			System.err.println(TXMUIMessages.clipboardIsEmpty);
+			return null;
+		}
+		String txmhome = Toolbox.getTxmHomePath();
+		new File(txmhome, "clipboard").mkdir(); //$NON-NLS-1$
+		File clipboardDirectory = new File(txmhome, "clipboard/" + corpusname); //$NON-NLS-1$
+		
+		if (CorpusManager.getCorpusManager().hasCorpus(clipboardDirectory.getName())) {
+			Shell shell = new Shell();
+			boolean b = MessageDialog.openConfirm(shell,
+					TXMUIMessages.confirm, NLS.bind(TXMUIMessages.theCorpusAndTheCorpusP0WillBeDeleted, clipboardDirectory.getName()));
+			if (!b) {
+				return null;
+			}
+		}
+		
+		org.txm.utils.DeleteDir.deleteDirectory(clipboardDirectory);
+		clipboardDirectory.mkdirs();
+		
+		File quicksrc = new File(clipboardDirectory, corpusname + ".txt"); //$NON-NLS-1$
+		try {
+			Writer writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(quicksrc)), "UTF-8"); //$NON-NLS-1$ 
+			writer.write(text.replace("\t", "    ")); //$NON-NLS-1$ //$NON-NLS-2$
+			writer.close();
+		} catch (Exception e) {
+			org.txm.utils.logger.Log.printStackTrace(e);
+			return null;
+		}
+		
+		// configure project
+		Workspace w = Toolbox.workspace;
+		Project project = w.getProject(clipboardDirectory.getName());
+		if (project == null) {	
+			project = new Project(w, clipboardDirectory.getName());
+		}
+		project.setSourceDirectory(clipboardDirectory.getAbsolutePath());
+		project.setImportModuleName("txt"); //$NON-NLS-1$
+		project.setEncoding("UTF-8"); //$NON-NLS-1$
+		project.getEditionDefinition("default").setBuildEdition(true); //$NON-NLS-1$
+		project.getCommandPreferences("concordance").set("view_reference_pattern", 
+				ReferencePattern.referenceToString(Arrays.asList("lbn"), null));
+		
+		if (lang.length() == 0) lang = Locale.getDefault().getLanguage();
+		if ("??".equals(lang)) { //$NON-NLS-1$
+			LangDetector detector = new LangDetector(quicksrc);
+			lang = detector.getLang();
+			System.out.println(TXMCoreMessages.bind(TXMUIMessages.identifiedLanguage, lang));
+		}
+		project.setLang(lang); //$NON-NLS-1$
+		System.out.println(TXMCoreMessages.bind(TXMUIMessages.usingLanguage, project.getLang()));
+		
+		String ttpath = TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.INSTALL_PATH);
+		
+		if (ttpath != null && ttpath.length() > 0 && new File(ttpath, "bin").isDirectory()) {
+			project.setAnnotate(true);
+		}
+		
+		ExecuteImportScript.executeScript(project); 
+		return null;
+	}
+}
\ No newline at end of file

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

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 3441)
@@ -9,16 +9,18 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.objects.Project;
 import org.txm.rcp.commands.CloseEditorsUsing;
+import org.txm.rcp.commands.OpenImportForm;
 import org.txm.rcp.commands.RestartTXM;
+import org.txm.rcp.swt.dialog.UpdateCorpusDialog;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.utils.logger.Log;
@@ -40,35 +42,42 @@
 		}
 		MainCorpus corpus = (MainCorpus) s;
 		
-		boolean updateEdition = false;
+		UpdateCorpusDialog dialog = new UpdateCorpusDialog(HandlerUtil.getActiveShell(event));
+		dialog.setDoUpdateEdition(TBXPreferences.getInstance().getBoolean(TBXPreferences.UPDATEEDITIONS));
+		dialog.setDoForceUpdate("true".equals(event.getParameter("org.txm.rcp.commands.workspace.UpdateCorpus.force")));
 		
-		// force corpus to be recomputed
-		String forceDirty = event.getParameter("org.txm.rcp.commands.workspace.UpdateCorpus.force"); //$NON-NLS-1$
-		if ("true".equals(forceDirty)) {
-			corpus.getProject().setDirty();
-			updateEdition = true;
+		if (dialog.open() != Window.OK) {
+			return null;
+		}
+		
+		if (dialog.getDoOpenCorpusParameters()) {
+			
+			corpus.getProject().setDoUpdate(true, dialog.getDoUpdateEdition());
+			if (dialog.getDoForceUpdate()) {
+				corpus.getProject().setDirty();
+			}
+			OpenImportForm.open(null, true);
 		} else {
-			if (corpus.getProject().getBuiltEditionNames().size() > 0) {
-				updateEdition = MessageDialog.openQuestion(HandlerUtil.getActiveShell(event), "Update editions", "Do you want to update the edition pages as well ?");
-			} else {
-				updateEdition = false; // no edition to do, skip the pager step when updating
-			}
+			
+			update(corpus, dialog.getDoForceUpdate(), dialog.getDoUpdateEdition());
 		}
 		
-		update(corpus, updateEdition);
-		
 		return corpus;
 	}
 	
 	public static JobHandler update(final MainCorpus corpus) {
-		return update(corpus, TBXPreferences.getInstance().getBoolean(TBXPreferences.UPDATEEDITIONS));
+		return update(corpus, false, TBXPreferences.getInstance().getBoolean(TBXPreferences.UPDATEEDITIONS));
 	}
 	
-	public static JobHandler update(final MainCorpus corpus, boolean updateEdition) {
+	public static JobHandler update(final MainCorpus corpus, boolean forceUpdate, boolean updateEdition) {
 		
 		final Project project = corpus.getProject();
 		if (project == null) return null;
 		
+		if (forceUpdate) {
+			project.setDirty();
+		}
+		
 		// String iname = project.getImportModuleName();
 		// if (!iname.matches("xtz|txt|hyperbase|discours|cnr|alceste|xml|xmltxm")) {
 		// System.out.println("Can't update a CQP corpus not imported with one of the XTZ, TXT, XML, XML-TXM, CNRS, Alceste, Hyperbase import modules.");
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenImportForm.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenImportForm.java	(revision 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenImportForm.java	(revision 3441)
@@ -39,9 +39,10 @@
 import org.txm.rcp.editors.imports.ImportFormEditor;
 import org.txm.rcp.editors.input.ImportFormEditorInput;
 
-// TODO: Auto-generated Javadoc
 /**
- * Open a file in the TxtEditor @ author mdecorde.
+ * Open the import form
+ *  
+ * @author mdecorde.
  */
 public class OpenImportForm extends AbstractHandler {
 
@@ -54,8 +55,13 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 
-		String filename = event.getParameter("org.txm.rcp.commands.importscript"); //$NON-NLS-1$
-		openfile(filename);
+		File script = null;
+		if (event.getParameters().containsKey("org.txm.rcp.commands.importscript")) {
+			String filename = event.getParameter("org.txm.rcp.commands.importscript"); //$NON-NLS-1$
+			script = new File (filename);
+		}
+		Boolean updateMode = "true".equals(event.getParameter("org.txm.rcp.commands.importupdatemode")); //$NON-NLS-1$
+		open(script, updateMode);
 		return null;
 	}
 
@@ -64,9 +70,10 @@
 	 *
 	 * @param filepath the filepath
 	 */
-	static public void openfile(String filepath) {
+	static public void open(File scriptname, boolean updateMode) {
 		try {
-			ImportFormEditorInput editorInput = new ImportFormEditorInput(new File(filepath));
+			ImportFormEditorInput editorInput = new ImportFormEditorInput(scriptname);
+			editorInput.setUpdateMode(updateMode);
 			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
 			IWorkbenchPage page = window.getActivePage();
 			IEditorPart a = page.openEditor(editorInput, ImportFormEditor.ID, true);
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 3440)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 3441)
@@ -74,6 +74,7 @@
 import org.eclipse.ui.part.ViewPart;
 import org.txm.Toolbox;
 import org.txm.core.results.TXMResult;
+import org.txm.objects.CorpusBuild;
 import org.txm.objects.Project;
 import org.txm.objects.Workspace;
 import org.txm.rcp.CorporaSourceProvider;
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 3440)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 3441)
@@ -139,6 +139,7 @@
 		
 		if (this.getParent() instanceof QueryBasedTXMResult) { // update the pQuery
 			this.pQuery = ((QueryBasedTXMResult)this.getParent()).getQuery();
+			this.setName(pQuery.getName());
 		}
 		
 		if (pID == null || pID.length() == 0) {
Index: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/messages_fr.properties
===================================================================
--- TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/messages_fr.properties	(revision 3440)
+++ TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/messages_fr.properties	(revision 3441)
@@ -75,7 +75,7 @@
 
 ImportGlozzCorpus_17 = ** Le fichier source TXT {0} n'a pas pu être créé.
 
-ImportGlozzCorpus_19 = ** la configuration du corpus n'a pas pu être sauvegardé : {0}
+ImportGlozzCorpus_19 = ** la configuration du corpus n'a pas pu être enregistré : {0}
 
 ImportGlozzCorpus_22 = ** Pas de script {0} trouvé pour le module d'import {0}
 
@@ -199,23 +199,23 @@
 
 SaveCorpus_0 = La sélection n''est pas un corpus racine : {0}
 
-SaveCorpus_3 = Sauvegarde des annotations ({0})
+SaveCorpus_3 = Enregistrement des annotations URS ({0})
 
-SaveCorpus_5 = Erreur lors de la sauvegarde du corpus.
+SaveCorpus_5 = Erreur lors de l'enregistrement  du corpus.
 
 SaveStructureAsGlozzModel_0 = La sélection n''est pas un corpus racine : {0}
 
-SaveStructureAsGlozzModel_1 = Sauvegarde de la structure du corpus {0} dans un modèle Glozz
+SaveStructureAsGlozzModel_1 = Enregistrement de la structure du corpus {0} dans un modèle Glozz
 
-SaveStructureAsGlozzModel_2 = Erreur lors de la sauvegarde de la structure.
+SaveStructureAsGlozzModel_2 = Erreur lors de l'enregistrement de la structure.
 
 SaveStructureAsGlozzModel_3 = Terminé.
 
 SaveStructure_0 = La sélection n''est pas un corpus racine : {0}
 
-SaveStructure_3 = Sauvegarde de la structure du corpus {0} ({1})
+SaveStructure_3 = Enregistrement de la structure du corpus {0} ({1})
 
-SaveStructure_5 = Erreur lors de la sauvegarde de la structure.
+SaveStructure_5 = Erreur lors de l'enregistrement de la structure.
 
 SaveVue_0 = La sélection n''est pas un corpus racine : {0}
 
@@ -231,7 +231,7 @@
 
 StartButton_12 = Démarrer l'annotation URS
 
-StartButton_4 = ** Le corpus n'a pas été sauvegardé.
+StartButton_4 = ** Le corpus n'a pas été enregistré.
 
 StartButton_5 = Terminé.
 
Index: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitConcordanceToolbar.java
===================================================================
--- TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitConcordanceToolbar.java	(revision 3440)
+++ TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitConcordanceToolbar.java	(revision 3441)
@@ -1,5 +1,6 @@
 package org.txm.annotation.urs.toolbar;
 
+import java.io.File;
 import java.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -271,7 +272,7 @@
 		equalLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
 		
 		// PROPERTY
-		annotationPropertiesCombo = new ComboViewer(annotationArea, SWT.SINGLE);
+		annotationPropertiesCombo = new ComboViewer(annotationArea, SWT.SINGLE|SWT.READ_ONLY);
 		annotationPropertiesCombo.setContentProvider(new ArrayContentProvider());
 		annotationPropertiesCombo.setLabelProvider(new SimpleLabelProvider());
 		annotationPropertiesCombo.getCombo().addKeyListener(new KeyListener() {
@@ -350,6 +351,27 @@
 			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
 		
+		affectAllAnnotationButton = new Button(annotationArea, SWT.PUSH);
+		affectAllAnnotationButton.setText("All");
+		affectAllAnnotationButton.setToolTipText("Create unit for all lines.");
+		affectAllAnnotationButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+		affectAllAnnotationButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				try {
+					affectMatchesToLines(concordance.getLines());
+				}
+				catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
 		deleteAnnotationButton = new Button(annotationArea, SWT.PUSH);
 		deleteAnnotationButton.setText("Delete");
 		deleteAnnotationButton.setToolTipText("Delete unit for each selected line.");
@@ -604,7 +626,7 @@
 		// System.out.println();
 		Log.info("Saving URS annotation...");
 		if (URSCorpora.saveCorpus(corpus)) {
-			Log.info("Done: URS annotations saved.");
+			Log.info("Done in ("+new File(corpus.getProjectDirectory(), "analec/"+corpus.getName()+".ec")+")");
 			return true;
 		} else {
 			Log.warning("Error: URS annotation not saved.");
Index: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/InstallURSFiles.java
===================================================================
--- TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/InstallURSFiles.java	(revision 3440)
+++ TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/InstallURSFiles.java	(revision 3441)
@@ -75,6 +75,7 @@
 	
 	@Override
 	public boolean needsReinstall(Workspace workspace) {
+		
 		File txmhomedir = new File(Toolbox.getTxmHomePath());
 		for (String folder : createfolders) {
 			if (!new File(txmhomedir, folder).exists()) {
Index: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/URSCorpora.java
===================================================================
--- TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/URSCorpora.java	(revision 3440)
+++ TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/URSCorpora.java	(revision 3441)
@@ -26,7 +26,7 @@
 	private static final HashMap<CorpusBuild, Corpus> corpora = new HashMap<>();
 	
 	private static final HashMap<CorpusBuild, Vue> vues = new HashMap<>();
-	
+
 	/**
 	 * Create the ec file if needed, store a reference to the corpus if not already done.
 	 * 
@@ -250,21 +250,31 @@
 	
 	@Override
 	public boolean isAutomatic() {
+		
 		return false;
 	}
 	
 	@Override
 	public boolean processFile(File xmlFile, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
+		
 		return false;
 	}
 	
 	@Override
 	public String getDetails() {
+		
 		return corpora.toString();
 	}
 	
 	@Override
 	public boolean hasAnnotationsToSave(CorpusBuild mcorpus) {
+
+		return hasAnnotationsToSaveStatic(mcorpus);
+	}
+	
+	public static boolean hasAnnotationsToSaveStatic(CorpusBuild mcorpus) {
+		
+		if (corpora.isEmpty()) return false;
 		if (!URSCorpora.hasCorpus(mcorpus)) return false; // no corpus instanced -> no annotations to save
 		return URSCorpora.getCorpus(mcorpus).isModifie();
 	}
@@ -275,6 +285,7 @@
 	 * @return true is an Analec corpus is already instanced
 	 */
 	private static boolean hasCorpus(CorpusBuild mcorpus) {
+		
 		return corpora.containsKey(mcorpus);
 	}
 }
Index: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/rcp/testers/IsURSCorpusDirty.java
===================================================================
--- TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/rcp/testers/IsURSCorpusDirty.java	(revision 0)
+++ TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/rcp/testers/IsURSCorpusDirty.java	(revision 3441)
@@ -0,0 +1,25 @@
+package org.txm.annotation.urs.rcp.testers;
+
+import java.util.List;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.txm.annotation.urs.URSCorpora;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+
+public class IsURSCorpusDirty extends PropertyTester {
+	
+	@Override
+	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+		
+		if (receiver instanceof List) {
+			List list = (List) receiver;
+			if (list.size() == 0) return true;
+			receiver = list.get(0);
+		}
+		if (receiver instanceof MainCorpus) {
+			return URSCorpora.hasAnnotationsToSaveStatic((MainCorpus)receiver);
+		}
+		
+		return false;
+	}
+}

Property changes on: TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/rcp/testers/IsURSCorpusDirty.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.analec.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- TXM/trunk/org.txm.analec.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3440)
+++ TXM/trunk/org.txm.analec.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3441)
@@ -16,7 +16,7 @@
 command.label.3 = URS
 command.name    = Charger une structure d'annotation...
 command.name.0  = Editer la structure d'annotation
-command.name.1  = Sauver la structure d'annotation
+command.name.1  = Enregistrer la structure d'annotation
 command.name.10 = Installer
 command.name.11 = Importer des annotations XML-TEI URS...
 command.name.12 = Export XML Glozz...
@@ -28,9 +28,9 @@
 command.name.18 = Outils ANR Democrat
 command.name.2  = Importer un mod\u00E8le Glozz...
 command.name.3  = Charger le Corpus Analec...
-command.name.4  = Sauver les annotations
+command.name.4  = Enregistrer les annotations URS
 command.name.5  = Charger une Vue
-command.name.6  = Sauver la Vue
+command.name.6  = Enregistrer la Vue
 command.name.7  = Exporter vers un mod\u00E8le Glozz...
 command.name.8  = Glozz
 command.name.9  = Importer les annotations Glozz...
Index: TXM/trunk/org.txm.analec.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.analec.rcp/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.analec.rcp/plugin.xml	(revision 3441)
@@ -123,7 +123,7 @@
                <visibleWhen
                      checkEnabled="false">
                   <reference
-                        definitionId="OneCorpusSelected">
+                        definitionId="CorpusNeedtoSaveURSAnnotation">
                   </reference>
                </visibleWhen>
             </command>
@@ -271,6 +271,24 @@
             </parameter>
          </command>
       </menuContribution>
+      <menuContribution
+            allPopups="false"
+            locationURI="toolbar:org.txm.rcp.toolbarcorpus?after=org.txm.rcp.toolbarcorpus.annotation">
+         <command
+               commandId="org.txm.annotation.urs.commands.SaveCorpus"
+               icon="platform:/plugin/org.txm.annotation.rcp/icons/functions/pencil_save.png"
+               label="URS"
+               mode="FORCE_TEXT"
+               style="push"
+               tooltip="URS">
+            <visibleWhen
+                  checkEnabled="false">
+               <reference
+                     definitionId="CorpusNeedtoSaveURSAnnotation">
+               </reference>
+            </visibleWhen>
+         </command>
+      </menuContribution>
    </extension>
    <extension
          point="org.eclipse.ui.commands">
@@ -423,6 +441,18 @@
                property="org.txm.annotation.urs.testers.canAnnotate">
          </test>
       </definition>
+      <definition
+            id="CorpusNeedtoSaveURSAnnotation">
+         <and>
+            <reference
+                  definitionId="OneMainCorpusSelected">
+            </reference>
+            <test
+                  forcePluginActivation="true"
+                  property="org.txm.annotation.urs.rcp.testers.IsURSCorpusDirty">
+            </test>
+         </and>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.core.expressions.propertyTesters">
@@ -491,5 +521,15 @@
             class="org.txm.annotation.urs.preferences.URSPreferences">
       </initializer>
    </extension>
+   <extension
+         point="org.eclipse.core.expressions.propertyTesters">
+      <propertyTester
+            class="org.txm.annotation.urs.rcp.testers.IsURSCorpusDirty"
+            id="org.txm.annotation.urs.rcp.testers.IsURSCorpusDirty"
+            namespace="org.txm.annotation.urs.rcp.testers"
+            properties="IsURSCorpusDirty"
+            type="java.lang.Object">
+      </propertyTester>
+   </extension>
 
 </plugin>
Index: TXM/trunk/org.txm.imports.metopes/plugin.xml
===================================================================
--- TXM/trunk/org.txm.imports.metopes/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.imports.metopes/plugin.xml	(revision 3441)
@@ -11,7 +11,7 @@
                style="push"
                tooltip="Metopes">
             <parameter
-                  name="org.txm.rcp.commands.commandParameter3"
+                  name="org.txm.rcp.commands.importscript"
                   value="metopesLoader.groovy">
             </parameter>
          </command>
Index: TXM/trunk/org.txm.conllu.rcp/src/org/txm/conllu/rcp/importsection/CoNLLUAnnotationSectionConfigurator.java
===================================================================
--- TXM/trunk/org.txm.conllu.rcp/src/org/txm/conllu/rcp/importsection/CoNLLUAnnotationSectionConfigurator.java	(revision 3440)
+++ TXM/trunk/org.txm.conllu.rcp/src/org/txm/conllu/rcp/importsection/CoNLLUAnnotationSectionConfigurator.java	(revision 3441)
@@ -9,6 +9,6 @@
 	@Override
 	public void installSections() {
 		
-		ImportModuleCustomization.additionalSections.put("conlluLoader.groovy", CoNLLUSection.class);
+		ImportModuleCustomization.addAdditionalSections("conllu", CoNLLUSection.class);
 	}
 }
Index: TXM/trunk/org.txm.conllu.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.conllu.rcp/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.conllu.rcp/plugin.xml	(revision 3441)
@@ -32,7 +32,7 @@
                label="%command.label"
                style="push">
             <parameter
-                  name="org.txm.rcp.commands.commandParameter3"
+                  name="org.txm.rcp.commands.importscript"
                   value="conllu/conlluLoader.groovy">
             </parameter>
          </command>
Index: TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 3440)
+++ TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 3441)
@@ -1612,9 +1612,13 @@
 	public boolean stepQueryLimits() {
 		// structural context
 
-		String fixedQuery = CQLQuery.fixQuery(pQuery.getQueryString(), this.getCorpus().getLang());
+		String fixedQuery = CQLQuery.fixQuery(pQuery.getQueryString(), this.getCorpus().getLang()); // a query starting with " or [ or (
 		if (fixedQuery.contains("@[") || fixedQuery.contains("@\"")) {
 			
+		} else if (fixedQuery.startsWith("(")) {
+			fixedQuery = "(@"+fixedQuery.substring(1);
+		} else if (fixedQuery.startsWith("((")) {
+			fixedQuery = "((@"+fixedQuery.substring(2);
 		} else {
 			fixedQuery = "@"+fixedQuery;
 		}
Index: TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/tigersearch/imports/TIGERImportSectionConfigurator.java
===================================================================
--- TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/tigersearch/imports/TIGERImportSectionConfigurator.java	(revision 3440)
+++ TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/tigersearch/imports/TIGERImportSectionConfigurator.java	(revision 3441)
@@ -10,6 +10,6 @@
 	@Override
 	public void installSections() {
 		
-		ImportModuleCustomization.additionalSections.put("tigersearchLoader.groovy", TIGERSection.class);
+		ImportModuleCustomization.addAdditionalSections("tigersearch", TIGERSection.class);
 	}
 }
Index: TXM/trunk/org.txm.tigersearch.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.tigersearch.rcp/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.tigersearch.rcp/plugin.xml	(revision 3441)
@@ -81,7 +81,7 @@
                label="%command.label.5"
                style="push">
             <parameter
-                  name="org.txm.rcp.commands.commandParameter3"
+                  name="org.txm.rcp.commands.importscript"
                   value="tigersearch/tigersearchLoader.groovy">
             </parameter>
          </command>
Index: TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java
===================================================================
--- TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 3440)
+++ TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 3441)
@@ -103,7 +103,7 @@
 					};
 					subcorpus.compute(false); // make it ready
 					subcorpus.setUserPersistable(false);
-					
+					subcorpus.setVisible(false);
 					//index.setUserPersistable(true); // make the index persistable to avoid bugs later
 				}
 			}
Index: TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java
===================================================================
--- TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 3440)
+++ TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 3441)
@@ -291,6 +291,9 @@
 		 */
 		@Override
 		public String getText(Object element) {
+			
+			
+			
 			if (element instanceof RResult) {
 				if (element instanceof TXMResult) {
 					return NLS.bind(RUIMessages.tXMNameP0SupSupRNameP1, ((TXMResult)element).getName(), ((RResult)element).getRSymbol());
Index: TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java
===================================================================
--- TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java	(revision 3440)
+++ TXM/trunk/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/handlers/SendToRCommand.java	(revision 3441)
@@ -141,13 +141,14 @@
 	 * @param o the o
 	 * @throws Exception the exception
 	 */
-	public String send(TXMResult o) throws Exception {
+	public static String send(TXMResult o) throws Exception {
 		
 		RStatsEngine rengine = (RStatsEngine) StatsEnginesManager.getREngine();
 		HashMap<String, RTransformer<? extends TXMResult>> transformers = rengine.getTransformers();
 		if (transformers.containsKey(o.getClass().getName())) {
 			RTransformer<? extends TXMResult> transformer = rengine.getTransformers().get(o.getClass().getName());
-			return transformer.fromTXMtoR(o);
+			String s = transformer.fromTXMtoR(o);
+			return s;
 		}
 		else {
 			return null;
Index: TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java	(revision 3440)
+++ TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java	(revision 3441)
@@ -61,22 +61,6 @@
 			return null;
 		}
 		
-		// System.out.println("DISPLAY="+Display.getDefault());
-		final Boolean[] doit = new Boolean[1];
-		doit[0] = true;
-		Display.getDefault().syncExec(new Runnable() {
-			
-			@Override
-			public void run() {
-				if (!MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Before saving annotations...", "All editors using this corpus will be closed. Continue?")) {
-					doit[0] = false;
-				}
-			}
-		});
-		if (doit[0] == false) {
-			return null;
-		}
-		
 		JobHandler jobhandler = new JobHandler(NLS.bind("Saving annotations of {0}", corpus)) {
 			
 			@Override
@@ -108,7 +92,7 @@
 			}
 		};
 		
-		if (doit[0]) jobhandler.startJob(true);
+		jobhandler.startJob(true);
 		jobhandler.join();
 		return jobhandler;
 	}
Index: TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotationsAndUpdateCorpus.java
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotationsAndUpdateCorpus.java	(revision 3440)
+++ TXM/trunk/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotationsAndUpdateCorpus.java	(revision 3441)
@@ -6,14 +6,18 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.annotation.kr.core.KRAnnotationEngine;
 import org.txm.annotation.kr.core.preferences.KRAnnotationPreferences;
 import org.txm.rcp.commands.workspace.UpdateCorpus;
 import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.dialog.UpdateCorpusDialog;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
@@ -34,6 +38,10 @@
 		if (!(s instanceof MainCorpus)) {
 			return null;
 		}
+		
+		
+		
+		
 		MainCorpus corpus = (MainCorpus) s;
 		try {
 			
@@ -42,6 +50,27 @@
 				return null;
 			}
 			
+			// System.out.println("DISPLAY="+Display.getDefault());
+			final Boolean[] doit = new Boolean[1];
+			doit[0] = true;
+			Display.getDefault().syncExec(new Runnable() {
+				
+				@Override
+				public void run() {
+					UpdateCorpusDialog dialog = new UpdateCorpusDialog(Display.getDefault().getActiveShell());
+					dialog.setTitle("Before saving annotations...");
+					dialog.setMessages("Save Annotations and update the corpus.", dialog.getBottomMessage());
+					dialog.setDoForceUpdate(false);
+					dialog.setDoUpdateEdition(KRAnnotationPreferences.getInstance().getBoolean(KRAnnotationPreferences.UPDATE_EDITION));
+					
+					doit[0] = dialog.open() == Window.OK;
+				}
+			});
+			if (doit[0] == false) {
+				return null;
+			}
+			
+			
 			Log.info(NLS.bind("Saving {0} annotations...", corpus.getName()));
 			JobHandler job = SaveAnnotations.save(corpus);
 			if (job == null) {
@@ -59,7 +88,7 @@
 							
 							try {
 								monitor.setTaskName("Updating corpus");
-								if (corpus != null && UpdateCorpus.update(corpus, KRAnnotationPreferences.getInstance().getBoolean(KRAnnotationPreferences.UPDATE_EDITION)) != null) {
+								if (corpus != null && UpdateCorpus.update(corpus, false, KRAnnotationPreferences.getInstance().getBoolean(KRAnnotationPreferences.UPDATE_EDITION)) != null) {
 									monitor.worked(50);
 									this.syncExec(new Runnable() {
 										
Index: TXM/trunk/org.txm.annotation.kr.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3440)
+++ TXM/trunk/org.txm.annotation.kr.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3441)
@@ -5,7 +5,7 @@
 command.label     = Entrep\u00F4t de connaissances
 command.label.0   = Textes et Annotations CQP de s\u00E9quences de mots au format XML-TEI SyMoGIH (.xml)...
 command.label.1   = Annotations CQP au format Table (.csv)...
-command.label.111 = Sauvegarder les annotations
+command.label.111 = Enregistrer les annotations CQP
 command.label.2   = Annotations CQP depuis une table (.csv)
 command.name      = Recoder
 command.name.0    = Enregistrer les annotations
Index: TXM/trunk/org.txm.annotation.kr.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.annotation.kr.rcp/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.annotation.kr.rcp/plugin.xml	(revision 3441)
@@ -282,8 +282,10 @@
         <command
               commandId="org.txm.annotation.kr.rcp.commands.SaveAnnotationsAndUpdateCorpus"
               icon="icons/functions/pencil_save.png"
-              label="%command.label.111"
-              style="push">
+              label="CQP"
+              mode="FORCE_TEXT"
+              style="push"
+              tooltip="CQP">
            <visibleWhen
                  checkEnabled="false">
               <reference
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/PrintTableRSymbolAndSelectedLinesNamesMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/PrintTableRSymbolAndSelectedLinesNamesMacro.groovy	(revision 0)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/PrintTableRSymbolAndSelectedLinesNamesMacro.groovy	(revision 3441)
@@ -0,0 +1,34 @@
+package org.txm.macro.r;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.Toolbox
+import org.txm.statsengine.r.core.RWorkspace
+import org.txm.statsengine.r.core.RResult
+import org.txm.core.results.TXMResult
+
+if (editor == null) {
+	println "No active editor. Aborting"
+	return
+}
+
+if (!(editor instanceof org.txm.lexicaltable.rcp.editors.LexicalTableEditor)) {
+	println "Active editor is not a table lexical editor ($editor). Aborting"
+	return
+}
+
+def table = editor.getResult()
+println "R name is: "+table.getRSymbol()
+
+monitor.syncExec(new Runnable() {
+	public void run() {
+		def selection = editor.getlineTableViewer().getSelection()
+		def names = table.getRowNames().asStringsArray()
+		println "Selection: "+selection.toList()
+		println "Names: "+names[selection.toList()]
+	}
+});
+
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/CreateLexicalTableFromRSymbolMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/CreateLexicalTableFromRSymbolMacro.groovy	(revision 0)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/CreateLexicalTableFromRSymbolMacro.groovy	(revision 3441)
@@ -0,0 +1,45 @@
+package org.txm.macro.r;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.Toolbox
+import org.txm.statsengine.r.core.RWorkspace
+import org.txm.statsengine.r.core.RResult
+import org.txm.core.results.TXMResult
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import org.txm.rcp.swt.widget.parameters.*
+import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl
+import org.txm.lexicaltable.core.functions.LexicalTable
+import org.txm.searchengine.cqp.corpus.MainCorpus
+
+def selection = corpusViewSelection
+if (!(selection instanceof TXMResult)) {
+	println "Selection is not a result. Aborting"
+	return
+}
+
+@Field @Option(name="r_table_symbol", usage="R symbol of the R table to import", widget="String", required=false, def="")
+def r_table_symbol
+
+if (!ParametersDialog.open(this)) return
+
+if (!RWorkspace.getRWorkspaceInstance().containsVariable(r_table_symbol)) {
+	println "Error: no R object found for symbol '$r_table_symbol'"
+	return
+}
+def corpus = corpusViewSelection
+if (!(corpus instanceof MainCorpus)) {
+	corpus = corpus.getFirstParent(MainCorpus.class)
+}
+
+def lt = new LexicalTable(corpus);
+lt.setData(new LexicalTableImpl(r_table_symbol))
+lt.compute()
+
+monitor.syncExec(new Runnable() {
+	public void run() {
+		org.txm.rcp.views.corpora.CorporaView.reload()
+	}
+});
\ No newline at end of file
Index: TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/PrintRSymbolMacro.groovy
===================================================================
--- TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/PrintRSymbolMacro.groovy	(revision 0)
+++ TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/r/PrintRSymbolMacro.groovy	(revision 3441)
@@ -0,0 +1,39 @@
+package org.txm.macro.r;
+// STANDARD DECLARATIONS
+
+import org.kohsuke.args4j.*
+
+import groovy.transform.Field
+
+import org.txm.Toolbox
+import org.txm.statsengine.r.core.RWorkspace
+import org.txm.statsengine.r.core.RResult
+import org.txm.core.results.TXMResult
+
+if (editor != null) {
+	println "editor: $editor"
+}
+
+def selection = corpusViewSelection
+if (!(selection instanceof TXMResult)) {
+	println "Selection is not a result. Aborting"
+	return
+}
+def symbol = null;
+
+if (selection instanceof RResult) {
+	symbol = ((RResult)selection).getRSymbol();
+//} else if (selection.getStringParameterValue("rsymbol").length() > 0) {
+//	symbol = selection.getStringParameterValue("rsymbol")
+} else {
+	try {
+		symbol = selection.getClass().getDeclaredMethod("getSymbol").invoke(selection)
+	} catch(Exception e) {}
+}
+
+if (symbol != null) {
+	println "R Name of $selection is: $symbol"
+} else {
+	println "$selection has no R representation"
+}
+
Index: TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java
===================================================================
--- TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 3440)
+++ TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 3441)
@@ -131,6 +131,16 @@
 	 * @param corpus the corpus
 	 * @return the object
 	 */
+	public static SynopticEditionEditor openEdition(CQPCorpus corpus) {
+		return openEdition(corpus, getDefaultEditions(corpus));
+	}
+	
+	/**
+	 * Open edition, but don't show a page
+	 *
+	 * @param corpus the corpus
+	 * @return the object
+	 */
 	public static SynopticEditionEditor openEdition(CQPCorpus corpus, String[] editions) {
 		return openEdition(corpus, Arrays.asList(editions));
 	}
Index: TXM/trunk/org.txm.edition.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.edition.rcp/plugin.xml	(revision 3440)
+++ TXM/trunk/org.txm.edition.rcp/plugin.xml	(revision 3441)
@@ -66,7 +66,8 @@
       <command
             defaultHandler="org.txm.edition.rcp.handlers.OpenEdition"
             id="org.txm.edition.rcp.handlers.OpenEdition"
-            name="%command.name">
+            name="%command.name"
+            returnTypeId="org.txm.searchengine.cqp.corpus.CQPCorpus">
       </command>
       <command
             defaultHandler="org.txm.edition.rcp.handlers.BackToText"
Index: TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java
===================================================================
--- TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 3440)
+++ TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 3441)
@@ -562,9 +562,12 @@
 		else if (this.getPartition() != null) {
 			return NLS.bind(LexicalTableCoreMessages.info_creatingLexicalTableWithTheP0PartitionCommaPropertiesP1, this.getPartition().getName(), this.property.asString());
 		}
+		else if (this.parent instanceof Subcorpus) {
+			return NLS.bind(LexicalTableCoreMessages.info_creatingLexicalTableWithTheP0PartitionCommaPropertiesP1, this.getPartition().getName(), this.property.asString());
+		}
 		// from main corpus and subcorpus
 		else {
-			return NLS.bind(LexicalTableCoreMessages.info_creatingLexicalTableWithTheP0CorpusAndTheP1Subcorpus, this.getCorpus().getCorpusParent().getName(), this.getParent().getName());
+			return NLS.bind("Computing Lexical table on {0}", this.parent.getName());
 		}
 	}
 	
Index: TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java
===================================================================
--- TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java	(revision 3440)
+++ TXM/trunk/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java	(revision 3441)
@@ -124,6 +124,7 @@
 	 */
 	public LexicalTableImpl(String symbol) throws RWorkspaceException {
 		super(symbol);
+		initSortedIndex();
 	}
 	
 	/** The nolex. */
Index: TXM/trunk/org.txm.core/src/java/org/txm/Toolbox.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/Toolbox.java	(revision 3440)
+++ TXM/trunk/org.txm.core/src/java/org/txm/Toolbox.java	(revision 3441)
@@ -875,6 +875,7 @@
 				builder.append(" no CQP corpus with name: "+project.getName().toUpperCase());
 				builder.append("  the import was not done or failed");
 				builder.append("\n");
+				continue;
 			}
 			
 			List<?> errors = corpus.isBuildValid();
@@ -891,7 +892,6 @@
 				builder.append("\n");
 			}
 	
-			
 			if (Log.getLevel().intValue() < Level.INFO.intValue()) { // print more details if log level is lower than INFO
 				
 				builder.append("Project: "+project.getName()+" at "+project.getProjectDirectory());
@@ -920,6 +920,5 @@
 		}
 		
 		IOUtils.write(checkupResultFile, builder.toString());
-		
 	}
 }
Index: TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java	(revision 3440)
+++ TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java	(revision 3441)
@@ -49,7 +49,7 @@
 	
 	public static final String EMPTY_PROPERTY_VALUE_CODE = "empty_property_value_code";
 	
-	public static final String IMPORT_DEFAULT_LANG = "import_default_lang";
+	public static final String CLIPBOARD_IMPORT_DEFAULT_LANG = "import_default_lang";
 	
 	/** The Constant EXPORT_SHOW. */
 	public static final String EXPORT_SHOW = "export_show"; //$NON-NLS-1$
@@ -170,6 +170,8 @@
 	public static final String NORMALISEATTRIBUTEVALUES = "normalize.attribute.values";
 	
 	public static final String CORPUS_VERSION = "corpus_version";
+
+	public static final String CLIPBOARD_IMPORT_ASK_LANG = "clipboard_import_ask_lang";
 	
 	
 	/**
@@ -206,7 +208,8 @@
 		preferences.putBoolean(TBXPreferences.LOG_IN_FILE, false);
 		preferences.put(TBXPreferences.LOG_LEVEL, "INFO"); //$NON-NLS-1$
 		
-		preferences.put(TBXPreferences.IMPORT_DEFAULT_LANG, Locale.getDefault().getLanguage().toLowerCase());
+		preferences.putBoolean(TBXPreferences.CLIPBOARD_IMPORT_ASK_LANG, true);
+		preferences.put(TBXPreferences.CLIPBOARD_IMPORT_DEFAULT_LANG, Locale.getDefault().getLanguage().toLowerCase());
 		preferences.put(TBXPreferences.UI_LOCALE, "fr"); //$NON-NLS-1$
 		
 		preferences.put(TBXPreferences.LANG, Locale.getDefault().getLanguage().toLowerCase());
Index: TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages_fr.properties
===================================================================
--- TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages_fr.properties	(revision 3440)
+++ TXM/trunk/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages_fr.properties	(revision 3441)
@@ -23,7 +23,7 @@
 info_connectingToRAtWithUser=Connexion à R à l'adresse {0}\:{1} avec l''utilisateur {2}.
 info_lastSafeEvalExpression=Dernière expression ''safeeval'' \: {0}.
 info_rPathNotSetTryingToFindIt=Chemin d'accès à l'exécutable de R non indiqué, recherche de l'exécutable dans des lieux standards…
-info_savingChartToFile=Sauvegarde du graphique dans le fichier \: {0}.
+info_savingChartToFile=Enregistrement du graphique dans le fichier \: {0}.
 info_startingRWithCommandLine=Démarrage de R avec la ligne de commande \: {0}
 info_startingStatsEngine=Démarrage du moteur de statistiques \: utilisateur \= {0}, distant \= {1}, port \= {2}, debug \= {3}.
 info_statisticsEngineLaunched=Moteur de statistiques lancé.
