Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 3592)
@@ -147,6 +147,7 @@
 	 * @param corpus the corpus
 	 */
 	public CreatePartitionDialog(Shell parentShell, CQPCorpus corpus) {
+		
 		super(parentShell);
 		this.corpus = corpus;
 		this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
@@ -159,6 +160,7 @@
 	 */
 	@Override
 	protected void configureShell(Shell newShell) {
+		
 		super.configureShell(newShell);
 		newShell.setText(TXMUIMessages.createPartition);
 		newShell.setMinimumSize(400, 400);
@@ -170,6 +172,7 @@
 	 */
 	@Override
 	protected Control createDialogArea(Composite parent) {
+		
 		Composite c = new Composite(parent, SWT.NONE);
 		c.setLayout(new GridLayout(2, false));
 		GridData maindatalayout = new GridData(GridData.FILL, GridData.FILL, true, false);
@@ -282,6 +285,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent event) {
+				
 				reloadProperties();
 			}
 		});
@@ -302,6 +306,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent event) {
+				
 				selectedStructuralUnitProperty = selectedStructuralUnit
 						.getOrderedProperties().get(propertyCombo.getSelectionIndex());
 			}
@@ -314,8 +319,7 @@
 		
 		assistedTab.setText(TXMUIMessages.assisted);
 		
-		compositeForAssisted = new PartitionComposer(tabFolder, SWT.NONE,
-				this.corpus);
+		compositeForAssisted = new PartitionComposer(tabFolder, SWT.NONE, this.corpus);
 		assistedTab.setControl(compositeForAssisted);
 		
 		// Third tab: avanced mode
@@ -329,19 +333,17 @@
 		advanceContainer.setLayout(advanceLayout);
 		advancedTab.setControl(advanceContainer);
 		
-		scrollComposite = new ScrolledComposite(advanceContainer, SWT.V_SCROLL
-				| SWT.BORDER);
-		scrollComposite.setLayoutData(new GridData(GridData.FILL,
-				GridData.FILL, true, true, 2, 1));
+		scrollComposite = new ScrolledComposite(advanceContainer, SWT.V_SCROLL | SWT.BORDER);
+		scrollComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
 		
 		Button plusButton = new Button(advanceContainer, SWT.NONE);
-		plusButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER,
-				GridData.FILL, false, false));
+		plusButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER, GridData.FILL, false, false));
 		plusButton.setText("+"); //$NON-NLS-1$
 		plusButton.addListener(SWT.Selection, new Listener() {
 			
 			@Override
 			public void handleEvent(Event event) {
+				
 				addQueryField();
 			}
 		});
