Index: TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java	(revision 3980)
@@ -143,7 +143,7 @@
 	public boolean _compute_with_lists(TXMProgressMonitor monitor) throws Exception {
 		
 		if (this.getUserName() == null || this.getUserName().length() == 0) {
-			this.setUserName("no_name");
+			this.setUserName("");
 		}
 		
 		Log.finest(NLS.bind(SearchEngineCoreMessages.info_creatingNewPartitionP0OfP1, this.getUserName(), this.getParent()));
@@ -742,4 +742,11 @@
 	public List<String> getPartNamesParameter() {
 		return pPartNames;
 	}
+
+	public void removeAllParts() {
+		
+		for (Part p : getParts()) {
+			p.delete();
+		}
+	}
 }
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3980)
@@ -1016,7 +1016,7 @@
 		if (virtualProperties == null) {
 			virtualProperties = new ArrayList<>();
 			virtualProperties.add(new PositionProperty(this));
-			// virtualProperties.add(new LengthProperty(this));
+			virtualProperties.add(new LengthProperty(this));
 		}
 		return virtualProperties;
 	}
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/WordProperty.java	(revision 3980)
@@ -3,6 +3,7 @@
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
 import org.txm.searchengine.cqp.corpus.query.MatchUtils;
@@ -117,6 +118,10 @@
 		return sb.toString();
 	}
 	
+	public String combine(List<String> values) {
+		return StringUtils.join(values, " ");
+	}
+	
 	/**
 	 * 
 	 * @return all indexed values in the main corpus 
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/LengthProperty.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/LengthProperty.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/LengthProperty.java	(revision 3980)
@@ -12,8 +12,10 @@
 import org.txm.searchengine.cqp.serverException.CqiServerError;
 
 /**
- * A CQP property at token/word level
+ * A CQP property at token/word level 
  * 
+ * NOT IMPLEMENTED YET: the actual codes needs to accees 
+ * 
  * @author mdecorde
  *
  */
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java	(revision 3980)
@@ -58,6 +58,5 @@
 	public String getCQLTest(List<String> values) {
 		return null;
 	}
-	
 }
 
Index: TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionPreferencePage.java
===================================================================
--- TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionPreferencePage.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionPreferencePage.java	(revision 3980)
@@ -1,72 +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.partition.rcp.preferences;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbench;
-import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
-import org.txm.core.messages.TXMCoreMessages;
-import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
-import org.txm.partition.rcp.messages.PartitionUIMessages;
-import org.txm.rcp.preferences.TXMPreferencePage;
-import org.txm.rcp.preferences.TXMPreferenceStore;
-
-/**
- * Partition preference page.
- * @author mdecorde
- * @author sjacquot
- *
- */
-public class PartitionPreferencePage extends TXMPreferencePage {
-
-	/**
-	 * Creates the field editors. Field editors are abstractions of the common
-	 * GUI blocks needed to manipulate various types of preferences. Each field
-	 * editor knows how to save and restore itself.
-	 */
-	@Override
-	public void createFieldEditors() {
-		
-		// Charts rendering
-		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent(), PartitionUIMessages.dimensionsChartRendering);
-		
-		this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORT_BY_SIZE, PartitionUIMessages.sortByPartSize, chartsTab));
-		this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, PartitionUIMessages.displayPartsCountInChartTitle, chartsTab));
-		
-		// other shared preferences
-		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
-
-	}
-	
-	@Override
-	public void init(IWorkbench workbench) {
-		this.setPreferenceStore(new TXMPreferenceStore(PartitionDimensionsPreferences.getInstance().getPreferencesNodeQualifier()));
-		this.setTitle(TXMCoreMessages.common_description);
-	}
-}
\ No newline at end of file
Index: TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionDimensionsPreferencePage.java
===================================================================
--- TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionDimensionsPreferencePage.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionDimensionsPreferencePage.java	(revision 3980)
@@ -0,0 +1,72 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.partition.rcp.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.core.messages.TXMCoreMessages;
+import org.txm.partition.core.preferences.PartitionDimensionsPreferences;
+import org.txm.partition.rcp.messages.PartitionUIMessages;
+import org.txm.rcp.preferences.TXMPreferencePage;
+import org.txm.rcp.preferences.TXMPreferenceStore;
+
+/**
+ * Partition preference page.
+ * @author mdecorde
+ * @author sjacquot
+ *
+ */
+public class PartitionDimensionsPreferencePage extends TXMPreferencePage {
+
+	/**
+	 * Creates the field editors. Field editors are abstractions of the common
+	 * GUI blocks needed to manipulate various types of preferences. Each field
+	 * editor knows how to save and restore itself.
+	 */
+	@Override
+	public void createFieldEditors() {
+		
+		// Charts rendering
+		Composite chartsTab = SWTChartsComponentsProvider.createChartsRenderingPreferencesTabFolderComposite(this.getFieldEditorParent(), PartitionUIMessages.dimensionsChartRendering);
+		
+		this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORT_BY_SIZE, PartitionUIMessages.sortByPartSize, chartsTab));
+		this.addField(new BooleanFieldEditor(PartitionDimensionsPreferences.CHART_DIMENSIONS_DISPLAY_PARTS_COUNT_IN_TITLE, PartitionUIMessages.displayPartsCountInChartTitle, chartsTab));
+		
+		// other shared preferences
+		SWTChartsComponentsProvider.createChartsRenderingPreferencesFields(this, chartsTab);
+
+	}
+	
+	@Override
+	public void init(IWorkbench workbench) {
+		this.setPreferenceStore(new TXMPreferenceStore(PartitionDimensionsPreferences.getInstance().getPreferencesNodeQualifier()));
+		this.setTitle(TXMCoreMessages.common_description);
+	}
+}
\ No newline at end of file

Property changes on: TXM/trunk/bundles/org.txm.partition.rcp/src/org/txm/partition/rcp/preferences/PartitionDimensionsPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/bundles/org.txm.partition.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- TXM/trunk/bundles/org.txm.partition.rcp/OSGI-INF/l10n/bundle.properties	(revision 3979)
+++ TXM/trunk/bundles/org.txm.partition.rcp/OSGI-INF/l10n/bundle.properties	(revision 3980)
@@ -4,4 +4,4 @@
 command.name=Dimensions
 command.tooltip=Dimensions
 editor.name=Dimensions
-page.name=Partition
+page.name=Partition dimensions
Index: TXM/trunk/bundles/org.txm.partition.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- TXM/trunk/bundles/org.txm.partition.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3979)
+++ TXM/trunk/bundles/org.txm.partition.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 3980)
@@ -4,4 +4,4 @@
 command.name=Dimensions
 command.tooltip=Dimensions
 editor.name=Dimensions
-page.name=Partition
+page.name=Partition dimensions
Index: TXM/trunk/bundles/org.txm.partition.rcp/plugin.xml
===================================================================
--- TXM/trunk/bundles/org.txm.partition.rcp/plugin.xml	(revision 3979)
+++ TXM/trunk/bundles/org.txm.partition.rcp/plugin.xml	(revision 3980)
@@ -69,7 +69,7 @@
          point="org.eclipse.ui.preferencePages">
       <page
             category="org.txm.rcp.preferences.UserPreferencePage"
-            class="org.txm.partition.rcp.preferences.PartitionPreferencePage"
+            class="org.txm.partition.rcp.preferences.PartitionDimensionsPreferencePage"
             id="org.txm.rcp.partition.preferences.PartitionPreferencePage"
             name="%page.name">
       </page>
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 3980)
@@ -217,7 +217,7 @@
 		
 		if (selectedTab == simpleTab) { // Simple mode
 			
-			partition = simplePanel.createPartition(name);
+			partition = simplePanel.createPartition(name, null);
 		}
 		else if (selectedTab == assistedTab) { // Assisted mode
 			
@@ -227,15 +227,15 @@
 				Log.info(TXMCoreMessages.bind(TXMUIMessages.noPartitionNameWasSpecifiedTheNameIsP0, name));
 			}
 			
-			partition = this.compositeForAssisted.createPartition(name);
+			partition = this.compositeForAssisted.createPartition(name, null);
 		}
 		else if (selectedTab == crossedTab) { // Advanced mode
 			
-			partition = crossedPanel.createPartition(name);
+			partition = crossedPanel.createPartition(name, null);
 		}
 		else if (selectedTab == advancedTab) { // Advanced mode
 			
-			partition = advancedPartitionPanel.createPartition(name);
+			partition = advancedPartitionPanel.createPartition(name, null);
 		}
 		
 		// Error
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SimplePartitionPanel.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SimplePartitionPanel.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SimplePartitionPanel.java	(revision 3980)
@@ -20,7 +20,7 @@
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
 import org.txm.utils.logger.Log;
 