@@ -386,6 +388,7 @@
 			
 			@Override
 			public void controlResized(ControlEvent e) {
+				
 				Rectangle r = scrollComposite.getClientArea();
 				scrollComposite.setMinSize(compositeForAdvanced.computeSize(
 						r.width, SWT.DEFAULT));
@@ -404,6 +407,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				// record the tab currently in use
 				if (tabFolder.getSelectionIndex() == 0) {
 					isSimpleSelected = true;
@@ -430,6 +434,7 @@
 	 * Reload properties.
 	 */
 	private void reloadProperties() {
+		
 		List<StructuralUnitProperty> properties = null;
 		selectedStructuralUnit = structuralUnitsFinal.get(structuralUnitsCombo
 				.getSelectionIndex());
@@ -469,6 +474,7 @@
 	 * @return true, if successful
 	 */
 	private boolean noquery() {
+		
 		for (QueryWidget query : queries) {
 			if (query.getText().length() == 0)
 				return true;
@@ -482,6 +488,7 @@
 	 * @param composite the composite
 	 */
 	private void createAdvancedQueryField() {
+		
 		addQueryField();
 		Rectangle r = scrollComposite.getClientArea();
 		scrollComposite.setMinSize(compositeForAdvanced.computeSize(r.width,
@@ -494,6 +501,7 @@
 	 * @param composite the composite
 	 */
 	private QueryWidget addQueryField() {
+		
 		return addQueryField(null, null);
 	}
 	
@@ -504,6 +512,7 @@
 	 * @param value the query
 	 */
 	private QueryWidget addQueryField(String name, String value) {
+		
 		final Text advancedPartLabel = new Text(compositeForAdvanced, SWT.BORDER);
 		advancedPartLabel.setText(TXMUIMessages.part
 				+ (partNames.size() + 1));
@@ -533,6 +542,7 @@
 			
 			@Override
 			public void handleEvent(Event event) {
+				
 				queries.remove(queryText);
 				partNames.remove(advancedPartLabel);
 				advancedPartLabel.dispose();
@@ -589,6 +599,7 @@
 	 * @return true, if is advanced selected
 	 */
 	public boolean isAdvancedSelected() {
+		
 		return isAdvancedSelected;
 	}
 	
@@ -598,6 +609,7 @@
 	 * @return the structural unit
 	 */
 	public StructuralUnit getStructuralUnit() {
+		
 		if (isAdvancedSelected())
 			throw new IllegalStateException(TXMUIMessages.cannotAskForTheSimpleTabWhenTheUserHasSelectedTheAdvancedTab);
 		return selectedStructuralUnit;
@@ -609,6 +621,7 @@
 	 * @return the structural unit property
 	 */
 	public StructuralUnitProperty getStructuralUnitProperty() {
+		
 		if (isAdvancedSelected())
 			throw new IllegalStateException(TXMUIMessages.cannotAskForTheSimpleTabWhenTheUserHasSelectedTheAdvancedTab);
 		return selectedStructuralUnitProperty;
@@ -620,6 +633,7 @@
 	 * @return the queries
 	 */
 	public List<String> getQueries() {
+		
 		if (!isAdvancedSelected())
 			throw new IllegalStateException(TXMUIMessages.cannotAskForTheSimpleTabWhenTheUserHasSelectedTheAdvancedTab);
 		return queriesString;
@@ -702,6 +716,7 @@
 	 * @return the advance part names
 	 */
 	private List<String> getAdvancePartNames() {
+		
 		ArrayList<String> values = new ArrayList<>();
 		int count = 0;
 		for (Text t : partNames) {
@@ -719,6 +734,7 @@
 	 * @return the partition
 	 */
 	public Partition getPartition() {
+		
 		return partition;
 	}
 }
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java	(revision 3592)
@@ -148,8 +148,10 @@
 		// TODO : we just put a composite into another composite. Everything
 		// should be directly put into parent
 		GridLayout layout4inclosing = new GridLayout(1, true);
+		layout4inclosing.verticalSpacing = 0;
+		layout4inclosing.horizontalSpacing = 0;
 		inclosing.setLayout(layout4inclosing);
-		inclosing.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+		inclosing.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 		
 		// name panel
 		Composite nameComposite = new Composite(inclosing, SWT.NONE);
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java	(revision 3592)
@@ -156,9 +156,14 @@
 	/** The Constant CHECKED. */
 	public static final String CHECKED = "icons/tick.png"; //$NON-NLS-1$
 	
+	public static final String CHECKEDALL = "icons/tick_all.png"; //$NON-NLS-1$
+	
 	/** The Constant UNCHECKED. */
 	public static final String UNCHECKED = "icons/cross.png"; //$NON-NLS-1$
 	
+	/** The Constant UNCHECKED. */
+	public static final String UNCHECKEDALL = "icons/cross_all.png"; //$NON-NLS-1$
+	
 	public static final String ACTION_INTERTEXTDIST = "icons/functions/dist.png"; //$NON-NLS-1$
 	
 	public static final String QUERYINDEX = "icons/functions/QueryIndex.png"; //$NON-NLS-1$
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 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties	(revision 3592)
@@ -31,7 +31,8 @@
 ampRunScript=&Exécuter un script
 ampSortOptions=Options de tri
 ampStructureColon=&Structure \:
-ampValue=&Valeur 
+ampValue=&Valeur
+ampValues=&Valeur(s)  
 andFrom=et de
 AnImportDotXMLImportConfigurationFileWasFoundRestoringImportParametersUsingThisfile=Restauration des paramètres d'importation à partir du fichier de paramètres import.xml.
 AnnotationsEngines=Moteurs d'annotation
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/TXMUIMessages.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/TXMUIMessages.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/TXMUIMessages.java	(revision 3592)
@@ -128,6 +128,8 @@
 	
 	public static String ampValue;
 	
+	public static String ampValues;
+	
 	public static String andFrom;
 	
 	public static String lemmatizeTheCorpus;
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties	(revision 3592)
@@ -31,7 +31,8 @@
 ampRunScript=&Run script
 ampSortOptions=&Sort options
 ampStructureColon=&Structure\:
-ampValue=&Value 
+ampValue=&Value
+ampValues=&Valu(e) 
 andFrom=and from
 AnImportDotXMLImportConfigurationFileWasFoundRestoringImportParametersUsingThisfile=Restoring import parameters from the import.xml parameters file.
 AnnotationsEngines=Annotation Engines
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java	(revision 3592)
@@ -101,20 +101,18 @@
 	 * @param corpus the corpus
 	 */
 	public PartitionComposer(Composite parent, int style, CQPCorpus corpus) {
+		
 		super(parent, style);
 		self = this;
 		this.setLayout(new GridLayout(1, true));
 		this.corpus = corpus;
 		
 		firstArea = new Composite(this, SWT.NONE);
-		firstArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-				true, false));
+		firstArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		dispoArea = new Composite(this, SWT.NONE);
-		dispoArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-				true, false));
+		dispoArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		btnArea = new Composite(this, SWT.NONE);
-		btnArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
-				false));
+		btnArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		
 		sc1 = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
 		sc1.setLayout(new GridLayout(1, true));
@@ -125,8 +123,7 @@
 		
 		partArea = new Composite(sc1, SWT.NONE);
 		sc1.setContent(partArea);
-		partArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
-				true));
+		partArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 		
 		// struct&prop
 		RowLayout layout = new RowLayout();
@@ -164,6 +161,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				reloadProperties();
 				updateDisplay();
 			}
@@ -182,6 +180,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				reloadPropertyValues();
 				updateDisplay();
 			}
@@ -193,12 +192,12 @@
 		// dispo
 		GridLayout layout2 = new GridLayout(2, false);
 		dispoArea.setLayout(layout2);
+		
 		Label dispoLabel = new Label(dispoArea, SWT.NONE);
 		dispoLabel.setText(TXMUIMessages.selectValuesToAssignColon);
-		dispoLabel.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-				false, false));
-		availableList = new org.eclipse.swt.widgets.List(dispoArea, SWT.MULTI
-				| SWT.READ_ONLY | SWT.V_SCROLL | SWT.BORDER);
+		dispoLabel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
+		
+		availableList = new org.eclipse.swt.widgets.List(dispoArea, SWT.MULTI | SWT.READ_ONLY | SWT.V_SCROLL | SWT.BORDER);
 		GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
 		data.heightHint = 10 * availableList.getItemHeight();
 		availableList.setLayoutData(data);
@@ -212,6 +211,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				// System.out.println(Messages.PartitionComposer_4);
 				PartItem p = new PartItem(partArea, SWT.BORDER, self);
 				GridData gdata = new GridData(GridData.FILL, GridData.FILL, true, true);
@@ -233,6 +233,7 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				for (PartItem p : parts) {
 					for (String s : p.getColumns())
 						self.add(s);
@@ -262,6 +263,7 @@
 	 * Update display.
 	 */
 	public void updateDisplay() {
+		
 		firstArea.layout();
 		dispoArea.layout();
 		partArea.layout();
@@ -274,6 +276,7 @@
 	 * Reload properties.
 	 */
 	protected void reloadProperties() {
+		
 		if (propCombo == null) return;
 		
 		propCombo.removeAll();
@@ -306,6 +309,7 @@
 	 * @param values the values
 	 */
 	protected void remove(List<String> values) {
+		
 		for (String s : values)
 			this.availableList.remove(s);
 		availableList.update();
@@ -317,6 +321,7 @@
 	 * @param s the s
 	 */
 	protected void add(String s) {
+		
 		this.availableList.add(s);
 		availableList.update();
 	}
@@ -325,6 +330,7 @@
 	 * Reload property values.
 	 */
 	private void reloadPropertyValues() {
+		
 		if (availableList == null) return;
 		
 		String[] items;
@@ -360,13 +366,13 @@
 	 * @return the structure
 	 */
 	public StructuralUnit getStructure() {
+		
 		try {
 			int index = structCombo.getSelectionIndex();
 			if (index < 0)
 				if (structCombo.getItemCount() > 0)
 					index = 0;
-				else
-					return null;
+				else return null;
 			structure = corpus.getStructuralUnit(structCombo.getItem(index));
 		}
 		catch (CqiClientException e) {
@@ -382,14 +388,14 @@
 	 * @return the property
 	 */
 	public StructuralUnitProperty getProperty() {
+		
 		if (getStructure() == null)
 			return null;
 		int index = propCombo.getSelectionIndex();
 		if (index < 0)
 			if (propCombo.getItemCount() > 0)
 				index = 0;
-			else
-				return null;
+			else return null;
 		property = structure.getProperty(propCombo.getItem(index));
 		return property;
 	}
@@ -400,6 +406,7 @@
 	 * @return the part queries
 	 */
 	public List<String> getPartQueries() {
+		
 		ArrayList<String> queries = new ArrayList<>();
 		for (PartItem p : parts)
 			queries.add(p.getQuery());
@@ -412,6 +419,7 @@
 	 * @return the selection
 	 */
 	public List<String> getSelection() {
+		
 		return Arrays.asList(availableList.getSelection());
 	}
 	
@@ -440,6 +448,7 @@
 		 * @param _composer the _composer
 		 */
 		public PartItem(Composite parent, int style, PartitionComposer _composer) {
+			
 			super(parent, style);
 			selfP = this;
 			this.composer = _composer;
@@ -467,6 +476,7 @@
 				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					PartItem p = selfP;
 					
 					for (String s : p.getColumns())
@@ -489,6 +499,7 @@
 				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					// System.out.println(Messages.bind(Messages.PartitionComposer_10, composer.getSelection()));
 					for (String s : composer.getSelection())
 						columns.add(s);
@@ -512,6 +523,7 @@
 				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					// System.out.println(Messages.bind(Messages.PartitionComposer_12, getSelection()));
 					for (String s : getSelection())
 						composer.add(s);
@@ -541,6 +553,7 @@
 		 * Removes the all.
 		 */
 		public void removeAll() {
+			
 			columns.removeAll();
 		}
 		
@@ -550,6 +563,7 @@
 		 * @param string the new title
 		 */
 		public void setTitle(String string) {
+			
 			this.title.setText(string);
 		}
 		
@@ -559,6 +573,7 @@
 		 * @return the columns
 		 */
 		public String[] getColumns() {
+			
 			return columns.getItems();
 		}
 		
@@ -568,6 +583,7 @@
 		 * @return the query
 		 */
 		public String getQuery() {
+			
 			return getSelection().toString();
 		}
 		
@@ -577,6 +593,7 @@
 		 * @return the selection
 		 */
 		public List<String> getSelection() {
+			
 			return Arrays.asList(columns.getSelection());
 		}
 	}
@@ -587,6 +604,7 @@
 	 * @return the partition
 	 */
 	public Partition createPartition(String name) {
+		
 		if (this.parts.size() == 0) {
 			System.out.println(TXMUIMessages.errorColonThisPartitionHasNoPart);
 			return null;
@@ -624,10 +642,12 @@
 	 * @return true, if successful
 	 */
 	public boolean hasUnassigned() {
+		
 		return this.availableList.getItemCount() > 0;
 	}
 	
 	public String getGeneratedName() {
+		
 		// TODO Auto-generated method stub
 		return null;
 	}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/ComplexSubcorpusPanel.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/ComplexSubcorpusPanel.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/ComplexSubcorpusPanel.java	(revision 3592)
@@ -29,8 +29,10 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.jface.viewers.ArrayContentProvider;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -62,9 +64,6 @@
 	/** The self. */
 	ComplexSubcorpusPanel self;
 	
-	/** The struct combo. */
-	Combo structCombo;
-	
 	/** The corpus. */
 	CQPCorpus corpus;
 	
@@ -102,7 +101,7 @@
 	public ComplexSubcorpusPanel(Composite parent, int style, CQPCorpus corpus) {
 		super(parent, style);
 		self = this;
-		this.setLayout(new GridLayout(2, false));
+		this.setLayout(new GridLayout(3, false));
 		this.corpus = corpus;
 		
 		try {
@@ -132,48 +131,27 @@
 			structuralUnitsProperties.put(su, properties);
 		}
 		
+		Label firstStep = new Label(this, SWT.NONE);
+		firstStep.setText("1- Configure");
+		firstStep = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
+		firstStep.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+		
 		Group andorGroup = new Group(this, SWT.SHADOW_ETCHED_IN);
 		andorGroup.setText(TXMUIMessages.match);
 		andorGroup.setLayout(new GridLayout(2, false));
-		andorGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+		andorGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
 		
 		andBtn = new Button(andorGroup, SWT.RADIO);
 		andBtn.setText(TXMUIMessages.allCriteria);
-		andBtn.setSelection(false);
+		andBtn.setSelection(true);
 		
 		Button orBtn = new Button(andorGroup, SWT.RADIO);
 		orBtn.setText(TXMUIMessages.someCriteria);
-		orBtn.setSelection(true);
+		orBtn.setSelection(false);
 		
-		// structure choice
-		Label l = new Label(this, SWT.None);
-		l.setText(TXMCoreMessages.common_structure);
-		structCombo = new Combo(this, SWT.READ_ONLY);
-		structCombo.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				for (QueryItem item : queryItems)
-					item.refreshProps();
-			}
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-		});
-		
-		int i_text = 0, i = 0;
-		for (StructuralUnit su : structuralunits) {
-			structCombo.add(su.getName());
-			if (su.getName().equals("text")) i_text = i; //$NON-NLS-1$
-			i++;
-		}
-		
-		if (structuralunits.size() > 0)
-			structCombo.select(i_text);
-		
 		queriesPanel = new Composite(this, SWT.NONE);
 		queriesPanel.setLayout(new GridLayout(1, false));
-		queriesPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+		queriesPanel.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
 		QueryItem item = new QueryItem(queriesPanel, SWT.NONE);
 		item.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		queryItems.add(item);
@@ -181,10 +159,18 @@
 		// 3 combos : struc, prop, value
 		// Add/Rmv contrainte
 		// affichage requete
-		l = new Label(this, SWT.NONE);
+		
+		Label secondStep = new Label(this, SWT.NONE);
+		secondStep.setText("2- Generate query");
+		secondStep = new Label(this, SWT.SEPARATOR | SWT.HORIZONTAL);
+		secondStep.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+		
+		Label l = new Label(this, SWT.NONE);
 		l.setText(TXMUIMessages.query);
+		
 		queryField = new Text(this, SWT.BORDER);
 		queryField.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+		
 		Button refreshBtn = new Button(this, SWT.PUSH);
 		refreshBtn.setText("Refresh the query");
 		refreshBtn.addSelectionListener(new SelectionListener() {
@@ -196,10 +182,10 @@
 			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
-			
+				
 			}
 		});
-			
+		
 		// first init
 		updateQueryField();
 	}
@@ -227,95 +213,36 @@
 	 * @return the query string
 	 */
 	public String getQueryString() {
-		String structName = this.structCombo.getText();
 		
-		String query = "/region[" + structName + ",a]::"; //$NON-NLS-1$ //$NON-NLS-2$
-		int nbitem = 0;
+		LinkedHashSet<String> parts = new LinkedHashSet<>(); // to avoid duplicates 
 		for (QueryItem item : queryItems) {
-			if (nbitem != 0)
-				if (andBtn.getSelection())
-					query += " &"; //$NON-NLS-1$
-				else
-					query += " |"; //$NON-NLS-1$
+			
+			String query = "";
+			
 			String prop = item.selectedSup.getFullName();
-			ISelection sel = item.valueCombo.getSelection();
-			String value = ""; //$NON-NLS-1$
-			if (sel instanceof IStructuredSelection) {
-				value = ((IStructuredSelection) sel).getFirstElement().toString();
-			}
-			int equals = item.testCombo.getSelectionIndex();
+			IStructuredSelection sel = item.valueCombo.getStructuredSelection();
+			String value = StringUtils.join(sel.toList(), "|");
 			
-			if (equals == 0) // is
-				query += " a." + prop + "=\"" + value + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			else if (equals == 1) // is not
-				query += " a." + prop + "!=\"" + value + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-			else if (equals == 2) // contains
-				query += " a." + prop + "=\".*" + value + ".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			int test = item.testCombo.getSelectionIndex();
+			
+			if (test == 0) // is
+				query = " _."+ prop + "=\"" + value + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			else if (test == 1) // is not
+				query = " _."+ prop + "!=\"" + value + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+			else if (test == 2) // contains
+				query = " _."+ prop + "=\".*" + value + ".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			else // does not contain
-				query += " a." + prop + "!=\".*" + value + ".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+				query = " _."+ prop + "!=\".*" + value + ".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			
-			nbitem++;
+			parts.add(query);
 		}
 		
-		/*
-		 * String query = "["; //$NON-NLS-1$ //$NON-NLS-2$
-		 * int nbitem = 0;
-		 * for (QueryItem item : queryItems) {
-		 * if (nbitem != 0)
-		 * if (andBtn.getSelection())
-		 * query += " &"; //$NON-NLS-1$
-		 * else
-		 * query += " |"; //$NON-NLS-1$
-		 * String prop = item.selectedSup.getFullName();
-		 * ISelection sel = item.valueCombo.getSelection();
-		 * String value = ""; //$NON-NLS-1$
-		 * if (sel instanceof IStructuredSelection) {
-		 * value = ((IStructuredSelection)sel).getFirstElement().toString();
-		 * }
-		 * int equals = item.testCombo.getSelectionIndex();
-		 * if (equals == 0) // is
-		 * query += " a."+prop+"=\""+value+"\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * else if (equals == 1) // is not
-		 * query += " a."+prop+"!=\""+value+"\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * else if (equals == 2) // contains
-		 * query += " a."+prop+"=\".*"+value+".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * else // does not contain
-		 * query += " a."+prop+"!=\".*"+value+".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * nbitem++;
-		 * }
-		 */
+		String sep = " | ";
+		if (andBtn.getSelection())
+			sep = " & "; //$NON-NLS-1$
 		
-		/**
-		 * //
-		 * for (QueryItem item : queryItems) {
-		 * if (nbitem != 0) { // adding a constraint
-		 * if (andBtn.getSelection())
-		 * query += " &"; //$NON-NLS-1$
-		 * else
-		 * query += " |"; //$NON-NLS-1$
-		 * }
-		 * String prop = item.selectedSup.getFullName();
-		 * ISelection sel = item.valueCombo.getSelection();
-		 * String value = ""; //$NON-NLS-1$
-		 * if (sel instanceof IStructuredSelection) {
-		 * value = ((IStructuredSelection)sel).getFirstElement().toString();
-		 * }
-		 * int equals = item.testCombo.getSelectionIndex();
-		 * 
-		 * if (equals == 0) // is
-		 * query += " _."+prop+"=\""+value+"\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * else if (equals == 1) // is not
-		 * query += " _."+prop+"!=\""+value+"\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * else if (equals == 2) // contains
-		 * query += " _."+prop+"=\".*"+value+".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * else // does not contain
-		 * query += " _."+prop+"!=\".*"+value+".*\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		 * 
-		 * nbitem++;
-		 * }
-		 * query += "] expand to "+structName;
-		 */
-		return query;
+		return "["+ StringUtils.join(parts, sep)+"]+ expand to "+queryItems.get(queryItems.size() - 1).structCombo.getText();
+		
 	}
 	
 	public String getQueryFieldValue() {
@@ -327,13 +254,31 @@
 	}
 	
 	public String getGeneratedName() {
-		String generated = ""; //$NON-NLS-1$
-		if (this.queryItems.size() > 0) {
-			QueryItem queryItem = this.queryItems.get(0);
-			generated += queryItem.selectedSup.asFullNameString() + "=" + queryItem.valueCombo.getList().getSelection()[0];
+		
+		LinkedHashSet<String> parts = new LinkedHashSet<>();
+		
+		for (QueryItem queryItem : queryItems) {
 			
+			String testString = "=";
+			int test = queryItem.testCombo.getSelectionIndex();
+			if (test == 0) // is
+				testString = "=";
+			else if (test == 1) // is not
+				testString = "!=";
+			else if (test == 2) // contains
+				testString = " contains ";
+			else // does not contain
+				testString = " does not contains";
+			
+			String generated = queryItem.selectedSup.asFullNameString() + testString + queryItem.valueCombo.getList().getSelection()[0];
+			parts.add(generated);
 		}
-		return generated;
+		
+		String sep = " | ";
+		if (andBtn.getSelection())
+			sep = " & "; //$NON-NLS-1$
+		
+		return StringUtils.join(parts, sep);
 	}
 	
 	/**
@@ -341,6 +286,9 @@
 	 */
 	class QueryItem extends Composite {
 		
+		/** The struct combo. */
+		Combo structCombo;
+		
 		/** The prop combo. */
 		Combo propCombo;
 		
@@ -368,7 +316,36 @@
 		public QueryItem(Composite parent, int style) {
 			super(parent, style);
 			
-			this.setLayout(new GridLayout(5, false));
+			this.setLayout(new GridLayout(7, false));
+			
+			// structure choice
+			Label l = new Label(this, SWT.None);
+			l.setText(TXMCoreMessages.common_structure);
+			
+			structCombo = new Combo(this, SWT.READ_ONLY);
+			structCombo.addSelectionListener(new SelectionListener() {
+				
+				@Override
+				public void widgetSelected(SelectionEvent e) {
+					for (QueryItem item : queryItems)
+						item.refreshProps();
+				}
+				
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {}
+			});
+			
+			int i_text = 0, i = 0;
+			for (StructuralUnit su : structuralunits) {
+				structCombo.add(su.getName());
+				if (su.getName().equals("text")) i_text = i; //$NON-NLS-1$
+				i++;
+			}
+			
+			if (structuralunits.size() > 0) {
+				structCombo.select(i_text);
+			}
+			
 			propCombo = new Combo(this, SWT.READ_ONLY);
 			propCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 			propCombo.addSelectionListener(new SelectionListener() {
@@ -390,7 +367,7 @@
 			testCombo.add(TXMUIMessages.doesNotContain);
 			testCombo.select(0);
 			
-			valueCombo = new ListViewer(this, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER | SWT.VIRTUAL);
+			valueCombo = new ListViewer(this, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.VIRTUAL);
 			valueCombo.setContentProvider(new ArrayContentProvider());
 			GridData data = new GridData(GridData.FILL, GridData.FILL, true, false);
 			data.heightHint = testCombo.getItemHeight();
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SuperListViewer.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SuperListViewer.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SuperListViewer.java	(revision 3592)
@@ -0,0 +1,208 @@
+package org.txm.rcp.swt.widget.structures;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.TransferData;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.List;
+import org.txm.rcp.IImageKeys;
+import org.txm.rcp.swt.GLComposite;
+
+public class SuperListViewer extends GLComposite {
+	
+	ListViewer valueCombo;
+	Button selectByListButton;
+	String lastValuesSelected = "";
+	Button selectByRegex;
+	String lastRegexSelected = "";
+	
+	public SuperListViewer(Composite parent, int listStyle) {
+		
+		super(parent, SWT.NONE, "SuperListViewer");
+		
+		this.getLayout().numColumns = 2;
+		this.getLayout().verticalSpacing = 1;
+		this.getLayout().horizontalSpacing = 1;
+		
+		valueCombo = new ListViewer(this, listStyle);
+		valueCombo.setContentProvider(new ArrayContentProvider());
+		valueCombo.getList().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 4));
+		int operations = DND.DROP_COPY | DND.DROP_MOVE;
+		Transfer[] transferTypes = new Transfer[]{TextTransfer.getInstance()};
+		valueCombo.addDropSupport(operations, transferTypes, new DropTargetAdapter() {
+			   @Override
+			    public void drop(DropTargetEvent event) {
+				   //System.out.println("DROP: "+event);
+				   
+				   if (event.data instanceof String) {
+					   selectByString((String)event.data);
+				   }
+			    }
+		});
+		
+		selectByListButton = new Button(this, SWT.PUSH);
+		selectByListButton.setToolTipText("Select values using a list of values");
+		selectByListButton.setImage(IImageKeys.getImage("icons/functions/data.png"));
+		selectByListButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
+		selectByListButton.addSelectionListener(new SelectionListener() {
+			
+			
+
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				InputDialog dialog = new InputDialog(e.display.getActiveShell(), "Select values using a list of values", "List of values to select", lastValuesSelected, null);
+				
+				if (dialog.open() == InputDialog.OK) {
+					String str = dialog.getValue();
+					str = str.trim();
+					selectByString(str);
+					lastValuesSelected = str;
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+
+		selectByRegex = new Button(this, SWT.PUSH);
+		selectByRegex.setToolTipText("Select values using a regular expression");
+		selectByRegex.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH));
+		selectByRegex.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
+		selectByRegex.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				InputDialog dialog = new InputDialog(e.display.getActiveShell(), "Select values by regular expression", "Regular expression to use", lastRegexSelected, null);
+				if (dialog.open() == InputDialog.OK) {
+					String str = dialog.getValue();
+					str = str.trim();
+					if (str.length() == 0) return;
+					
+					selectByRegex(str);
+					lastRegexSelected = str;
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+		
+		Button allButton = new Button(this, SWT.PUSH);
+		allButton.setToolTipText("Select all");
+		allButton.setImage(IImageKeys.getImage(IImageKeys.CHECKEDALL));
+		allButton.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
+		allButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				valueCombo.getList().selectAll();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+		
+		Button clearButton = new Button(this, SWT.PUSH);
+		clearButton.setToolTipText("De-select all");
+		clearButton.setImage(IImageKeys.getImage(IImageKeys.UNCHECKEDALL));
+		clearButton.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING, false, false));
+		clearButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				valueCombo.getList().deselectAll();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+	}
+	
+	public void selectAll() {
+		valueCombo.getList().selectAll();
+	}
+	
+	public void deSelectAll() {
+		valueCombo.getList().deselectAll();
+	}
+	
+	public void selectByRegex(String regex) {
+		String[] listValues = valueCombo.getList().getItems();
+		ArrayList<Integer> indices = new ArrayList<>();
+		
+		for (int i = 0 ; i < listValues.length ; i++) {
+			if (listValues[i].matches(regex)) {
+				indices.add(i);
+			}
+		}
+	
+		int[] iindices = new int[indices.size()];
+		for (int i = 0 ; i < indices.size() ; i++) iindices[i] = indices.get(i);
+		
+		//valueCombo.getList().deselectAll();
+		valueCombo.getList().select(iindices);
+	}
+	
+	public void selectByString(String str) {
+		if (str == null) return;
+		if (str.length() == 0) return;
+		
+		selectByStringValues(str.split("[\t\n|]"));
+	}
+	
+	public void selectByStringValues(String[] values) {
+		String[] listValues = valueCombo.getList().getItems();
+		ArrayList<Integer> indices = new ArrayList<>();
+		for (String v : values) {
+			int i = Arrays.binarySearch(listValues, v);
+			if (i >= 0) {
+				indices.add(i);
+			}
+		}
+		int[] iindices = new int[indices.size()];
+		for (int i = 0 ; i < indices.size() ; i++) iindices[i] = indices.get(i);
+		
+		//valueCombo.getList().deselectAll();
+		valueCombo.getList().select(iindices);
+	}
+	
+	public void setInput(Object input) {
+		valueCombo.setInput(input);
+	}
+	
+	public ListViewer getListviewer() {
+		
+		return valueCombo;
+	}
+
+	public List getList() {
+		
+		return valueCombo.getList();
+	}
+
+	public IStructuredSelection getSelection() {
+		
+		return valueCombo.getStructuredSelection();
+	}
+
+}

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

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SimpleSubcorpusPanel.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SimpleSubcorpusPanel.java	(revision 3591)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SimpleSubcorpusPanel.java	(revision 3592)
@@ -38,7 +38,7 @@
 
 	Combo structuralUnitsCombo;
 	Combo propertyCombo;
-	ListViewer valueCombo;
+	SuperListViewer valueCombo;
 
 	List<StructuralUnit> structuralUnitsFinal;
 	private Button validationButton;
@@ -69,24 +69,13 @@
 		propertyCombo.setLayoutData(new GridData(GridData.FILL,GridData.FILL, true, false));
 
 		Label valuesLabel = new Label(this, SWT.NONE);
-		valuesLabel.setText(TXMUIMessages.ampValue);
+		valuesLabel.setText(TXMUIMessages.ampValues);
 		valuesLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
 
-		valueCombo = new ListViewer(this, SWT.MULTI |SWT.V_SCROLL | SWT.BORDER | SWT.VIRTUAL);
-		valueCombo.setContentProvider(new ArrayContentProvider());
-		//		valueCombo.setLabelProvider(new LabelProvider() {
-		//
-		//	        @Override
-		//	        public String getText(Object element) {
-		//	            return Activator.getSomeService().key2Value((Integer) element);
-		//	        }
-		//
-		//	    });
+		valueCombo = new SuperListViewer(this, SWT.MULTI |SWT.V_SCROLL | SWT.BORDER | SWT.VIRTUAL);
 		GridData data = new GridData(GridData.FILL,GridData.FILL, true, false);
 		data.heightHint = 100;
-		valueCombo.getList().setLayoutData(data);
-
-
+		valueCombo.setLayoutData(data);
 		// Load StructuralUnit
 		// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		List<StructuralUnit> structuralUnits = null;
@@ -153,8 +142,7 @@
 
 		propertyCombo.addSelectionListener(new SelectionListener() {
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) { }
 
 			@Override
 			public void widgetSelected(SelectionEvent event) {
@@ -165,17 +153,11 @@
 		valueCombo.getList().addSelectionListener(new SelectionListener() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				ISelection sel = valueCombo.getSelection();
-				if (sel instanceof IStructuredSelection) {
-					selectedValues = ((IStructuredSelection)sel).toList();
-				}
+				selectedValues = valueCombo.getSelection().toList();
 			}
 
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-				// TODO Auto-generated method stub
-
-			}
+			public void widgetDefaultSelected(SelectionEvent e) { }
 		});
 
 		reloadProperties();
@@ -209,8 +191,8 @@
 		}
 		GridData data = new GridData(GridData.FILL_BOTH);
 		data.heightHint = 10 * valueCombo.getList().getItemHeight();
-		valueCombo.getList().setLayoutData(data);
-		valueCombo.getList().getParent().layout();
+		valueCombo.setLayoutData(data);
+		valueCombo.getParent().layout();
 	}
 
 	/**
Index: TXM/trunk/org.txm.rcp/icons/cross_all.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/org.txm.rcp/icons/cross_all.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: TXM/trunk/org.txm.rcp/icons/tick_all.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/org.txm.rcp/icons/tick_all.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: TXM/trunk/org.txm.rcp/icons/functions/data.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: TXM/trunk/org.txm.rcp/icons/functions/data.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