-public class SimplePartitionPanel extends Composite {
+public class SimplePartitionPanel extends Composite implements ParitionParameterGenerator {
 
 	// For the "simple" tab
 	/** The selected structural unit. */
@@ -238,10 +238,8 @@
 		return selectedStructuralUnitProperty;
 	}
 
-	public Partition createPartition(String name) {
+	public Partition createPartition(String name, Partition partition) {
 
-		Partition partition = null;
-
 		// Simple mode
 
 		StructuralUnit structuralUnit = this.structuralUnitsFinal.get(this.structuralUnitsCombo.getSelectionIndex());
@@ -252,7 +250,11 @@
 				name = property.asFullNameString();
 			}
 
-			partition = new Partition(corpus);
+			if (partition == null) {
+				partition = new Partition(corpus);
+			} else {
+				partition.removeAllParts();
+			}
 			partition.setParameters(name, property, null);
 		}
 		catch (Exception e) {
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/CrossedPartitionPanel.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/CrossedPartitionPanel.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/CrossedPartitionPanel.java	(revision 3980)
@@ -23,7 +23,7 @@
 import org.txm.searchengine.cqp.corpus.Subcorpus;
 import org.txm.utils.logger.Log;
 
-public class CrossedPartitionPanel extends Composite {
+public class CrossedPartitionPanel extends Composite implements ParitionParameterGenerator {
 
 	/** The selected structural unit property. */
 	private List<StructuralUnitProperty> selectedStructuralUnitProperties = new ArrayList<>();
@@ -83,7 +83,7 @@
 		propertyLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
 		propertyLabel.setToolTipText("Select at least two properties");
 		
-		propertyCombo = new SuperListViewer(this, SWT.MULTI);
+		propertyCombo = new SuperListViewer(this, SWT.MULTI|SWT.V_SCROLL);
 		propertyCombo.setLabelProvider(new LabelProvider() {
 			@Override
 			public String getText(Object element) {
@@ -94,7 +94,9 @@
 				}
 			}
 		});
-		propertyCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+		GridData gdata = new GridData(GridData.FILL, GridData.FILL, true, true);
+		gdata.heightHint = 400;
+		propertyCombo.setLayoutData(gdata);
 
 		ArrayList<StructuralUnitProperty> all = new ArrayList<>();
 		for (StructuralUnit su : structuralUnitsFinal) {
@@ -148,7 +150,7 @@
 		return selectedStructuralUnitProperties;
 	}
 
-	public Partition createPartition(String name) {
+	public Partition createPartition(String name, Partition partition) {
 		
 		if (selectedStructuralUnitProperties.size() < 2) {
 			return null;
@@ -166,9 +168,8 @@
 		String expandTarget = expandText.getText();
 		
 		PartitionQueriesGenerator pqg = new PartitionQueriesGenerator();
-		Partition partition;
 		try {
-			partition = pqg.createPartition(corpus, false,
+			partition = pqg.createPartition(corpus, partition, false,
 					name, partNamePrefix, separator,
 					structuralUnits, structuralUnitProperties,
 					structuralUnitToIgnore, expandTarget);
@@ -208,7 +209,7 @@
 		 * @throws CqiClientException 
 		 * @throws InterruptedException 
 		 */
-		public Partition createPartition(CQPCorpus corpus, boolean debug,
+		public Partition createPartition(CQPCorpus corpus, Partition partition, boolean debug,
 				String partitionName, String partNamePrefix, String separator,
 				List<String> structuralUnits, List<String> structuralUnitProperties,
 				List<String> structuralUnitToIgnore, String expandTarget) throws CqiClientException, InterruptedException 	{
@@ -266,7 +267,11 @@
 
 				// Creating the partition
 				if (!DEBUG  && queries.size() == partNames.size()) {
-					Partition partition = new Partition(corpus);
+					if (partition == null) {
+						partition = new Partition(corpus);
+					} else {
+						partition.removeAllParts();
+					}
 					partition.setParameters(PARTITION_NAME, queries, partNames);
 					partition.compute();
 					return partition;
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/ComplexSubcorpusPanel.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/ComplexSubcorpusPanel.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/ComplexSubcorpusPanel.java	(revision 3980)
@@ -59,7 +59,7 @@
 /**
  * The Class ComplexSubcorpusPanel.
  */
-public class ComplexSubcorpusPanel extends Composite {
+public class ComplexSubcorpusPanel extends Composite implements SubcorpusParameterGenerator {
 	
 	/** The self. */
 	
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/ParitionParameterGenerator.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/ParitionParameterGenerator.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/ParitionParameterGenerator.java	(revision 3980)
@@ -0,0 +1,14 @@
+package org.txm.rcp.swt.widget.structures;
+
+import org.txm.searchengine.cqp.corpus.Partition;
+
+public interface ParitionParameterGenerator {
+	
+	/**
+	 * creates or updates a partition
+	 * @param name
+	 * @param partition
+	 * @return
+	 */
+	public Partition createPartition(String name, Partition partition);
+}

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

Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SubcorpusParameterGenerator.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SubcorpusParameterGenerator.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SubcorpusParameterGenerator.java	(revision 3980)
@@ -0,0 +1,7 @@
+package org.txm.rcp.swt.widget.structures;
+
+
+public interface SubcorpusParameterGenerator {
+	public String getQueryString();
+	public String getGeneratedName();
+}

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

Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/AdvancedPartitionPanel.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/AdvancedPartitionPanel.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/AdvancedPartitionPanel.java	(revision 3980)
@@ -27,7 +27,7 @@
 import org.txm.utils.io.IOUtils;
 import org.txm.utils.logger.Log;
 
-public class AdvancedPartitionPanel extends Composite {
+public class AdvancedPartitionPanel extends Composite implements ParitionParameterGenerator {
 
 	// for the "advanced" tab
 	/** The queries. */
@@ -189,7 +189,7 @@
 	 *
 	 * @return the advance part names
 	 */
-	private List<String> getAdvancePartNames() {
+	public List<String> getNames() {
 
 		ArrayList<String> values = new ArrayList<>();
 		int count = 0;
@@ -229,7 +229,7 @@
 		return false;
 	}
 
-	public Partition createPartition(String name) {
+	public Partition createPartition(String name, Partition partition) {
 
 		queriesString.clear();
 		for (QueryWidget query : queries) {
@@ -237,8 +237,6 @@
 			//query.memorize();
 		}
 
-		Partition partition = null;
-
 		try {
 			// auto-naming if needed
 			if (name.isEmpty()) {
@@ -246,8 +244,12 @@
 				Log.info(TXMCoreMessages.bind(TXMUIMessages.noPartitionNameWasSpecifiedTheNameIsP0, name));
 			}
 
-			partition = new Partition(this.corpus);
-			partition.setParameters(name, this.getQueries(), this.getAdvancePartNames());
+			if (partition == null) {
+				partition = new Partition(this.corpus);
+			} else {
+				partition.removeAllParts();
+			}
+			partition.setParameters(name, this.getQueries(), this.getNames());
 		}
 		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
@@ -256,4 +258,5 @@
 
 		return partition;
 	}
+
 }
\ No newline at end of file
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java	(revision 3980)
@@ -50,6 +50,7 @@
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.widget.structures.ParitionParameterGenerator;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.Partition;
@@ -63,7 +64,7 @@
 /**
  * used for assisted mode of partition creation @ author mdecorde.
  */
-public class PartitionComposer extends Composite {
+public class PartitionComposer extends Composite implements ParitionParameterGenerator{
 	
 	/** The self. */
 	PartitionComposer self;
@@ -595,13 +596,13 @@
 	 *
 	 * @return the partition
 	 */
-	public Partition createPartition(String name) {
+	public Partition createPartition(String name, Partition partition) {
 		
 		if (this.parts.size() == 0) {
 			System.out.println(TXMUIMessages.errorColonThisPartitionHasNoPart);
 			return null;
 		}
-		
+				
 		List<String> queries = new ArrayList<>();
 		List<String> partnames = new ArrayList<>();
 		for (PartItem part : this.parts) {
@@ -618,9 +619,13 @@
 		}
 		
 		try {
-			Partition p = new Partition(corpus);
-			p.setParameters(name, queries, partnames);
-			return p;
+			if (partition == null) {
+				partition = new Partition(corpus);
+			} else {
+				partition.removeAllParts();
+			}
+			partition.setParameters(name, queries, partnames);
+			return partition;
 		}
 		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
@@ -637,10 +642,5 @@
 		
 		return this.availableList.getItemCount() > 0;
 	}
-	
-	public String getGeneratedName() {
-		
-		// TODO Auto-generated method stub
-		return null;
-	}
+
 }
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorpusViewLabelProvider.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorpusViewLabelProvider.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorpusViewLabelProvider.java	(revision 3980)
@@ -19,6 +19,8 @@
 	public String getText(Object element) { // cut label if too long
 		
 		String txt = super.getText(element);
+		if (txt == null || txt.length() == 0) return "no_name";
+		
 		if (txt != null && txt.length() > TXMEditor.MAX_NAME_LENGTH) {
 			txt = txt.substring(0, TXMEditor.MAX_NAME_LENGTH - 1) + "..."; //$NON-NLS-1$
 		}
Index: TXM/trunk/bundles/org.txm.index.core/src/org/txm/index/core/functions/Line.java
===================================================================
--- TXM/trunk/bundles/org.txm.index.core/src/org/txm/index/core/functions/Line.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.index.core/src/org/txm/index/core/functions/Line.java	(revision 3980)
@@ -198,6 +198,7 @@
 	 * @return the string
 	 */
 	public String toString(String separator) {
+		
 		String rez = ""; //$NON-NLS-1$
 		int len = 0;
 		for (int i = 0; i < properties.size();) {
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/SubcorpusPreferencePage.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/SubcorpusPreferencePage.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/SubcorpusPreferencePage.java	(revision 3980)
@@ -37,8 +37,11 @@
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.ui.IWorkbench;
 import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TBXPreferences;
+import org.txm.core.preferences.TXMPreferences;
 import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.rcp.Application;
+import org.txm.rcp.preferences.RCPPreferences;
 import org.txm.rcp.preferences.TXMPreferencePage;
 import org.txm.rcp.preferences.TXMPreferenceStore;
 import org.txm.searchengine.cqp.core.preferences.SubcorpusPreferences;
@@ -79,6 +82,11 @@
 		
 		optimized_mode = new BooleanFieldEditor(SubcorpusPreferences.OPTIMIZED_MODE, "Create structured subcorpus using optimized queries", BooleanFieldEditor.DEFAULT, getFieldEditorParent());
 		addField(optimized_mode);
+		
+		if (TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER)) {
+			editor_mode = new BooleanFieldEditor(SubcorpusPreferences.EDITORMODE, "Create subcorpus using an editor instead of a dialog", BooleanFieldEditor.DEFAULT, getFieldEditorParent());
+			addField(editor_mode);
+		}
 	}
 	
 	/*
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/PartitionPreferencePage.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/PartitionPreferencePage.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/PartitionPreferencePage.java	(revision 3980)
@@ -37,6 +37,7 @@
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.ui.IWorkbench;
 import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TBXPreferences;
 import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.rcp.Application;
 import org.txm.rcp.preferences.TXMPreferencePage;
@@ -52,17 +53,17 @@
  *
  */
 public class PartitionPreferencePage extends TXMPreferencePage {
-
+	
 	/** The cqi_server_is_remote. */
 	private BooleanFieldEditor editor_mode;
-
+	
 	/**
 	 * Instantiates a new cQP preference page.
 	 */
 	public PartitionPreferencePage() {
 		super();
 	}
-
+	
 	/**
 	 * Creates the field editors. Field editors are abstractions of the common
 	 * GUI blocks needed to manipulate various types of preferences. Each field
@@ -70,11 +71,13 @@
 	 */
 	@Override
 	public void createFieldEditors() {
-
-		editor_mode = new BooleanFieldEditor(PartitionPreferences.EDITOR_MODE, "Create partitions using the editor mode", BooleanFieldEditor.DEFAULT, getFieldEditorParent());
-		addField(editor_mode);
+		
+		if (TBXPreferences.getInstance().getBoolean(TBXPreferences.EXPERT_USER)) {
+			editor_mode = new BooleanFieldEditor(PartitionPreferences.EDITOR_MODE, "Create partitions using the editor mode", BooleanFieldEditor.DEFAULT, getFieldEditorParent());
+			addField(editor_mode);
+		}
 	}
-
+	
 	/*
 	 * (non-Javadoc)
 	 * 
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java	(revision 3980)
@@ -11,6 +11,8 @@
 import org.eclipse.swt.events.SelectionListener;
 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.Group;
 import org.eclipse.swt.widgets.Label;
@@ -27,40 +29,43 @@
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.swt.widget.AssistedChoiceQueryWidget;
 import org.txm.rcp.swt.widget.structures.ComplexSubcorpusPanel;
+import org.txm.rcp.swt.widget.structures.ContextsSubcorpusPanel;
 import org.txm.rcp.swt.widget.structures.SimpleSubcorpusPanel;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.Subcorpus;
 import org.txm.searchengine.cqp.corpus.query.Match;
 
 public class SubcorpusEditor extends TXMEditor<Subcorpus> {
-
+	
 	protected static final String ASSISTANTS_GROUPNAME = "Assistants";
 	private Label nameLabel;
 	@Parameter(key = TXMPreferences.USER_NAME)
-
+	
 	private Text nameText;
-
+	
 	private Label queryLabel;
-
+	
 	@Parameter(key = TXMPreferences.QUERY)
 	private AssistedChoiceQueryWidget queryWidget;
-
+	
 	Label matchesInfo;
 	Text matchStartsEndsInfo;
+	Composite assistantPanel;
 	private Group modeGroups;
 	private ToolItem refreshQueryButton;
-
+	private Button updateQueryFromAssistance;
+	
 	@Override
 	public void _createPartControl() throws Exception {
-
+		
 		getSite().getPage().addPartListener(new IPartListener() {
-
+			
 			@Override
 			public void partOpened(IWorkbenchPart part) { }
-
+			
 			@Override
 			public void partDeactivated(IWorkbenchPart part) { }
-
+			
 			@Override
 			public void partClosed(IWorkbenchPart part) {
 				TXMResult r = getResult();
@@ -69,172 +74,214 @@
 					CorporaView.refresh();
 				}
 			}
-
+			
 			@Override
 			public void partBroughtToTop(IWorkbenchPart part) { }
-
+			
 			@Override
 			public void partActivated(IWorkbenchPart part) { }
 		});
-
+		
 		// Modified computing listeners to manage multi lines query widgets
-				ComputeKeyListener computeKeyListener = new ComputeKeyListener(this) {
-
-					@Override
-					public void keyPressed(KeyEvent e) {
-
-						if (queryWidget.getQuery() == null) return;
-						if (!queryWidget.getQuery().getSearchEngine().hasMultiLineQueries()) super.keyPressed(e);
-					}
-				};
+		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this) {
+			
+			@Override
+			public void keyPressed(KeyEvent e) {
+				
+				if (queryWidget.getQuery() == null) return;
+				if (!queryWidget.getQuery().getSearchEngine().hasMultiLineQueries()) super.keyPressed(e);
+			}
+		};
 		
 		getMainParametersComposite().getLayout().numColumns = 4;
-
+		
 		nameLabel = new Label(getMainParametersComposite(), SWT.NONE);
 		nameLabel.setText(TXMUIMessages.name);
 		nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		
 		nameText = new Text(this.getMainParametersComposite(), SWT.BORDER);
 		GridData gdata = new GridData(SWT.FILL, SWT.CENTER, true, false);
 		nameText.setLayoutData(gdata);
 		gdata.widthHint = 150;
 		nameText.addModifyListener(computeKeyListener);
-
+		
 		queryLabel = new Label(getMainParametersComposite(), SWT.NONE);
 		queryLabel.setText(TXMUIMessages.ampQuery);
 		queryLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		
 		queryWidget = new AssistedChoiceQueryWidget(this.getMainParametersComposite(), SWT.BORDER|SWT.DROP_DOWN | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL, getResult());
-		queryWidget.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
+		gdata = new GridData(SWT.FILL, SWT.FILL, true, true);
+		gdata.minimumWidth = 400;
+		queryWidget.setLayoutData(gdata);
 		queryWidget.addKeyListener(computeKeyListener);
 		queryWidget.getQueryWidget().addModifyListener(computeKeyListener);
-
+		
 		ArrayList<String> modes = new ArrayList<String>();
 		final ArrayList<SelectionListener> listeners = new ArrayList<SelectionListener>();
-
+		
 		// MODE TABS
 		SelectionListener openCloseSelectionListener = new SelectionListener() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-
-				boolean v = getTopToolbar().isVisible(ASSISTANTS_GROUPNAME);
-				if (!v) { // not visible remove all composites
-					if (modeGroups.getChildren().length > 0) {
-						Control c = modeGroups.getChildren()[0];
-						if (c instanceof SimpleSubcorpusPanel) {
-							SimpleSubcorpusPanel ssp = (SimpleSubcorpusPanel)c;
-							String q = ssp.getQueryString();
-							if (q.length() > 0) {
-								queryWidget.setText(q);
-							}
-						} else if (c instanceof ComplexSubcorpusPanel) {
-							ComplexSubcorpusPanel ssp = (ComplexSubcorpusPanel)c;
-							GridData gdata = new GridData(GridData.FILL, GridData.FILL, true, true);
-							ssp.setLayoutData(gdata);
-							gdata.heightHint = 600;
-							String q = ssp.getQueryString();
-							if (q.length() > 0) {
-								queryWidget.setText(q);
-							}
+				
+				if (e.getSource() == updateQueryFromAssistance) { // copy query
+					Control c = modeGroups.getChildren()[0];
+					if (c instanceof SimpleSubcorpusPanel) {
+						SimpleSubcorpusPanel ssp = (SimpleSubcorpusPanel)c;
+						String q = ssp.getQueryString();
+						if (q.length() > 0) {
+							queryWidget.setText(q);
+							nameText.setText(ssp.getGeneratedName());
 						}
-						for (Control c2 : modeGroups.getChildren()) c2.dispose();
+					} else if (c instanceof ComplexSubcorpusPanel) {
+						ComplexSubcorpusPanel ssp = (ComplexSubcorpusPanel)c;
+						String q = ssp.getQueryString();
+						if (q.length() > 0) {
+							queryWidget.setText(q);
+							nameText.setText(ssp.getGeneratedName());
+						}
 					}
-				} else { 
+				} else {
 					
-					for (Control c : modeGroups.getChildren()) c.dispose();
+					for (Control c2 : modeGroups.getChildren()) c2.dispose();
 					
-					if (modeGroups.getChildren().length  == 0) {
-						listeners.get(0).widgetSelected(e);
+					boolean v = getTopToolbar().isVisible(ASSISTANTS_GROUPNAME);
+					if (v) { // not visible remove all composites
+						
+						updateQueryFromAssistance.setEnabled(false);
+						getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, false);
+					} else { 
+						
+						updateQueryFromAssistance.setEnabled(true);
+						if (modeGroups.getChildren().length  == 0) { // select first mode by default
+							listeners.get(0).widgetSelected(e);
+						}
 					}
+					
+					modeGroups.layout(true);
+					getResultArea().getParent().layout(true);
 				}
 			}
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {	}
 		};
-
+		
 		modes.add("Simple");
 		modes.add("Assisted");
-
+		modes.add("Contexts");
+		
 		listeners.add(new SelectionListener() { // create alistener to instantiate a new AnnotationArea
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				try {
-					for (Control c : modeGroups.getChildren()) c.dispose();
-
+					for (Control c : modeGroups.getChildren()) c.dispose(); // clean
+					
 					getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, true);
-
-					SimpleSubcorpusPanel panel = new SimpleSubcorpusPanel(modeGroups, SWT.BORDER, null, getResult().getCorpusParent());
-					panel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
-
+					
+					assistantPanel = new SimpleSubcorpusPanel(modeGroups, SWT.BORDER, null, getResult().getCorpusParent());
+					assistantPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+					
 					modeGroups.layout(true);
 					getResultArea().getParent().layout(true);
-
+					updateQueryFromAssistance.setEnabled(true);
+					
 				} catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
 		listeners.add(new SelectionListener() { // create alistener to instantiate a new AnnotationArea
-
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				try {
-					for (Control c : modeGroups.getChildren()) c.dispose();
-
+					for (Control c : modeGroups.getChildren()) c.dispose(); // clean
+					
 					getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, true);
-
-					ComplexSubcorpusPanel panel = new ComplexSubcorpusPanel(modeGroups, SWT.BORDER, getResult().getCorpusParent());
-					panel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
-
+					
+					assistantPanel = new ComplexSubcorpusPanel(modeGroups, SWT.BORDER, getResult().getCorpusParent());
+					assistantPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+					
 					modeGroups.layout(true);
 					getResultArea().getParent().layout(true);
-
+					updateQueryFromAssistance.setEnabled(true);
+					
 				} catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
-
+			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
+		listeners.add(new SelectionListener() { // create alistener to instantiate a new AnnotationArea
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				try {
+					for (Control c : modeGroups.getChildren()) c.dispose(); // clean
+					
+					getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, true);
+					
+					assistantPanel = new ContextsSubcorpusPanel(modeGroups, SWT.BORDER, getResult().getCorpusParent());
+					assistantPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+					
+					modeGroups.layout(true);
+					getResultArea().getParent().layout(true);
+					updateQueryFromAssistance.setEnabled(true);
+					
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
 		modeGroups = this.getTopToolbar().installAlternativesGroup(ASSISTANTS_GROUPNAME, ASSISTANTS_GROUPNAME, IImageKeys.ACTION_ASSISTQUERY, null, false, openCloseSelectionListener, modes, listeners);
 		modeGroups.setLayout(new GridLayout(1, true));
-
+		
 		// RESULT AREA
-
+		
+		updateQueryFromAssistance = new Button(this.getResultArea(), SWT.PUSH);
+		updateQueryFromAssistance.setText("Update query from query assitant");
+		updateQueryFromAssistance.addSelectionListener(openCloseSelectionListener);
+		updateQueryFromAssistance.setEnabled(false);
+		
 		matchesInfo = new Label(this.getResultArea(), SWT.NONE);
 		matchesInfo.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
-
+		
 		matchStartsEndsInfo = new Text(this.getResultArea(), SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
 		matchStartsEndsInfo.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, true));
 	}
-
+	
 	protected void refreshQuery() {
 		System.out.println("Refresh query...");
 	}
-
+	
 	@Override
 	public void updateResultFromEditor() {
 		// nothing to do
 	}
-
+	
 	@Override
 	public void updateEditorFromResult(boolean update) throws Exception {
-
+		
 		List<? extends org.txm.objects.Match> matches = getResult().getMatches();
 		if (matches == null || matches.size() == 0) {
-
+			
 			if (getResult().hasBeenComputedOnce()) {
 				matchesInfo.setText(NLS.bind("{0} match and {1} token", 0, 0));
 			} else {
-				matchesInfo.setText("(not computed yes)");
+				matchesInfo.setText("(not computed yet)");
 			}
 			matchStartsEndsInfo.setText("");
 		} else {
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/PartitionEditor.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/PartitionEditor.java	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/PartitionEditor.java	(revision 3980)
@@ -1,6 +1,8 @@
 package org.txm.searchengine.cqp.rcp.editor;
 
-import org.apache.commons.lang.StringUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.viewers.CellLabelProvider;
 import org.eclipse.jface.viewers.ISelection;
@@ -18,15 +20,25 @@
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 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.Event;
+import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.Parameter;
+import org.txm.rcp.IImageKeys;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.editors.listeners.ComputeKeyListener;
+import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.GLComposite;
 import org.txm.rcp.swt.widget.AssistedQueryWidget;
+import org.txm.rcp.swt.widget.PartitionComposer;
+import org.txm.rcp.swt.widget.structures.CrossedPartitionPanel;
+import org.txm.rcp.swt.widget.structures.SimplePartitionPanel;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Part;
@@ -34,7 +46,9 @@
 import org.txm.utils.logger.Log;
 
 public class PartitionEditor extends TXMEditor<Partition> {
-
+	
+	protected static final String ASSISTANTS_GROUPNAME = "Assistants";
+	
 	TableViewer partsViewer;
 	TableViewerColumn nameColumn;
 	TableViewerColumn queryColumn;
@@ -46,6 +60,9 @@
 	
 	private Text partNameWidget;
 	private AssistedQueryWidget queryWidget;
+	private Group modeGroups;
+	private Button updateQueryFromAssistance;
+	private Composite assistantPanel;
 	
 	@Override
 	public void _createPartControl() throws Exception {
@@ -57,11 +74,13 @@
 		getMainParametersComposite().getLayout().numColumns = 7;
 		
 		Label l = new Label(getMainParametersComposite(), SWT.NONE);
-		l.setText("Name");
+		l.setText(TXMUIMessages.name);
 		l.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
 		
 		nameWidget = new Text(getMainParametersComposite(), SWT.BORDER);
-		nameWidget.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		GridData gdata = new GridData(SWT.LEFT, SWT.CENTER, false, false);
+		gdata.minimumWidth = 300;
+		nameWidget.setLayoutData(gdata);
 		nameWidget.addModifyListener(new ModifyListener() {
 			
 			@Override
@@ -81,12 +100,16 @@
 		miniInfoLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
 		
 		partNameWidget = new Text(getMainParametersComposite(), SWT.BORDER);
-		partNameWidget.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		gdata = new GridData(SWT.LEFT, SWT.CENTER, false, false);
+		gdata.minimumWidth = 300;
+		partNameWidget.setLayoutData(gdata);
 		
 		// [ (v)]
 		// queryWidget = new QueryWidget(queryArea, SWT.DROP_DOWN);
 		queryWidget = new AssistedQueryWidget(getMainParametersComposite(), SWT.DROP_DOWN, getResult().getCorpus());
-		queryWidget.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+		gdata = new GridData(SWT.LEFT, SWT.CENTER, false, false);
+		gdata.minimumWidth = 400;
+		queryWidget.setLayoutData(gdata);
 		queryWidget.addKeyListener(new ComputeKeyListener(this) {
 			@Override
 			public void keyPressed(KeyEvent e) {
@@ -131,6 +154,182 @@
 			public void widgetDefaultSelected(SelectionEvent e) { }
 		});
 		
+		ArrayList<String> modes = new ArrayList<String>();
+		final ArrayList<SelectionListener> listeners = new ArrayList<SelectionListener>();
+		
+		// MODE TABS
+		SelectionListener openCloseSelectionListener = new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				if (e.getSource() == updateQueryFromAssistance) { // copy query
+					Control c = modeGroups.getChildren()[0];
+					
+					if (c instanceof SimplePartitionPanel) {
+						
+						SimplePartitionPanel ssp = (SimplePartitionPanel)c;
+						ssp.createPartition("", getResult());
+					} else if (c instanceof CrossedPartitionPanel) {
+						
+						CrossedPartitionPanel ssp = (CrossedPartitionPanel)c;
+						ssp.createPartition("", getResult());
+					}  else if (c instanceof PartitionComposer) {
+						
+						PartitionComposer ssp = (PartitionComposer)c;
+						ssp.createPartition(nameWidget.getText(), getResult());
+					}
+					
+					compute(false);
+					
+					try {
+						updateEditorFromResult(false);
+					}
+					catch (Exception e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
+					
+				} else {
+					
+					for (Control c2 : modeGroups.getChildren()) c2.dispose();
+					
+					boolean v = getTopToolbar().isVisible(ASSISTANTS_GROUPNAME);
+					if (v) { // not visible remove all composites
+						updateQueryFromAssistance.setEnabled(false);
+						getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, false);
+					} else { 
+						updateQueryFromAssistance.setEnabled(true);
+						if (modeGroups.getChildren().length  == 0) { // select first mode by default
+							listeners.get(0).widgetSelected(e);
+						}
+					}
+					
+					modeGroups.layout(true);
+					getResultArea().getParent().layout(true);
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {	}
+		};
+		
+		modes.add("Simple");
+		modes.add("Assisted");
+		modes.add("Crossed");
+		
+		listeners.add(new SelectionListener() { // create alistener to instantiate a new AnnotationArea
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				try {
+					for (Control c : modeGroups.getChildren()) c.dispose(); // clean
+					
+					getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, true);
+					
+					assistantPanel = new SimplePartitionPanel(modeGroups, SWT.BORDER, getResult().getCorpus());
+					assistantPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+					
+					modeGroups.layout(true);
+					getResultArea().getParent().layout(true);
+					updateQueryFromAssistance.setEnabled(true);
+					
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		listeners.add(new SelectionListener() { // create alistener to instantiate a new AnnotationArea
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				try {
+					for (Control c : modeGroups.getChildren()) c.dispose(); // clean
+					
+					getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, true);
+					
+					assistantPanel = new PartitionComposer(modeGroups, SWT.BORDER, getResult().getCorpus());
+					assistantPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+					
+					modeGroups.layout(true);
+					getResultArea().getParent().layout(true);
+					updateQueryFromAssistance.setEnabled(true);
+					
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		listeners.add(new SelectionListener() { // create alistener to instantiate a new AnnotationArea
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				try {
+					for (Control c : modeGroups.getChildren()) c.dispose(); // clean
+					
+					getTopToolbar().setVisible(ASSISTANTS_GROUPNAME, true);
+					
+					assistantPanel = new CrossedPartitionPanel(modeGroups, SWT.BORDER, getResult().getCorpus());
+					assistantPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+					
+					modeGroups.layout(true);
+					getResultArea().getParent().layout(true);
+					updateQueryFromAssistance.setEnabled(true);
+					
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		modeGroups = this.getTopToolbar().installAlternativesGroup(ASSISTANTS_GROUPNAME, ASSISTANTS_GROUPNAME, IImageKeys.ACTION_ASSISTQUERY, null, false, openCloseSelectionListener, modes, listeners);
+		modeGroups.setLayout(new GridLayout(1, true));
+		
+		// RESULT AREA
+		
+		GLComposite buttons = new GLComposite(this.getResultArea(), SWT.NONE, "buttons");
+		buttons.getLayout().numColumns = 10;
+		buttons.getLayout().horizontalSpacing = 2;
+		
+		Button deleteAllButton = new Button(buttons, SWT.PUSH);
+		deleteAllButton.setText("Clear");
+		deleteAllButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				for (Part p : getResult().getParts()) {
+					p.delete();
+				}
+				
+				partsViewer.setInput(getResult());
+				try {
+					updateEditorFromResult(false);
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					e1.printStackTrace();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+		
+		updateQueryFromAssistance = new Button(buttons, SWT.PUSH);
+		updateQueryFromAssistance.setText("Add parts from from assitant");
+		updateQueryFromAssistance.addSelectionListener(openCloseSelectionListener);
+		updateQueryFromAssistance.setEnabled(false);
+		
 		partsViewer = new TableViewer(this.getResultArea());
 		partsViewer.getTable().setLayoutData(GridDataFactory.fillDefaults().align(GridData.FILL, GridData.FILL).grab(true, true).create());
 		partsViewer.getTable().setHeaderVisible(true);
@@ -143,18 +342,20 @@
 				if (e.keyCode == SWT.DEL) {
 					ISelection isel = partsViewer.getSelection();
 					IStructuredSelection sel = (IStructuredSelection)isel;
-					Object o = sel.getFirstElement();
-					if (o != null && o instanceof Part) {
-						Part p = (Part)o;
-						p.delete();
-						partsViewer.setInput(getResult());
-						try {
-							updateEditorFromResult(false);
-						} catch (Exception e1) {
-							// TODO Auto-generated catch block
-							e1.printStackTrace();
+					for (Object o : sel.toList()) {
+						if (o != null && o instanceof Part) {
+							Part p = (Part)o;
+							p.delete();
 						}
 					}
+					
+					partsViewer.setInput(getResult());
+					try {
+						updateEditorFromResult(false);
+					} catch (Exception e1) {
+						// TODO Auto-generated catch block
+						e1.printStackTrace();
+					}
 				}
 			}
 			
@@ -169,7 +370,7 @@
 				if (inputElement instanceof Partition) {
 					return ((Partition)inputElement).getParts().toArray();
 				}
-								
+				
 				return new Object[0];
 			}
 			
@@ -249,7 +450,7 @@
 		
 		partsViewer.setInput(getResult());
 	}
-
+	
 	/**
 	 * 
 	 * @param event
@@ -288,11 +489,54 @@
 		return false;
 	}
 	
+	/**
+	 * 
+	 * @return success state
+	 */
+	public boolean addMultiParts(ArrayList<String> queries, ArrayList<String> names) {
+		System.out.println("Add parts: "+queries+" "+names);
+		
+		if (queries.size() == 0) {
+			Log.warning("Error: no queries");
+			return false;
+		}
+		if (names.size() == 0) {
+			Log.warning("Error: no names.");
+			return false;
+		}
+		if (names.size() != queries.size()) {
+			Log.warning("Error: names and queries sizes differ.");
+			return false;
+		}
+		try {
+			for (int i = 0 ; i < names.size() ; i++) {
+				Part p = new Part(getResult(), names.get(i), queries.get(i));
+				
+				if (p.compute() && p.getSize() > 0) { // the part is OK, update the partition parameters
+					getResult().getQueriesParameter().add(queries.get(i));
+					getResult().getPartNamesParameter().add(names.get(i));
+				} else {
+					p.delete(); // remove bad results
+				}
+			}
+			
+			compute(false);
+			
+			updateEditorFromResult(false);
+		}
+		catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+	
 	@Override
 	public void updateResultFromEditor() {
 		// nothing to do
 	}
-
+	
 	@Override
 	public void updateEditorFromResult(boolean update) throws Exception {
 		partsViewer.setInput(getResult());
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/plugin.xml
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3979)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3980)
@@ -99,6 +99,12 @@
             id="org.txm.searchengine.cqp.rcp.preferences.SubcorpusPreferencePage"
             name="%page.name.0">
       </page>
+      <page
+            category="org.txm.rcp.preferences.UserPreferencePage"
+            class="org.txm.searchengine.cqp.rcp.preferences.PartitionPreferencePage"
+            id="org.txm.searchengine.cqp.rcp.preferences.PartitionPreferencePage"
+            name="Partition">
+      </page>
    </extension>
    <extension
          point="org.eclipse.ui.menus">
