Index: tmp/org.txm.libs.msoffice/src/org/txm/libs/msoffice/ReadExcel.java
===================================================================
--- tmp/org.txm.libs.msoffice/src/org/txm/libs/msoffice/ReadExcel.java	(revision 3060)
+++ tmp/org.txm.libs.msoffice/src/org/txm/libs/msoffice/ReadExcel.java	(revision 3061)
@@ -95,6 +95,7 @@
 		for (int rowIndex = 0; rowIndex < nRows; rowIndex++) {
 			Row row = ws.getRow(rowIndex);
 			if (row == null) continue;
+			
 			for (int i = 0; i < columnIdxToTest.size(); i++) {
 				int colIndex = columnIdxToTest.get(i);
 				
@@ -433,6 +434,7 @@
 		for (int rowIndex = 0; rowIndex < nRows; rowIndex++) {
 			Row row = ws.getRow(rowIndex);
 			if (row == null) continue;
+			
 			for (int i = 0; i < columnIdxToTest.size(); i++) {
 				int colIndex = columnIdxToTest.get(i);
 				
@@ -541,6 +543,7 @@
 	protected void _getRecord() {
 		record = new HashMap<>();
 		Row row = ws.getRow(iRow);
+		if (row == null) return;
 		
 		for (int colIndex = 0; colIndex < header.length; colIndex++) {
 			String col = header[colIndex];
@@ -601,7 +604,10 @@
 			}
 			
 			int nRows = ws.getPhysicalNumberOfRows();
-			if (nRows == 0) return null;
+			if (nRows == 0) {
+				System.out.println("** Excel2XML: no row to process. Aborting.");
+				return null;
+			}
 			
 			Row firstRow = ws.getRow(0);
 			int colMax = firstRow.getLastCellNum();
@@ -613,6 +619,8 @@
 			
 			for (int rowIndex = 0; rowIndex < nRows; rowIndex++) {
 				Row row = ws.getRow(rowIndex);
+				if (row == null) continue;
+				
 				ArrayList<String> dataLine = new ArrayList<>();
 				data.add(dataLine);
 				for (int colIndex = 0; colIndex < colMax; colIndex++) {
Index: tmp/org.txm.rcp.feature/feature.xml
===================================================================
--- tmp/org.txm.rcp.feature/feature.xml	(revision 3060)
+++ tmp/org.txm.rcp.feature/feature.xml	(revision 3061)
@@ -268,4 +268,11 @@
          install-size="0"
          version="0.0.0"/>
 
+   <plugin
+         id="org.txm.searchengine.rcp"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>
Index: tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java
===================================================================
--- tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 3060)
+++ tmp/org.txm.internalview.rcp/src/org/txm/internalview/rcp/editors/InternalViewEditor.java	(revision 3061)
@@ -125,7 +125,7 @@
 		});
 		
 		// Word properties selector
-		propertiesSelector = new PropertiesSelector<WordProperty>(parametersArea);
+		propertiesSelector = new PropertiesSelector<>(parametersArea);
 		propertiesSelector.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, true));
 		propertiesSelector.setLayout(new GridLayout(3, false));
 		try {
@@ -138,7 +138,7 @@
 		propertiesSelector.addSelectionListener(computeSelectionListener);
 		
 		// Structural unit properties selector
-		structuralUnitPropertiesSelector = new PropertiesSelector<StructuralUnitProperty>(parametersArea);
+		structuralUnitPropertiesSelector = new PropertiesSelector<>(parametersArea);
 		structuralUnitPropertiesSelector.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, true));
 		structuralUnitPropertiesSelector.setLayout(new GridLayout(3, false));
 		structuralUnitPropertiesSelector.setTitle(InternalViewUIMessages.structuralProperties);
@@ -188,7 +188,7 @@
 				int nlines = internalView.getSegmentLength();
 				List<WordProperty> props = internalView.getProperties();
 				
-				ArrayList<Object[]> lines = new ArrayList<Object[]>();
+				ArrayList<Object[]> lines = new ArrayList<>();
 				for (int i = 0; i < nlines; i++) {
 					lines.add(new String[props.size()]);
 				}
@@ -237,17 +237,17 @@
 	}
 	
 	
-	HashMap<Property, TableViewerColumn> columns = new HashMap<Property, TableViewerColumn>();
+	HashMap<Property, TableViewerColumn> columns = new HashMap<>();
 	
-	HashMap<TableViewerColumn, Integer> columnsOrder = new HashMap<TableViewerColumn, Integer>();
+	HashMap<TableViewerColumn, Integer> columnsOrder = new HashMap<>();
 	
 	private void initColumns() {
 		
 		for (TableViewerColumn col : columns.values()) {
 			col.getColumn().dispose();
 		}
-		columnsOrder = new HashMap<TableViewerColumn, Integer>();
-		columns = new HashMap<Property, TableViewerColumn>();
+		columnsOrder = new HashMap<>();
+		columns = new HashMap<>();
 		
 		if (internalView == null) {
 			// System.out.println("REMOVE NON USED COLUMNS");
@@ -298,7 +298,7 @@
 			else {
 				query.append(col.getText() + "=\""); //$NON-NLS-1$
 			}
-			HashSet<String> values = new HashSet<String>();
+			HashSet<String> values = new HashSet<>();
 			for (int i = 0; i < indexes.length; i++) {
 				int idx = indexes[i];
 				values.add(CQLQuery.addBackSlash(items[idx].getText(icol)));
@@ -358,7 +358,6 @@
 		navigation.setCurrentPosition(this.getResult().getCurrentPage());
 		navigation.setMaxPosition(this.getResult().getSegmentsCount());
 		
-		navigation.setInfoLineText(" / " + this.getResult().getSegmentsCount()); //$NON-NLS-1$
 		navigation.refresh();
 		navigationPanel.layout();
 	}
Index: tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/tigersearchLoader.groovy
===================================================================
--- tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/tigersearchLoader.groovy	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/tigersearchLoader.groovy	(revision 3061)
@@ -33,7 +33,6 @@
 import org.txm.metadatas.*
 import org.txm.objects.*
 import org.txm.importer.scripts.xmltxm.*
-import org.txm.tokenizer.TokenizerClasses
 import org.txm.utils.*
 import org.txm.utils.i18n.*
 import org.txm.importer.xtz.*
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java	(revision 3061)
@@ -37,75 +37,80 @@
 import org.txm.utils.logger.Log;
 
 public class TSIndex extends Index {
-
-
+	
+	public static final String EDITIONID = "editionId";
+	
 	public TSIndex(CQPCorpus corpus, List<WordProperty> props)
 			throws CqiClientException, IOException, CqiServerError {
 		super(corpus);
 		this.setParameters(new CQLQuery("[]"), props, null, null, null, null);
 	}
-
+	
 	public TSIndex(CQPCorpus corpus, CQLQuery query, List<WordProperty> props)
 			throws CqiClientException, IOException, CqiServerError {
 		super(corpus);
 		this.setParameters(query, props, null, null, null, null);
 	}
-
-//	public TSIndex(Partition partition, CQLQuery query, List<WordProperty> props)
-//			throws CqiClientException, IOException, CqiServerError {
-//		super(partition);
-//		this.setParameters(query, props, null, null, null, null);
-//	}
-
-
-	boolean isTIgerInitialized = false;
+	
+	// public TSIndex(Partition partition, CQLQuery query, List<WordProperty> props)
+	// throws CqiClientException, IOException, CqiServerError {
+	// super(partition);
+	// this.setParameters(query, props, null, null, null, null);
+	// }
+	
+	
+	boolean isTigerInitialized = false;
+	
 	private TSCorpus tscorpus;
+	
 	private TSResult tsresult;
+	
 	private boolean initTIGERSearch() {
-		if (isTIgerInitialized) return isTIgerInitialized;
-
+		if (isTigerInitialized) return isTigerInitialized;
+		
 		String id = getCorpus().getMainCorpus().getName();
-		File configfile = new File(getCorpus().getProjectDirectory(),"tiger/tigersearch.logprop");
+		File configfile = new File(getCorpus().getProjectDirectory(), "tiger/tigersearch.logprop");
 		File registrydir = new File(getCorpus().getProjectDirectory(), "tiger");
-
+		
 		TSCorpusManager manager = new TSCorpusManager(registrydir, configfile);
 		if (manager.isInitialized()) {
 			tscorpus = manager.getCorpus(id);
 			if (tscorpus == null) {
-				System.out.println("TIGERSearch corpus not found in "+registrydir);
-				isTIgerInitialized = false;
+				System.out.println("TIGERSearch corpus not found in " + registrydir);
+				isTigerInitialized = false;
 			}
-
-			isTIgerInitialized = true;
+			
+			isTigerInitialized = true;
 		}
-		return isTIgerInitialized;
+		return isTigerInitialized;
 	}
-
+	
 	@Override
 	/**
 	 * count tokens.
 	 *
 	 * @param corp the corp
 	 * @return true, if successful
-	 * @throws CqiClientException 
-	 * @throws CqiServerError 
-	 * @throws IOException 
+	 * @throws CqiClientException
+	 * @throws CqiServerError
+	 * @throws IOException
 	 */
 	protected boolean scanCorpus(CQPCorpus corp) throws CqiClientException, IOException, CqiServerError {
-
+		
 		if (!initTIGERSearch()) return false;
-
+		
 		// get the cqp result of the query
-		//	long time = System.currentTimeMillis();
-		//		QueryResult result = corp.query(getQuery(), "index", true); //$NON-NLS-1$
-		boolean isTargetUsed = false;//CQPSearchEngine.getCqiClient().subCorpusHasField(result.getQualifiedCqpId(), ICqiClient.CQI_CONST_FIELD_TARGET);
-
+		// long time = System.currentTimeMillis();
+		// QueryResult result = corp.query(getQuery(), "index", true); //$NON-NLS-1$
+		boolean isTargetUsed = false;// CQPSearchEngine.getCqiClient().subCorpusHasField(result.getQualifiedCqpId(), ICqiClient.CQI_CONST_FIELD_TARGET);
+		
 		// System.out.println("nLines : "+nLines);
 		List<Match> matches;
 		try {
 			matches = getMatchesFromTSQuery(corp);
-		} catch (Exception e1) {
-			System.out.println("Error while queing TIGERSearch: "+e1);
+		}
+		catch (Exception e1) {
+			System.out.println("Error while queing TIGERSearch: " + e1);
 			e1.printStackTrace();
 			return false;
 		}
@@ -114,10 +119,10 @@
 			return false;
 		}
 		this.nTotalTokens += nbresults; // get number of tokens
-
+		
 		// count matches
 		// time = System.currentTimeMillis();
-		List<Integer> allpositions = new ArrayList<Integer>();
+		List<Integer> allpositions = new ArrayList<>();
 		for (int j = 0; j < nbresults; j++) {
 			Match match = matches.get(j);
 			// beginingOfKeywordsPositions.add(match.getStart()); // get the
@@ -125,19 +130,20 @@
 			// lengthOfKeywords.add(match.size());// get the last index
 			if (isTargetUsed) {
 				allpositions.add(match.getTarget());
-			} else {
+			}
+			else {
 				for (int i = match.getStart(); i <= match.getEnd(); i++)
 					allpositions.add(i);
 			}
 		}
-
+		
 		int[] allpositionsarray = new int[allpositions.size()];
 		int pcount = 0;
 		for (int p : allpositions)
 			allpositionsarray[pcount++] = p;
-
+		
 		// time = System.currentTimeMillis();
-		HashMap<Property, int[]> propsId = new HashMap<Property, int[]>();
+		HashMap<Property, int[]> propsId = new HashMap<>();
 		for (Property property : pProperties) {
 			try {
 				if (property instanceof StructuralUnitProperty) {
@@ -146,15 +152,17 @@
 									property.getQualifiedName(),
 									allpositionsarray);
 					propsId.put(property, structs);
-				} else {
+				}
+				else {
 					int[] indices = CorpusManager.getCorpusManager()
 							.getCqiClient().cpos2Id(
 									property.getQualifiedName(),
 									allpositionsarray);
 					propsId.put(property, indices);
 				}
-			} catch (Exception e) {
-				System.out.println("Error while properties projection: "+e);
+			}
+			catch (Exception e) {
+				System.out.println("Error while properties projection: " + e);
 				Log.printStackTrace(e);
 				return false;
 			}
@@ -175,42 +183,43 @@
 				line.putIds(property, ids);
 			}
 			currentIndex += size;
-
+			
 			String signature = line.getSignature();
-
+			
 			if (counts.containsKey(signature)) // if the counts contains the
-				// signature, increment its
-				// corresponding value
+			// signature, increment its
+			// corresponding value
 			{
 				while (counts.get(signature).size() <= currentpartid)
 					counts.get(signature).add(0);
 				int c = counts.get(signature).get(currentpartid) + 1;
 				counts.get(signature).set(currentpartid, c);
-			} else // else initialize count of the signature to 1
+			}
+			else // else initialize count of the signature to 1
 			{
 				// System.out.println("add new sign "+signature+" of line "+line.toString());
-				ArrayList<Integer> tmp = new ArrayList<Integer>();
+				ArrayList<Integer> tmp = new ArrayList<>();
 				for (int j = 0; j < currentpartid + 1; j++)
 					tmp.add(0);
 				counts.put(signature, tmp);
 				counts.get(signature).set(currentpartid, 1);
-
+				
 				lines.add(line);
 			}
 		}
 		// System.out.println("Time count lines "+(System.currentTimeMillis()-time));
 		// System.out.println("took "+(System.currentTimeMillis()-time));
 		return true;
-
+		
 	}
-
+	
 	private List<Match> getMatchesFromTSQuery(CQPCorpus corp) throws Exception {
-		ArrayList<Match> matches =  new ArrayList<Match>();
+		ArrayList<Match> matches = new ArrayList<>();
 		tsresult = tscorpus.query(pQuery.toString());
 		boolean debug = false;
 		ResultForest forest = tsresult.getForest();
 		MatchResult result = tsresult.getMatchResult();
-
+		
 		int var_ok = 0;
 		String label = "@|pivot";
 		Pattern p = Pattern.compile(label);
@@ -219,48 +228,49 @@
 		}
 		if (var_ok == 0) {
 			System.out.println("** Error in TSIndex: no label '@' or 'pivot' found in TIGERSearch query. Aborting.");
-			return matches; 
-		} else if (var_ok > 1) {
+			return matches;
+		}
+		else if (var_ok > 1) {
 			System.out.println("** Error in TSIndex: too many labels '@' or 'pivot' found in TIGERSearch query. Aborting.");
-			return matches; 
+			return matches;
 		}
-
+		
 		InternalCorpusQueryManager manager = tsresult.getManager();
-		//		Display_Sentence match = null;
-		//		
-		//		if (forest.isNextMatch()) {
-		//			match = forest.nextMatch();
-		//		} else {
-		//			match = null;
-		//		}
-
-		HashSet<String> matchingTnodesID = new HashSet<String>();
-		String EDITIONID = "editionId";
-
+		// Display_Sentence match = null;
+		//
+		// if (forest.isNextMatch()) {
+		// match = forest.nextMatch();
+		// } else {
+		// match = null;
+		// }
+		
+		HashSet<String> matchingTnodesID = new HashSet<>();
+		
 		int size = forest.getForestSize();
-		for ( int match_no = 0 ; match_no < size ; match_no++) {
-			if (debug) System.out.println("Match "+match_no);
+		for (int match_no = 0; match_no < size; match_no++) {
+			if (debug) System.out.println("Match " + match_no);
 			int sentno = result.getSentenceNumberAt(match_no);
 			Sentence sentence = manager.getSentence(sentno);
-
-			result.orderSentenceSubmatches(sentno); 
+			
+			result.orderSentenceSubmatches(sentno);
 			int n = result.getSentenceSubmatchSize(sentno);
-
-			for (int iSubMatch=0; iSubMatch<n; iSubMatch++) {
-				if (debug) System.out.println(" Sub "+iSubMatch);
+			
+			for (int iSubMatch = 0; iSubMatch < n; iSubMatch++) {
+				if (debug) System.out.println(" Sub " + iSubMatch);
 				int[] var_values = result.getSentenceSubmatchAt(sentno, iSubMatch);
 				int value;
-				for (int j=0; j<var_values.length; j++) {
-					if (debug) System.out.println("  Var "+j+" name="+result.getVariableName(j));
+				for (int j = 0; j < var_values.length; j++) {
+					if (debug) System.out.println("  Var " + j + " name=" + result.getVariableName(j));
 					value = var_values[j];
-					if (value>=0) {
+					if (value >= 0) {
 						String var_name = result.getVariableName(j);
 						Node referred = sentence.getNode(value);
 						if (p.matcher(var_name).matches()) {
 							if (referred instanceof T_Node) {
-								if (debug) System.out.println("    Node: "+referred.getFeature(EDITIONID));
+								if (debug) System.out.println("    Node: " + referred.getFeature(EDITIONID));
 								matchingTnodesID.add(referred.getFeature(EDITIONID));
-							} else if (referred instanceof NT_Node) {
+							}
+							else if (referred instanceof NT_Node) {
 								for (T_Node c : getTerminals((NT_Node) referred, sentence)) {
 									matchingTnodesID.add(c.getFeature(EDITIONID));
 								}
@@ -270,71 +280,73 @@
 				}
 			}
 		}
-
-
-		//		while (match != null) {
-		//			if (debug) System.out.println("Match: "+forest.getCurrentMatchNumber()+" Nsub="+forest.getSubMatchesSize());
-		//			Display_Sentence sub = null;
-		//			int[] var_values = match.getSentenceSubmatchAt(sentno,i);
-		//			
-		//			sub = match;
-		//			int nlabel;
-		//			while (sub != null) {
-		//				if (debug) System.out.println(" Sub: "+forest.getCurrentSubMatchNumber());
-		//				Node matchingNode = sub.getMatchSubgraphNode();
-		//				//if (debug) System.out.println(matchingNode.getIncomingEdgeLabel());
-		//				if (matchingNode instanceof T_Node) {
-		//					T_Node node = (T_Node)matchingNode;
-		//					if (debug) System.out.println("  T node: "+node.getFeature(EDITIONID)+" "+node.getFeature("word"));
-		//					matchingTnodesID.add(node.getFeature(EDITIONID));
-		//				} else if (matchingNode instanceof NT_Node) {
-		//					NT_Node ntnode = (NT_Node)matchingNode;
-		//					if (debug) System.out.println("  NT node: "+ntnode.getChilds());
-		//					for (T_Node node : getTerminals(ntnode, sub)) {
-		//						if (debug) System.out.println("   T node: "+node.getFeature(EDITIONID)+" "+node.getFeature("word"));
-		//						matchingTnodesID.add(node.getFeature(EDITIONID));
-		//					}
-		//				}
+		
+		
+		// while (match != null) {
+		// if (debug) System.out.println("Match: "+forest.getCurrentMatchNumber()+" Nsub="+forest.getSubMatchesSize());
+		// Display_Sentence sub = null;
+		// int[] var_values = match.getSentenceSubmatchAt(sentno,i);
 		//
-		//				if (forest.isNextSubMatch()) {
-		//					sub = forest.nextSubMatch();
-		//				} else {
-		//					sub = null;
-		//				}
-		//			}
-		//			
-		//			if (forest.isNextMatch()) {
-		//				match = forest.nextMatch();
-		//			} else {
-		//				match = null;
-		//			}
-		//		}
-
-		HashSet<String> matchingTnodesIDFiltered = new HashSet<String>();
+		// sub = match;
+		// int nlabel;
+		// while (sub != null) {
+		// if (debug) System.out.println(" Sub: "+forest.getCurrentSubMatchNumber());
+		// Node matchingNode = sub.getMatchSubgraphNode();
+		// //if (debug) System.out.println(matchingNode.getIncomingEdgeLabel());
+		// if (matchingNode instanceof T_Node) {
+		// T_Node node = (T_Node)matchingNode;
+		// if (debug) System.out.println(" T node: "+node.getFeature(EDITIONID)+" "+node.getFeature("word"));
+		// matchingTnodesID.add(node.getFeature(EDITIONID));
+		// } else if (matchingNode instanceof NT_Node) {
+		// NT_Node ntnode = (NT_Node)matchingNode;
+		// if (debug) System.out.println(" NT node: "+ntnode.getChilds());
+		// for (T_Node node : getTerminals(ntnode, sub)) {
+		// if (debug) System.out.println(" T node: "+node.getFeature(EDITIONID)+" "+node.getFeature("word"));
+		// matchingTnodesID.add(node.getFeature(EDITIONID));
+		// }
+		// }
+		//
+		// if (forest.isNextSubMatch()) {
+		// sub = forest.nextSubMatch();
+		// } else {
+		// sub = null;
+		// }
+		// }
+		//
+		// if (forest.isNextMatch()) {
+		// match = forest.nextMatch();
+		// } else {
+		// match = null;
+		// }
+		// }
+		
+		HashSet<String> matchingTnodesIDFiltered = new HashSet<>();
 		for (String s : matchingTnodesID) {
 			if (s == null || s.length() == 0 || s.endsWith("_dupl")) {
-
-			} else {
+				
+			}
+			else {
 				matchingTnodesIDFiltered.add(s);
 			}
 		}
-
-		if (debug) System.out.println("Matching ids: "+matchingTnodesIDFiltered);
+		
+		if (debug) System.out.println("Matching ids: " + matchingTnodesIDFiltered);
 		String[] strings = new String[matchingTnodesIDFiltered.size()];
 		int i = 0;
-		for (String s : matchingTnodesIDFiltered) strings[i++] = s;
+		for (String s : matchingTnodesIDFiltered)
+			strings[i++] = s;
 		matchingTnodesIDFiltered = null;
-
+		
 		matches = buildMatches_CQI(strings);
 		strings = null;
-
+		
 		// one word per match ! the word is inside one of the CQP (sub-)Corpus matches
-		List<Match> finalMatches = new ArrayList<Match>();
+		List<Match> finalMatches = new ArrayList<>();
 		List<Match> corpusMatches = corp.getMatches();
 		int iCorpusStart = 0;
-		for (int iMatch = 0 ; iMatch < matches.size() ; iMatch++) {
+		for (int iMatch = 0; iMatch < matches.size(); iMatch++) {
 			Match m1 = matches.get(iMatch);
-			for (int iCorpus = iCorpusStart ; iCorpus < corpusMatches.size() ; iCorpus++) {
+			for (int iCorpus = iCorpusStart; iCorpus < corpusMatches.size(); iCorpus++) {
 				Match m2 = corpusMatches.get(iCorpus);
 				if (m2.getStart() <= m1.getStart() && m1.getEnd() <= m2.getEnd()) {
 					finalMatches.add(m1);
@@ -346,72 +358,77 @@
 		matches = null;
 		corpusMatches = null;
 		return finalMatches;
-
+		
 	}
-
+	
 	private ArrayList<Match> buildMatches_CQI(String[] strings) throws CqiClientException, IOException, CqiServerError {
 		boolean debug = false;
-		ArrayList<Match> matches = new ArrayList<Match>();
+		ArrayList<Match> matches = new ArrayList<>();
 		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
 		Property idProperty = getCorpus().getProperty("id");
-
-		if (debug) System.out.println("Call CQI.str2Id with strings.len="+strings.length);
+		
+		if (debug) System.out.println("Call CQI.str2Id with strings.len=" + strings.length);
 		if (debug) System.out.println(Arrays.toString(strings));
 		if (debug) System.out.flush();
-
+		
 		int[] ids = CQI.str2Id(idProperty.getQualifiedName(), strings);
-
-		if (debug) System.out.println("Call CQI.idList2Cpos with strings.len="+ids.length);
+		
+		if (debug) System.out.println("Call CQI.idList2Cpos with strings.len=" + ids.length);
 		if (debug) System.out.println(Arrays.toString(ids));
 		if (debug) System.out.flush();
-
-		HashSet<Integer> positionsSet = new HashSet<Integer>();
+		
+		HashSet<Integer> positionsSet = new HashSet<>();
 		for (int id : ids) {
 			int[] positions = CQI.id2Cpos(idProperty.getQualifiedName(), id);
-			for( int p : positions) positionsSet.add(p);
+			for (int p : positions)
+				positionsSet.add(p);
 		}
-
+		
 		int[] positions = new int[positionsSet.size()];
 		int i = 0;
-		for (int p : positionsSet) positions[i++] = p;
+		for (int p : positionsSet)
+			positions[i++] = p;
 		positionsSet = null;
 		Arrays.sort(positions);
-		if (debug) System.out.println("Positions: "+Arrays.toString(positions));
-
-		for (int p : positions) matches.add(new Match(p, p, -1));
-
-		//build matches and regroups matches
-		//		int previous = -999;
-		//		int start = -1, end = -1, target = -1;
-		//		for (int p : positions) {
-		//			//System.out.println("P="+p+" start="+start+" end="+end+" target="+target+" Prev="+previous);
-		//			if (p - previous > 1) {
-		//				if (start >= 0) {
-		//					matches.add(new Match(start, end, target));
-		//				}
-		//				start = p;
-		//			}
-		//			end = p;
-		//			previous = p;
-		//		}
-		//		System.out.println(matches);
+		if (debug) System.out.println("Positions: " + Arrays.toString(positions));
+		
+		for (int p : positions)
+			matches.add(new Match(p, p, -1));
+			
+		// build matches and regroups matches
+		// int previous = -999;
+		// int start = -1, end = -1, target = -1;
+		// for (int p : positions) {
+		// //System.out.println("P="+p+" start="+start+" end="+end+" target="+target+" Prev="+previous);
+		// if (p - previous > 1) {
+		// if (start >= 0) {
+		// matches.add(new Match(start, end, target));
+		// }
+		// start = p;
+		// }
+		// end = p;
+		// previous = p;
+		// }
+		// System.out.println(matches);
 		return matches;
 	}
-
-
-	protected static ArrayList<T_Node> EMPTYTERMINALS = new ArrayList<T_Node>();
+	
+	
+	protected static ArrayList<T_Node> EMPTYTERMINALS = new ArrayList<>();
+	
 	public static ArrayList<T_Node> getTerminals(NT_Node ntnode, Sentence sub) {
 		if (ntnode.getChilds().size() == 0) return EMPTYTERMINALS;
-
-		ArrayList<T_Node> terminals = new ArrayList<T_Node>();
+		
+		ArrayList<T_Node> terminals = new ArrayList<>();
 		for (Object o : ntnode.getChilds()) {
-			int n = (Integer)o;
+			int n = (Integer) o;
 			Node node = sub.getNode(n);
 			if (node instanceof T_Node) {
-				terminals.add((T_Node)node);
-			} else if (node instanceof NT_Node) {
-				terminals.addAll(getTerminals((NT_Node)node, sub));
+				terminals.add((T_Node) node);
 			}
+			else if (node instanceof NT_Node) {
+				terminals.addAll(getTerminals((NT_Node) node, sub));
+			}
 		}
 		return terminals;
 	}
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 3061)
@@ -34,17 +34,28 @@
 	@Parameter(key = TXMPreferences.QUERY)
 	protected String pQuery;
 	
+	/**
+	 * from 0 to N-1 sentences
+	 */
+	@Parameter(key = TXMPreferences.INDEX)
+	protected int index;
+	
+	/**
+	 * from 0 to N-1 sentence subgraphs
+	 */
+	@Parameter(key = TXMPreferences.SUB_INDEX)
+	protected int subIndex;
+	
 	public CorpusBuild getCorpus() {
 		return corpus;
 	}
 	
-	public TIGERSearch(CorpusBuild corpus2) {
-		this(null, corpus2);
-		
+	public TIGERSearch(CorpusBuild corpus) {
+		this(null, corpus);
 	}
 	
-	public TIGERSearch(String parentNodePath, CorpusBuild corpus2) {
-		super(parentNodePath, corpus2);
+	public TIGERSearch(String parentNodePath, CorpusBuild corpus) {
+		super(parentNodePath, corpus);
 		
 		this.corpus = getParent();
 		
@@ -262,4 +273,9 @@
 	public String getResultType() {
 		return "Tiger search";
 	}
+	
+	public void setIndexAndSubIndex(int sent, int sub) {
+		this.index = sent;
+		this.subIndex = sub;
+	}
 }
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java	(revision 3061)
@@ -27,6 +27,7 @@
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.searchengine.cqp.serverException.CqiServerError;
+import org.txm.tigersearch.rcp.preferences.TIGERSearchPreferences;
 import org.txm.utils.DeleteDir;
 import org.txm.utils.logger.Log;
 
@@ -35,11 +36,11 @@
 import ims.tiger.query.processor.CorpusQueryProcessor;
 
 public class TIGERSearchEngine extends SearchEngine {
-
+	
 	public static final String NAME = "TIGER";
-
+	
 	HashMap<CorpusBuild, TSCorpus> corpora = null;
-
+	
 	public TSCorpus getTSCorpus(CorpusBuild corpus) {
 		CorpusBuild root = corpus.getRootCorpusBuild();
 		TSCorpus tscorpus = corpora.get(root);
@@ -54,29 +55,30 @@
 		if (tscorpus != null) {
 			corpora.put(root, tscorpus);
 			return tscorpus;
-		} else {
+		}
+		else {
 			return null;
 		}
 	}
-
+	
 	public TSCorpus removeTSCorpus(CorpusBuild corpus) {
 		CorpusBuild root = corpus.getRootCorpusBuild();
 		return corpora.remove(root);
 	}
-
+	
 	@Override
 	public boolean isRunning() {
 		return true;
 	}
-
+	
 	@Override
 	public boolean initialize() throws Exception {
 		return true;
 	}
-
+	
 	/**
 	 * 
-	 * @param cqpCorpus the targeted CQPCorpus 
+	 * @param cqpCorpus the targeted CQPCorpus
 	 * @return the first sentence and last sentence id (from 0 to N, N the number of sentences). WARNING: this is not the list of sentences in the targeted CQPCorpus. unless the CQPcorpus is contigues
 	 * 
 	 * @throws UnexpectedAnswerException
@@ -87,15 +89,15 @@
 	public static int[] getSentMinMax(CQPCorpus cqpCorpus) throws UnexpectedAnswerException, IOException, CqiServerError, CqiClientException {
 		List<org.txm.searchengine.cqp.corpus.query.Match> matches = cqpCorpus.getMatches();
 		if (matches.size() == 0) {
-			return new int[]{0,0};
+			return new int[] { 0, 0 };
 		}
-
-		return getSentMinMax(cqpCorpus, matches.get(0).getStart(), matches.get(matches.size()-1).getEnd());
+		
+		return getSentMinMax(cqpCorpus, matches.get(0).getStart(), matches.get(matches.size() - 1).getEnd());
 	}
 	
 	/**
 	 * 
-	 * @param cqpCorpus the targeted CQPCorpus 
+	 * @param cqpCorpus the targeted CQPCorpus
 	 * @return the first sentence and last sentence id (from 0 to N, N the number of sentences). WARNING: this is not the list of sentences in the targeted CQPCorpus. unless the CQPcorpus is contigues
 	 * 
 	 * @throws UnexpectedAnswerException
@@ -107,32 +109,33 @@
 		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
 		List<org.txm.searchengine.cqp.corpus.query.Match> matches = cqpCorpus.getMatches();
 		if (matches.size() == 0) {
-			return new int[]{0,0};
+			return new int[] { 0, 0 };
 		}
-		int[] cpos = new int[] {start, end};
+		int[] cpos = new int[] { start, end };
 		int[] structs = CQI.cpos2Struc(cqpCorpus.getStructuralUnit("s").getProperty("n").getQualifiedName(), cpos);
 		if (structs.length == 0) {
-			return new int[]{0,0};
+			return new int[] { 0, 0 };
 		}
 		int sent_min = structs[0];
-		int sent_max = structs[structs.length-1];
-		return new int[]{sent_min, sent_max};
+		int sent_max = structs[structs.length - 1];
+		return new int[] { sent_min, sent_max };
 	}
 	
 	/**
 	 * 
 	 * @return true because TIGER queries are frequently multi lines
 	 */
+	@Override
 	public boolean hasMultiLineQueries() {
 		return true;
 	}
-
+	
 	@Override
 	public boolean start(IProgressMonitor monitor) throws Exception {
-		corpora = new HashMap<CorpusBuild, TSCorpus>();
+		corpora = new HashMap<>();
 		return true;
 	}
-
+	
 	@Override
 	public boolean stop() throws Exception {
 		if (corpora != null) {
@@ -143,142 +146,150 @@
 		}
 		return true;
 	}
-
+	
 	@Override
 	public String getName() {
 		return NAME;
 	}
-
+	
 	@Override
 	public Selection query(CorpusBuild corpus, IQuery query, String name, boolean saveQuery) throws Exception {
-
+		
 		TSCorpus tcorpus = this.getTSCorpus(corpus);
 		TSResult result = null;
 		if (corpus == corpus.getRootCorpusBuild() || !(corpus instanceof CQPCorpus)) { // root corpus or something not a CQPCorpus
 			result = tcorpus.query(query.getQueryString().replace("\n", " "));
-		} else {
-			CQPCorpus cqpCorpus = (CQPCorpus)corpus;
+		}
+		else {
+			CQPCorpus cqpCorpus = (CQPCorpus) corpus;
 			AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
 			List<org.txm.searchengine.cqp.corpus.query.Match> matches = cqpCorpus.getMatches();
 			if (matches.size() == 0) {
 				return new EmptySelection(query);
 			}
-			int[] cpos = {matches.get(0).getStart(), matches.get(matches.size()-1).getEnd()};
+			int[] cpos = { matches.get(0).getStart(), matches.get(matches.size() - 1).getEnd() };
 			int[] structs = CQI.cpos2Struc(cqpCorpus.getStructuralUnit("s").getProperty("n").getQualifiedName(), cpos);
 			if (structs.length == 0) {
 				return new EmptySelection(query);
 			}
 			int sent_min = structs[0];
-			int sent_max = structs[structs.length-1];
-			Log.finest("QUERYING sentences: "+sent_min+" -> "+sent_max);
-			result = tcorpus.query(query.getQueryString().replace("\n", " "), sent_min, sent_max+1, -1);
+			int sent_max = structs[structs.length - 1];
+			Log.finest("QUERYING sentences: " + sent_min + " -> " + sent_max);
+			result = tcorpus.query(query.getQueryString().replace("\n", " "), sent_min, sent_max + 1, -1);
 		}
 		MatchResult mresult = result.getMatchResult();
 		int size = mresult.size();
-		//System.out.println("size: "+size);
+		// System.out.println("size: "+size);
 		int subsize = mresult.submatchSize();
 		if (size == 0 || subsize == 0) {
 			return new EmptySelection(query);
 		}
-
+		
 		Index index = tcorpus.getIndex();
-
+		
 		// compute sentence positions
-		//TODO move it to TSCorpus
+		// TODO move it to TSCorpus
 		int[] starts = tcorpus.getSentenceStartPositions();
-
-		LinkedHashSet<TIGERMatch> tigerMatchesList = new LinkedHashSet<TIGERMatch>();
-
+		
+		LinkedHashSet<TIGERMatch> tigerMatchesList = new LinkedHashSet<>();
+		
 		List<String> variables = java.util.Arrays.asList(mresult.getVariableNames());
-		//System.out.println("Variables: "+variables+" iPivot="+variables.indexOf("pivot"));
+		// System.out.println("Variables: "+variables+" iPivot="+variables.indexOf("pivot"));
 		int iPivot = variables.indexOf("pivot");
-
+		
 		MappedByteBuffer offsetsMapped = tcorpus.getOffsetsMapped();
-		//MappedByteBuffer offsetsMapped = tcorpus.getOffsetsMapped();
+		// MappedByteBuffer offsetsMapped = tcorpus.getOffsetsMapped();
 		
-		//System.out.println("submatchSize: "+subsize);
-		for (int imatch = 0 ; imatch < size; imatch++) { // the matching sentences
-			int sent = mresult.getSentenceNumberAt(imatch);
-			//Sentence sentence = tcorpus.manager.getSentence(sent);
-
-			//System.out.println(" sent: "+sent);
+		boolean useSubMatches = TIGERSearchPreferences.getInstance().getBoolean(TIGERSearchPreferences.USESUBMATCHES);
+		
+		// System.out.println("submatchSize: "+subsize);
+		for (int isentMatch = 0; isentMatch < size; isentMatch++) { // the matching sentences
+			int sent = mresult.getSentenceNumberAt(isentMatch);
+			// Sentence sentence = tcorpus.manager.getSentence(sent);
+			
+			// System.out.println(" sent: "+sent);
 			int sent_submatch = mresult.getSentenceSubmatchSize(sent);
-
-			//System.out.println(" sent submatch size: "+sent_submatch);
-			for (int isubmatch = 0 ; isubmatch < sent_submatch ; isubmatch++) { // the matches in the sentence
-				int[] match = mresult.getSentenceSubmatchAt(sent, isubmatch);
-
+			
+			// System.out.println(" sent submatch size: "+sent_submatch);
+			for (int iSubMatch = 0; iSubMatch < sent_submatch; iSubMatch++) { // the matches in the sentence
+				int[] match = mresult.getSentenceSubmatchAt(sent, iSubMatch);
+				
 				int sent_start = starts[sent];
-
-				//				System.out.println("  sent="+sent_start+ " matches="+Arrays.toString(match)+" ipivot="+iPivot);
-				for (int i = 0 ; i < match.length ; i++) {
-
+				
+				// System.out.println(" sent="+sent_start+ " matches="+Arrays.toString(match)+" ipivot="+iPivot);
+				for (int i = 0; i < match.length; i++) {
+					
 					if (iPivot != -1 && i != iPivot) continue; // skip match that are not 'pivot'
-
-					int left = sent_start+index.getLeftCorner(sent, match[i]);
+					
+					int left = sent_start + index.getLeftCorner(sent, match[i]);
 					if (offsetsMapped != null) { // the TIGER token is not in the CQP corpus
-						left += offsetsMapped.getInt(left*Integer.BYTES);
-						//						System.out.println("left="+left+" offset="+offsetsMapped.getInt(left*Integer.BYTES));
+						left += offsetsMapped.getInt(left * Integer.BYTES);
+						// System.out.println("left="+left+" offset="+offsetsMapped.getInt(left*Integer.BYTES));
 					}
-					int right = sent_start+index.getRightCorner(sent, match[i]);
+					int right = sent_start + index.getRightCorner(sent, match[i]);
 					if (offsetsMapped != null) { // the TIGER token is not in the CQP corpus
-						right += offsetsMapped.getInt(right*Integer.BYTES);
+						right += offsetsMapped.getInt(right * Integer.BYTES);
 					}
-					//System.out.println("   M="+match[i]+" ("+left+", "+right+")");
-
+					// System.out.println(" M="+match[i]+" ("+left+", "+right+")");
+					
 					TIGERMatch tigerMatch = new TIGERMatch(left, right);
-
-					//System.out.println("  ajusted="+(tigerMatch));
+					
+					// System.out.println(" ajusted="+(tigerMatch));
 					tigerMatchesList.add(tigerMatch);
+					
+					if (!useSubMatches) { // use only the first submatch
+						break;
+					}
 				}
 			}
 		}
-
-		//intersect with corpus matches
-		List<? extends Match> result2 = Match.intersect(corpus.getMatches(),  new ArrayList<TIGERMatch>(tigerMatchesList), true);
-
+		
+		// intersect with corpus matches
+		List<? extends Match> result2 = Match.intersect(corpus.getMatches(), new ArrayList<>(tigerMatchesList), true);
+		
 		return new TIGERSelection(query, result2);
 	}
-
+	
 	@Override
 	public IQuery newQuery() {
 		return new TIGERQuery();
 	}
-
+	
 	@Override
 	public boolean hasIndexes(CorpusBuild corpus) {
 		if (corpus == null) return false;
-
-		//TODO implement a corpora of TIGER corpus
+		
+		// TODO implement a corpora of TIGER corpus
 		CorpusBuild root = corpus.getRootCorpusBuild();
 		File buildDirectory = new File(root.getProjectDirectory(), "tiger");
-		return	new File(buildDirectory, "tigersearch.logprop").exists() && 
+		return new File(buildDirectory, "tigersearch.logprop").exists() &&
 				new File(buildDirectory, root.getID()).exists();
 	}
-
+	
 	@Override
 	public void notify(TXMResult r, String state) {
 		if (r instanceof MainCorpus && "clean".equals(state)) { // the CQP corpus has been deleted by the user
-			MainCorpus c = (MainCorpus)r;
-			File buildDirectory = new File(c.getProjectDirectory(), "tiger/"+c.getID());
+			MainCorpus c = (MainCorpus) r;
+			File buildDirectory = new File(c.getProjectDirectory(), "tiger/" + c.getID());
 			if (buildDirectory.exists()) {
 				DeleteDir.deleteDirectory(buildDirectory);
 			}
-		} else if (r instanceof Project && "clean".equals(state)) {  // the Project has been deleted by the user
-			Project c = (Project)r;
+		}
+		else if (r instanceof Project && "clean".equals(state)) {  // the Project has been deleted by the user
+			Project c = (Project) r;
 			File buildDirectory = new File(c.getProjectDirectory(), "tiger");
 			if (buildDirectory.exists()) {
 				DeleteDir.deleteDirectory(buildDirectory);
 			}
 		}
 	}
-
+	
 	@Override
 	public String getValueForProperty(Match match, SearchEngineProperty property) {
 		// TODO Auto-generated method stub
 		return null;
 	}
-
+	
 	@Override
 	public List<String> getValuesForProperty(Match match, SearchEngineProperty property) {
 		// TODO Auto-generated method stub
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/preferences/TIGERSearchPreferences.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/preferences/TIGERSearchPreferences.java	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/preferences/TIGERSearchPreferences.java	(revision 3061)
@@ -11,30 +11,34 @@
  *
  */
 public class TIGERSearchPreferences extends TXMPreferences {
-
-		
+	
+	
 	public static String VERSION = "version";
-
-
+	
+	public static String USESUBMATCHES = "use_sub_matches";
+	
+	
 	/**
 	 * Gets the instance.
+	 * 
 	 * @return the instance
 	 */
-	public static TXMPreferences getInstance()	{
+	public static TXMPreferences getInstance() {
 		if (!TXMPreferences.instances.containsKey(TIGERSearchPreferences.class)) {
 			new TIGERSearchPreferences();
 		}
 		return TXMPreferences.instances.get(TIGERSearchPreferences.class);
 	}
-
 	
+	
 	@Override
 	public void initializeDefaultPreferences() {
 		super.initializeDefaultPreferences();
 		
 		Preferences preferences = this.getDefaultPreferencesNode();
-//		preferences.putBoolean(GROUP_BY_TEXTS, true);
-//		preferences.putInt(METHOD, 2);
+		preferences.putBoolean(USESUBMATCHES, true);
+		// preferences.putBoolean(GROUP_BY_TEXTS, true);
+		// preferences.putInt(METHOD, 2);
 	}
 }
 
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 3061)
@@ -166,7 +166,6 @@
 		svgPanel = new SVGComposite(mainPanel, SWT.EMBEDDED | SWT.NO_BACKGROUND);
 		svgPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 		
-		initializeFields();
 		this.getTopToolbar().setVisible(COMPUTING_PARAMETERS_GROUP_ID, true);
 	}
 	
@@ -178,13 +177,13 @@
 		if (!registrydir.exists()) {
 			System.out.println("TIGERSearch corpus '" + id + "' has no TIGERSearch registry directory: " + registrydir);
 			queryArea.setText("TIGERSearch corpus '" + id + "' has no TIGERSearch registry directory: " + registrydir);
-			okButton.setEnabled(false);
+			// okButton.setEnabled(false);
 			return;
 		}
 		if (!registrydir.exists()) {
 			System.out.println("TIGERSearch corpus '" + id + "' has no TIGERSearch config file: " + configfile);
 			queryArea.setText("TIGERSearch corpus '" + id + "' has no TIGERSearch config file: " + configfile);
-			okButton.setEnabled(false);
+			// okButton.setEnabled(false);
 			return;
 		}
 		// String query = "#n:[cat = \"Obj\"] >* #m & arity(#n, 2, 10)";
@@ -287,6 +286,9 @@
 	
 	@Override
 	public void updateEditorFromResult(boolean update) {
+		if (update == false) {
+			initializeFields();
+		}
 		// final String query = queryArea.getText().trim();
 		// if (query.length() == 0) {
 		// System.out.println("No query, aborting.");
@@ -351,6 +353,8 @@
 		int sent = sentSpinner.getSelection() - 1;
 		int sub = subSpinner.getSelection() - 1;
 		
+		ts.setIndexAndSubIndex(sent, sub);
+		
 		if (ts == null) return false; // no result
 		if (!ts.isComputed()) return false;
 		
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeTIGERSearch.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeTIGERSearch.java	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/commands/ComputeTIGERSearch.java	(revision 3061)
@@ -31,60 +31,71 @@
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.preferences.TXMPreferences;
 import org.txm.function.tigersearch.TIGERSearch;
-import org.txm.rcp.TXMWindows;
+import org.txm.rcp.editors.TXMEditor;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.tigersearch.editors.TIGERSearchEditor;
-import org.txm.tigersearch.editors.TIGERSearchEditorInput;
 import org.txm.utils.logger.Log;
 
 
-// TODO: Auto-generated Javadoc
 /**
- * open the TIGERSearch Editor 
+ * Open the TIGERSearch Editor using the current selection OR a preference node set in the RCP command parameter TXMPreferences.RESULT_PARAMETERS_NODE_PATH
+ * 
  * @author mdecorde.
  */
 public class ComputeTIGERSearch extends AbstractHandler {
-
+	
 	/** The ID. */
 	public static String ID = "org.txm.rcp.commands.function.ComputeTIGERSearch"; //$NON-NLS-1$
-
-	/** The selection. */
-	private IStructuredSelection selection;
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
 	public Object execute(final ExecutionEvent event) throws ExecutionException {
 		
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-
-		Object s = selection.getFirstElement();
-		openEditor(s);
-
-		return null;
+		Object s = null;
+		
+		// From link: creating from parameter node
+		String parametersNodePath = event.getParameter(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
+		if (parametersNodePath != null && !parametersNodePath.isEmpty()) {
+			s = new TIGERSearch(parametersNodePath);
+		}
+		else { // From view result node
+			IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+			s = selection.getFirstElement();
+		}
+		
+		return openEditor(s);
 	}
-
-	public static void openEditor(Object obj) {
+	
+	public static TIGERSearchEditor openEditor(Object obj) {
 		
 		TIGERSearch ts = null;
 		
 		if (obj instanceof CQPCorpus) {
-			ts = new TIGERSearch((CQPCorpus)obj);
-		} else if (obj instanceof TIGERSearch) {
-			ts = (TIGERSearch)obj;
-		} else {
-			System.out.println("Selection is not a corpus: "+obj);
-			return;
+			ts = new TIGERSearch((CQPCorpus) obj);
 		}
+		else if (obj instanceof TIGERSearch) {
+			ts = (TIGERSearch) obj;
+		}
+		else {
+			System.out.println("Selection is not a corpus: " + obj);
+			return null;
+		}
 		
 		try {
-			TIGERSearchEditor.openEditor(ts, TIGERSearchEditor.ID); //$NON-NLS-1$
-		} catch (Exception e) {
+			TXMEditor<?> editor = TIGERSearchEditor.openEditor(ts, TIGERSearchEditor.ID);
+			if (editor instanceof TIGERSearchEditor) {
+				return (TIGERSearchEditor) editor;
+			}
+		}
+		catch (Exception e) {
 			Log.printStackTrace(e);
 		}
+		return null;
 	}
 }
Index: tmp/org.txm.tigersearch.rcp/plugin.xml
===================================================================
--- tmp/org.txm.tigersearch.rcp/plugin.xml	(revision 3060)
+++ tmp/org.txm.tigersearch.rcp/plugin.xml	(revision 3061)
@@ -266,6 +266,15 @@
             </visibleWhen>
          </command>
       </menuContribution>
+      <menuContribution
+            locationURI="popup:org.txm.concordance.rcp.editors.ConcordanceEditor">
+         <command
+               commandId="org.txm.tigersearch.commands.ComputeTIGERSearch"
+               icon="icons/functions/TS.png"
+               label="Send To TIGERSearch"
+               style="push">
+         </command>
+      </menuContribution>
    </extension>
    <extension
          point="org.eclipse.ui.editors">
@@ -326,7 +335,7 @@
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
-            category="org.txm.rcp.preferences.UserPreferencePage"
+            category="org.txm.searchengine.rcp.preferences.SearchEnginePreferencesPage"
             class="org.txm.tigersearch.rcp.preferences.TIGERSearchPreferencePage"
             id="org.txm.tigersearch.rcp.preferences.TIGERSearchPreferencePage"
             name="TIGERSearch">
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 3060)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 3061)
@@ -76,12 +76,12 @@
 		Index index = (Index) result;
 		CQPCorpus corpus = CQPCorpus.getFirstParentCorpus(index);
 		
-		
 		// TODO enable subcorpus from index query when the hidden subcorpus deletion will be managed or another system implemented (eg new SubCorpus(TXMResult result)
 		if (index.getQuery() instanceof CQLQuery && IndexPreferences.getInstance().getBoolean(IndexPreferences.LINK_USING_SUBCORPUS)) {
 			CQLQuery cqlQuery = (CQLQuery) index.getQuery();
 			if (cqlQuery == null || cqlQuery.isEmpty() || // no query
-					cqlQuery.getQueryString().equals("[]")) { // don't bother creating a subcorpus use the parent corpus
+					cqlQuery.getQueryString().equals("[]") ||
+					cqlQuery.getQueryString().equals(".*")) { // don't bother creating a subcorpus use the parent corpus
 				return corpus;
 			}
 			
Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/preferences/RPreferencePage.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/preferences/RPreferencePage.java	(revision 3060)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/preferences/RPreferencePage.java	(revision 3061)
@@ -42,6 +42,7 @@
 import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.preferences.RPreferences;
 import org.txm.statsengine.r.rcp.messages.RUIMessages;
+
 // TODO: Auto-generated Javadoc
 /**
  * This class represents a preference page that is contributed to the
@@ -55,12 +56,13 @@
  */
 
 public class RPreferencePage extends TXMPreferencePage {
-
+	
 	/** The r_path_to_executable. */
 	private StringFieldEditor r_path_to_executable;
 	
 	/** The r_server_adress. */
 	private StringFieldEditor r_server_adress;
+	
 	private IntegerFieldEditor r_port;
 	
 	/** The r_user. */
@@ -73,30 +75,33 @@
 	private BooleanFieldEditor r_is_remote;
 	
 	private BooleanFieldEditor r_debug;
-
 	
+	
 	/** The r_use_file_transfert. */
 	private BooleanFieldEditor r_use_file_transfert;
 	
 	private StringFieldEditor r_svg_device;
 	
 	private StringFieldEditor r_rargs;
+	
 	private StringFieldEditor r_rserveargs;
-
 	
+	private StringFieldEditor r_repos;
 	
+	
+	
 	@Override
 	public void init(IWorkbench workbench) {
 		this.setPreferenceStore(new TXMPreferenceStore(RPreferences.getInstance().getPreferencesNodeQualifier()));
-		//this.setTitle(RUIMessages.runRServeInDebugMode);
-		//FIXME todo if needed
-		//setDescription(Messages.RPreferencePage_1);
-		//this.setImageDescriptor(SpecificitiesAdapterFactory.ICON);
+		// this.setTitle(RUIMessages.runRServeInDebugMode);
+		// FIXME todo if needed
+		// setDescription(Messages.RPreferencePage_1);
+		// this.setImageDescriptor(SpecificitiesAdapterFactory.ICON);
 	}
-
 	
-
-
+	
+	
+	
 	/**
 	 * Creates the field editors. Field editors are abstractions of the common
 	 * GUI blocks needed to manipulate various types of preferences. Each field
@@ -104,13 +109,13 @@
 	 */
 	@Override
 	public void createFieldEditors() {
-
+		
 		r_debug = new BooleanFieldEditor(RPreferences.DEBUG, RUIMessages.runRServeInDebugMode, BooleanFieldEditor.DEFAULT, getFieldEditorParent());
 		addField(r_debug);
 		
 		r_is_remote = new BooleanFieldEditor(RPreferences.REMOTE, RUIMessages.remoteConnection, BooleanFieldEditor.DEFAULT, getFieldEditorParent());
 		addField(r_is_remote);
-
+		
 		r_path_to_executable = new FileFieldEditor(RPreferences.PATH_TO_EXECUTABLE, RUIMessages.pathToRBinary, getFieldEditorParent());
 		addField(r_path_to_executable);
 		
@@ -119,38 +124,42 @@
 		
 		r_rserveargs = new StringFieldEditor(RPreferences.RSERVEARGS, RUIMessages.rserveArgs, getFieldEditorParent());
 		addField(r_rserveargs);
-				
+		
 		r_use_file_transfert = new BooleanFieldEditor(RPreferences.FILE_TRANSFERT, RUIMessages.useFileBasedRDataTransfert, BooleanFieldEditor.DEFAULT,
 				getFieldEditorParent());
 		addField(r_use_file_transfert);
-
+		
 		r_server_adress = new StringFieldEditor(RPreferences.SERVER_ADDRESS, RUIMessages.serverAddress, getFieldEditorParent());
 		addField(r_server_adress);
 		
 		r_port = new IntegerFieldEditor(RPreferences.PORT, RUIMessages.portDefaultIs6311, getFieldEditorParent());
 		addField(r_port);
-
+		
 		r_user = new StringFieldEditor(RPreferences.USER, RUIMessages.user, getFieldEditorParent());
 		addField(r_user);
-
+		
 		r_password = new StringFieldEditor(RPreferences.PASSWORD, RUIMessages.password, getFieldEditorParent());
 		addField(r_password);
 		
-//		r_svg_device = new StringFieldEditor(R_SVG_DEVICE, Messages.RPreferencePage_5,
-//				getFieldEditorParent());
-//		addField(r_svg_device);
-
+		// r_svg_device = new StringFieldEditor(R_SVG_DEVICE, Messages.RPreferencePage_5,
+		// getFieldEditorParent());
+		// addField(r_svg_device);
 		
+		
 		changeFieldStates(RPreferences.getInstance().getBoolean(RPreferences.REMOTE));
 		
 		
 		addField(new BooleanFieldEditor(RPreferences.SHOW_EVAL_LOGS, "Log the R eval command lines", getFieldEditorParent()));
 		
+		r_repos = new StringFieldEditor(RPreferences.DEFAULT_REPOS, "Defautl package repository", getFieldEditorParent());
+		addField(r_repos);
+		
 	}
 	
 	
 	/**
 	 * Enable/disable the fields according to the remote mode activation.
+	 * 
 	 * @param serverIsRemote
 	 */
 	public void changeFieldStates(boolean serverIsRemote) {
@@ -163,7 +172,8 @@
 			r_rargs.setEnabled(false, getFieldEditorParent());
 			r_rserveargs.setEnabled(false, getFieldEditorParent());
 			r_use_file_transfert.setEnabled(false, getFieldEditorParent());
-		} else {
+		}
+		else {
 			r_server_adress.setEnabled(false, getFieldEditorParent());
 			r_user.setEnabled(false, getFieldEditorParent());
 			r_password.setEnabled(false, getFieldEditorParent());
@@ -174,8 +184,9 @@
 			r_use_file_transfert.setEnabled(true, getFieldEditorParent());
 		}
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
 	 */
 	@Override
@@ -184,24 +195,26 @@
 			changeFieldStates((Boolean) event.getNewValue());
 		}
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
 	 */
 	@Override
 	public boolean performOk() {
 		try {
 			super.performOk();
-			//Toolbox.updateProperties(ApplicationWorkbenchAdvisor.getProperties());
+			// Toolbox.updateProperties(ApplicationWorkbenchAdvisor.getProperties());
 			
 			RWorkspace rw = RWorkspace.getRWorkspaceInstance();
-			if (rw != null)	{
+			if (rw != null) {
 				RWorkspace.setUseFileCommunication(RPreferences.getInstance().getBoolean(RPreferences.FILE_TRANSFERT));
 				rw.setLog(RWorkspace.isLoggingEvalCommandLines());
 			}
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			System.err.println(NLS.bind(TXMUIMessages.failedToSavePreferencesColonP0, e));
 		}
 		return true;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/CQPLibPreferences.java
===================================================================
--- tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/CQPLibPreferences.java	(revision 3060)
+++ tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/CQPLibPreferences.java	(revision 3061)
@@ -59,18 +59,14 @@
 		// FIXME: SJ: some code in this method should be done only at TXM first run
 		// Extra note: and be better to use P2.inf and install/uninstall Touchpoints
 		
-		
 		Preferences preferences = this.getDefaultPreferencesNode();
 		
-		
-		
 		String CQPFRAGMENT = "org.txm.libs.cqp." + System.getProperty("osgi.os");
 		// TODO: fix preferences logic between org.txm.cqp.lib and org.txm.searchengine.cqp
 		Log.fine("CQPLibPreferences.initializeDefaultPreferences()");
 		String saved = getString(CQPLibPreferences.VERSION);
 		Version currentVersion = BundleUtils.getBundleVersion(CQPFRAGMENT); // the CQPFRAGMENT plugin contains the right version
 		
-		
 		String os = "win";
 		String ext = "";
 		String osname = System.getProperty("os.name").toLowerCase();
Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java	(revision 3060)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java	(revision 3061)
@@ -113,12 +113,9 @@
 			binding.setProperty("readyToLoad", Boolean.FALSE); //$NON-NLS-1$
 			// System.out.println("script="+script);
 			
-			TokenizerClasses.reset();
-			if (!TokenizerClasses.loadFromProject(project.getPreferencesScope())) {
+			if (!new TokenizerClasses().loadFromProject(project.getPreferencesScope())) {
 				Log.severe("Error: failed to load tokenizer parameters");
 				monitor.done();
-				// if (basedir.exists()) basedir.renameTo(errorBinDirectory);
-				// if (tempBinDirectory.exists()) tempBinDirectory.renameTo(basedir);
 				return Status.CANCEL_STATUS;
 			}
 			
@@ -129,8 +126,6 @@
 			s.run(); // run the groovy import script
 			monitor.worked(90);
 			
-			TokenizerClasses.reset(); // restore default tokenizer classes
-			
 			Object ready = binding.getVariable("readyToLoad"); //$NON-NLS-1$
 			if (ready != null && ready instanceof Boolean) {
 				Boolean readyToLoad = (Boolean) ready;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/table/Excel2XMLMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/table/Excel2XMLMacro.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/table/Excel2XMLMacro.groovy	(revision 3061)
@@ -3,6 +3,8 @@
 import org.kohsuke.args4j.*
 import groovy.transform.Field
 import java.nio.charset.Charset
+
+import org.txm.libs.msoffice.ReadExcel
 import org.txm.rcpapplication.swt.widget.parameters.*
 import org.txm.utils.*
 import javax.xml.stream.*
@@ -17,66 +19,36 @@
 
 def stringToIndent = { str -> org.txm.utils.AsciiUtils.buildAttributeId(org.txm.utils.AsciiUtils.convertNonAscii(str)).toLowerCase() }
 
-// from http://www.java-connect.com/apache-poi-tutorials/read-all-type-of-excel-cell-value-as-string-using-poi
-def getCellValueAsString = { cell ->
-        strCellValue = null
-        if (cell != null) {
-            switch (cell.getCellType()) {
-            case CellType.STRING:
-                strCellValue = cell.toString()
-                break
-            case CellType.NUMERIC:
-                if (DateUtil.isCellDateFormatted(cell)) {
-                    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy")
-                    strCellValue = dateFormat.format(cell.getDateCellValue())
-                } else {
-                    value = cell.getNumericCellValue()
-                    longValue = value.longValue()
-                    strCellValue = new String(longValue.toString())
-                }
-                break
-            case CellType.BOOLEAN:
-                strCellValue = new String(new Boolean(cell.getBooleanCellValue()).toString())
-                break
-            case CellType.BLANK:
-                strCellValue = ""
-                break
-            }
-        }
-        if (strCellValue == null) strCellValue = ""
-        return strCellValue
-}
-
 @Field @Option(name="inputFile", usage="fichier Excel à traiter", widget="File", required=true, def="")
-File inputFile
+		File inputFile
 
 @Field @Option(name="sheetName", usage="sheet name (if no name is given the first sheet will be used)", widget="String", required=false, def="")
-def sheetName
+		def sheetName
 
 @Field @Option(name="rootTag", usage="root tag name", widget="String", required=false, def="root")
-def rootTag
+		def rootTag
 
 @Field @Option(name="textTag", usage="line unit tag name", widget="String", required=false, def="unit")
-def textTag
+		def textTag
 
 @Field @Option(name="metadataColumnList", usage="metadata columns list separated by comma", widget="String", required=false, def="meta1,meta2")
-def metadataColumnList
+		def metadataColumnList
 
 @Field @Option(name="dateColumnList", usage="date columns list separated by comma", widget="String", required=false, def="meta1,meta2")
-def dateColumnList
+		def dateColumnList
 
 @Field @Option(name="textColumnList", usage="text columns list separated by comma", widget="String", required=false, def="textColumnList1,textColumnList2")
-def textColumnList
+		def textColumnList
 
 @Field @Option(name="EmbedInTEI", usage="text columns list separated by comma", widget="Boolean", required=false, def="false")
-def EmbedInTEI
+		def EmbedInTEI
 
 if (!ParametersDialog.open(this)) return
 
-if (!inputFile.exists()) {
-	println "** Excel2XML: no '"+inputFile.name+"' file found. Aborting."
-	return false
-}
+	if (!inputFile.exists()) {
+		println "** Excel2XML: no '"+inputFile.name+"' file found. Aborting."
+		return false
+	}
 
 if (!inputFile.canRead()) {
 	println "** Excel2XML: '"+inputFile.name+"' file not readable. Aborting."
@@ -84,158 +56,132 @@
 }
 
 try {
-
-metadataColumnList = metadataColumnList.split(",").collect { it.trim() }
-dateColumnList = dateColumnList.split(",").collect { it.trim() }
-textColumnList = textColumnList.split(",").collect { it.trim() }
-textTag = textTag.trim()
-rootTag = rootTag.trim()
-
-wb = WorkbookFactory.create(inputFile)
-
-if (sheetName.length() == 0) {
-	ws = wb.getSheetAt(0)
-} else {
-	ws = wb.getSheet(sheetName)
-	if (ws == null) {
-		println "** Excel2XML: no '"+sheetName+" found. Aborting."
-		return false
+	
+	metadataColumnList = metadataColumnList.split(",").collect { it.trim() }
+	dateColumnList = dateColumnList.split(",").collect { it.trim() }
+	textColumnList = textColumnList.split(",").collect { it.trim() }
+	textTag = textTag.trim()
+	rootTag = rootTag.trim()
+	
+	ReadExcel excel = new ReadExcel(inputFile, sheetName);
+	excel.readHeaders();
+	
+	headers = excel.getHeaders()
+	
+	println "Headers: $headers"
+	
+	ok = true
+	metadataColumnList.each { m ->
+		if (!headers.contains(m)) {
+			println "** Excel2XML: missing metadataColumnList column: $m"
+			ok = false
+		}
 	}
-}
-
-if (ws == null) {
-	println "** Excel2XML: no sheet found. Aborting."
-	return false
-}
-
-nRows = ws.getPhysicalNumberOfRows()
-println nRows+" rows."
- 
-firstRow = ws.getRow(0)
-colMax = firstRow.getLastCellNum()
-
-headers = (0..colMax-1).collect { getCellValueAsString(firstRow.getCell(it)) }
-
-println "Headers: $headers"
-
-normalizedHeaders = headers.collect { stringToIndent(it) }
-
-ok = true
-metadataColumnList.each { m ->
-	if (!headers.contains(m)) {
-		println "** Excel2XML: missing metadataColumnList column: $m"
-		ok = false
+	textColumnList.each { t ->
+		if (!headers.contains(t)) {
+			println "** Excel2XML: missing textColumnList column: $t"
+			ok = false
+		}
 	}
-}
-textColumnList.each { t ->
-	if (!headers.contains(t)) {
-		println "** Excel2XML: missing textColumnList column: $t"
-		ok = false
-	}
-}
-
-if (!ok) { return false }
-
-metadataColumnIndex = metadataColumnList.collect { headers.indexOf(it) }
-dateColumnsIndex = dateColumnList.collect { headers.indexOf(it) }
-textColumnIndex = textColumnList.collect { headers.indexOf(it) }
-
-println "metadataColumnList = "+metadataColumnList
-println "metadataColumnIndex = "+metadataColumnIndex
-
-println "dateColumnList = "+dateColumnList
-println "dateColumnsIndex = "+dateColumnsIndex
-
-println "textColumnList = "+textColumnList
-println "textColumnIndex = "+textColumnIndex
-
-name = inputFile.getName()
-idx = name.lastIndexOf(".")
-
-if (idx > 0) name = name.substring(0, idx)
-outputFile = new File(inputFile.getParentFile(), name+".xml")
-
-factory = XMLOutputFactory.newInstance()
-output = new FileOutputStream(outputFile)
-writer = factory.createXMLStreamWriter(output, "UTF-8")
-
-writer.writeStartDocument("UTF-8","1.0")
-writer.writeCharacters("\n") // simple XML formating
-
-if (EmbedInTEI) {
-	writer.writeStartElement("TEI")
-	writer.writeStartElement("teiHeader")
-	writer.writeEndElement() // teiHeader
-	writer.writeStartElement("text")
-	writer.writeCharacters("\n")
-}
-
-writer.writeStartElement(rootTag)
-writer.writeCharacters("\n")
-
-pb_n = 1
-
-(1..nRows-1).each { rowIndex ->
-
-	writer.writeCharacters("  ")
-	writer.writeEmptyElement("pb") // <pb/> to get one page per input line (don't forget high number of words per page in import module)
-	writer.writeAttribute("n", ""+pb_n++)
+	
+	if (!ok) { return false }
+	
+	println "metadataColumnList = "+metadataColumnList
+	println "dateColumnList = "+dateColumnList
+	println "textColumnList = "+textColumnList
+	
+	name = inputFile.getName()
+	idx = name.lastIndexOf(".")
+	
+	if (idx > 0) name = name.substring(0, idx)
+	outputFile = new File(inputFile.getParentFile(), name+".xml")
+	
+	factory = XMLOutputFactory.newInstance()
+	output = new FileOutputStream(outputFile)
+	writer = factory.createXMLStreamWriter(output, "UTF-8")
+	
+	writer.writeStartDocument("UTF-8","1.0")
 	writer.writeCharacters("\n") // simple XML formating
-
-	writer.writeCharacters("  ")
-	writer.writeStartElement(textTag)
-	metadataColumnIndex.each { colIndex -> // build an attribute for each metadata
-		def row = ws.getRow(rowIndex)
-		if (row != null) {
-		String s = getCellValueAsString(row.getCell(colIndex));
-		if (s == null) s ="";
-		value = s.replaceAll("\n", ";").trim()
-		writer.writeAttribute(normalizedHeaders[colIndex], value)
-		if (colIndex in dateColumnsIndex) { // also split date attributes in day+month+year attributes
-			matches = (value =~ /([0-9]{2})\/([0-9]{2})\/([0-9]{4})/)
-			writer.writeAttribute(normalizedHeaders[colIndex]+"jour", matches[0][1])
-			writer.writeAttribute(normalizedHeaders[colIndex]+"joursemaine", new java.text.SimpleDateFormat('EEEE').format(Date.parse("dd/MM/yyyy", value)))
-			writer.writeAttribute(normalizedHeaders[colIndex]+"mois", matches[0][2])
-			writer.writeAttribute(normalizedHeaders[colIndex]+"annee", matches[0][3])
-		}
-		}
+	
+	if (EmbedInTEI) {
+		writer.writeStartElement("TEI")
+		writer.writeStartElement("teiHeader")
+		writer.writeEndElement() // teiHeader
+		writer.writeStartElement("text")
+		writer.writeCharacters("\n")
 	}
+	
+	writer.writeStartElement(rootTag)
 	writer.writeCharacters("\n")
-
-	writer.writeCharacters("    ")
-	writer.writeStartElement("metadata")
-	writer.writeStartElement("list")
-	writer.writeAttribute("type", "unordered")
-	writer.writeCharacters("\n")
-
- 	metadataColumnIndex.each { colIndex ->
- 		writer.writeStartElement("item")
- 		def row = ws.getRow(rowIndex)
- 		if (row != null) {
- 			writer.writeCharacters(headers[colIndex]+" : "+getCellValueAsString(row.getCell(colIndex)).replaceAll("\n", ";"))
+	
+	pb_n = 1
+	
+	//(1..nRows-1).each { rowIndex ->
+	def record = null
+	while (excel.readRecord()) {
+		
+		record = excel.getRecord()
+		if (record.isEmpty()) continue;
+		
+		//println "record=$record"
+		
+		writer.writeCharacters("  ")
+		writer.writeEmptyElement("pb") // <pb/> to get one page per input line (don't forget high number of words per page in import module)
+		writer.writeAttribute("n", ""+pb_n++)
+		writer.writeCharacters("\n") // simple XML formating
+		
+		writer.writeCharacters("  ")
+		writer.writeStartElement(textTag)
+		//metadataColumnIndex.each { colIndex -> // build an attribute for each metadata
+		for (def metadataName : metadataColumnList) {
+			String s = record.get(metadataName);
+			if (s == null) s = "";
+			
+			value = s.replaceAll("\n", ";").trim()
+			writer.writeAttribute(stringToIndent(metadataName), value)
+			
+			if (metadataName in dateColumnList) { // also split date attributes in day+month+year attributes
+				matches = (value =~ /([0-9]{2})\/([0-9]{2})\/([0-9]{4})/)
+				writer.writeAttribute(metadataName+"-jour", matches[0][1])
+				writer.writeAttribute(metadataName+"-joursemaine", new java.text.SimpleDateFormat('EEEE').format(Date.parse("dd/MM/yyyy", value)))
+				writer.writeAttribute(metadataName+"-mois", matches[0][2])
+				writer.writeAttribute(metadataName+"-annee", matches[0][3])
+			}
+		}
+		writer.writeCharacters("\n")
+		
+		writer.writeCharacters("    ")
+		writer.writeStartElement("metadata")
+		writer.writeStartElement("list")
+		writer.writeAttribute("type", "unordered")
+		writer.writeCharacters("\n")
+		
+		//metadataColumnIndex.each { colIndex ->
+		for (def metadataName : metadataColumnList) {
+			writer.writeStartElement("item")
+			writer.writeCharacters(metadataName+" : "+record.get(metadataName).replaceAll("\n", ";"))
 			writer.writeEndElement() // item
 			writer.writeCharacters("\n")
 		}
-	}
-	writer.writeCharacters("    ")
-	writer.writeEndElement() // list
-	writer.writeEndElement() // head
-	writer.writeCharacters("\n")
-
-   	textColumnIndex.each { colIndex ->
-		
-    	writer.writeCharacters("    ")
-    	writer.writeStartElement(normalizedHeaders[colIndex])
-		writer.writeStartElement("p")
-		writer.writeStartElement("head")
-		writer.writeStartElement("hi")
-		writer.writeCharacters(headers[colIndex]+" : ")
-		writer.writeEndElement() // hi
+		writer.writeCharacters("    ")
+		writer.writeEndElement() // list
 		writer.writeEndElement() // head
-		def row = ws.getRow(rowIndex)
-		if (row != null) {
-			value = getCellValueAsString(row.getCell(colIndex))
-
+		writer.writeCharacters("\n")
+		
+		//textColumnIndex.each { colIndex ->
+		for (def textColumnName : textColumnList) {
+			
+			writer.writeCharacters("    ")
+			writer.writeStartElement(stringToIndent(textColumnName))
+			writer.writeStartElement("p")
+			writer.writeStartElement("head")
+			writer.writeStartElement("hi")
+			writer.writeCharacters(textColumnName+" : ")
+			writer.writeEndElement() // hi
+			writer.writeEndElement() // head
+			
+			value = record.get(textColumnName)
+				
 			if (value ==~ /(?s)^[A-Z]{3}:  [^;\n]+? +[;\n].*/) {
 				value.findAll( /(?s)[A-Z]{3}:  ([^;\n]+?) +[;\n]/ ).each { desc ->
 					writer.writeStartElement("descripteur")
@@ -251,25 +197,26 @@
 			writer.writeEndElement() // textColumn
 			writer.writeCharacters("\n")
 		}
+		
+		writer.writeCharacters("  ")
+		writer.writeEndElement() // textTag
+		writer.writeCharacters("\n")
 	}
-
-	writer.writeCharacters("  ")
-	writer.writeEndElement() // textTag
+	
+	writer.writeEndElement() // rootTag
 	writer.writeCharacters("\n")
-}
-
-writer.writeEndElement() // rootTag
-writer.writeCharacters("\n")
-if (EmbedInTEI) {
-	writer.writeEndElement() // text
-	writer.writeCharacters("\n")
-	writer.writeEndElement() // TEI
-	writer.writeCharacters("\n")
-}
-writer.close()
-output.close()
-println "Result file: $outputFile"
-
+	
+	if (EmbedInTEI) {
+		writer.writeEndElement() // text
+		writer.writeCharacters("\n")
+		writer.writeEndElement() // TEI
+		writer.writeCharacters("\n")
+	}
+	
+	writer.close()
+	output.close()
+	println "Result file: $outputFile"
+	
 } catch (Exception e) {
 	println "** Excel2XML: unable to read input file. Aborting."
 	println e.getLocalizedMessage()
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/table/Excel2XMLWithoutAPIMacro2.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/table/Excel2XMLWithoutAPIMacro2.groovy	(revision 0)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/table/Excel2XMLWithoutAPIMacro2.groovy	(revision 3061)
@@ -0,0 +1,282 @@
+package org.txm.macro.table
+
+import org.kohsuke.args4j.*
+import groovy.transform.Field
+import java.nio.charset.Charset
+import org.txm.rcpapplication.swt.widget.parameters.*
+import org.txm.utils.*
+import javax.xml.stream.*
+import java.net.URL
+import java.text.SimpleDateFormat
+
+import org.apache.poi.ss.usermodel.*
+import org.apache.poi.hssf.usermodel.*
+import org.apache.poi.xssf.usermodel.*
+import org.apache.poi.ss.usermodel.WorkbookFactory
+import org.apache.poi.ss.util.*
+
+def stringToIndent = { str -> org.txm.utils.AsciiUtils.buildAttributeId(org.txm.utils.AsciiUtils.convertNonAscii(str)).toLowerCase() }
+
+// from http://www.java-connect.com/apache-poi-tutorials/read-all-type-of-excel-cell-value-as-string-using-poi
+def getCellValueAsString = { cell ->
+	strCellValue = null
+	if (cell != null) {
+		switch (cell.getCellType()) {
+			case CellType.STRING:
+				strCellValue = cell.toString()
+				break
+			case CellType.NUMERIC:
+				if (DateUtil.isCellDateFormatted(cell)) {
+					SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy")
+					strCellValue = dateFormat.format(cell.getDateCellValue())
+				} else {
+					value = cell.getNumericCellValue()
+					longValue = value.longValue()
+					strCellValue = new String(longValue.toString())
+				}
+				break
+			case CellType.BOOLEAN:
+				strCellValue = new String(new Boolean(cell.getBooleanCellValue()).toString())
+				break
+			case CellType.BLANK:
+				strCellValue = ""
+				break
+		}
+	}
+	if (strCellValue == null) strCellValue = ""
+	return strCellValue
+}
+
+@Field @Option(name="inputFile", usage="fichier Excel à traiter", widget="File", required=true, def="")
+		File inputFile
+
+@Field @Option(name="sheetName", usage="sheet name (if no name is given the first sheet will be used)", widget="String", required=false, def="")
+		def sheetName
+
+@Field @Option(name="rootTag", usage="root tag name", widget="String", required=false, def="root")
+		def rootTag
+
+@Field @Option(name="textTag", usage="line unit tag name", widget="String", required=false, def="unit")
+		def textTag
+
+@Field @Option(name="metadataColumnList", usage="metadata columns list separated by comma", widget="String", required=false, def="meta1,meta2")
+		def metadataColumnList
+
+@Field @Option(name="dateColumnList", usage="date columns list separated by comma", widget="String", required=false, def="meta1,meta2")
+		def dateColumnList
+
+@Field @Option(name="textColumnList", usage="text columns list separated by comma", widget="String", required=false, def="textColumnList1,textColumnList2")
+		def textColumnList
+
+@Field @Option(name="EmbedInTEI", usage="text columns list separated by comma", widget="Boolean", required=false, def="false")
+		def EmbedInTEI
+
+if (!ParametersDialog.open(this)) return
+
+	if (!inputFile.exists()) {
+		println "** Excel2XML: no '"+inputFile.name+"' file found. Aborting."
+		return false
+	}
+
+if (!inputFile.canRead()) {
+	println "** Excel2XML: '"+inputFile.name+"' file not readable. Aborting."
+	return false
+}
+
+try {
+	
+	metadataColumnList = metadataColumnList.split(",").collect { it.trim() }
+	dateColumnList = dateColumnList.split(",").collect { it.trim() }
+	textColumnList = textColumnList.split(",").collect { it.trim() }
+	textTag = textTag.trim()
+	rootTag = rootTag.trim()
+	
+	wb = WorkbookFactory.create(inputFile)
+	
+	if (sheetName.length() == 0) {
+		ws = wb.getSheetAt(0)
+	} else {
+		ws = wb.getSheet(sheetName)
+		if (ws == null) {
+			println "** Excel2XML: no '"+sheetName+" found. Aborting."
+			return false
+		}
+	}
+	
+	if (ws == null) {
+		println "** Excel2XML: no sheet found. Aborting."
+		return false
+	}
+	
+	nRows = ws.getPhysicalNumberOfRows()
+	println nRows+" rows."
+	
+	firstRow = ws.getRow(0)
+	colMax = firstRow.getLastCellNum()
+	
+	headers = (0..colMax-1).collect { getCellValueAsString(firstRow.getCell(it)) }
+	
+	println "Headers: $headers"
+	
+	normalizedHeaders = headers.collect { stringToIndent(it) }
+	
+	ok = true
+	metadataColumnList.each { m ->
+		if (!headers.contains(m)) {
+			println "** Excel2XML: missing metadataColumnList column: $m"
+			ok = false
+		}
+	}
+	textColumnList.each { t ->
+		if (!headers.contains(t)) {
+			println "** Excel2XML: missing textColumnList column: $t"
+			ok = false
+		}
+	}
+	
+	if (!ok) { return false }
+	
+	metadataColumnIndex = metadataColumnList.collect { headers.indexOf(it) }
+	dateColumnsIndex = dateColumnList.collect { headers.indexOf(it) }
+	textColumnIndex = textColumnList.collect { headers.indexOf(it) }
+	
+	println "metadataColumnList = "+metadataColumnList
+	println "metadataColumnIndex = "+metadataColumnIndex
+	
+	println "dateColumnList = "+dateColumnList
+	println "dateColumnsIndex = "+dateColumnsIndex
+	
+	println "textColumnList = "+textColumnList
+	println "textColumnIndex = "+textColumnIndex
+	
+	name = inputFile.getName()
+	idx = name.lastIndexOf(".")
+	
+	if (idx > 0) name = name.substring(0, idx)
+	outputFile = new File(inputFile.getParentFile(), name+".xml")
+	
+	factory = XMLOutputFactory.newInstance()
+	output = new FileOutputStream(outputFile)
+	writer = factory.createXMLStreamWriter(output, "UTF-8")
+	
+	writer.writeStartDocument("UTF-8","1.0")
+	writer.writeCharacters("\n") // simple XML formating
+	
+	if (EmbedInTEI) {
+		writer.writeStartElement("TEI")
+		writer.writeStartElement("teiHeader")
+		writer.writeEndElement() // teiHeader
+		writer.writeStartElement("text")
+		writer.writeCharacters("\n")
+	}
+	
+	writer.writeStartElement(rootTag)
+	writer.writeCharacters("\n")
+	
+	pb_n = 1
+	
+	(1..nRows-1).each { rowIndex ->
+		
+		writer.writeCharacters("  ")
+		writer.writeEmptyElement("pb") // <pb/> to get one page per input line (don't forget high number of words per page in import module)
+		writer.writeAttribute("n", ""+pb_n++)
+		writer.writeCharacters("\n") // simple XML formating
+		
+		writer.writeCharacters("  ")
+		writer.writeStartElement(textTag)
+		metadataColumnIndex.each { colIndex -> // build an attribute for each metadata
+			def row = ws.getRow(rowIndex)
+			if (row != null) {
+				String s = getCellValueAsString(row.getCell(colIndex));
+				if (s == null) s ="";
+				value = s.replaceAll("\n", ";").trim()
+				writer.writeAttribute(normalizedHeaders[colIndex], value)
+				if (colIndex in dateColumnsIndex) { // also split date attributes in day+month+year attributes
+					matches = (value =~ /([0-9]{2})\/([0-9]{2})\/([0-9]{4})/)
+					writer.writeAttribute(normalizedHeaders[colIndex]+"jour", matches[0][1])
+					writer.writeAttribute(normalizedHeaders[colIndex]+"joursemaine", new java.text.SimpleDateFormat('EEEE').format(Date.parse("dd/MM/yyyy", value)))
+					writer.writeAttribute(normalizedHeaders[colIndex]+"mois", matches[0][2])
+					writer.writeAttribute(normalizedHeaders[colIndex]+"annee", matches[0][3])
+				}
+			}
+		}
+		writer.writeCharacters("\n")
+		
+		writer.writeCharacters("    ")
+		writer.writeStartElement("metadata")
+		writer.writeStartElement("list")
+		writer.writeAttribute("type", "unordered")
+		writer.writeCharacters("\n")
+		
+		metadataColumnIndex.each { colIndex ->
+			
+			def row = ws.getRow(rowIndex)
+			if (row != null) {
+				writer.writeStartElement("item")
+				writer.writeCharacters(headers[colIndex]+" : "+getCellValueAsString(row.getCell(colIndex)).replaceAll("\n", ";"))
+				writer.writeEndElement() // item
+				writer.writeCharacters("\n")
+			}
+		}
+		writer.writeCharacters("    ")
+		writer.writeEndElement() // list
+		writer.writeEndElement() // head
+		writer.writeCharacters("\n")
+		
+		textColumnIndex.each { colIndex ->
+			
+			writer.writeCharacters("    ")
+			writer.writeStartElement(normalizedHeaders[colIndex])
+			writer.writeStartElement("p")
+			writer.writeStartElement("head")
+			writer.writeStartElement("hi")
+			writer.writeCharacters(headers[colIndex]+" : ")
+			writer.writeEndElement() // hi
+			writer.writeEndElement() // head
+			def row = ws.getRow(rowIndex)
+			if (row != null) {
+				value = getCellValueAsString(row.getCell(colIndex))
+				
+				if (value ==~ /(?s)^[A-Z]{3}:  [^;\n]+? +[;\n].*/) {
+					value.findAll( /(?s)[A-Z]{3}:  ([^;\n]+?) +[;\n]/ ).each { desc ->
+						writer.writeStartElement("descripteur")
+						matches = (desc =~ /(?s)([A-Z]{3}):  ([^;\n]+?) +[;\n]/)
+						writer.writeAttribute("type", matches[0][1])
+						writer.writeCharacters(matches[0][2])
+						writer.writeEndElement() // descripteur
+					}
+				} else {
+					writer.writeCharacters(value)
+				}
+				writer.writeEndElement() // p
+				writer.writeEndElement() // textColumn
+				writer.writeCharacters("\n")
+			}
+		}
+		
+		writer.writeCharacters("  ")
+		writer.writeEndElement() // textTag
+		writer.writeCharacters("\n")
+	}
+	
+	writer.writeEndElement() // rootTag
+	writer.writeCharacters("\n")
+	if (EmbedInTEI) {
+		writer.writeEndElement() // text
+		writer.writeCharacters("\n")
+		writer.writeEndElement() // TEI
+		writer.writeCharacters("\n")
+	}
+	
+	writer.close()
+	output.close()
+	println "Result file: $outputFile"
+	
+} catch (Exception e) {
+	println "** Excel2XML: unable to read input file. Aborting."
+	println e.getLocalizedMessage()
+	println e.printStackTrace()
+	return false
+}
+
+return true
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/importer/XTZImporterMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/importer/XTZImporterMacro.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/importer/XTZImporterMacro.groovy	(revision 3061)
@@ -106,7 +106,8 @@
 BaseParameters params = new BaseParameters(importFile);
 params.load()
 params.rootDir = srcDirectory.getAbsolutePath();
-TokenizerClasses.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
+TokenizerClasses tc = new TokenizerClasses();
+tc.loadFromNode(params.getTokenizerElement(params.getCorpusElement()));
 if (params == null) { println "no parameters. Aborting"; return; }
 
 String corpusname = params.getCorpusName();
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/importer.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/importer.groovy	(revision 3061)
@@ -54,7 +54,7 @@
 import org.txm.objects.*;
 import org.txm.*;
 import org.txm.core.engines.*;
-
+import org.txm.tokenizer.TokenizerClasses
 // TODO: Auto-generated Javadoc
 /**
  * The Class importer.
@@ -93,7 +93,7 @@
 						
 			print "."
 			File outfile = new File(binDir,"tokenized/"+f.getName());
-			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(f, outfile, lang)
+			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(f, outfile, TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang))
 			tokenizer.setOutSideTextTagsAndKeepContent("note");
 			if (!tokenizer.process()) {
 				println("Failed to tokenize $f")
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/importer.groovy	(revision 3061)
@@ -41,7 +41,7 @@
 import org.txm.scripts.filters.FusionHeader.*
 import org.txm.scripts.filters.TagSentences.*
 import org.txm.scripts.filters.Tokeniser.*
-
+import org.txm.tokenizer.TokenizerClasses
 /**
  * The Class importer.
  */
@@ -224,7 +224,7 @@
 			cpb.tick()
 			File tfile = new File(tokenizedDir, pfile.getName());
 
-			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(pfile, tfile, lang);
+			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(pfile, tfile, TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang));
 			tokenizer.setStartTag("text")
 			if (!tokenizer.process()) {
 				println("Failed to tokenize file "+pfile)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/importer.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/importer.groovy	(revision 3061)
@@ -30,6 +30,7 @@
 
 //import org.txm.scripts.filters.TabulatedToXml.*;
 import org.txm.scripts.importer.*;
+import org.txm.tokenizer.TokenizerClasses
 import org.txm.importer.scripts.filters.*;
 import org.txm.scripts.*;
 import org.txm.importer.cwb.CwbEncode
@@ -52,7 +53,7 @@
 import org.txm.scripts.filters.Tokeniser.*;
 import org.txm.scripts.filters.FusionHeader.*;
 import org.txm.scripts.filters.TagSentences.*;
-
+import org.txm.tokenizer.TokenizerClasses
 import org.txm.Toolbox;
 
 // TODO: Auto-generated Javadoc
@@ -109,7 +110,8 @@
 			cpb.tick()
 			File resultfile = new File(tokenizeDir, f.getName());
 			try {
-				def tokenizer = new SimpleTokenizerXml(f, resultfile, lang);
+				
+				def tokenizer = new SimpleTokenizerXml(f, resultfile, TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang));
 				if (project.getAnnotate()) { // an annotation will be done, does the annotation engine needs another tokenizer ?
 					String engineName = project.getImportParameters().node("annotate").get("engine", "TreeTagger")
 					def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine(engineName)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/importer.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/importer.groovy	(revision 3061)
@@ -51,7 +51,7 @@
 import org.txm.*;
 import org.txm.core.engines.*;
 import org.txm.utils.*;
-
+import org.txm.tokenizer.TokenizerClasses
 /**
  * The Class importer.
  */
@@ -111,7 +111,7 @@
 			String filename = pfile.getName().substring(0, pfile.getName().length()-4)
 			File tfile = new File(binDir, "tokenized/"+filename+".xml");
 			
-			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(pfile, tfile, lang);
+			SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(pfile, tfile, TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang));
 			if (project.getAnnotate()) { // an annotation will be done, does the annotation engine needs another tokenizer ?
 				String engineName = project.getImportParameters().node("annotate").get("engine", "TreeTagger")
 				def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine(engineName)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImporter.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImporter.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZImporter.groovy	(revision 3061)
@@ -27,6 +27,7 @@
 import org.txm.utils.io.*
 import org.txm.importer.xtz.*
 import org.txm.core.engines.*
+import org.txm.tokenizer.TokenizerClasses
 
 class XTZImporter extends Importer {
 	
@@ -381,7 +382,7 @@
 				cpb.tick()
 				File infile = f;
 				File outfile = new File(module.getBinaryDirectory(),"tokenized/"+f.getName());
-				SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(infile, outfile, lang)
+				SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(infile, outfile, TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang))
 				if (module.getProject().getAnnotate()) { // an annotation will be done, does the annotation engine needs another tokenizer ?
 					String engineName = module.getProject().getImportParameters().node("annotate").get("engine", "TreeTagger")
 					def engine = Toolbox.getEngineManager(EngineType.ANNOTATION).getEngine(engineName)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/xtzLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/xtzLoader.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/xtzLoader.groovy	(revision 3061)
@@ -33,7 +33,6 @@
 import org.txm.metadatas.*
 import org.txm.objects.*
 import org.txm.importer.scripts.xmltxm.*
-import org.txm.tokenizer.TokenizerClasses
 import org.txm.utils.*
 import org.txm.utils.i18n.*
 import org.txm.importer.xtz.*
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy	(revision 3061)
@@ -34,7 +34,6 @@
 import org.txm.scripts.importer.xml.compiler
 import org.txm.scripts.importer.xml.pager_old
 import org.txm.objects.*
-import org.txm.tokenizer.TokenizerClasses
 import org.txm.utils.*
 import org.txm.utils.io.*
 import org.txm.utils.xml.DomUtils
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/importer.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/importer.groovy	(revision 3061)
@@ -45,6 +45,7 @@
 import org.txm.scripts.filters.TagSentences.*
 import org.txm.scripts.filters.Tokeniser.*
 import org.txm.importer.ValidateXml
+import org.txm.tokenizer.TokenizerClasses
 
 // TODO: Auto-generated Javadoc
 /**
@@ -162,7 +163,7 @@
 				cpb2.tick()
 				File infile = f
 				File outfile = new File(binDir, "tokenized/"+f.getName())
-				SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(infile, outfile, lang)
+				SimpleTokenizerXml tokenizer = new SimpleTokenizerXml(infile, outfile, TokenizerClasses.newTokenizerClasses(project.getPreferencesScope(), lang))
 				boolean retokenize = "true" == project.getTokenizerParameter("doRetokenizeStep", "false")
 				tokenizer.setRetokenize(retokenize)
 				if (ignoredElements != null && ignoredElements.trim().length() > 0) {
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy	(revision 3061)
@@ -34,7 +34,6 @@
 import org.txm.scripts.importer.xml.importer;
 import org.txm.scripts.importer.xml.compiler;
 import org.txm.objects.*;
-import org.txm.tokenizer.TokenizerClasses;
 import org.txm.utils.*;
 import org.txm.utils.io.*;
 import org.txm.*;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessEnclitics/ProcessEnclitics.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessEnclitics/ProcessEnclitics.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ProcessEnclitics/ProcessEnclitics.groovy	(revision 3061)
@@ -41,7 +41,7 @@
 	int counter;
 	
 	/** The enclitics. */
-	String enclitics = TokenizerClasses.enclitics;
+	String enclitics = new TokenizerClasses().enclitics;
 
 	/* (non-Javadoc)
 	 * @see org.txm.importer.filters.Filter#SetUsedParam(java.lang.Object)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneOpenTagPerLine/OneOpenTagPerLine.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneOpenTagPerLine/OneOpenTagPerLine.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneOpenTagPerLine/OneOpenTagPerLine.groovy	(revision 3061)
@@ -38,7 +38,7 @@
 class OneOpenTagPerLine extends Filter {
 	
 	/** The tag_all. */
-	String tag_all = TokenizerClasses.tag_all;
+	String tag_all = new TokenizerClasses().tag_all;
 	
 	/** The counterreg1. */
 	int counterreg1 = 0;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/WordInternalElement/WordInternalElement.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/WordInternalElement/WordInternalElement.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/WordInternalElement/WordInternalElement.groovy	(revision 3061)
@@ -29,7 +29,7 @@
 
 import org.txm.importer.scripts.filters.*;
 import java.util.regex.*;
-import org.txm.tokenizer.*;
+import org.txm.tokenizer.TokenizerClasses;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -44,7 +44,7 @@
 	def old;
 	
 	/** The corr_tags_no_seg. */
-	String corr_tags_no_seg = TokenizerClasses.corr_tags_no_seg;
+	String corr_tags_no_seg = new TokenizerClasses().corr_tags_no_seg;
 
 	/* (non-Javadoc)
 	 * @see org.txm.importer.filters.Filter#SetUsedParam(java.lang.Object)
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentences.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentences.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentences.groovy	(revision 3061)
@@ -87,19 +87,37 @@
 	def _after;
 	
 	/** The div_tags. */
-	def div_tags = TokenizerClasses.div_tags;
+	def div_tags;
 	
 	/** The q_tags. */
-	def q_tags = TokenizerClasses.q_tags;
+	def q_tags;
 	
 	/** The corr_tags_no_seg. */
-	def corr_tags_no_seg = TokenizerClasses.corr_tags_no_seg;
+	def corr_tags_no_seg;
 	
 	/** The corr_tags. */
-	def corr_tags = TokenizerClasses.corr_tags;
+	def corr_tags;
 	
-	def strongPunct = TokenizerClasses.punct_strong;
+	def strongPunct;
 	
+	public TagSentences() {
+		
+		TokenizerClasses tc = new TokenizerClasses()
+		/** The div_tags. */
+		div_tags = tc.div_tags;
+		
+		/** The q_tags. */
+		q_tags = tc.q_tags;
+		
+		/** The corr_tags_no_seg. */
+		corr_tags_no_seg = tc.corr_tags_no_seg;
+		
+		/** The corr_tags. */
+		corr_tags = tc.corr_tags;
+		
+		strongPunct = tc.punct_strong;
+	}
+	
 	/* (non-Javadoc)
 	 * @see org.txm.importer.filters.Filter#SetUsedParam(java.lang.Object)
 	 */
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentencesXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentencesXml.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/TagSentences/TagSentencesXml.groovy	(revision 3061)
@@ -109,7 +109,7 @@
 	String rendMulti = "MULTI_S";
 	boolean multi = false;
 	boolean startProcess = false;
-	String strongPunct = TokenizerClasses.punct_strong;
+	String strongPunct = new TokenizerClasses().punct_strong;
 
 	/** The localname. */
 	String localname;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenWords/ReunitBrokenWords.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenWords/ReunitBrokenWords.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/ReunitBrokenWords/ReunitBrokenWords.groovy	(revision 3061)
@@ -38,28 +38,28 @@
 {
 	
 	/** The tag_all. */
-	def tag_all = TokenizerClasses.tag_all;
+	def tag_all;
 	
 	/** The div_tags. */
-	def div_tags = TokenizerClasses.div_tags;
+	def div_tags;
 	
 	/** The q_tags. */
-	def q_tags = TokenizerClasses.q_tags;
+	def q_tags ;
 	
 	/** The extraword_tags. */
-	def extraword_tags = TokenizerClasses.extraword_tags;
+	def extraword_tags;
 	
 	/** The corr_tags_no_seg. */
-	def corr_tags_no_seg = TokenizerClasses.corr_tags_no_seg;
+	def corr_tags_no_seg;
 	
 	/** The corr_tags. */
-	def corr_tags = TokenizerClasses.corr_tags;
+	def corr_tags;
 	
 	/** The word_tags. */
-	def word_tags = TokenizerClasses.word_tags;
+	def word_tags;
 	
 	/** The intraword_tags. */
-	def intraword_tags = TokenizerClasses.intraword_tags;
+	def intraword_tags;
 	
 	/** The tag. */
 	def tag;
@@ -79,6 +79,33 @@
 	/** The level. */
 	private String level = "extraword";
 	
+	public ReunitBrokenWords() {
+		TokenizerClasses tc = new TokenizerClasses()
+		/** The tag_all. */
+		tag_all = tc.tag_all;
+		
+		/** The div_tags. */
+		div_tags = tc.div_tags;
+		
+		/** The q_tags. */
+		q_tags = tc.q_tags;
+		
+		/** The extraword_tags. */
+		extraword_tags = tc.extraword_tags;
+		
+		/** The corr_tags_no_seg. */
+		corr_tags_no_seg = tc.corr_tags_no_seg;
+		
+		/** The corr_tags. */
+		corr_tags = tc.corr_tags;
+		
+		/** The word_tags. */
+		word_tags = tc.word_tags;
+		
+		/** The intraword_tags. */
+		intraword_tags = tc.intraword_tags;
+	}
+	
 	/* (non-Javadoc)
 	 * @see org.txm.importer.filters.Filter#SetUsedParam(java.lang.Object)
 	 */
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneTagPerLine/OneTagPerLine.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneTagPerLine/OneTagPerLine.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/OneTagPerLine/OneTagPerLine.groovy	(revision 3061)
@@ -39,7 +39,7 @@
 class OneTagPerLine extends Filter {
 	
 	/** The tag_all. */
-	String tag_all = TokenizerClasses.tag_all;
+	String tag_all = new TokenizerClasses().tag_all;
 	
 	/** The counterreg1. */
 	int counterreg1 = 0;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/FastSimpleTokenizerXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/FastSimpleTokenizerXml.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/FastSimpleTokenizerXml.groovy	(revision 3061)
@@ -57,19 +57,19 @@
 public class FastSimpleTokenizerXml {
 
 	/** The word_tags. */
-	String word_tags = TokenizerClasses.word_tags;
+	String word_tags;
 
 	/** The intraword_tags. */
-	String intraword_tags = TokenizerClasses.intraword_tags;
+	String intraword_tags
 
 	/** The punct_strong. */
-	def punct_strong = TokenizerClasses.punct_strong;
+	def punct_strong;
 
 	/** The punct_all. */
-	def punct_all = TokenizerClasses.punct_all;
+	def punct_all;
 
 	/** The word_chars. */
-	def word_chars = TokenizerClasses.word_chars;
+	def word_chars;
 	
 	def fclitics = null; // default behavior don't manage clitics
 	def pclitics = null; // default behavior don't manage clitics
@@ -129,34 +129,50 @@
 	public FastSimpleTokenizerXml(File infile, File outfile, String lang)
 	{
 		this.lang = lang;
+		TokenizerClasses tc = new TokenizerClasses(lang)
 		if (lang != null)
 		if (lang.startsWith("en")) {
-			fclitics = TokenizerClasses.FClitic_en
+			fclitics = tc.FClitic_en
 		} else if (lang.startsWith("fr")) {
-			fclitics = TokenizerClasses.FClitic_fr
-			pclitics = TokenizerClasses.PClitic_fr
+			fclitics = tc.FClitic_fr
+			pclitics = tc.PClitic_fr
 		} else if (lang.startsWith("gl")) {
-			fclitics = TokenizerClasses.FClitic_gl
+			fclitics = tc.FClitic_gl
 		} else if (lang.startsWith("it")) {
-			pclitics = TokenizerClasses.PClitic_it
+			pclitics = tc.PClitic_it
 		}
 		
+		/** The word_tags. */
+		word_tags = tc.word_tags;
+	
+		/** The intraword_tags. */
+		intraword_tags = tc.intraword_tags;
+	
+		/** The punct_strong. */
+		punct_strong = tc.punct_strong;
+	
+		/** The punct_all. */
+		punct_all = tc.punct_all;
+	
+		/** The word_chars. */
+		word_chars = tc.word_chars;
+		
 		this.outfile = outfile;
 		this.infile = infile;
 		this.filename = infile.getName();
 		int index = filename.lastIndexOf(".");
 		if (index > 0) filename = filename.substring(0, index);
 		
-		String strRegElision = TokenizerClasses.regElision;
-		String strRegPunct = TokenizerClasses.regPunct;
+		String strRegElision = tc.regElision;
+		String strRegPunct = tc.regPunct;
 		regElision = ~/\A(.*?)(\p{L}++$strRegElision)(.*)\Z/
 		reg3pts = ~/\A(.*)(\.\.\.)(.*)\Z/
 		regPunct = ~/\A(.*)($strRegPunct)(.*)\Z/
 		if (fclitics != null)
 			regFClitics = ~/(.+)($fclitics)/
-		whitespaces = ~TokenizerClasses.whitespaces;
+		whitespaces = ~tc.whitespaces;
 		
-		regSplitWhiteSpaces = Pattern.compile(TokenizerClasses.whitespaces);
+		regSplitWhiteSpaces = Pattern.compile(tc.whitespaces);
 		regLN = Pattern.compile("/\n/");
 		regCTRL = Pattern.compile("/\\p{C}/");
 		
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/Tokeniser.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/Tokeniser.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/Tokeniser.groovy	(revision 3061)
@@ -42,6 +42,8 @@
 		int index = filename.lastIndexOf(".");
 		if(index > 0)
 			filename = filename.substring(0, index);
+			
+		tc = new TokenizerClasses()
 	}
 
 	static public int DEBUG = 0;
@@ -113,22 +115,9 @@
 
 	/** The tag_all. */
 	def tag_all = "<[^>]+>";
+	
+	TokenizerClasses tc;
 
-	/** The word_tags. */
-	def word_tags = TokenizerClasses.word_tags;
-
-	/** The intraword_tags. */
-	def intraword_tags = TokenizerClasses.intraword_tags;
-
-	/** The punct_strong. */
-	def punct_strong = TokenizerClasses.punct_strong;
-
-	/** The punct_all. */
-	def punct_all = TokenizerClasses.punct_all;
-
-	/** The word_chars. */
-	def word_chars = TokenizerClasses.word_chars;
-	def punct_quotes = TokenizerClasses.punct_quotes;
 	String filename;
 	int wordcount = 1;
 	/* (non-Javadoc)
@@ -137,11 +126,11 @@
 	void SetUsedParam(Object args)
 	{
 		try {
-			word_tags = args.get("word_tags");
-			intraword_tags = args.get("intraword_tags");
-			punct_strong = args.get("punct_strong");
-			punct_all = args.get("punct_all");
-			word_chars = args.get("word_chars");
+			tc.word_tags = args.get("word_tags");
+			tc.intraword_tags = args.get("intraword_tags");
+			tc.punct_strong = args.get("punct_strong");
+			tc.punct_all = args.get("punct_all");
+			tc.word_chars = args.get("word_chars");
 		} catch(Exception e) {
 			System.err.println(e)
 			System.err.println("tokenizer needs an \"args\" map with the following elements :\n word_tags, intraword_tags, punct_strong, " +
@@ -186,7 +175,7 @@
 				println " segment: "+segment+"\n linetype: "+linetype;
 
 			if (linetype == "word") {
-				if(	(m = segment =~ /\A\s*(.*?)<\/($word_tags)>(.*)\Z/) )
+				if(	(m = segment =~ /\A\s*(.*?)<\/(${tc.word_tags})>(.*)\Z/) )
 				{
 					segment = m[0][3];
 					linetype = "text";
@@ -335,7 +324,7 @@
 								segment = " ";
 							}
 						}
-						else if( (m = segment =~ /\A\s*<($word_tags)([^>]*)>(.*)\Z/)) {
+						else if( (m = segment =~ /\A\s*<(${tc.word_tags})([^>]*)>(.*)\Z/)) {
 							if(DEBUG-- > 0)
 								println("   tag word: 1w="+m[0][1]+" 2="+m[0][2]+" 3seg="+m[0][3]);
 							segment = m[0][3];
@@ -383,7 +372,7 @@
 							//push @numbers, $word;
 							//print "Number found: <w type=\"num\">$word</w>\n";
 						}
-						else if( (m = segment =~ /\A\s*($punct_all|[$punct_quotes])(.*)\Z/))
+						else if( (m = segment =~ /\A\s*(${tc.punct_all}|[${tc.punct_quotes}])(.*)\Z/))
 						{
 							if(DEBUG-- > 0)
 								println "   Punctuation marks: 1w="+m[0][1]+" 2seg="+m[0][2]
@@ -394,7 +383,7 @@
 							output.print("<w id=\"w_"+filename+"_$wordcount\" type=\"pon\">"+word+"</w>"+lineSeparator);
 							wordcount++;
 						}
-						else if( (m = segment =~ /\A\s*(($word_chars)*[{\(\[]($word_chars)+[\)\]}]($word_chars)+|($word_chars)+[{\(\[]($word_chars)+[\)\]}])(\s+|$punct_all)(.*?)\Z/))						{
+						else if( (m = segment =~ /\A\s*((${tc.word_chars})*[{\(\[](${tc.word_chars})+[\)\]}](${tc.word_chars})+|(${tc.word_chars})+[{\(\[](${tc.word_chars})+[\)\]}])(\s+|${tc.punct_all})(.*?)\Z/))						{
 							if(DEBUG-- > 0)
 								println "   Words with brackets: 1w="+m[0][1]+" 2="+m[0][2]+" 3="+m[0][3]+" 4="+m[0][4]+" 5="+m[0][5]+" 6="+m[0][6]+" 7seg="+m[0][7]+" 8seg="+m[0][8];
 							segment = m[0][7]+m[0][8];//"$7$8";
@@ -410,7 +399,7 @@
 							output.print("<w id=\"w_"+filename+"_$wordcount\">"+word+"</w>"+lineSeparator);
 							wordcount++;
 						}
-						else if( (m = segment =~ /\A\s*(((<[^>]+>)*($word_chars+)(<[^>]+>)*)+)(\s+|$punct_all)(.*?)\Z/))
+						else if( (m = segment =~ /\A\s*(((<[^>]+>)*(${tc.word_chars}+)(<[^>]+>)*)+)(\s+|${tc.punct_all})(.*?)\Z/))
 						{
 							segment = m[0][6]+m[0][7];//"$6$7";
 							word = m[0][1];
@@ -430,7 +419,7 @@
 							wordcount++;
 							output.print(towrite);
 						}
-						else if( (m = segment =~ /\A\s*(((<[^>]+>)*($word_chars)+(<[^>]+>)*)+)[$punct_quotes](.*?)\Z/))
+						else if( (m = segment =~ /\A\s*(((<[^>]+>)*(${tc.word_chars})+(<[^>]+>)*)+)[${tc.punct_quotes}](.*?)\Z/))
 						{
 							if(DEBUG-- > 0)
 								println "   Other word patterns with elision: 1w="+m[0][1]+" 2="+m[0][2]+" 3="+m[0][3]+" 4="+m[0][4]+" 5="+m[0][5]+" 6seg="+m[0][6];
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/OldSimpleTokenizerXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/OldSimpleTokenizerXml.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/OldSimpleTokenizerXml.groovy	(revision 3061)
@@ -72,71 +72,71 @@
 import org.txm.tokenizer.TokenizerClasses;
 
 public class OldSimpleTokenizerXml {
-
+	
 	/** The word_tags. */
-	String word_tags = TokenizerClasses.word_tags;
-
+	String word_tags;
+	
 	/** The intraword_tags. */
-	String intraword_tags = TokenizerClasses.intraword_tags;
-
+	String intraword_tags;
+	
 	/** The punct_strong. */
-	def punct_strong = TokenizerClasses.punct_strong;
-
+	def punct_strong;
+	
 	/** The punct_all. */
-	def punct_all = TokenizerClasses.punct_all;
-
+	def punct_all;
+	
 	/** The word_chars. */
-	def word_chars = TokenizerClasses.word_chars;
-
+	def word_chars;
+	
 	def fclitics = null; // default behavior don't manage clitics
 	def pclitics = null; // default behavior don't manage clitics
-
+	
 	/** The ignorable_tags. */
 	String ignorable_tags
 	String outside_text_tags_keep_content
 	String outside_text_tags
 	String startTag = null
-
+	
 	/** The DEBUG. */
 	public boolean DEBUG = false;
-
+	
 	/** The outfile. */
 	File outfile;
-
+	
 	/** The infile. */
 	File infile;
-
+	
 	String lang;
-
+	
 	/** The buffer. */
 	StringBuffer buffer;
-
+	
 	/** The writer. */
 	XMLStreamWriter writer;
 	BufferedOutputStream output;
-
+	
 	/** The parser. */
 	XMLStreamReader parser
-
+	
 	/** The localname. */
 	String localname;
-
+	
 	/** The prefix. */
 	String prefix;
 	String filename;
-
+	
 	def regElision;
 	def reg3pts;
 	def regPunct;
 	def regFClitics = null ;
 	def regPClitics = null ;
 	String whitespaces;
-
+	
 	public OldSimpleTokenizerXml(File infile, File outfile)
 	{
 		this(infile, outfile, "");
 	}
-
+	
 	/**
 	 * Instantiates a new simple tokenizer xml.
 	 *
@@ -146,24 +146,40 @@
 	public OldSimpleTokenizerXml(File infile, File outfile, String lang)
 	{
 		this.lang = lang;
+		TokenizerClasses tc = new TokenizerClasses(lang)
 		if (lang != null)
 			if (lang.startsWith("en")) {
-				fclitics = TokenizerClasses.FClitic_en
+				fclitics = tc.FClitic_en
 			} else if (lang.startsWith("fr")) {
-				fclitics = TokenizerClasses.FClitic_fr
-				pclitics = TokenizerClasses.PClitic_fr
+				fclitics = tc.FClitic_fr
+				pclitics = tc.PClitic_fr
 			} else if (lang.startsWith("gl")) {
-				fclitics = TokenizerClasses.FClitic_gl
+				fclitics = tc.FClitic_gl
 			} else if (lang.startsWith("it")) {
-				pclitics = TokenizerClasses.PClitic_it
+				pclitics = tc.PClitic_it
 			}
-
+		
+		/** The word_tags. */
+		word_tags = tc.word_tags;
+		
+		/** The intraword_tags. */
+		intraword_tags = tc.intraword_tags;
+		
+		/** The punct_strong. */
+		punct_strong = tc.punct_strong;
+		
+		/** The punct_all. */
+		punct_all = tc.punct_all;
+		
+		/** The word_chars. */
+		word_chars = tc.word_chars;
+		
 		this.outfile = outfile;
 		this.infile = infile;
 		this.filename = infile.getName();
 		int index = filename.lastIndexOf(".");
 		if (index > 0) filename = filename.substring(0, index);
-
+		
 		String strRegElision = TokenizerClasses.regElision;
 		String strRegPunct = TokenizerClasses.regPunct;
 		regElision = /\A(.*?)(\p{L}++$strRegElision)(.*)\Z/
@@ -175,7 +191,7 @@
 			regPClitics = /(.+)(pclitics)(.*)/
 		whitespaces = TokenizerClasses.whitespaces;
 	}
-
+	
 	/**
 	 * Fill infos.
 	 *
@@ -190,7 +206,7 @@
 			prefix = parser.getPrefix();
 		}
 	}
-
+	
 	/**
 	 * Donothing.
 	 *
@@ -202,7 +218,7 @@
 	{
 		if (event == XMLStreamConstants.START_ELEMENT ) {
 			String namespace = parser.getNamespaceURI();
-
+			
 			localname = parser.getLocalName();
 			if (prefix != null && prefix.length() > 0)
 				writer.writeStartElement(prefix+":"+localname);
@@ -211,12 +227,12 @@
 				//					writer.writeStartElement(namespace, localname);
 				//				else
 				writer.writeStartElement(localname);
-
+			
 			//			if(parser.getNamespaceCount() > 0)
 			//				writer.writeDefaultNamespace(parser.getNamespaceURI(0))
 			//			for(int i = 1 ; i < parser.getNamespaceCount() ; i++)
 			//				writer.writeNamespace(parser.getNamespacePrefix(i), parser.getNamespaceURI(i));
-
+			
 			String namespace_prefix;
 			for (int i = 0 ; i<   parser.getNamespaceCount() ; i++) {
 				namespace_prefix = parser.getNamespacePrefix(i);
@@ -226,7 +242,7 @@
 					writer.writeDefaultNamespace(parser.getNamespaceURI(i));
 				}
 			}
-
+			
 			String attrprefix, attname;
 			boolean hasId = false;
 			boolean hasType = false
@@ -237,22 +253,22 @@
 				if ("id".equals(attname)) hasId = true;
 				if ("type".equals(attname)) hasType = true;
 				if ("n".equals(attname)) hasN = true;
-
+				
 				if(attrprefix != null && attrprefix.length() > 0)
 					writer.writeAttribute(attrprefix+":"+attname, parser.getAttributeValue(i))
 				else
 					writer.writeAttribute(attname, parser.getAttributeValue(i))
 			}
-
+			
 			if (wordid != null && !hasId && localname == "w")
 				writer.writeAttribute("id", "w_"+filename+"_"+wordcount);
-
+			
 			if (!hasType && localname == "w")
 				writer.writeAttribute("type", "w");
-
+			
 			if (!hasN && localname == "w")
 				writer.writeAttribute("n", ""+wordcount);
-
+			
 			writer.writeCharacters("\n");
 		}
 		else if(event == XMLStreamConstants.END_ELEMENT)
@@ -269,10 +285,10 @@
 			}
 		}
 	}
-
+	
 	/** The wordcount. */
 	int wordcount = 0;
-
+	
 	/** The ignorecontent. */
 	boolean ignorecontent = true;//tokenize a partir de <body>
 	boolean insideword = false;
@@ -291,7 +307,7 @@
 		output = new BufferedOutputStream(new FileOutputStream(outfile))
 		writer = factory.createXMLStreamWriter(output, "UTF-8")
 		writer.setNamespaceContext(new PersonalNamespaceContext());
-
+		
 		def inputData = infile.toURI().toURL().openStream();
 		def inputfactory = XMLInputFactory.newInstance();
 		//inputfactory.setProperty("http://apache.org/xml/properties/input-buffer-size", new Integer(2048));
@@ -300,7 +316,7 @@
 		//println "PARSER: "+parser.getClass()
 		writer.writeStartDocument("UTF-8","1.0");
 		writer.writeCharacters("\n");
-
+		
 		int previousEvent = 0;
 		boolean startProcess = false;
 		if (startTag == null) // if no startTag specified we process from the start
@@ -313,7 +329,7 @@
 				if (!startProcess) {
 					if (event == XMLStreamConstants.START_ELEMENT) {
 						if (parser.getLocalName().matches(startTag)) {
-
+							
 							startProcess = true
 							ignorecontent = false;
 						}
@@ -323,7 +339,7 @@
 						continue;
 					}
 				}
-
+				
 				if (previousEvent == XMLStreamConstants.CHARACTERS && previousEvent != event) {
 					processWord(); // tokenize
 					buffer = new StringBuffer();
@@ -331,7 +347,7 @@
 				fillInfos(event);//get localname and prefix
 				if (event == XMLStreamConstants.START_ELEMENT) {
 					//println "Open: "+localname;
-
+					
 					if (localname.matches(word_tags)) // ignore the content of the word but keep counting
 					{
 						//println "Found pretagged word";
@@ -385,7 +401,7 @@
 				}
 				previousEvent = event;
 			}
-
+			
 			parser.close()
 			writer.close();
 			output.close();
@@ -397,15 +413,15 @@
 		}
 		return true;
 	}
-
+	
 	public void setOutSideElements(String regexp) {
 		this.outside_text_tags = regexp;
 	}
-
+	
 	public void setOutSideTextTags(String regexp) {
 		this.outside_text_tags_keep_content = regexp;
 	}
-
+	
 	protected void goToEndOfElement(String name) {
 		//println "START ignoring tag and content of $name"
 		def openedTags = []
@@ -423,7 +439,7 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * Process word.
 	 */
@@ -439,7 +455,7 @@
 			iterate(s);
 		}
 	}
-
+	
 	/**
 	 * Iterate. a String, should be called when a word is found in a String
 	 *
@@ -453,8 +469,8 @@
 			s = standardChecks(s);
 		}
 	}
-
-
+	
+	
 	/**
 	 * Standard checks.
 	 *
@@ -467,7 +483,7 @@
 		if (fclitics != null && (m = s =~ regFClitics) ) {
 			if (DEBUG) println "CLITIC found: $s ->"+ m[0][1]+" + "+m[0][2]+" + "+m[0][3]
 			if (m[0][1] != null && m[0][1].length() > 0) iterate(m[0][1]);// process first part of the string
-
+			
 			wordcount++;
 			writer.writeStartElement("w");
 			writeWordAttributes();// id
@@ -475,18 +491,18 @@
 			writer.writeCharacters(m[0][2]);
 			writer.writeEndElement();
 			writer.writeCharacters("\n");
-
+			
 			return m[0][3];
 		} else if ((m = s =~ regElision)) {
 			if (DEBUG) println "Elision found: $s ->"+ m[0][1]+" + "+m[0][2]+" + "+m[0][3]
 			iterate(m[0][1])
-
+			
 			int sep = s.indexOf("'");
 			if (sep < 0)
 				sep = s.indexOf("’");
 			if (sep < 0)
 				sep = s.indexOf("‘");
-
+			
 			wordcount++;
 			writer.writeStartElement("w");
 			writeWordAttributes();// id
@@ -494,14 +510,14 @@
 			writer.writeCharacters(m[0][2]);
 			writer.writeEndElement();
 			writer.writeCharacters("\n");
-
+			
 			return m[0][3];
 		}
 		else if ((m = s =~ reg3pts) )
 		{
 			if(DEBUG){println "REG '...' found: $s -> "+m[0][1]+" + "+m[0][2]+" + "+m[0][3]}
 			iterate(m[0][1])
-
+			
 			wordcount++;
 			writer.writeStartElement("w");
 			writeWordAttributes();// id
@@ -509,7 +525,7 @@
 			writer.writeCharacters("...");
 			writer.writeEndElement();
 			writer.writeCharacters("\n");
-
+			
 			return m[0][3];
 		}
 		else if ((m = s =~ regPunct) )
@@ -517,7 +533,7 @@
 		{
 			if(DEBUG){println "PUNCT found: $s ->"+m[0][1]+" + "+m[0][2]+" + "+m[0][3]}
 			iterate(m[0][1]);
-
+			
 			wordcount++;
 			writer.writeStartElement("w");
 			writeWordAttributes();// id
@@ -525,7 +541,7 @@
 			writer.writeCharacters(m[0][2]);
 			writer.writeEndElement();
 			writer.writeCharacters("\n");
-
+			
 			return m[0][3];
 		}
 		else
@@ -541,11 +557,11 @@
 			writer.writeCharacters(s);
 			writer.writeEndElement();
 			writer.writeCharacters("\n");
-
+			
 			return "";
 		}
 	}
-
+	
 	/**
 	 * Write word attributes.
 	 *
@@ -556,12 +572,12 @@
 		writer.writeAttribute("id", "w_"+filename+"_"+wordcount);
 		writer.writeAttribute("n",""+wordcount);
 	}
-
+	
 	public void setStartTag(String tag)
 	{
 		this.startTag = tag;
 	}
-
+	
 	/**
 	 * Tokenize.
 	 *
@@ -572,7 +588,7 @@
 	{
 		return str.tokenize()	// cut by whitespace
 	}
-
+	
 	/**
 	 * The main method.
 	 *
@@ -585,15 +601,15 @@
 		for (String lang : ["fr", null]) {
 			print "."
 			File outputFile = new File(inputDir, "test-${lang}.xml")
-
+			
 			OldSimpleTokenizerXml tokenizer = new OldSimpleTokenizerXml(inputFile, outputFile, lang)
 			tokenizer.DEBUG = true
 			tokenizer.process();
 		}
-
+		
 		println ""
 		println "Done"
-
+		
 		//		String lang = "en"
 		//		File inDir = new File("/home/mdecorde/xml/ny911/cycle1/Data_Modif_Pour_Import_XML_Cycle1/xml_files/1xml_par_participant")
 		//		File outDir = new File("/home/mdecorde/xml/ny911/cycle1/Data_Modif_Pour_Import_XML_Cycle1/xml_files/1xml_par_participant-t")
@@ -612,6 +628,6 @@
 		//		}
 		//		println ""
 		//		println "Done"
-
+		
 	}
 }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/SimpleTokenizerXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/SimpleTokenizerXml.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/SimpleTokenizerXml.groovy	(revision 3061)
@@ -64,14 +64,13 @@
 	LinkedHashMap<String, String>retokenizedWordProperties = new LinkedHashMap()
 	
 	/** The word_tags. */
-	String word_tags = TokenizerClasses.word_tags;
-	String word_element_to_create = TokenizerClasses.word_element_to_create;
+	String word_tags;
+	String word_element_to_create
 	Pattern reg_word_tags;
 	/** The intraword_tags. */
-	String intraword_tags = TokenizerClasses.intraword_tags;
-	
+	String intraword_tags
 	/** The word_chars. */
-	String word_chars = TokenizerClasses.word_chars;
+	String word_chars
 	
 	/** The outside_text_tags_ignore_content. */
 	String note_content = null;
@@ -118,21 +117,26 @@
 		this(infile, outfile, "");
 	}
 	
+	public SimpleTokenizerXml(File infile, File outfile, String lang) {
+		this(infile, outfile, new TokenizerClasses(lang));
+	}
+	
 	/**
 	 * Instantiates a new simple tokenizer xml.
 	 *
 	 * @param infile the infile
 	 * @param outfile the outfile
 	 */
-	public SimpleTokenizerXml(File infile, File outfile, String lang) {
-		this.lang = lang;
+	public SimpleTokenizerXml(File infile, File outfile, TokenizerClasses tc) {
+		this.lang = tc.lang;
 		this.stringTokenizer = new SimpleStringTokenizer(lang);
 		
-		word_tags = TokenizerClasses.word_tags;
+		word_tags = tc.word_tags;
+		word_element_to_create = tc.word_element_to_create;
 		reg_word_tags = Pattern.compile(word_tags);
 		
-		intraword_tags = TokenizerClasses.intraword_tags;
-		word_chars = TokenizerClasses.word_chars;
+		intraword_tags = tc.intraword_tags;
+		word_chars = tc.word_chars;
 		
 		this.outfile = outfile;
 		this.infile = infile;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TokenizerXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TokenizerXml.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TokenizerXml.groovy	(revision 3061)
@@ -73,22 +73,9 @@
  * The Class TokenizerXml.
  */
 public class TokenizerXml {
-	
-	/** The word_tags. */
-	String word_tags = TokenizerClasses.word_tags;
-	
-	/** The intraword_tags. */
-	String intraword_tags = TokenizerClasses.intraword_tags;
-	
-	/** The punct_strong. */
-	def punct_strong = TokenizerClasses.punct_strong;
-	
-	/** The punct_all. */
-	def punct_all = TokenizerClasses.punct_all;
-	
-	/** The word_chars. */
-	def word_chars = TokenizerClasses.word_chars;
-	
+	
+	TokenizerClasses tc = new TokenizerClasses();
+		
 	/** The ignorable_tags. */
 	String ignorable_tags = "note"
 	
@@ -120,7 +107,7 @@
 	public TokenizerXml(File infile, File outfile)
 	{
 		this.outfile = outfile;
-		this.infile = infile;
+		this.infile = infile;
 	}
 	
 	/**
@@ -131,8 +118,7 @@
 	 */
 	public fillInfos(int event)
 	{
-		if (event == XMLStreamConstants.START_ELEMENT || event == XMLStreamConstants.END_ELEMENT) 
-		{
+		if (event == XMLStreamConstants.START_ELEMENT || event == XMLStreamConstants.END_ELEMENT) {
 			localname = parser.getLocalName();
 			prefix = parser.getPrefix();
 		}
@@ -147,27 +133,22 @@
 	public donothing(int event)
 	{
 		if (event == XMLStreamConstants.START_ELEMENT ) {
-			if(prefix != null && prefix.length() > 0)
+			if (prefix != null && prefix.length() > 0)
 				writer.writeStartElement(prefix+":"+localname);
 			else
 				writer.writeStartElement(localname);
 			String attrprefix;
-			for(int i = 0 ; i < parser.getAttributeCount() ; i++)
-			{
+			for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
 				attrprefix = parser.getAttributePrefix(i);
 				if(attrprefix != null && attrprefix.length() > 0)
 					writer.writeAttribute(attrprefix+":"+parser.getAttributeLocalName(i), parser.getAttributeValue(i))
 				else
 					writer.writeAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i))
 			}
-		}
-		else if(event == XMLStreamConstants.END_ELEMENT)
-		{
+		} else if(event == XMLStreamConstants.END_ELEMENT) {
 			writer.writeEndElement();
 			writer.writeCharacters("\n");
-		}
-		else if(event == XMLStreamConstants.CHARACTERS)
-		{
+		} else if(event == XMLStreamConstants.CHARACTERS) {
 			writer.writeCharacters(parser.getText());
 		}
 	}
@@ -188,19 +169,15 @@
 		def inputfactory = XMLInputFactory.newInstance();
 		parser = inputfactory.createXMLStreamReader(inputData);
 		
-		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) 
-		{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 			fillInfos(event);
-			if (event == XMLStreamConstants.START_ELEMENT) 
-			{
+			if (event == XMLStreamConstants.START_ELEMENT) {
 				//println "Open: "+localname;
-				if(localname == "text")
-				{
+				if (localname == "text") {
 					ignorecontent = false;
 					donothing(event);
 				}
-				if(localname.matches(word_tags))
-				{
+				if (localname.matches(tc.word_tags)) {
 					//println "Found pretagged word";
 					donothing(event);
 					wordcount++;
@@ -263,7 +240,7 @@
 							writer.writeCharacters(s);
 							writer.writeEndElement();
 							writer.writeCharacters("\n");
-						} else if(s.matches(/$punct_all|['‘’]/))
+						} else if(s.matches(/${tc.punct_all}|['‘’]/))
 										{
 							wordcount++;	
 							writer.writeStartElement("w");
@@ -308,7 +285,7 @@
 								writer.writeCharacters("\n");
 							}
 						}
-						else if(s.matches(/($punct_all)(.*)/))
+						else if(s.matches(/(${tc.punct_all})(.*)/))
 						{
 							wordcount++;	
 							writer.writeStartElement("w");
@@ -325,7 +302,7 @@
 							writer.writeEndElement();
 							writer.writeCharacters("\n");
 						}
-						else if(s.matches(/(.*)($punct_all)/))
+						else if(s.matches(/(.*)(${tc.punct_all})/))
 						{
 							wordcount++;	
 							writer.writeStartElement("w");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TEITokenizer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TEITokenizer.groovy	(revision 3060)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TEITokenizer.groovy	(revision 3061)
@@ -4,7 +4,7 @@
 import java.util.regex.Pattern;
 
 import org.txm.importer.StaxIdentityParser;
-import org.txm.tokenizer.*;
+import org.txm.tokenizer.TokenizerClasses;
 
 public class TEITokenizer extends StaxIdentityParser {
 
@@ -14,7 +14,6 @@
 	STATES state = STATES.IGNORE;
 	String STARTTAG = ".*"
 	String NOTETAG = ""
-	//String WORDTAG = TokenizerClasses.word_tags;
 
 	static String PONTEST = "[.;:,!?]";
 	static String TYPE = "type";
@@ -22,19 +21,19 @@
 	static String PON = "pon"
 	static String NUM = "num"
 	static String ENDOFLINE = System.getProperty("line.separator");
-	def tests = TokenizerClasses.tests;
+	def tests;
 
 	int firstElement = 1;
 	String filename = "";
 	int wordcount = 0;
 	String previousElem;
 
-	def word_tags = TokenizerClasses.word_tags;
-	def intraword_tags = TokenizerClasses.intraword_tags;
-	def punct_strong = TokenizerClasses.punct_strong;
-	def punct_all = TokenizerClasses.punct_all;
-	def word_chars = TokenizerClasses.word_chars;
-	def punct_quotes = TokenizerClasses.punct_quotes;
+	def word_tags;
+	def intraword_tags;
+	def punct_strong;
+	def punct_all;
+	def word_chars;
+	def punct_quotes;
 
 	StringBuffer buffer = new StringBuffer();
 
@@ -43,8 +42,19 @@
 
 		this.filename = new File(inputurl.getFile()).getName();
 		int index = filename.lastIndexOf(".");
-		if (index > 0)
+		if (index > 0) {
 			filename = filename.substring(0, index);
+		}
+		
+		TokenizerClasses tc = new TokenizerClasses()
+		tests = tc.tests;
+			
+		word_tags = tc.word_tags;
+		intraword_tags = tc.intraword_tags;
+		punct_strong = tc.punct_strong;
+		punct_all = tc.punct_all;
+		word_chars = tc.word_chars;
+		punct_quotes = tc.punct_quotes;
 	}
 
 	protected void processBuffer() {
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java	(revision 3060)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/___TextToConcordance.java	(revision 3061)
@@ -1,103 +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.edition.rcp.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.concordance.core.functions.Concordance;
-import org.txm.concordance.rcp.editors.ConcordanceEditor;
-import org.txm.rcp.editors.IEditionEditor;
-import org.txm.rcp.editors.TXMResultEditorInput;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.searchengine.cqp.corpus.CQPCorpus;
-import org.txm.searchengine.cqp.corpus.query.CQLQuery;
-
-// TODO: Auto-generated Javadoc
-/**
- * use the ITextSelection to compute a concordance
- * 
- * @author mdecorde.
- */
-// FIXME: SJ: to remove?
-@Deprecated
-public class ___TextToConcordance extends AbstractHandler {
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		// System.out.println("Call TextToConcordance");
-		IWorkbenchWindow window;
-		TXMResultEditorInput editorInput;
-		window = HandlerUtil.getActiveWorkbenchWindow(event);
-		// selection = HandlerUtil.getCurrentSelection(event);
-		
-		IEditorPart editor = window.getActivePage().getActiveEditor();
-		
-		if (editor instanceof IEditionEditor) {
-			
-			// System.out.println(((TXMBrowser)editor).getWordIDsSelection());
-			String query = ((IEditionEditor) editor).getTextSelection();
-			if (query.length() == 0) {
-				System.out.println("No text selection. Aborting.");
-				return null;
-			}
-			query = fixQuery(query);
-			
-			CQPCorpus corpus = ((IEditionEditor) editor).getCorpus();
-			Concordance concordance = new Concordance(corpus);
-			concordance.setParameters(new CQLQuery(query), null, null, null, null, null, null, null, null, null, null);
-			editorInput = new TXMResultEditorInput(concordance);
-			
-			IWorkbenchPage page = window.getActivePage();
-			try {
-				ConcordanceEditor conceditor = (ConcordanceEditor) page
-						.openEditor(editorInput, "ConcordanceEditor"); //$NON-NLS-1$
-			}
-			catch (PartInitException e) {
-				System.err.println("Error: " + e.getLocalizedMessage());
-			}
-		}
-		return null;
-	}
-	
-	public static String fixQuery(String query) {
-		query = "\"" + query.replaceAll("\"", "\\\"");// .replaceAll("("+TokenizerClasses.regPunct+")", " $1 ");
-		query = query.replaceAll(" +", "\" \"") + "\"";
-		return query;
-	}
-}
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SearchEditionToolbar.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SearchEditionToolbar.java	(revision 3060)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SearchEditionToolbar.java	(revision 3061)
@@ -3,26 +3,35 @@
 import java.util.List;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
 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.txm.edition.rcp.handlers.BackToText;
 import org.txm.objects.Match;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.swt.widget.AssistedChoiceQueryWidget;
 import org.txm.rcp.swt.widget.NewNavigationWidget;
 import org.txm.searchengine.core.IQuery;
 import org.txm.searchengine.core.Selection;
+import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.searchengine.cqp.corpus.QueryResult;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
+import org.txm.searchengine.cqp.corpus.query.MatchUtils;
 import org.txm.utils.logger.Log;
 
 public class SearchEditionToolbar {
 	
 	private GridData searchGdata;
 	
+	private GridData searchGdata2;
+	
+	private GridData searchGdata3;
+	
 	private AssistedChoiceQueryWidget searchText;
 	
 	/**
@@ -37,80 +46,85 @@
 	
 	private NewNavigationWidget searchNagigation;
 	
-	private GridData searchGdata2;
 	
+	
 	Composite lowerControlsArea;
 	
 	MainCorpus mcorpus;
 	
 	SynopticEditionEditor editor;
 	
+	private List<String> foundWordids;
+	
+	private Button searchButton;
+	
 	public void init(Composite lowerControlsArea, MainCorpus mcorpus, SynopticEditionEditor editor) {
 		
 		this.lowerControlsArea = lowerControlsArea;
 		this.mcorpus = mcorpus;
 		this.editor = editor;
 		
-		Button searchButton = new Button(lowerControlsArea, SWT.PUSH);
-		searchButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH));
-		searchButton.addSelectionListener(new SelectionListener() {
+		Button endSearchButton = new Button(lowerControlsArea, SWT.PUSH);
+		endSearchButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_DELETE));
+		endSearchButton.addSelectionListener(new SelectionListener() {
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				if (searchGdata.widthHint == 0) {
-					searchGdata.minimumWidth = searchGdata.widthHint = 250;
-					searchGdata2.minimumWidth = searchGdata2.widthHint = 250;
+				if (searchGdata.widthHint > 0) {
+					searchGdata.minimumWidth = searchGdata.widthHint = 0;
+					searchGdata2.minimumWidth = searchGdata2.widthHint = 0;
+					searchGdata3.minimumWidth = searchGdata3.widthHint = 0;
 					lowerControlsArea.layout();
+					searchButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH));
 				}
-				else if (searchText.getQuery() != null) {
-					Log.info("Searching " + searchText.getQuery());
-					IQuery q = searchText.getQuery();
-					try {
-						Selection tmp = q.getSearchEngine().query(mcorpus, q, "SEARCH", false);
-						if (tmp.getNMatch() > 0) {
-							searchResult = tmp;
-							
-							searchIndex = 0;
-							String wordid = editor.getEditionPanel(0).getCurrentPage().getWordId();
-							String text = editor.getEditionPanel(0).getCurrentPage().getEdition().getText().getName();
-							if (wordid != null && text != null) {
-								QueryResult rez2 = mcorpus.query(new CQLQuery("[_.text_id=\"" + text + "\" & id=\"" + wordid + "\"]"), "SEARCHINIT", false);
-								if (rez2.getNMatch() > 0) {
-									int p = rez2.getMatch(0).getStart();
-									List<? extends Match> matches = searchResult.getMatches();
-									for (int i = 0; i < matches.size(); i++) {
-										if (p < matches.get(i).getStart()) {
-											searchIndex = i - 1; // previous index was the one
-											break;
-										}
-									}
-								}
-							}
-							searchNagigation.setEnabled(true);
-							searchNagigation.setCurrentPosition(searchIndex);
-							searchNagigation.setMinPosition(1);
-							searchNagigation.setMaxPosition(tmp.getNMatch());
-							searchNagigation.refresh();
-							Log.info("" + searchResult.getNMatch() + " matches.");
-						}
-					}
-					catch (Exception e1) {
-						// TODO Auto-generated catch block
-						e1.printStackTrace();
-					}
-				}
 			}
 			
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
+		searchGdata3 = new GridData(GridData.CENTER, GridData.CENTER, false, false);
+		searchGdata3.minimumWidth = 0;
+		searchGdata3.widthHint = 0;
+		endSearchButton.setLayoutData(searchGdata3);
 		
 		searchText = new AssistedChoiceQueryWidget(lowerControlsArea, SWT.NONE, mcorpus);
-		searchGdata = new GridData(GridData.CENTER, GridData.FILL, false, false);
+		searchGdata = new GridData(GridData.CENTER, GridData.CENTER, false, false);
 		searchGdata.minimumWidth = 0;
 		searchGdata.widthHint = 0;
 		searchText.setLayoutData(searchGdata);
+		searchText.addKeyListener(new KeyListener() {
+			
+			@Override
+			public void keyReleased(KeyEvent e) {
+				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
+					if (searchText.getQuery() != null) {
+						search();
+					}
+				}
+			}
+			
+			@Override
+			public void keyPressed(KeyEvent e) {}
+		});
 		
+		searchButton = new Button(lowerControlsArea, SWT.PUSH);
+		searchButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH));
+		searchButton.addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				if (searchGdata.widthHint == 0) {
+					openSearch(editor.getTextSelection());
+				}
+				else if (searchText.getQuery() != null) {
+					search();
+				}
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {}
+		});
+		
 		searchNagigation = new NewNavigationWidget(lowerControlsArea, SWT.NONE) {
 			
 			@Override
@@ -121,18 +135,103 @@
 				// Log.info("showing the " + index + " match.");
 			}
 		};
-		searchGdata2 = new GridData(GridData.CENTER, GridData.FILL, false, false);
+		searchGdata2 = new GridData(GridData.CENTER, GridData.CENTER, false, false);
 		searchGdata2.minimumWidth = 0;
 		searchGdata2.widthHint = 0;
 		searchNagigation.setLayoutData(searchGdata2);
 		searchNagigation.setEnabled(false);
+		
 	}
 	
+	/**
+	 * Open the search tool if not done
+	 */
+	public void openSearch(String value) {
+		if (searchGdata.widthHint == 0) {
+			searchGdata.minimumWidth = searchGdata.widthHint = 350; //
+			searchGdata2.minimumWidth = searchGdata2.widthHint = SWT.DEFAULT; // several buttons
+			searchGdata3.minimumWidth = searchGdata3.widthHint = SWT.DEFAULT; // button
+			lowerControlsArea.layout();
+			searchButton.setImage(IImageKeys.getImage(IImageKeys.START));
+		}
+		searchText.setFocus();
+		if (value != null && value.length() > 0) {
+			searchText.setText(value);
+		}
+	}
+	
+	protected void search() {
+		Log.info("Searching " + searchText.getQuery());
+		IQuery q = searchText.getQuery();
+		try {
+			Selection tmp = searchText.getQuery().getSearchEngine().query(mcorpus, q, "SEARCH", false);
+			if (tmp.getNMatch() > 0) {
+				searchResult = tmp;
+				
+				searchText.getQueryWidget().memorize();
+				
+				searchIndex = 0;
+				String wordid = editor.getEditionPanel(0).getCurrentPage().getWordId();
+				String text = editor.getEditionPanel(0).getCurrentPage().getEdition().getText().getName();
+				if (wordid != null && text != null) {
+					QueryResult rez2 = mcorpus.query(new CQLQuery("[_.text_id=\"" + text + "\" & id=\"" + wordid + "\"]"), "SEARCHINIT", false);
+					if (rez2.getNMatch() > 0) {
+						int p = rez2.getMatch(0).getStart();
+						List<? extends Match> matches = searchResult.getMatches();
+						for (int i = 0; i < matches.size(); i++) {
+							if (p < matches.get(i).getStart()) {
+								searchIndex = i; // previous index was the one
+								break;
+							}
+						}
+					}
+				}
+				searchNagigation.setEnabled(true);
+				searchNagigation.setCurrentPosition(searchIndex);
+				searchNagigation.setMinPosition(1);
+				searchNagigation.setMaxPosition(tmp.getNMatch());
+				searchNagigation.refresh();
+				Log.info("" + searchResult.getNMatch() + " hits.");
+			}
+			else {
+				searchIndex = 0;
+				searchNagigation.setEnabled(false);
+				searchNagigation.setCurrentPosition(0);
+				searchNagigation.setMinPosition(0);
+				searchNagigation.setMaxPosition(0);
+				searchNagigation.refresh();
+				Log.info("No hit.");
+			}
+		}
+		catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+	}
+	
 	protected void showCurrentSearchMatch() {
 		if (searchResult != null && searchIndex >= 0) {
-			String text = "";
-			String wordid = "";
-			editor.getEditionPanel(0).backToText(editor.getResult().getProject().getText(text), wordid);
+			try {
+				if (foundWordids != null) {
+					editor.removeHighlightWordsById(BackToText.red, foundWordids);
+					editor.setFocusedWordID(null);
+					editor.updateWordStyles();
+				}
+				Match match = searchResult.getMatches().get(searchIndex);
+				String text = CQPSearchEngine.getEngine().getValueForProperty(match, mcorpus.getStructuralUnitProperty("text_id"));
+				int[] positions = MatchUtils.toPositions(match);
+				foundWordids = CQPSearchEngine.getEngine().getValuesForProperty(positions, mcorpus.getProperty("id"));
+				if (foundWordids.size() == 0) return;
+				
+				editor.getEditionPanel(0).backToText(editor.getResult().getProject().getText(text), foundWordids.get(0));
+				editor.addHighlightWordsById(BackToText.red, foundWordids);
+				editor.setFocusedWordID(foundWordids.get(0));
+				editor.updateWordStyles();
+			}
+			catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
 		}
 	}
 }
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 3060)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 3061)
@@ -21,6 +21,8 @@
 import org.eclipse.swt.browser.Browser;
 import org.eclipse.swt.browser.ProgressEvent;
 import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.MenuEvent;
 import org.eclipse.swt.events.MenuListener;
 import org.eclipse.swt.events.MouseEvent;
@@ -604,6 +606,20 @@
 			}
 		});
 		
+		getBrowser().addKeyListener(new KeyListener() {
+			
+			@Override
+			public void keyReleased(KeyEvent e) {
+				
+				if (e.keyCode == 102 && (e.stateMask & SWT.CTRL) != 0) {
+					synopticEditionEditor.getSearchEditionToolbar().openSearch(getTextSelection());
+				}
+			}
+			
+			@Override
+			public void keyPressed(KeyEvent e) {}
+		});
+		
 		getBrowser().addProgressListener(progresslistener);
 		new CommandLink(synopticEditionEditor, getBrowser());
 		new EditionLink(synopticEditionEditor, getBrowser());
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java	(revision 3060)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java	(revision 3061)
@@ -75,6 +75,7 @@
 import org.txm.edition.rcp.messages.EditionUIMessages;
 import org.txm.objects.Edition;
 import org.txm.objects.Page;
+import org.txm.objects.Project;
 import org.txm.objects.Text;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.editors.IEditionEditor;
@@ -126,6 +127,8 @@
 	// private Label text_label;
 	private TXMAutoCompleteField identifiantComboAutoCompleteField;
 	
+	private SearchEditionToolbar set;
+	
 	// TODO finish editor conversion
 	@Override
 	public Text getResult() {
@@ -135,6 +138,10 @@
 		return text;
 	}
 	
+	public SearchEditionToolbar getSearchEditionToolbar() {
+		return set;
+	}
+	
 	/**
 	 * Instantiates a new txm browser.
 	 */
@@ -384,6 +391,18 @@
 		this.removeComputeButton();
 		
 		editionsArea = getResultArea();
+		editionsArea.addKeyListener(new KeyListener() {
+			
+			@Override
+			public void keyReleased(KeyEvent e) {
+				if (e.keyCode == 102 && (e.stateMask & SWT.CTRL) != 0) {
+					getSearchEditionToolbar().openSearch(getTextSelection());
+				}
+			}
+			
+			@Override
+			public void keyPressed(KeyEvent e) {}
+		});
 		
 		lowerControlsArea = getBottomToolbar().installGLComposite(EditionUIMessages.controls, 15, false);
 		lowerControlsArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
@@ -395,12 +414,17 @@
 		
 		// supplementaryButtonToolbar = new TXMEditorToolBar(this, getTopToolbarContainer(), annotationWidgetsArea, SWT.NONE, "annotation urs");
 		
+		set = new SearchEditionToolbar();
+		Project project = this.getResult().getProject();
+		MainCorpus mcorpus = (MainCorpus) project.getCorpusBuild(project.getName().toUpperCase(), MainCorpus.class);
+		set.init(lowerControlsArea, mcorpus, this);
+		
 		// Edition names label
-		editionsChooser = new Button(lowerControlsArea, SWT.PUSH);
-		editionsChooser.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
 		
+		
 		if (mainCorpus.getProject().getBuiltEditionNames().size() > 1) {
-			
+			editionsChooser = new Button(lowerControlsArea, SWT.PUSH);
+			editionsChooser.setText(StringUtils.join(editionNames, " | ")); //$NON-NLS-1$
 			editionsChooser.addSelectionListener(new SelectionListener() {
 				
 				@Override
@@ -436,9 +460,6 @@
 				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
 		}
-		else {
-			editionsChooser.setEnabled(false);
-		}
 		
 		// Navigation buttons
 		GLComposite pageNavigationComposite = new GLComposite(lowerControlsArea, SWT.NONE, EditionUIMessages.pageButtons);
@@ -450,7 +471,7 @@
 		page_label = new Label(pageNavigationComposite, SWT.NONE);
 		Button next = new Button(pageNavigationComposite, SWT.FLAT | SWT.PUSH);
 		Button last = new Button(pageNavigationComposite, SWT.FLAT | SWT.PUSH);
-		pageNavigationComposite.setLayoutData(new GridData(GridData.CENTER, GridData.FILL, true, false));
+		pageNavigationComposite.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true, false));
 		
 		GLComposite textNavigationComposite = new GLComposite(lowerControlsArea, SWT.NONE, EditionUIMessages.textButtons);
 		textNavigationComposite.getLayout().numColumns = 7;
@@ -461,7 +482,7 @@
 		KeyStroke keys = KeyStroke.getInstance(SWT.CONTROL, SWT.SPACE);
 		try {
 			String[] text_ids = corpus.getCorpusTextIdsList();
-			GridData gdata = new GridData(GridData.CENTER, GridData.FILL, true, false);
+			GridData gdata = new GridData(GridData.CENTER, GridData.CENTER, true, false);
 			gdata.minimumWidth = 1;
 			for (String text_id : text_ids) {
 				double s = text_id.length() * 7;
@@ -489,10 +510,10 @@
 		// text_label = new Label(textNavigationComposite, SWT.NONE);
 		Button nextText = new Button(textNavigationComposite, SWT.FLAT | SWT.PUSH);
 		Button lastText = new Button(textNavigationComposite, SWT.FLAT | SWT.PUSH);
-		textNavigationComposite.setLayoutData(new GridData(GridData.CENTER, GridData.FILL, false, false));
+		textNavigationComposite.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 		// Layouts data
 		
-		editionsChooser.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
+		if (editionsChooser != null) editionsChooser.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
 		
 		// GridData buttonGridData = new GridData(GridData.END,GridData.CENTER, true, false);
 		// buttonGridData.widthHint = 30;
Index: tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportStep.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportStep.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportStep.java	(revision 3061)
@@ -3,6 +3,8 @@
 import java.io.File;
 import java.util.HashMap;
 
+import org.txm.objects.Project;
+
 /**
  * One of the step of an import module
  * 
@@ -10,18 +12,26 @@
  *
  */
 public abstract class ImportStep {
-
+	
 	protected File inputDirectory, outputDirectory;
+	
 	protected ImportModule module;
 	
-	protected HashMap<String, Object> stepProperties = new HashMap<String, Object>();
+	protected Project project;
+	
+	protected HashMap<String, Object> stepProperties = new HashMap<>();
+	
 	protected boolean isSuccessFul = false;
+	
 	protected String reason = "not set.";
+	
 	protected boolean stopAtFirstError = true;
+	
 	protected boolean debug = true;
 	
 	public ImportStep(ImportModule module) {
 		this.module = module;
+		this.project = module.getProject();
 		debug = module.debug;
 	}
 	
Index: tmp/org.txm.core/src/java/org/txm/importer/ImportFileManager.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ImportFileManager.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/importer/ImportFileManager.java	(revision 3061)
@@ -94,7 +94,7 @@
 			
 			LinkedHashMap<String, String> sectionParameters = new LinkedHashMap<>();
 			sections.put(name, sectionParameters);
-			NodeList parameterList = doc.getElementsByTagName("parameter");
+			NodeList parameterList = section.getElementsByTagName("parameter");
 			for (int j = 0; j < parameterList.getLength(); j++) {
 				Element parameter = (Element) parameterList.item(j);
 				String name2 = parameter.getAttribute("name");
Index: tmp/org.txm.core/src/java/org/txm/importer/ImportPreferencesManager.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/importer/ImportPreferencesManager.java	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/importer/ImportPreferencesManager.java	(revision 3061)
@@ -0,0 +1,160 @@
+package org.txm.importer;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.LinkedHashMap;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+import org.txm.objects.Project;
+import org.txm.utils.logger.Log;
+import org.txm.utils.xml.DomUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * Read and save a import parameter file
+ * 
+ * The file is read to fill the ImportFormEditor > CorpusPage widgets
+ * 
+ * @author mdecorde
+ *
+ */
+public class ImportPreferencesManager {
+	
+	/**
+	 * one map per import section
+	 */
+	LinkedHashMap<String, LinkedHashMap<String, String>> sections = new LinkedHashMap<>();
+	
+	private Project project;
+	
+	public ImportPreferencesManager(Project project) {
+		this.project = project;
+	}
+	
+	public LinkedHashMap<String, LinkedHashMap<String, String>> getSections() {
+		return sections;
+	}
+	
+	public LinkedHashMap<String, String> getSection(String name) {
+		if (name == null) return null;
+		return sections.get(name);
+	}
+	
+	public String load() throws BackingStoreException {
+		String version = project.getCorpusVersion();
+		if ("0.8.0".equals(version)) {
+			loadFrom080();
+		}
+		else if ("0.8.2".equals(version)) {
+			genericLoad();
+		}
+		else {
+			return "Wrong import parameter file version: " + project + ": " + version;
+		}
+		return "";
+	}
+	
+	private void loadFrom080() {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	/**
+	 * simple reading of all section parameters are stored in a section element with parameter elements (@key + text)
+	 * 
+	 * @throws BackingStoreException
+	 */
+	private void genericLoad() throws BackingStoreException {
+		sections.clear();
+		
+		Preferences sectionList = project.getPreferencesScope().getNode("import").node("sections");
+		String[] sectionNames = sectionList.childrenNames();
+		for (int i = 0; i < sectionNames.length; i++) {
+			Preferences section = sectionList.node(sectionNames[i]);
+			String name = section.name();
+			if (name == null || name.length() == 0) {
+				Log.warning("Load import 0.8.2 parameters: section with no name");
+				continue;
+			}
+			if (sections.containsKey(name)) {
+				Log.warning("Load import 0.8.2 parameters: duplicated section with name:" + name);
+				continue;
+			}
+			
+			LinkedHashMap<String, String> sectionParameters = new LinkedHashMap<>();
+			sections.put(name, sectionParameters);
+			for (String name2 : section.keys()) {
+				String parameter = section.get(name2, "");
+				
+				if (sectionParameters.containsKey(name2)) {
+					Log.warning("Load import 0.8.2 parameters: duplicated parameter with name:" + name2 + " in section: " + name);
+					continue;
+				}
+				
+				sectionParameters.put(name2, parameter);
+			}
+		}
+	}
+	
+	public String save() throws BackingStoreException {
+		String version = project.getCorpusVersion();
+		if ("0.8.0".equals(version)) {
+			saveFrom080();
+		}
+		else if ("0.8.2".equals(version)) {
+			genericSave();
+		}
+		else {
+			return "Wrong import parameter file version: " + project + ": " + version;
+		}
+		return "";
+	}
+	
+	private void genericSave() throws BackingStoreException {
+		IEclipsePreferences importNode = project.getPreferencesScope().getNode("import");
+		Preferences sectionList = importNode.node("sections");
+		
+		// store previous values
+		if (importNode.nodeExists("sections-previous")) {
+			importNode.node("sections-previous").removeNode(); // clear previous values
+		}
+		Preferences oldSectionList = importNode.node("sections-previous"); // create/get the node
+		oldSectionList.removeNode();
+		for (String section : sectionList.childrenNames()) {
+			Preferences sectionPref = sectionList.node(section);
+			Preferences sectionPref2 = oldSectionList.node(section);
+			for (String key : sectionPref.keys()) {
+				sectionPref2.put(key, sectionPref.get(key, ""));
+			}
+		}
+		
+		// clear the sections list
+		sectionList.clear();
+		for (String section : sectionList.childrenNames()) {
+			sectionList.node(section).removeNode();
+		}
+		
+		// recreate sections
+		for (String section : this.sections.keySet()) {
+			Preferences n = sectionList.node(section);
+			LinkedHashMap<String, String> prefs = this.sections.get(section);
+			for (String key : prefs.keySet()) {
+				n.put(key, prefs.get(key));
+			}
+		}
+	}
+	
+	private void saveFrom080() {
+		// TODO Auto-generated method stub
+		
+	}
+}

Property changes on: tmp/org.txm.core/src/java/org/txm/importer/ImportPreferencesManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.core/src/java/org/txm/scripts/importer/ReadImportParameters.groovy
===================================================================
--- tmp/org.txm.core/src/java/org/txm/scripts/importer/ReadImportParameters.groovy	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/scripts/importer/ReadImportParameters.groovy	(revision 3061)
@@ -31,14 +31,11 @@
 	String description;
 	
 	boolean debug;
-
-	public ReadImportParameters()
-	{
-
+	
+	public ReadImportParameters() {
 	}
-
-	public boolean read(File infile)
-	{
+	
+	public boolean read(File infile) {
 		try {
 			def url = infile.toURI().toURL();
 			def inputData = url.openStream();
@@ -53,11 +50,9 @@
 		}catch (IOException ex) {
 			System.out.println("IOException while parsing ");
 		}
-		
 	}
-
-	public boolean read(def parser)
-	{
+	
+	public boolean read(def parser) {
 		boolean startAlignInfos = false;
 		boolean startEditions = false;
 		boolean startMetadatas = false;
@@ -65,42 +60,34 @@
 		boolean startSAttributes = false;
 		boolean startTokenizer = false;
 		
-		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next())
-		{
+		for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 			switch (event) {
-
+				
 				case XMLStreamConstants.END_ELEMENT:
 					String localname = parser.getLocalName();
-					if(localname == "linkGrp")
-					{
+					if(localname == "linkGrp") {
 						startAlignInfos = false;
 					}
-					else if(localname == "metadatas")
-					{
+					else if(localname == "metadatas") {
 						startMetadatas = false;
 					}
-					else if(localname == "editions")
-					{
+					else if(localname == "editions") {
 						startEditions = false;
 					}
-					else if(localname == "pattributes")
-					{
+					else if(localname == "pattributes") {
 						startPAttributes = false;
 					}
-					else if(localname == "sattributes")
-					{
+					else if(localname == "sattributes") {
 						startSAttributes = false;
 					}
-					else if(localname == "tokenizer")
-					{
+					else if(localname == "tokenizer") {
 						startSAttributes = false;
 					}
 					break;
-
+				
 				case XMLStreamConstants.START_ELEMENT:
 					String localname = parser.getLocalName();
-					if (localname == "import")
-					{
+					if (localname == "import") {
 						basename = parser.getAttributeValue(null, "name");
 						encoding = parser.getAttributeValue(null, "encoding");
 						language = parser.getAttributeValue(null, "lang");
@@ -112,12 +99,10 @@
 						
 						boolean debug;
 					}
-					else if(localname == "editions")
-					{
+					else if(localname == "editions") {
 						startEditions = true;
 					}
-					else if(localname == "edition")
-					{
+					else if(localname == "edition") {
 						String corpus = parser.getAttributeValue(null, "corpus")
 						if(!editions.containsKey(corpus))
 							editions.put(corpus, []);
@@ -133,52 +118,52 @@
 						startMetadatas = true;
 					}
 					else if (localname == "metadata" && startMetadatas) {
-						metadatas.put(parser.getAttributeValue(null, "id"), 
-							["id":parser.getAttributeValue(null, "id"),
-							"shortname":parser.getAttributeValue(null, "shortname"),
-							"longname":parser.getAttributeValue(null, "longname"),
-							"type":parser.getAttributeValue(null, "type"),
-							"selection":parser.getAttributeValue(null, "selection"),
-							"partition":parser.getAttributeValue(null, "partition"),
-							"display":parser.getAttributeValue(null, "display"),])
+						metadatas.put(parser.getAttributeValue(null, "id"),
+								["id":parser.getAttributeValue(null, "id"),
+									"shortname":parser.getAttributeValue(null, "shortname"),
+									"longname":parser.getAttributeValue(null, "longname"),
+									"type":parser.getAttributeValue(null, "type"),
+									"selection":parser.getAttributeValue(null, "selection"),
+									"partition":parser.getAttributeValue(null, "partition"),
+									"display":parser.getAttributeValue(null, "display"),])
 					}
 					else if (localname == "pattributes") {
 						startPAttributes = true;
 					} else if(localname == "pattribute" && startPAttributes) {
-						pattributes.put(parser.getAttributeValue(null, "id"), 
-							["id":parser.getAttributeValue(null, "id"),
-							"shortname":parser.getAttributeValue(null, "shortname"),
-							"longname":parser.getAttributeValue(null, "longname"),
-							"type":parser.getAttributeValue(null, "type"),
-							"renderer":parser.getAttributeValue(null, "renderer"),
-							"tooltip":parser.getAttributeValue(null, "tooltip"),
-							"display":parser.getAttributeValue(null, "display"),
-							"min":parser.getAttributeValue(null, "min"),
-							"max":parser.getAttributeValue(null, "max"),
-							"inputFormat":parser.getAttributeValue(null, "inputFormat"),
-							"outputFormat":parser.getAttributeValue(null, "outputFormat"),
-							"position":parser.getAttributeValue(null, "position"),
-							"sortBy":parser.getAttributeValue(null, "sortBy")])
+						pattributes.put(parser.getAttributeValue(null, "id"),
+								["id":parser.getAttributeValue(null, "id"),
+									"shortname":parser.getAttributeValue(null, "shortname"),
+									"longname":parser.getAttributeValue(null, "longname"),
+									"type":parser.getAttributeValue(null, "type"),
+									"renderer":parser.getAttributeValue(null, "renderer"),
+									"tooltip":parser.getAttributeValue(null, "tooltip"),
+									"display":parser.getAttributeValue(null, "display"),
+									"min":parser.getAttributeValue(null, "min"),
+									"max":parser.getAttributeValue(null, "max"),
+									"inputFormat":parser.getAttributeValue(null, "inputFormat"),
+									"outputFormat":parser.getAttributeValue(null, "outputFormat"),
+									"position":parser.getAttributeValue(null, "position"),
+									"sortBy":parser.getAttributeValue(null, "sortBy")])
 					}
 					else if (localname == "sattributes") {
 						startSAttributes = true;
 					}
 					else if (localname == "sattribute" && startSAttributes) {
-						sattributes.put(parser.getAttributeValue(null, "id"), 
-							["id":parser.getAttributeValue(null, "id"),
-							"shortname":parser.getAttributeValue(null, "shortname"),
-							"longname":parser.getAttributeValue(null, "longname"),
-							"type":parser.getAttributeValue(null, "type"),
-							"renderer":parser.getAttributeValue(null, "renderer"),
-							"tooltip":parser.getAttributeValue(null, "tooltip"),
-							"pattern":parser.getAttributeValue(null, "renderer"),
-							"import":parser.getAttributeValue(null, "import"),
-							"min":parser.getAttributeValue(null, "min"),
-							"max":parser.getAttributeValue(null, "max"),
-							"mandatory":parser.getAttributeValue(null, "mandatory"),
-							"order":parser.getAttributeValue(null, "order"),
-							"inputFormat":parser.getAttributeValue(null, "inputFormat"),
-							"outputFormat":parser.getAttributeValue(null, "outputFormat"),])
+						sattributes.put(parser.getAttributeValue(null, "id"),
+								["id":parser.getAttributeValue(null, "id"),
+									"shortname":parser.getAttributeValue(null, "shortname"),
+									"longname":parser.getAttributeValue(null, "longname"),
+									"type":parser.getAttributeValue(null, "type"),
+									"renderer":parser.getAttributeValue(null, "renderer"),
+									"tooltip":parser.getAttributeValue(null, "tooltip"),
+									"pattern":parser.getAttributeValue(null, "renderer"),
+									"import":parser.getAttributeValue(null, "import"),
+									"min":parser.getAttributeValue(null, "min"),
+									"max":parser.getAttributeValue(null, "max"),
+									"mandatory":parser.getAttributeValue(null, "mandatory"),
+									"order":parser.getAttributeValue(null, "order"),
+									"inputFormat":parser.getAttributeValue(null, "inputFormat"),
+									"outputFormat":parser.getAttributeValue(null, "outputFormat"),])
 					} else if (localname == "link" && startAlignInfos) {
 						String target = parser.getAttributeValue(null, "target");
 						String struct = parser.getAttributeValue(null, "alignElement");
@@ -191,10 +176,10 @@
 								i--
 							}
 						}
-
+						
 						if (level == null)
 							level = "1";
-
+						
 						if (corpora.size() == 0) {
 							println "no corpus aligned: "+parser.getLocation()
 							return false;
@@ -214,32 +199,26 @@
 			}
 		}
 	}
-
-	public Set<String> getAlignements()
-	{
+	
+	public Set<String> getAlignements() {
 		return links.keySet();
 	}
-
-	public ArrayList<String> getTargets(String alignement)
-	{
+	
+	public ArrayList<String> getTargets(String alignement) {
 		return links.get(alignement);
 	}
-
-	public String getStructure(String alignement)
-	{
+	
+	public String getStructure(String alignement) {
 		return structs.get(alignement);
 	}
-
-	public int getLevel(String alignement)
-	{
+	
+	public int getLevel(String alignement) {
 		return levels.get(alignement);
 	}
-
-	public void dump()
-	{
+	
+	public void dump() {
 		println "LINKS"
-		for(String link : links.keySet())
-		{
+		for(String link : links.keySet()) {
 			println link
 			println " corpus: "+links.get(link)
 			println " struct: "+structs.get(link)
@@ -268,9 +247,8 @@
 		println " description $description"
 		println "DEBUG: $debug"
 	}
-
-	public static void main(String[] args)
-	{
+	
+	public static void main(String[] args) {
 		String userhome = System.getProperty("user.home");
 		File alignfile = new File(userhome, "xml/xmltxmpara/align.xml")
 		ReadImportParameters parameters = new ReadImportParameters();
Index: tmp/org.txm.core/src/java/org/txm/core/engines/EnginesManager.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/engines/EnginesManager.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/core/engines/EnginesManager.java	(revision 3061)
@@ -19,26 +19,26 @@
  * @author sjacquot
  *
  */
-public abstract class EnginesManager<T extends Engine> extends HashMap<String, T>{
-
+public abstract class EnginesManager<T extends Engine> extends HashMap<String, T> {
+	
 	private static final long serialVersionUID = 9186978207738860351L;
-
+	
 	public static final String ENGINES_MANAGER_EXTENSION_POINT_ID = EnginesManager.class.getName();
-
+	
 	/**
 	 * Current engine.
 	 */
 	protected T currentEngine = null;
-
 	
 	
+	
 	/**
 	 * Finds out the engines that matches this manager engines extension point.
 	 * 
 	 * @return
 	 */
 	public abstract boolean fetchEngines();
-
+	
 	/**
 	 * Creates and initializes the engines from contributions with the specified extension point id.
 	 * 
@@ -46,33 +46,35 @@
 	 * @return true if at least one engine has been created otherwise false
 	 */
 	protected boolean fetchEngines(String engineExtensionPointId) {
-
+		
 		IConfigurationElement[] contributions = RegistryFactory.getRegistry().getConfigurationElementsFor(engineExtensionPointId);
-
+		
 		Log.finest(TXMCoreMessages.bind("Looking for {0} engines contributions with extension point id {1}...", this.getEnginesDescription(), engineExtensionPointId)); //$NON-NLS-1$
 		Log.finest(TXMCoreMessages.bind("{0} engine(s) found.", contributions.length)); //$NON-NLS-1$
-
+		
 		for (int i = 0; i < contributions.length; i++) {
 			try {
 				@SuppressWarnings("unchecked")
 				T engine = (T) contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
-
+				
 				Log.fine(TXMCoreMessages.bind("Initializing engine: {0}...", engine));
-
+				
 				if (engine.initialize()) {
 					this.put(engine.getName(), engine);
-				} else {
+				}
+				else {
 					Log.severe("Failed to initialize " + engine.getName() + " engine.");
 				}
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				Log.severe("Error: failed to instantiate " + contributions[i].getName() + ".");
 				e.printStackTrace();
 			}
 		}
-
+		
 		return this.size() > 0;
 	}
-
+	
 	/**
 	 * Starts the engines.
 	 * 
@@ -81,30 +83,32 @@
 	 */
 	public boolean startEngines(IProgressMonitor monitor) {
 		for (Engine engine : this.values()) {
-
+			
 			String log = "Starting " + this.getEnginesDescription() + " engine: " + engine.getName() + "...";
 			Log.fine(log);
-
+			
 			if (monitor != null) {
 				monitor.subTask(log);
 			}
-
+			
 			try {
 				engine.start(monitor);
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				Log.severe("Error: failed to start engine " + engine.getName() + ".");
 				e.printStackTrace();
 			}
 		}
-
+		
 		if (this.currentEngine == null && this.size() > 0) {
 			this.setCurrentEngine((T) this.values().toArray()[0]);
 		}
 		return true;
 	}
-
+	
+	@Override
 	public String toString() {
-		return getEnginesType()+": "+super.toString();
+		return getEnginesType() + ": " + super.toString();
 	}
 	
 	/**
@@ -115,10 +119,10 @@
 		if (currentEngine == null) {
 			return false;
 		}
-
+		
 		return currentEngine.isRunning();
 	}
-
+	
 	/**
 	 * Stops the engines.
 	 * 
@@ -126,19 +130,20 @@
 	 */
 	public boolean stopEngines() {
 		for (Engine engine : this.values()) {
-
+			
 			Log.fine("Stopping " + this.getEnginesDescription() + " engine: " + engine.getName() + "..."); //$NON-NLS-1$
-
+			
 			try {
 				engine.stop();
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				Log.severe("Error: failed to stop engine " + engine.getName() + ".");
 				e.printStackTrace();
 			}
 		}
 		return true;
 	}
-
+	
 	/**
 	 * Restarts the engines.
 	 * 
@@ -158,23 +163,24 @@
 					Log.fine("Starting " + this.getEnginesDescription() + " engine: " + engine.getName() + "..."); //$NON-NLS-1$
 					engine.start(new LogMonitor());
 				}
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				Log.severe("Error: failed to stop engine " + engine.getName() + ".");
 				e.printStackTrace();
 			}
 		}
 		return true;
 	}
-
+	
 	/**
 	 * Gets the engine type that this manager supports.
 	 * 
 	 * @return the engine type that this manager supports
 	 */
 	public abstract EngineType getEnginesType();
-
 	
 	
+	
 	/**
 	 * Gets the engine description that this manager supports.
 	 * 
@@ -183,7 +189,7 @@
 	public String getEnginesDescription() {
 		return this.getEnginesType().getDescription();
 	}
-
+	
 	/**
 	 * Gets the available engines.
 	 * 
@@ -192,7 +198,7 @@
 	public HashMap<String, T> getEngines() {
 		return this;
 	}
-
+	
 	/**
 	 * Gets an engine specified by its name.
 	 * 
@@ -211,7 +217,7 @@
 	public T getCurrentEngine() {
 		return this.currentEngine;
 	}
-
+	
 	/**
 	 * Sets the current engine.
 	 * 
@@ -221,7 +227,7 @@
 		Log.finest("Setting current " + this.getEnginesDescription() + " engine to " + engine + ".");
 		this.currentEngine = engine;
 	}
-
+	
 	/**
 	 * Sets the current engine specified by its name.
 	 * 
@@ -230,7 +236,7 @@
 	public void setCurrentEngine(String name) {
 		this.setCurrentEngine(this.getEngine(name));
 	}
-
+	
 	/**
 	 * Gets an installed engine according to its class type.
 	 * 
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 3061)
@@ -117,6 +117,16 @@
 	public static final String QUERY = "query"; //$NON-NLS-1$
 	
 	/**
+	 * Result index.
+	 */
+	public static final String INDEX = "index"; //$NON-NLS-1$
+	
+	/**
+	 * Result sub index.
+	 */
+	public static final String SUB_INDEX = "sub_index"; //$NON-NLS-1$
+	
+	/**
 	 * Structural unit.
 	 */
 	public static final String STRUCTURAL_UNIT = "structural_unit"; //$NON-NLS-1$
Index: tmp/org.txm.core/src/java/org/txm/objects/Match.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Match.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/objects/Match.java	(revision 3061)
@@ -3,21 +3,38 @@
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * Abstraction of a match. A Match is defined by its start-end positions.
+ * 
+ * It may have a target position to focus a position
+ * 
+ * TODO manage multiple target positions
+ * TODO manage multiple labeled target positions
+ * TODO store match index (hard to update the match indices ?)
+ * TODO store sub match index (hard to update the submatch indices ?)
+ * 
+ * @author mdecorde
+ *
+ */
 public abstract class Match implements Comparable<Match> {
+	
 	public abstract int getStart();
+	
 	public abstract int getEnd();
+	
 	public abstract int getTarget();
 	
 	public boolean contains(Match m) {
 		return (this.getStart() <= m.getStart() && m.getEnd() <= this.getEnd());
 	}
 	
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Comparable#compareTo(java.lang.Object)
 	 */
 	@Override
 	public int compareTo(Match m) {
-
+		
 		if (m == null)
 			return -1;
 		if (this.getStart() < m.getStart())
@@ -28,10 +45,10 @@
 			return -1;
 		else
 			return 1;
-
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Object#toString()
 	 */
 	@Override
@@ -49,19 +66,21 @@
 	}
 	
 	public List<Integer> getRange() {
-		List<Integer> ret = new ArrayList<Integer>(size());
-		for (int i = getStart() ; i <= getEnd(); i++) ret.add(i);
+		List<Integer> ret = new ArrayList<>(size());
+		for (int i = getStart(); i <= getEnd(); i++)
+			ret.add(i);
 		return ret;
 	}
-
+	
 	public abstract void setEnd(int p);
-
+	
 	public abstract void setStart(int p);
 	
 	public abstract void setTarget(int p);
 	
 	/**
 	 * intersect sorted list of Matches
+	 * 
 	 * @param list1
 	 * @param sublist2
 	 * @param strict_inclusion if true the match must be exactly included
@@ -71,22 +90,25 @@
 		ArrayList<Match> result = new ArrayList<>();
 		int i1 = 0;
 		int i2 = 0;
-		for (; i2 < sublist2.size() && i1 < list1.size(); ) {
+		for (; i2 < sublist2.size() && i1 < list1.size();) {
 			Match m = list1.get(i1);
 			Match subm = sublist2.get(i2);
 			if (m.getEnd() < subm.getStart()) {
 				i1++;
-			} else if (subm.getEnd() < m.getStart()) {
+			}
+			else if (subm.getEnd() < m.getStart()) {
 				i2++;
-			} else {
+			}
+			else {
 				if (strict_inclusion) {
 					if (m.getStart() <= subm.getStart() && subm.getEnd() <= m.getEnd()) {
 						result.add(subm);
 					}
-				} else {
+				}
+				else {
 					result.add(subm);
 				}
-
+				
 				i2++;
 			}
 		}
Index: tmp/org.txm.core/src/java/org/txm/objects/Match2P.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Match2P.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/objects/Match2P.java	(revision 3061)
@@ -6,8 +6,10 @@
  * @author mdecorde
  *
  */
-public class Match2P extends  Match {
+public class Match2P extends Match {
+	
 	protected int start;
+	
 	protected int end;
 	
 	public Match2P(int start, int end) {
@@ -19,27 +21,27 @@
 	public int getStart() {
 		return start;
 	}
-
+	
 	@Override
 	public int getEnd() {
 		return end;
 	}
-
+	
 	@Override
 	public int getTarget() {
 		return -1;
 	}
-
+	
 	@Override
 	public void setEnd(int p) {
 		end = p;
 	}
-
+	
 	@Override
 	public void setStart(int p) {
 		start = p;
 	}
-
+	
 	@Override
-	public void setTarget(int p) {	}
+	public void setTarget(int p) {}
 }
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 3060)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 3061)
@@ -881,6 +881,10 @@
 					tmp.setTextContent(this.getTokenizerParameter("regElision", ""));
 					tokenizerElement.appendChild(tmp);
 					
+					for (EditionDefinition ed2 : this.getEditionDefinitions()) {
+						if ("default".equals(ed2.getName())) continue; // "default" is already declared
+						bp.addEditionDefinition(corpusElem, ed2.getName(), "html", this.getImportModuleName());
+					}
 					EditionDefinition ed = this.getEditionDefinition("default");
 					bp.setPageBreakElement(ed.getPageElement());
 					bp.setWordsPerPage(ed.getWordsPerPage());
@@ -888,7 +892,6 @@
 					bp.setTextualPlans(this.getTextualPlan("OutSideTextTagsAndKeepContent"), this.getTextualPlan("Note"), this.getTextualPlan("OutSideTextTags"), this.getTextualPlan("MileStones"));
 					bp.setWordElement(this.getTokenizerWordElement());
 					
-					
 					for (Text t : this.getTexts()) {
 						Element elementT = bp.addText(corpusElem, t.getName(), t.getSource());
 						for (Edition e : t.getEditions()) {
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java	(revision 3060)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java	(revision 3061)
@@ -1407,6 +1407,7 @@
 				connection.eval("setwd(\"" + userdir.getAbsolutePath().replace("\\", "/") + "\")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			}
 			
+			// set the libraries directory to install new R packages
 			File RLibrariesWorkspaceDirectory = new File(userdir, "libraries");
 			RLibrariesWorkspaceDirectory.mkdir();
 			if (!RLibrariesWorkspaceDirectory.exists()) {
@@ -1421,6 +1422,13 @@
 				rPackagesPath = rPackagesPath.replace("\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$
 			}
 			
+			// set the default R repository
+			String repos = RPreferences.getInstance().getString(RPreferences.DEFAULT_REPOS);
+			if (repos.length() > 0) {
+				Log.fine("Set the 'repos' R option to " + repos);
+				connection.eval("options(repos=\"" + repos + "\")");//$NON-NLS-1$ //$NON-NLS-2$
+			}
+			
 			// set proxy configuration using detected system proxy if exists
 			SystemProxyDetector conf = new SystemProxyDetector();
 			this.initializeRWorkspaceConnectionConfiguration(conf);
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java	(revision 3060)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java	(revision 3061)
@@ -70,7 +70,9 @@
 	 */
 	public static final String SHOW_EVAL_LOGS = "show_eval_logs"; //$NON-NLS-1$
 	
+	public static final String DEFAULT_REPOS = "default_repos";
 	
+	
 	/**
 	 * Gets the instance.
 	 * 
@@ -165,6 +167,7 @@
 			return;
 		}
 		
+		preferences.put(DEFAULT_REPOS, "https://cloud.r-project.org");
 		preferences.put(PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
 		preferences.putBoolean(IS_MANDATORY, false);
 		preferences.put(SERVER_ADDRESS, "127.0.0.1");
Index: tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginesManager.java
===================================================================
--- tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginesManager.java	(revision 3060)
+++ tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginesManager.java	(revision 3061)
@@ -10,12 +10,15 @@
 
 /**
  * Search engines manager.
+ * 
  * @author mdecorde
  *
  */
-//FIXME: useless class, the type and priority/order should be defined in org.txm.core.engines.EnginesManager extension point
+// FIXME: useless class, the type and priority/order should be defined in org.txm.core.engines.EnginesManager extension point
 public class SearchEnginesManager extends EnginesManager<SearchEngine> {
-
+	
+	private static final long serialVersionUID = 8476457980915443357L;
+	
 	/**
 	 * 
 	 * @return
@@ -23,7 +26,7 @@
 	public static SearchEngine getCQPSearchEngine() {
 		return (SearchEngine) Toolbox.getEngineManager(EngineType.SEARCH).getEngine("CQP"); //$NON-NLS-1$
 	}
-
+	
 	/**
 	 * 
 	 * @return
@@ -39,19 +42,19 @@
 	public static SearchEngine getSearchEngine(String name) {
 		return (SearchEngine) Toolbox.getEngineManager(EngineType.SEARCH).getEngine(name);
 	}
-
+	
 	@Override
 	public boolean fetchEngines() {
 		return this.fetchEngines(SearchEngine.EXTENSION_POINT_ID);
 	}
-
+	
 	@Override
 	public EngineType getEnginesType() {
 		return EngineType.SEARCH;
 	}
-
+	
 	public static List<SearchEngine> getAvailableEngines(CorpusBuild corpus) {
-		List<SearchEngine> availables = new ArrayList<SearchEngine>();
+		List<SearchEngine> availables = new ArrayList<>();
 		SearchEnginesManager em = (SearchEnginesManager) Toolbox.getEngineManager(EngineType.SEARCH);
 		for (String name : em.getEngines().keySet()) {
 			SearchEngine engine = em.getEngine(name);
Index: tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginePreferences.java
===================================================================
--- tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginePreferences.java	(revision 0)
+++ tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginePreferences.java	(revision 3061)
@@ -0,0 +1,41 @@
+package org.txm.searchengine.core;
+
+import org.osgi.service.prefs.Preferences;
+import org.txm.core.preferences.TXMPreferences;
+
+
+public class SearchEnginePreferences extends TXMPreferences {
+	
+	/**
+	 * contains the last bundle version setting the TreeTagger models directory
+	 */
+	public static final String DEFAULT_SEARCH_ENGINE = "default_search_engine"; //$NON-NLS-1$
+	
+	/**
+	 * if set, the available search engines are shown in TXM interfaces
+	 */
+	public static final String SHOW_SEARCH_ENGINES = "show_search_engines"; //$NON-NLS-1$
+	
+	/**
+	 * Gets the instance.
+	 * 
+	 * @return the instance
+	 */
+	public static TXMPreferences getInstance() {
+		if (!TXMPreferences.instances.containsKey(SearchEnginePreferences.class)) {
+			new SearchEnginePreferences();
+		}
+		return TXMPreferences.instances.get(SearchEnginePreferences.class);
+	}
+	
+	@Override
+	public void initializeDefaultPreferences() {
+		super.initializeDefaultPreferences();
+		
+		// Default preferences if no org.txm.udpipe.core fragment is found
+		Preferences preferences = this.getDefaultPreferencesNode();
+		
+		preferences.put(DEFAULT_SEARCH_ENGINE, "CQP");
+		preferences.putBoolean(SHOW_SEARCH_ENGINES, false);
+	}
+}

Property changes on: tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEnginePreferences.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.searchengine.core/plugin.xml
===================================================================
--- tmp/org.txm.searchengine.core/plugin.xml	(revision 3060)
+++ tmp/org.txm.searchengine.core/plugin.xml	(revision 3061)
@@ -10,5 +10,11 @@
             name="org.txm.searchengine.core.SearchEngines">
       </EngineManager>
    </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.searchengine.core.SearchEnginePreferences">
+      </initializer>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.searchengine.cqp.rcp/plugin.xml
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3060)
+++ tmp/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3061)
@@ -58,7 +58,7 @@
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
-            category="org.txm.rcp.preferences.AdvancePreferencePage"
+            category="org.txm.searchengine.rcp.preferences.SearchEnginePreferencesPage"
             class="org.txm.searchengine.cqp.rcp.preferences.CQPPreferencePage"
             id="org.txm.searchengine.cqp.rcp.preferences.CQPPreferencePage"
             name="CQP">
Index: tmp/org.txm.searchengine.cqp.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/META-INF/MANIFEST.MF	(revision 3060)
+++ tmp/org.txm.searchengine.cqp.rcp/META-INF/MANIFEST.MF	(revision 3061)
@@ -8,9 +8,9 @@
 Bundle-SymbolicName: org.txm.searchengine.cqp.rcp;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: %Bundle-Name
-Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexpor
- t,org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=re
- export
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
+ org.txm.searchengine.rcp;bundle-version="1.0.0";visibility:=reexport
 Bundle-ManifestVersion: 2
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.java
===================================================================
--- tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.java	(revision 3060)
+++ tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/TokenizerClasses.java	(revision 3061)
@@ -30,6 +30,7 @@
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
+import java.util.Locale;
 import java.util.regex.Pattern;
 
 import javax.xml.parsers.ParserConfigurationException;
@@ -48,104 +49,133 @@
  */
 public class TokenizerClasses {
 	
+	public String lang;
+	
+	public TokenizerClasses(String lang) {
+		if (lang != null) {
+			this.lang = lang;
+		}
+		else {
+			this.lang = Locale.getDefault().getCountry();
+		}
+		reset();
+	}
+	
+	public TokenizerClasses() {
+		this(Locale.getDefault().getCountry());
+	}
+	
+	/**
+	 * Helper
+	 * 
+	 * @param projectScope
+	 * @return
+	 */
+	public static TokenizerClasses newTokenizerClasses(ProjectScope projectScope, String lang) {
+		TokenizerClasses tc = new TokenizerClasses();
+		tc.loadFromProject(projectScope);
+		tc.lang = lang;
+		return tc;
+	}
+	
 	//// ROOTS ? ////
-	public static boolean debug = false;
+	public boolean debug = false;
 	
 	/** The tag_all. */
-	public static String tag_all = null;
+	public String tag_all = null;
 	
 	/** The Weblex enclitics. */
-	public static String enclitics = null;
+	public String enclitics = null;
 	
-	public static String encliticsFR = null;
+	public String encliticsFR = null;
 	
 	/** The TT enclitics. */
-	public static String FClitic_en = null;
+	public String FClitic_en = null;
 	
-	public static String PClitic_fr = null;
+	public String PClitic_fr = null;
 	
-	public static String FClitic_fr = null;
+	public String FClitic_fr = null;
 	
-	public static String PClitic_it = null;
+	public String PClitic_it = null;
 	
-	public static String FClitic_gl = null;
+	public String FClitic_gl = null;
 	
 	/** The div_tags. */
-	public static String div_tags = null;
+	public String div_tags = null;
 	
 	/** The q_tags. */
-	public static String q_tags = null;
+	public String q_tags = null;
 	
 	/** The extraword_tags. */
-	public static String extraword1_tags = null;
+	public String extraword1_tags = null;
 	
 	/** The corr_tags_no_seg. */
-	public static String corr_tags_no_seg = null;
+	public String corr_tags_no_seg = null;
 	
 	/** The word_tags. */
-	public static String word_tags = null;
+	public String word_tags = null;
 	
 	/** the element to create when a word is created */
-	public static String word_element_to_create = null;
+	public String word_element_to_create = null;
 	
 	/** The intraword_tags. */
-	public static String intraword_tags = null;
+	public String intraword_tags = null;
 	
 	/** The punct_quotes. */
-	public static String punct_quotes = null;
+	public String punct_quotes = null;
 	
 	/** The punct_strong1. */
-	public static String punct_strong1 = null;
+	public String punct_strong1 = null;
 	
 	/** The punct_strong2. */
-	public static String punct_strong2 = null;
+	public String punct_strong2 = null;
 	
 	/** The punct_paren_open1. */
-	public static String punct_paren_open1 = null;
+	public String punct_paren_open1 = null;
 	
 	/** The punct_paren_open2. */
-	public static String punct_paren_open2 = null;
+	public String punct_paren_open2 = null;
 	
 	/** The punct_paren_close1. */
-	public static String punct_paren_close1 = null;
+	public String punct_paren_close1 = null;
 	
 	/** The punct_paren_close2. */
-	public static String punct_paren_close2 = null;
+	public String punct_paren_close2 = null;
 	
 	/** The punct_weak. */
-	public static String punct_weak = null;
+	public String punct_weak = null;
 	
-	public static String entity = null;
+	public String entity = null;
 	
-	public static String seg_tags = null;
+	public String seg_tags = null;
 	
 	//// COMBINAISONS ////
 	
 	/** The corr_tags. */
-	public static String corr_tags = null;
+	public String corr_tags = null;
 	
 	/** The extraword_tags. */
-	public static String extraword_tags = null;
+	public String extraword_tags = null;
 	
 	/** The punct_strong. */
-	public static String punct_strong = null;
+	public String punct_strong = null;
 	
 	/** The punct_paren_open. */
-	public static String punct_paren_open = null;
+	public String punct_paren_open = null;
 	
 	/** The punct_paren_close. */
-	public static String punct_paren_close = null;
+	public String punct_paren_close = null;
 	
 	/** The punct_paren. */
-	public static String punct_paren = null;
+	public String punct_paren = null;
 	
 	/** The punct_all. */
-	public static String punct_all = null;
+	public String punct_all = null;
 	
 	/** The word_chars. */
-	public static String word_chars = null;
+	public String word_chars = null;
 	
-	public static TTest[] tests = {
+	public TTest[] tests = {
 			// new TTest(/\A(.*-)(je|m[eo]i|tu|t[eo]i|lui|luy|ilz|ils?|no?u?s|vo?u?s|on|leurs|ce|ci|là|elles?)(.*)\Z/),
 			// new TTest(/\A(.*)(-)()\Z/, "pon"),
 			// new TTest(/\A(.*)(Bande dessinée|eau de vie|machine à écrire|Moyen Âge|petit pois|poule d'eau|Avoir l'air|se rendre compte|faire semblant|prendre froid|s'en aller|Comme il faut|bon
@@ -173,16 +203,12 @@
 			// new TTest(/\A(.*)(\p{Ps}|\p{Pe}|\p{Pi}|\p{Pf}|\p{Po}|\p{S})(.*)\Z/, "pon")
 	};
 			
-	public static String whitespaces = null;
+	public String whitespaces = null;
 	
-	public static String regElision = null;
+	public String regElision = null;
 	
-	public static String regPunct = null;
+	public String regPunct = null;
 	
-	static {
-		reset(); // Initialize static fields
-	}
-	
 	// punct_strong1 = ".!?";
 	// punct_strong2 = "\\.\\.|\\.\\.\\.|…|\\|";
 	// punct_strong = "[$punct_strong1]|$punct_strong2";
@@ -197,7 +223,7 @@
 	// punct_all = "$punct_strong|$punct_paren|[$punct_weak]";
 	// word_chars = "[^ $punct_strong1$punct_paren_open1$punct_paren_close1$punct_weak]|&[^;]+;";
 	
-	public static void reset() {
+	public void reset() {
 		tag_all = "<[A-Za-z][^>]+>";
 		
 		div_tags = "TEI|text|front|body|div|div1|div2|div3|div4|div5|div6|back|head|trailer|p|ab|sp|speaker|list|notice|bibl|opener|dateline";
@@ -235,7 +261,7 @@
 		recombine();
 	}
 	
-	public static void recombine() {
+	public void recombine() {
 		corr_tags = "" + corr_tags_no_seg + "|" + seg_tags + "";
 		extraword_tags = "" + div_tags + "|" + q_tags + "|" + extraword1_tags + "";
 		punct_strong = "[" + punct_strong1 + "]|" + punct_strong2 + "";
@@ -254,7 +280,7 @@
 	 * @return the java.lang. object
 	 */
 	@Deprecated
-	public static void toDom(Document doc, Node parent) {
+	public void toDom(Document doc, Node parent) {
 		Element tokenizer = doc.createElement("tokenizer");
 		tokenizer.setAttribute("onlyThoseTests", "false");
 		parent.appendChild(tokenizer);
@@ -395,7 +421,7 @@
 	/**
 	 * Dump.
 	 */
-	public static void dump() {
+	public void dump() {
 		System.out.println("BRUT");
 		System.out.println("tag_all = " + tag_all + "");
 		System.out.println("enclitics = " + enclitics + "");
@@ -435,7 +461,7 @@
 		}
 	}
 	
-	public static boolean isValid() {
+	public boolean isValid() {
 		try {
 			Pattern.compile(tag_all);
 		}
@@ -699,7 +725,7 @@
 	 * @return
 	 */
 	@Deprecated
-	public static boolean loadFromNode(Element tokenizerElement) {
+	public boolean loadFromNode(Element tokenizerElement) {
 		// load params
 		String tmp_strong_punct = null;
 		NodeList params = tokenizerElement.getElementsByTagName("param");
@@ -811,7 +837,7 @@
 		// System.out.println("OK? "+ TokenizerClasses.loadFromNode((Element) tokenizer));
 	}
 	
-	public static boolean loadFromProject(ProjectScope projectScope) {
+	public boolean loadFromProject(ProjectScope projectScope) {
 		// load params
 		IEclipsePreferences params = projectScope.getNode("Tokenizer");
 		
Index: tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/SimpleStringTokenizer.groovy
===================================================================
--- tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/SimpleStringTokenizer.groovy	(revision 3060)
+++ tmp/org.txm.tokenizer.core/src/org/txm/tokenizer/SimpleStringTokenizer.groovy	(revision 3061)
@@ -31,13 +31,13 @@
 public class SimpleStringTokenizer implements StringTokenizer {
 	
 	/** The punct_strong. */
-	String punct_strong = TokenizerClasses.punct_strong;
+	String punct_strong;
 	
 	/** The punct_all. */
-	String punct_all = TokenizerClasses.punct_all;
+	String punct_all;
 	
 	/** The word_chars. */
-	String word_chars = TokenizerClasses.word_chars;
+	String word_chars;
 	
 	String fclitics = null; // default behavior don't manage clitics
 	
@@ -66,36 +66,48 @@
 	
 	Pattern regSplitWhiteSpaces;
 	
+	TokenizerClasses tc;
+	
 	/**
 	 * Instantiates a new simple string tokenizer.
 	 *
 	 * @param lang
 	 */
 	public SimpleStringTokenizer(String lang) {
-		this.lang = lang;
+		this(new TokenizerClasses(lang))
+	}
+	
+	/**
+	 * Instantiates a new simple string tokenizer.
+	 *
+	 * @param lang
+	 */
+	public SimpleStringTokenizer(TokenizerClasses tc) {
+		this.tc = tc
+		this.lang = tc.lang;
 		if (lang != null)
 			if (lang.startsWith("en")) {
-				fclitics = TokenizerClasses.FClitic_en;
+				fclitics = tc.FClitic_en;
 			} else if (lang.startsWith("fr")) {
-				fclitics = TokenizerClasses.FClitic_fr;
-				pclitics = TokenizerClasses.PClitic_fr;
+				fclitics = tc.FClitic_fr;
+				pclitics = tc.PClitic_fr;
 			} else if (lang.startsWith("gl")) {
-				fclitics = TokenizerClasses.FClitic_gl;
+				fclitics = tc.FClitic_gl;
 			} else if (lang.startsWith("it")) {
-				pclitics = TokenizerClasses.PClitic_it;
+				pclitics = tc.PClitic_it;
 			}
 		
-		punct_strong = TokenizerClasses.punct_strong;
-		punct_all = TokenizerClasses.punct_all;
-		word_chars = TokenizerClasses.word_chars;
+		punct_strong = tc.punct_strong;
+		punct_all = tc.punct_all;
+		word_chars = tc.word_chars;
 		
-		String strRegElision = TokenizerClasses.regElision;
+		String strRegElision = tc.regElision;
 		if (strRegElision != null && strRegElision.length() > 0) {
 			regElision = ~/^([\p{L}-]++${strRegElision}[\p{L}-]++)(.*)$/ // the test must start with the start of string  ^
 		}
 		reg3pts = ~/^(.*?)(\.\.\.)(.*)$/
 		
-		String strRegPunct = TokenizerClasses.regPunct;
+		String strRegPunct = tc.regPunct;
 		if (strRegPunct != null && strRegPunct.length() > 0) {
 			regPunct = ~/^(.*?)($strRegPunct)(.*)$/
 		}
@@ -105,12 +117,12 @@
 		if (pclitics != null && pclitics.length() > 0)
 			regPClitics = /^($pclitics)(.*)/ // the test must start with the start of string  ^
 		
-		if (TokenizerClasses.whitespaces != null && TokenizerClasses.whitespaces.length() > 0) {
-			regWhitespaces = ~TokenizerClasses.whitespaces;
+		if (tc.whitespaces != null && tc.whitespaces.length() > 0) {
+			regWhitespaces = ~tc.whitespaces;
 		}
 		
-		if (TokenizerClasses.whitespaces != null && TokenizerClasses.whitespaces.length() > 0) {
-			regSplitWhiteSpaces = Pattern.compile(TokenizerClasses.whitespaces);
+		if (tc.whitespaces != null && tc.whitespaces.length() > 0) {
+			regSplitWhiteSpaces = Pattern.compile(tc.whitespaces);
 		}
 	}
 	
@@ -160,7 +172,7 @@
 	public String standardChecks(ArrayList<String> result, String s) {
 		Matcher m;
 		
-		for (TTest test : TokenizerClasses.tests) {
+		for (TTest test : tc.tests) {
 			if ((m = s =~ test.regex)) {
 				if (DEBUG) {println "test : "+test.regex}
 				if (test.before > 0) {
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java	(revision 3060)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/ComputeConcordance.java	(revision 3061)
@@ -46,23 +46,23 @@
  * @author sjacquot
  */
 public class ComputeConcordance extends BaseAbstractHandler {
-
+	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		
-		if(!this.checkCorpusEngine()) {
+		if (!this.checkCorpusEngine()) {
 			return false;
 		}
-
+		
 		Concordance concordance = null;
-
+		
 		// From link: creating from parameter node
 		String parametersNodePath = event.getParameter(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
 		if (parametersNodePath != null && !parametersNodePath.isEmpty()) {
 			concordance = new Concordance(parametersNodePath);
 		}
 		// From view result node
-		else	{
+		else {
 			Object selection = this.getCorporaViewSelectedObject(event);
 			
 			// Creating from Corpus
@@ -72,7 +72,7 @@
 			}
 			// Reopening existing result
 			else if (selection instanceof Concordance) {
-				concordance = (Concordance)selection;
+				concordance = (Concordance) selection;
 			}
 			// Error
 			else {
@@ -88,4 +88,4 @@
 	public static TXMEditor openEditor(Concordance concordance) {
 		return TXMEditor.openEditor(concordance, ConcordanceEditor.class.getName());
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/SendConcordanceToTIGERSearch.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/SendConcordanceToTIGERSearch.java	(revision 0)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/SendConcordanceToTIGERSearch.java	(revision 3061)
@@ -0,0 +1,141 @@
+// 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.concordance.rcp.handlers;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.concordance.core.functions.Concordance;
+import org.txm.concordance.core.functions.Line;
+import org.txm.core.results.TXMResult;
+import org.txm.links.rcp.handlers.SendSelectionToQueryable;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.Selection;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+
+/**
+ * Sends the selected lines of a concordance to compute a TIGERSearch command.
+ * 
+ * @author mdecorde
+ * 
+ */
+public class SendConcordanceToTIGERSearch extends SendSelectionToQueryable {
+	
+	public Concordance getConcordance(ExecutionEvent event, ISelection selection) {
+		if (selection instanceof StructuredSelection) {
+			StructuredSelection sselection = (StructuredSelection) selection;
+			List<?> list = sselection.toList();
+			if (list.size() == 0) return null;
+			Object o = list.get(0);
+			if (!(o instanceof org.txm.concordance.core.functions.Line)) return null;
+			Line line = (Line) o;
+			return line.getConcordance();
+		}
+		else {
+			return null;
+		}
+	}
+	
+	@Override
+	public String createQuery(ExecutionEvent event, ISelection selection) {
+		Concordance concordance = getConcordance(event, selection);
+		if (concordance == null) return "";
+		
+		StructuredSelection sselection = (StructuredSelection) selection;
+		List<?> list = sselection.toList();
+		IQuery query = concordance.getQuery();
+		String engine = query.getSearchEngine().getName();
+		if ("TIGER".equals(engine)) {
+			return query.getQueryString(); // TODO the command must also set the current shown graph
+		}
+		else { // use the pivot word IDs
+			StringBuilder buffer = new StringBuilder();
+			buffer.append("[editionId=/");
+			for (int i = 0; i < list.size(); i++) {
+				Line line = (Line) list.get(i);
+				if (line.getMatch().size() == 0) continue; // avoid NPE later
+				
+				if (i > 0) buffer.append("|");
+				buffer.append(line.getKeywordIds().get(0));
+			}
+			buffer.append("/]");
+			return buffer.toString();
+		}
+	}
+	
+	@Override
+	public Integer getIndexResult(ExecutionEvent event, ISelection selection) {
+		Concordance concordance = getConcordance(event, selection);
+		if (concordance == null) return null;
+		
+		IQuery query = concordance.getQuery();
+		String engine = query.getSearchEngine().getName();
+		if ("TIGER".equals(engine)) {
+			return concordance.getTopIndex(); // TODO the command must also set the current shown graph
+		}
+		else {
+			return null;
+		}
+	}
+	
+	@Override
+	public Integer getSubIndexResult(ExecutionEvent event, ISelection selection) {
+		Concordance concordance = getConcordance(event, selection);
+		if (concordance == null) return 0;
+		
+		IQuery query = concordance.getQuery();
+		String engine = query.getSearchEngine().getName();
+		if ("TIGER".equals(engine)) {
+			return null; // TODO the command must also set the current shown graph
+		}
+		else {
+			return null;
+		}
+	}
+	
+	@Override
+	public String createQueries(ExecutionEvent event, ISelection selection) {
+		return null;
+	}
+	
+	@Override
+	public TXMResult getResultParent(ExecutionEvent event) {
+		@SuppressWarnings("unchecked")
+		TXMEditor<Concordance> editor = (TXMEditor<Concordance>) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
+		
+		TXMResult result = editor.getResult();
+		Concordance concordance = (Concordance) result;
+		CQPCorpus corpus = CQPCorpus.getFirstParentCorpus(concordance);
+		
+		return corpus;
+	}
+}

Property changes on: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/handlers/SendConcordanceToTIGERSearch.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3060)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3061)
@@ -60,8 +60,6 @@
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
@@ -72,7 +70,6 @@
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
@@ -83,7 +80,6 @@
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IWorkbenchPartSite;
@@ -95,9 +91,9 @@
 import org.txm.concordance.core.functions.comparators.LexicographicLeftContextComparator;
 import org.txm.concordance.core.functions.comparators.LexicographicRightContextComparator;
 import org.txm.concordance.core.functions.comparators.LineComparator;
-import org.txm.concordance.core.functions.comparators.WordPositionComparator;
 import org.txm.concordance.core.functions.comparators.PropertiesReferenceComparator;
 import org.txm.concordance.core.functions.comparators.ReverseComparator;
+import org.txm.concordance.core.functions.comparators.WordPositionComparator;
 import org.txm.concordance.core.preferences.ConcordancePreferences;
 import org.txm.concordance.rcp.actions.DefineSortReferencePattern;
 import org.txm.concordance.rcp.actions.DefineViewReferencePattern;
@@ -111,7 +107,6 @@
 import org.txm.concordance.rcp.widgets.ComplexSortSelector;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.Parameter;
-import org.txm.core.results.TXMResult;
 import org.txm.objects.Page;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.JobsTimer;
@@ -122,10 +117,8 @@
 import org.txm.rcp.editors.listeners.ComputeKeyListener;
 import org.txm.rcp.editors.listeners.ComputeSelectionListener;
 import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.rcp.preferences.RCPPreferences;
 import org.txm.rcp.swt.GLComposite;
 import org.txm.rcp.swt.widget.AssistedChoiceQueryWidget;
-import org.txm.rcp.swt.widget.AssistedQueryWidget;
 import org.txm.rcp.swt.widget.NavigationWidget;
 import org.txm.rcp.swt.widget.PropertiesSelector;
 import org.txm.rcp.swt.widget.ReferencePatternSelector;
Index: tmp/org.txm.concordance.rcp/plugin.xml
===================================================================
--- tmp/org.txm.concordance.rcp/plugin.xml	(revision 3060)
+++ tmp/org.txm.concordance.rcp/plugin.xml	(revision 3061)
@@ -31,6 +31,15 @@
             </iterate>
          </with>
       </definition>
+      <definition
+            id="ConcordanceEditorActive">
+         <with
+               variable="activePart">
+            <instanceof
+                  value="org.txm.concordance.rcp.editors.ConcordanceEditor">
+            </instanceof>
+         </with>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.ui.menus">
@@ -199,5 +208,24 @@
             name="%editor.name">
       </editor>
    </extension>
+   <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="org.txm.concordance.rcp.handlers.SendConcordanceToTIGERSearch"
+            commandId="org.txm.tigersearch.commands.ComputeTIGERSearch">
+         <activeWhen>
+            <and>
+               <or>
+                  <reference
+                        definitionId="ConcordanceEditorActive">
+                  </reference>
+               </or>
+               <reference
+                     definitionId="SendSelectionContextNotActive">
+               </reference>
+            </and>
+         </activeWhen>
+      </handler>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF	(revision 3060)
+++ tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF	(revision 3061)
@@ -6,9 +6,9 @@
 Bundle-SymbolicName: org.txm.concordance.rcp;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: %Bundle-Name
-Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexpor
- t,org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexpor
- t
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0";visibility:=reexport,
+ org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.links.rcp;bundle-version="1.0.0";visibility:=reexport
 Bundle-ManifestVersion: 2
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Bundle-Vendor: Textometrie.org
Index: tmp/org.txm.rcp/icons/functions/Delete.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: tmp/org.txm.rcp/icons/functions/Search_settings.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

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

Index: tmp/org.txm.rcp/icons/functions/Search.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/AdvancedPreferencePage.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/AdvancedPreferencePage.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/AdvancedPreferencePage.java	(revision 3061)
@@ -27,12 +27,10 @@
 //
 package org.txm.rcp.preferences;
 
-import java.io.File;
 import java.util.logging.Level;
 
 import org.eclipse.jface.preference.BooleanFieldEditor;
 import org.eclipse.jface.preference.ComboFieldEditor;
-import org.eclipse.jface.preference.DirectoryFieldEditor;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -53,18 +51,19 @@
  */
 public class AdvancedPreferencePage extends TXMPreferencePage {
 	
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 	 */
 	@Override
 	protected void createFieldEditors() {
-
+		
 		// install directory
-		//addField(new DirectoryFieldEditor(TBXPreferences.INSTALL_DIR, TXMUIMessages.tXMInstallDirectory, getFieldEditorParent()));
+		// addField(new DirectoryFieldEditor(TBXPreferences.INSTALL_DIR, TXMUIMessages.tXMInstallDirectory, getFieldEditorParent()));
 		
 		// txmhome directory
-		//addField(new DirectoryFieldEditor(TBXPreferences.USER_TXM_HOME, TXMUIMessages.tXMUserDirectory, getFieldEditorParent()));
+		// addField(new DirectoryFieldEditor(TBXPreferences.USER_TXM_HOME, TXMUIMessages.tXMUserDirectory, getFieldEditorParent()));
 		
 		Group updateGroup = new Group(getFieldEditorParent(), SWT.NONE);
 		updateGroup.setText(TXMUIMessages.logs);
@@ -88,7 +87,7 @@
 		choices[7][0] = choices[7][1] = "FINEST"; //$NON-NLS-1$
 		choices[8][0] = choices[8][1] = "ALL"; //$NON-NLS-1$
 		addField(new ComboFieldEditor(TBXPreferences.LOG_LEVEL, TXMUIMessages.logLevel, choices, updateGroup));
-
+		
 		// Log timings
 		addField(new BooleanFieldEditor(TBXPreferences.SHOW_TIMINGS, TXMUIMessages.displayRuntimesInConsole, updateGroup));
 		
@@ -100,24 +99,22 @@
 		
 		// Show dialog on severe error
 		addField(new BooleanFieldEditor(RCPPreferences.SHOW_SEVERE_DIALOG, "Show a dialog box when a severe error occurs", updateGroup));
-
+		
 		// Log in file
 		addField(new BooleanFieldEditor(TBXPreferences.LOG_IN_FILE, TXMUIMessages.logInAFile, updateGroup));
 		
 		// Update level
 		String[][] choices2 = new String[4][2];
-		choices2[0][0] = choices2[0][1]= "STABLE"; //$NON-NLS-1$
+		choices2[0][0] = choices2[0][1] = "STABLE"; //$NON-NLS-1$
 		choices2[1][0] = choices2[1][1] = "BETA"; //$NON-NLS-1$
 		choices2[2][0] = choices2[2][1] = "ALPHA"; //$NON-NLS-1$
 		choices2[3][0] = choices2[3][1] = "DEV"; //$NON-NLS-1$
-		addField(new ComboFieldEditor(RCPPreferences.UPDATE_LEVEL, TXMUIMessages.updateLevel,choices2, getFieldEditorParent()));
+		addField(new ComboFieldEditor(RCPPreferences.UPDATE_LEVEL, TXMUIMessages.updateLevel, choices2, getFieldEditorParent()));
 		
-		// Expert mode
-		addField(new BooleanFieldEditor(TBXPreferences.EXPERT_USER, TXMUIMessages.advancedUserMode, getFieldEditorParent()));
-
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
 	 */
 	@Override
@@ -128,26 +125,27 @@
 			MacroExplorer.refresh();
 			CorporaView.refresh();
 			
-			//update the Logger options
+			// update the Logger options
 			Log.setLevel(Level.parse(Toolbox.getPreference(TBXPreferences.LOG_LEVEL)));
 			Log.setPrintInConsole(TBXPreferences.getInstance().getBoolean(TBXPreferences.ADD_TECH_LOGS));
-
+			
 			Log.log_stacktrace_boolean = TBXPreferences.getInstance().getBoolean(TBXPreferences.LOG_STACKTRACE);
 			
 			boolean log_in_file = TBXPreferences.getInstance().getBoolean(TBXPreferences.LOG_IN_FILE);
 			String file = Log.setPrintInFile(log_in_file);
 			
 			// update repositories
-			IHandlerService service = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
+			IHandlerService service = PlatformUI.getWorkbench().getService(IHandlerService.class);
 			service.executeCommand("org.txm.rcp.p2.plugins.FixUpdateHandler", null); //$NON-NLS-1$
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			System.err.println(NLS.bind(TXMUIMessages.failedToSavePreferencesColonP0, e));
 		}
 		return true;
 	}
-
+	
 	@Override
 	public void init(IWorkbench workbench) {
 		this.setPreferenceStore(new TXMPreferenceStore(TBXPreferences.getInstance().getPreferencesNodeQualifier()));
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/IImageKeys.java	(revision 3061)
@@ -88,6 +88,9 @@
 	/** The Constant ACTION_SEARCH. */
 	public static final String ACTION_SEARCH = "icons/functions/Search.png"; //$NON-NLS-1$
 	
+	/** The Constant ACTION_SEARCH. */
+	public static final String ACTION_SEARCH_SETTINGS = "icons/functions/Search_settings.png"; //$NON-NLS-1$
+	
 	/** The Constant ACTION_CAH. */
 	public static final String ACTION_CAH = "icons/functions/CAH.png"; //$NON-NLS-1$
 	
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/TokenizerSection.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/TokenizerSection.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/TokenizerSection.java	(revision 3061)
@@ -124,7 +124,7 @@
 		gdata.indent = 20;
 		l1.setLayoutData(gdata);
 		
-		textWhiteSpaces = toolkit.createText(sectionClient, TokenizerClasses.whitespaces, SWT.BORDER);
+		textWhiteSpaces = toolkit.createText(sectionClient, "", SWT.BORDER);
 		gdata = getLongTextGridData();
 		textWhiteSpaces.setLayoutData(gdata);
 		
@@ -134,7 +134,7 @@
 		gdata.indent = 20;
 		l2.setLayoutData(gdata);
 		
-		textPuncts = toolkit.createText(sectionClient, TokenizerClasses.regPunct, SWT.BORDER);
+		textPuncts = toolkit.createText(sectionClient, "", SWT.BORDER);
 		gdata = getLongTextGridData();
 		textPuncts.setLayoutData(gdata);
 		
@@ -144,7 +144,7 @@
 		gdata.indent = 10;
 		l4.setLayoutData(gdata);
 		
-		textElisions = toolkit.createText(sectionClient, TokenizerClasses.regElision, SWT.BORDER);
+		textElisions = toolkit.createText(sectionClient, "", SWT.BORDER);
 		gdata = getLongTextGridData();
 		textElisions.setLayoutData(gdata);
 		
@@ -154,7 +154,7 @@
 		gdata.indent = 10;
 		l3.setLayoutData(gdata);
 		
-		textPunctsStrong = toolkit.createText(sectionClient, TokenizerClasses.punct_strong, SWT.BORDER);
+		textPunctsStrong = toolkit.createText(sectionClient, "", SWT.BORDER);
 		gdata = getLongTextGridData();
 		textPunctsStrong.setLayoutData(gdata);
 		
@@ -170,11 +170,11 @@
 			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				TokenizerClasses.reset();
-				textWhiteSpaces.setText(TokenizerClasses.whitespaces);
-				textPuncts.setText(TokenizerClasses.regPunct);
-				textPunctsStrong.setText(TokenizerClasses.punct_strong);
-				textElisions.setText(TokenizerClasses.regElision);
+				TokenizerClasses tc = new TokenizerClasses(); // use default tokenizer classes
+				textWhiteSpaces.setText(tc.whitespaces);
+				textPuncts.setText(tc.regPunct);
+				textPunctsStrong.setText(tc.punct_strong);
+				textElisions.setText(tc.regElision);
 			}
 		});
 		
@@ -314,11 +314,13 @@
 		if (this.section.isDisposed()) return;
 		if (project == null) return;
 		
+		TokenizerClasses tc = new TokenizerClasses();
+		tc.loadFromProject(project.getPreferencesScope());
 		
-		textWhiteSpaces.setText(project.getTokenizerParameter("whitespaces", TokenizerClasses.whitespaces)); //$NON-NLS-1$
-		textPuncts.setText(project.getTokenizerParameter("regPunct", TokenizerClasses.regPunct)); //$NON-NLS-1$
-		textPunctsStrong.setText(project.getTokenizerParameter("punct_strong", TokenizerClasses.punct_strong)); //$NON-NLS-1$
-		textElisions.setText(project.getTokenizerParameter("regElision", TokenizerClasses.regElision)); //$NON-NLS-1$
+		textWhiteSpaces.setText(project.getTokenizerParameter("whitespaces", tc.whitespaces)); //$NON-NLS-1$
+		textPuncts.setText(project.getTokenizerParameter("regPunct", tc.regPunct)); //$NON-NLS-1$
+		textPunctsStrong.setText(project.getTokenizerParameter("punct_strong", tc.punct_strong)); //$NON-NLS-1$
+		textElisions.setText(project.getTokenizerParameter("regElision", tc.regElision)); //$NON-NLS-1$
 		
 		String wtagElement = project.getTokenizerWordElement();
 		wordElementText.setText(wtagElement);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3061)
@@ -513,10 +513,9 @@
 		}
 		catch (Throwable e) {
 			Log.severe(TXMCoreMessages.bind("TXMEditor.createPartControl(): can not create the editor for result {0}.", this.getResult())); //$NON-NLS-1$
-			e.printStackTrace();
+			Log.printStackTrace(e);
 			createPartControlDoneSucessfully = false;
 		}
-		
 	}
 	
 	@Override
@@ -1102,6 +1101,9 @@
 			}
 			else if (tmpEditor instanceof TXMMultiPageEditor) {
 				editor = (TXMEditor<? extends TXMResult>) ((TXMMultiPageEditor) tmpEditor).getMainEditorPart();
+				
+				// If result specify a opening Area use it
+				
 			}
 			else {
 				Log.severe(NLS.bind("Failed to open editor {0}.", editorId)); // $NON-NLS-1$
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryWidget.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryWidget.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryWidget.java	(revision 3061)
@@ -47,12 +47,12 @@
  * 
  */
 public class QueryWidget extends Combo {
-
+	
 	SearchEngine se;
 	
 	/** The history. */
-	private static Deque<String> history = new LinkedList<String>();
-
+	private static Deque<String> history = new LinkedList<>();
+	
 	/**
 	 * Instantiates a new query widget.
 	 *
@@ -68,11 +68,16 @@
 	public QueryWidget(Composite composite, int style) {
 		this(composite, style, SearchEnginesManager.getCQPSearchEngine());
 	}
-
+	
 	public void setSearchEngine(SearchEngine se) {
 		this.se = se;
 	}
-
+	
+	
+	public SearchEngine getSearchEngine() {
+		return this.se;
+	}
+	
 	/**
 	 * Gets the CQP query string inferred from the user input.
 	 *
@@ -82,27 +87,30 @@
 		String rawQuery;
 		if (getSelectionIndex() < 0) {
 			rawQuery = getText();
-		} else {
+		}
+		else {
 			rawQuery = this.getItem(this.getSelectionIndex());
 		}
 		return se.newQuery().setQuery(rawQuery).getQueryString();
 	}
-
+	
 	/**
 	 * Memorize.
 	 */
 	public void memorize() {
 		String inputString;
-		if (getSelectionIndex() == -1)
+		if (getSelectionIndex() == -1) {
 			inputString = getText();
-		else
+		}
+		else {
 			inputString = getItems()[getSelectionIndex()];
+		}
 		history.remove(inputString);
 		history.addFirst(inputString);
 		this.setItems(history.toArray(new String[history.size()]));
 		this.setText(this.getItem(0));
 	}
-
+	
 	/**
 	 * Memorize.
 	 *
@@ -116,24 +124,27 @@
 		this.setItems(history.toArray(new String[history.size()]));
 		this.setText(this.getItem(0));
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.swt.widgets.Combo#checkSubclass()
 	 */
 	@Override
 	protected void checkSubclass() {
+		
 	}
-
+	
 	/**
 	 * Gets the query.
 	 *
 	 * @return the query
 	 */
 	public IQuery getQuery() {
-		if (!this.getQueryString().isEmpty())	{
-			return se.newQuery().setQuery(this.getQueryString());	
-		} else {
+		if (!this.getQueryString().isEmpty()) {
+			return se.newQuery().setQuery(this.getQueryString());
+		}
+		else {
 			return null;
 		}
-	};
+	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedQueryWidget.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedQueryWidget.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedQueryWidget.java	(revision 3061)
@@ -45,6 +45,7 @@
 import org.txm.searchengine.core.SearchEngine;
 import org.txm.searchengine.core.SearchEnginesManager;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
+
 // TODO: Auto-generated Javadoc
 /**
  * the QueryWidget plus the button to open the QueryAssisDialog @ author
@@ -59,11 +60,11 @@
 	
 	/** The querywidget. */
 	protected QueryWidget querywidget;
-
+	
 	private QueryAssistDialog d;
-
+	
 	private KeyListener listener;
-
+	
 	/**
 	 * Instantiates a new assisted query widget.
 	 *
@@ -73,8 +74,8 @@
 	 */
 	public AssistedQueryWidget(Composite parent, int style, final CQPCorpus corpus, SearchEngine se) {
 		super(parent, SWT.NONE);
-		this.setLayout(GLComposite.createDefaultLayout(2));
-
+		this.setLayout(GLComposite.createDefaultLayout(5));
+		
 		this.se = se;
 		
 		magicstick = new Button(this, SWT.PUSH);
@@ -82,6 +83,7 @@
 		magicstick.setImage(IImageKeys.getImage(IImageKeys.ACTION_ASSISTQUERY));
 		magicstick.setToolTipText(TXMUIMessages.openTheQueryAssistant);
 		magicstick.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				d = new QueryAssistDialog(e.display.getActiveShell(), corpus);
@@ -94,11 +96,11 @@
 					listener.keyPressed(ke);
 				}
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		querywidget = new QueryWidget(this, style, se);
 		querywidget.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
 	}
@@ -106,12 +108,14 @@
 	public AssistedQueryWidget(Composite parent, int style, CQPCorpus corpus) {
 		this(parent, style, corpus, SearchEnginesManager.getCQPSearchEngine());
 	}
-
+	
+	@Override
 	public boolean setFocus() {
 		return this.querywidget.setFocus();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.swt.widgets.Control#addKeyListener(org.eclipse.swt.events.KeyListener)
 	 */
 	@Override
@@ -120,7 +124,7 @@
 		if (querywidget != null)
 			this.querywidget.addKeyListener(listener);
 	}
-
+	
 	/**
 	 * Gets the query string.
 	 *
@@ -138,14 +142,14 @@
 	public String getRawString() {
 		return querywidget.getText();
 	}
-
+	
 	/**
 	 * Memorize.
 	 */
 	public void memorize() {
 		querywidget.memorize();
 	}
-
+	
 	/**
 	 * Memorize.
 	 *
@@ -154,11 +158,11 @@
 	public void memorize(String query) {
 		querywidget.memorize(query);
 	}
-
+	
 	/**
 	 * Clears the query test.
 	 */
-	public void clearQuery()	{
+	public void clearQuery() {
 		this.querywidget.setText(""); //$NON-NLS-1$
 	}
 	
@@ -169,24 +173,24 @@
 	 */
 	public void setText(String query) {
 		
-//		if(query.isEmpty())	{
-//			query = ""; //$NON-NLS-1$
-//		}
+		// if(query.isEmpty()) {
+		// query = ""; //$NON-NLS-1$
+		// }
 		
-//		// fix the query
-//		query = query.replaceAll("^\"(.*)\"$","$1"); //$NON-NLS-1$
+		// // fix the query
+		// query = query.replaceAll("^\"(.*)\"$","$1"); //$NON-NLS-1$
 		
 		querywidget.setText(query);
 	}
-
+	
 	public IQuery getQuery() {
 		return this.querywidget.getQuery();
 	}
-
+	
 	/**
 	 * @return the querywidget
 	 */
 	public QueryWidget getQueryWidget() {
 		return querywidget;
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/NewNavigationWidget.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/NewNavigationWidget.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/NewNavigationWidget.java	(revision 3061)
@@ -50,28 +50,30 @@
  * @author sjacquot
  */
 public class NewNavigationWidget extends Composite {
-
+	
 	/** The info line. */
 	Label infoLine;
+	
 	Text currentPositionText;
-
+	
 	/** The first. */
 	Button first;
-
+	
 	/** The last. */
 	Button last;
-
+	
 	/** The next. */
 	Button next;
-
+	
 	/** The prev. */
 	Button prev;
-
+	
 	/** The n line per page. */
 	int nLinePerPage;
+	
 	private Color whiteColor;
-
 	
+	
 	/**
 	 * Current position;
 	 */
@@ -106,11 +108,11 @@
 		this.currentPosition = 0;
 		
 		this.setLayout(new GridLayout(6, false));
-
+		
 		// | [|<] [<] [info] [>] [>|] |
-
+		
 		// [|<]
-		first = new Button(this, SWT.PUSH);
+		first = new Button(this, SWT.FLAT | SWT.PUSH);
 		first.setToolTipText("|<"); //$NON-NLS-1$
 		first.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
 		first.addSelectionListener(new SelectionListener() {
@@ -127,9 +129,9 @@
 				
 			}
 		});
-
+		
 		// [<]
-		prev = new Button(this, SWT.PUSH);
+		prev = new Button(this, SWT.FLAT | SWT.PUSH);
 		prev.setToolTipText("<"); //$NON-NLS-1$
 		prev.addSelectionListener(new SelectionListener() {
 			
@@ -145,8 +147,8 @@
 				
 			}
 		});
-
 		
+		
 		// [current]
 		currentPositionText = new Text(this, SWT.BORDER);
 		GridData currentPositionLayoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER, SWT.CENTER, true, false);
@@ -169,18 +171,18 @@
 				}
 			}
 		});
-
-
+		
+		
 		// [info]
 		infoLine = new Label(this, SWT.NONE);
 		GridData layoutData = new GridData(GridData.VERTICAL_ALIGN_CENTER, SWT.CENTER, true, false);
 		infoLine.setLayoutData(layoutData);
-
+		
 		whiteColor = currentPositionText.getBackground();
 		currentPositionText.setBackground(infoLine.getBackground());
 		
 		// [>]
-		next = new Button(this, SWT.PUSH);
+		next = new Button(this, SWT.FLAT | SWT.PUSH);
 		next.setToolTipText(">"); //$NON-NLS-1$
 		next.addSelectionListener(new SelectionListener() {
 			
@@ -196,10 +198,10 @@
 				
 			}
 		});
-
-
+		
+		
 		// [>|]
-		last = new Button(this, SWT.PUSH);
+		last = new Button(this, SWT.FLAT | SWT.PUSH);
 		last.setToolTipText(">|"); //$NON-NLS-1$
 		last.addSelectionListener(new SelectionListener() {
 			
@@ -215,14 +217,14 @@
 				
 			}
 		});
-
-		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART)); 
+		
+		first.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART));
 		prev.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
 		next.setImage(IImageKeys.getImage(IImageKeys.CTRLPLAY));
 		last.setImage(IImageKeys.getImage(IImageKeys.CTRLEND));
 		
 	}
-
+	
 	/**
 	 * 
 	 * @param parent
@@ -231,14 +233,14 @@
 		this(parent, SWT.NONE);
 	}
 	
-
+	
 	public void addGoToKeyListener(KeyListener keyListener) {
 		currentPositionText.addKeyListener(keyListener);
 		currentPositionText.setEditable(true);
-		//currentPositionText.setBackground(whiteColor);
-		//currentPosition.setBackground(new Color(currentPosition.get));
+		// currentPositionText.setBackground(whiteColor);
+		// currentPosition.setBackground(new Color(currentPosition.get));
 	}
-
+	
 	/**
 	 * Adds the first listener.
 	 *
@@ -247,7 +249,7 @@
 	public void addFirstListener(SelectionListener selectionListener) {
 		first.addSelectionListener(selectionListener);
 	}
-
+	
 	/**
 	 * Adds the next listener.
 	 *
@@ -256,7 +258,7 @@
 	public void addNextListener(SelectionListener selectionListener) {
 		next.addSelectionListener(selectionListener);
 	}
-
+	
 	/**
 	 * Adds the previous listener.
 	 *
@@ -265,7 +267,7 @@
 	public void addPreviousListener(SelectionListener selectionListener) {
 		prev.addSelectionListener(selectionListener);
 	}
-
+	
 	/**
 	 * Adds the last listener.
 	 *
@@ -274,7 +276,7 @@
 	public void addLastListener(SelectionListener selectionListener) {
 		last.addSelectionListener(selectionListener);
 	}
-
+	
 	/**
 	 * Sets the first enabled.
 	 *
@@ -283,7 +285,7 @@
 	public void setFirstEnabled(boolean b) {
 		first.setEnabled(b);
 	}
-
+	
 	/**
 	 * Sets the last enabled.
 	 *
@@ -292,7 +294,7 @@
 	public void setLastEnabled(boolean b) {
 		last.setEnabled(b);
 	}
-
+	
 	/**
 	 * Sets the next enabled.
 	 *
@@ -301,7 +303,7 @@
 	public void setNextEnabled(boolean b) {
 		next.setEnabled(b);
 	}
-
+	
 	/**
 	 * Sets the previous enabled.
 	 *
@@ -310,46 +312,47 @@
 	public void setPreviousEnabled(boolean b) {
 		prev.setEnabled(b);
 	}
-
 	
 	
+	
 	protected int getCurrentPositionFromTextField() {
 		int ret = -1;
 		try {
 			ret = Integer.parseInt(this.currentPositionText.getText());
-		} catch(Exception e) {
+		}
+		catch (Exception e) {
 			System.out.println(TXMUIMessages.errorWhileGettingCurrentPositionValueColon);
 			Log.printStackTrace(e);
 		}
 		return ret;
 	}
-
 	
-
+	
+	
 	/**
 	 * @return the minPosition
 	 */
 	public int getMinPosition() {
 		return minPosition;
 	}
-
-
+	
+	
 	/**
 	 * @param minPosition the minPosition to set
 	 */
 	public void setMinPosition(int minPosition) {
 		this.minPosition = minPosition;
 	}
-
-
+	
+	
 	/**
 	 * @return the maxPosition
 	 */
 	public int getMaxPosition() {
 		return maxPosition;
 	}
-
-
+	
+	
 	/**
 	 * @param maxPosition the maxPosition to set
 	 */
@@ -360,26 +363,29 @@
 	/**
 	 * Refreshes the widgets.
 	 */
-	public void refresh()	{
+	public void refresh() {
 		
 		// range tests
-		if(this.currentPosition < this.minPosition)	{
+		if (this.currentPosition < this.minPosition) {
 			this.currentPosition = this.minPosition;
 		}
-		else if(this.currentPosition > this.maxPosition)	{
+		else if (this.currentPosition > this.maxPosition) {
 			this.currentPosition = this.maxPosition;
 		}
 		
 		// update UI
 		this.currentPositionText.setText(String.valueOf(this.currentPosition));
+		
 		this.prev.setEnabled(this.currentPosition > this.minPosition);
 		this.next.setEnabled(this.currentPosition < this.maxPosition);
 		this.first.setEnabled(this.currentPosition > this.minPosition);
 		this.last.setEnabled(this.currentPosition < this.maxPosition);
+		
+		setInfoLineText(" / " + (this.maxPosition - this.minPosition)); //$NON-NLS-1$
 		this.layout();
 	}
-
-
+	
+	
 	/**
 	 * Sets the info line text.
 	 *
@@ -387,7 +393,7 @@
 	 */
 	public void setInfoLineText(String s) {
 		this.infoLine.setText(s);
-	} 
+	}
 	
 	
 	/**
@@ -396,16 +402,16 @@
 	public void setCurrentPosition(int currentPosition) {
 		this.currentPosition = currentPosition + this.shift;
 	}
-
-
+	
+	
 	/**
 	 * @return the currentPosition
 	 */
 	public int getCurrentPosition() {
 		return this.currentPosition - this.shift;
 	}
-
-
+	
+	
 	/**
 	 * @return the currentPositionText
 	 */
@@ -413,4 +419,4 @@
 		return currentPositionText;
 	}
 	
-}
\ No newline at end of file
+}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java	(revision 3061)
@@ -560,54 +560,68 @@
 				script.getBinding().setVariable("args", args);
 			}
 		}
-		
+		Log.finest("Calling syncExec on display: " + Display.getDefault());
 		Display.getDefault().syncExec(new Runnable() {
 			
 			@Override
 			public void run() {
-				boolean okNames = true;
-				CmdLineParser parser = new CmdLineParser(bean);
-				
-				Display display = Display.getCurrent();
-				Shell shell = display.getActiveShell();
-				
-				// check names
-				Class c = bean.getClass();
-				for (OptionHandler opt : parser.getOptions()) {
-					try {
-						if (opt.option instanceof NamedOptionDef) {
-							NamedOptionDef option = (NamedOptionDef) opt.option;
-							c.getDeclaredField(option.name());
+				try {
+					boolean okNames = true;
+					CmdLineParser parser = new CmdLineParser(bean);
+					
+					Display display = Display.getCurrent();
+					Shell shell = display.getActiveShell();
+					Log.finest("Display=" + display + " Shell=" + shell);
+					// check names
+					Class c = bean.getClass();
+					Log.finest("Parsing options: " + parser.getOptions());
+					for (OptionHandler opt : parser.getOptions()) {
+						try {
+							if (opt.option instanceof NamedOptionDef) {
+								NamedOptionDef option = (NamedOptionDef) opt.option;
+								c.getDeclaredField(option.name());
+							}
 						}
+						catch (NoSuchFieldException e) {
+							Log.warning(TXMUIMessages.errorInAtOptionNameDeclarationColon + e.getMessage());
+							okNames = false;
+						}
 					}
-					catch (NoSuchFieldException e) {
-						System.out.println(TXMUIMessages.errorInAtOptionNameDeclarationColon + e.getMessage());
-						okNames = false;
-					}
-				}
-				if (okNames) {
-					ParametersDialog dialog = new ParametersDialog(shell, bean, parser.getOptions(), args);
-					if (dialog.getShell() != null)
-						dialog.getShell().setActive();
-					if (dialog.getMustShowDialog()) {
-						retOpen = dialog.open() == ParametersDialog.OK;
-						errorOpen = dialog.isError();
-					}
-					else { // fields initialized by 'args'
-						dialog.initializeMacroVariables(); // with args
-						if (dialog.getNumberOfFields() > 0) dialog.saveParameters();
-						retOpen = true;
-						errorOpen = false;
-					}
-					
-					if (bean instanceof groovy.lang.Script) { // reset the timer binding if already existing
-						groovy.lang.Script script = (groovy.lang.Script) bean;
-						if (script.getBinding().hasVariable("timer")) {
-							Timer timer = (Timer) script.getBinding().getVariable("timer");
-							timer.reset();
+					if (okNames) {
+						ParametersDialog dialog = new ParametersDialog(shell, bean, parser.getOptions(), args);
+						if (dialog.getShell() != null) {
+							Log.finest("Activating shell:" + shell);
+							shell.setActive();
 						}
+						if (dialog.getMustShowDialog()) {
+							Log.finest("The parameters dialog must be opened to fill all mandatory fields.");
+							retOpen = dialog.open() == ParametersDialog.OK;
+							errorOpen = dialog.isError();
+						}
+						else { // fields initialized by 'args'
+							Log.finest("The parameters dialog dont need to be opened all mandatory fields are set: " + args);
+							dialog.initializeMacroVariables(); // with args
+							if (dialog.getNumberOfFields() > 0) dialog.saveParameters();
+							retOpen = true;
+							errorOpen = false;
+						}
+						
+						if (bean instanceof groovy.lang.Script) { // reset the timer binding if already existing
+							
+							groovy.lang.Script script = (groovy.lang.Script) bean;
+							if (script.getBinding().hasVariable("timer")) {
+								Log.finest("Reset groovy execution timer: " + args);
+								Timer timer = (Timer) script.getBinding().getVariable("timer");
+								timer.reset();
+							}
+						}
 					}
 				}
+				catch (Throwable e) {
+					Log.severe("Could not open dialog: " + e);
+					Log.printStackTrace(e);
+					errorOpen = true;
+				}
 			}
 		});
 		return retOpen && !errorOpen;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java	(revision 3061)
@@ -27,6 +27,8 @@
 //
 package org.txm.rcp.swt.widget;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.eclipse.jface.viewers.ComboViewer;
@@ -44,35 +46,46 @@
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.swt.GLComposite;
+import org.txm.rcp.swt.dialog.ComboDialog;
 import org.txm.rcp.swt.dialog.QueryAssistDialog;
 import org.txm.rcp.swt.provider.ListContentProvider;
 import org.txm.searchengine.core.IQuery;
 import org.txm.searchengine.core.SearchEngine;
+import org.txm.searchengine.core.SearchEnginePreferences;
 import org.txm.searchengine.core.SearchEnginesManager;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 
 /**
- * The QueryWidget 
- * 	+ the button to open the QueryAssisDialog
- *  + Engine selector 
+ * The QueryWidget
+ * + the button to open the QueryAssisDialog
+ * + Engine selector
  * 
  * @author mdecorde.
  */
 public class AssistedChoiceQueryWidget extends Composite {
-
+	
 	/** The magicstick button: opens the QueryAssist dialog. */
 	protected Button magicstick;
-
+	
 	/** The querywidget. */
 	protected QueryWidget querywidget;
-
+	
 	protected QueryAssistDialog d;
-
-	protected ComboViewer engineCombo;
+	
+	// protected ComboViewer engineCombo;
+	
 	protected List<SearchEngine> engines;
+	
+	private GridData magcistickGData;
+	
+	private Button settingsButton;
+	
+	private Label selectedEngineLabel;
+	
 	/**
 	 * Instantiates a new assisted query widget.
 	 *
@@ -82,49 +95,79 @@
 	 */
 	public AssistedChoiceQueryWidget(Composite parent, int style, final CQPCorpus corpus) {
 		super(parent, SWT.NONE);
-		this.setLayout(GLComposite.createDefaultLayout(3));
-
+		this.setLayout(GLComposite.createDefaultLayout(5));
+		
 		engines = SearchEnginesManager.getAvailableEngines(corpus.getMainCorpus());
-
+		SearchEngine initialEngine = null;
 		if (engines.size() > 1) {
-			engineCombo = new ComboViewer(this);
-			Combo ccombo = engineCombo.getCombo();
-			engineCombo.setContentProvider(new ListContentProvider());
-			ccombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-					false, false));
-			engineCombo.setLabelProvider(new LabelProvider() {
+			
+			// set default engine
+			String defaultEngineName = SearchEnginePreferences.getInstance().getString(SearchEnginePreferences.DEFAULT_SEARCH_ENGINE);
+			int iDefault = -1;
+			int iSuperDefault = 0;
+			for (int i = 0; i < engines.size(); i++) {
+				SearchEngine engine = engines.get(i);
+				if (defaultEngineName.equals(engine.getName())) {
+					iDefault = i;
+				}
+				if ("CQP".equals(engine.getName())) {
+					iSuperDefault = i;
+				}
+			}
+			
+			if (iDefault >= 0) {
+				initialEngine = engines.get(iDefault);
+			}
+			else {
+				initialEngine = engines.get(iSuperDefault);
+			}
+		}
+		else {
+			initialEngine = engines.get(0);
+		}
+		
+		selectedEngineLabel = new Label(this, SWT.NONE);
+		selectedEngineLabel.setText("");
+		GridData gdata = new GridData(GridData.FILL, GridData.CENTER, false, false);
+		selectedEngineLabel.setLayoutData(gdata);
+		
+		if (SearchEnginePreferences.getInstance().getBoolean(SearchEnginePreferences.SHOW_SEARCH_ENGINES)) {
+			settingsButton = new Button(this, SWT.PUSH);
+			settingsButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
+			settingsButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH_SETTINGS));
+			settingsButton.setToolTipText(TXMUIMessages.openTheQueryAssistant);
+			settingsButton.addSelectionListener(new SelectionListener() {
+				
 				@Override
-				public String getText(Object element) {
-					return ((SearchEngine)element).getName();
+				public void widgetSelected(SelectionEvent e) {
+					ArrayList<String> values = new ArrayList<>();
+					for (SearchEngine se : engines) {
+						values.add(se.getName());
+					}
+					ComboDialog dialog = new ComboDialog(e.display.getActiveShell(), "Engines", values, querywidget.getSearchEngine().getName());
+					if (dialog.open() == ComboDialog.OK) {
+						String name = dialog.getSelectedValue();
+						for (SearchEngine se : engines) {
+							if (se.getName().equals(name)) {
+								changeEngine(se);
+								return;
+							}
+						}
+					}
 				}
-			});
-			engineCombo.setInput(engines);
-			ccombo.select(0);
-			engineCombo.addSelectionChangedListener(new ISelectionChangedListener() {
-
+				
 				@Override
-				public void selectionChanged(SelectionChangedEvent event) {
-					ISelection isel = event.getSelection();
-					StructuredSelection sel = (StructuredSelection)isel;
-					Object o = sel.getFirstElement();
-					SearchEngine se = (SearchEngine)o;
-					querywidget.setSearchEngine(se);
-					
-					GridData gdata = (GridData) querywidget.getLayoutData();
-					gdata.heightHint = -1;
-					querywidget.layout();
-					relayout();
-					
-				}
+				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
 		}
-
+		
 		magicstick = new Button(this, SWT.PUSH);
-		magicstick.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-				false, false));
+		magcistickGData = new GridData(GridData.FILL, GridData.CENTER, false, false);
+		magicstick.setLayoutData(magcistickGData);
 		magicstick.setImage(IImageKeys.getImage(IImageKeys.ACTION_ASSISTQUERY));
 		magicstick.setToolTipText(TXMUIMessages.openTheQueryAssistant);
 		magicstick.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				d = new QueryAssistDialog(e.display.getActiveShell(), corpus);
@@ -132,70 +175,101 @@
 					querywidget.setText(d.getQuery());
 				}
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
-		for (SearchEngine engine : engines) {
-			querywidget = new QueryWidget(this, style, engine);
-			querywidget.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-			break; // set the first engine as default engine
+		
+		setMagicEnabled("CQP".equals(initialEngine.getName()));
+		
+		querywidget = new QueryWidget(this, style, initialEngine);
+		querywidget.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+	}
+	
+	protected void changeEngine(SearchEngine se) {
+		querywidget.setSearchEngine(se);
+		
+		// GridData gdata = (GridData) querywidget.getLayoutData();
+		// gdata.heightHint = -1;
+		// querywidget.layout();
+		// relayout();
+		
+		setMagicEnabled("CQP".equals(se.getName()));
+		
+		String defaultEngineName = SearchEnginePreferences.getInstance().getString(SearchEnginePreferences.DEFAULT_SEARCH_ENGINE);
+		if (defaultEngineName.equals(se.getName())) {
+			selectedEngineLabel.setText("");
 		}
+		else {
+			selectedEngineLabel.setText(" " + se.getName() + " ");
+		}
+		selectedEngineLabel.getParent().layout();
 	}
 	
+	private void setMagicEnabled(boolean b) {
+		magicstick.setEnabled(b);
+		
+		if (b) {
+			magcistickGData.widthHint = magcistickGData.minimumWidth = SWT.DEFAULT;
+		}
+		else {
+			magcistickGData.widthHint = magcistickGData.minimumWidth = 0;
+		}
+		magicstick.getParent().layout();
+	}
+	
 	protected void relayout() {
 		Composite parent = AssistedChoiceQueryWidget.this.getParent();
-//		parent.layout(true);
-//		parent.getParent().layout(true);
+		// parent.layout(true);
+		// parent.getParent().layout(true);
 		try {
 			parent.getParent().getParent().layout(true);
-		} catch(Exception e) {
+		}
+		catch (Exception e) {
 			parent.layout(true);
 		}
-//		while (parent instanceof Composite) {
-//			
-//			if (!(parent.getParent() instanceof Composite)) {
-//				parent.layout();
-//				return;
-//			}
-//			parent = parent.getParent();
-//		}
+		// while (parent instanceof Composite) {
+		//
+		// if (!(parent.getParent() instanceof Composite)) {
+		// parent.layout();
+		// return;
+		// }
+		// parent = parent.getParent();
+		// }
 	}
-
+	
+	@Override
 	public void setEnabled(boolean b) {
 		super.setEnabled(b);
 		querywidget.setEnabled(b);
 	}
-
+	
 	public void setSearchEngine(SearchEngine engine) {
-		if (engineCombo != null) {
-			int i = engines.indexOf(engine);
-			if (i >= 0) {
-				engineCombo.setSelection(new StructuredSelection(engine));
-			}
+		int i = engines.indexOf(engine);
+		if (i >= 0) {
+			changeEngine(engine);
 		}
 	}
-
+	
 	public void setSearchEngine(String name) {
-		if (engineCombo != null) {
-			for (int i = 0 ; i < engines.size() ; i++) {
-				if (name.equals(engines.get(i).getName())) {
-					engineCombo.setSelection(new StructuredSelection(engines.get(i)));
-				}
+		for (int i = 0; i < engines.size(); i++) {
+			if (name.equals(engines.get(i).getName())) {
+				changeEngine(engines.get(i));
 			}
 		}
 	}
-
+	
 	public QueryWidget getQueryWidget() {
 		return querywidget;
 	}
-
+	
+	@Override
 	public boolean setFocus() {
 		return this.querywidget.setFocus();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.swt.widgets.Control#addKeyListener(org.eclipse.swt.events.KeyListener)
 	 */
 	@Override
@@ -203,7 +277,7 @@
 		if (querywidget != null)
 			this.querywidget.addKeyListener(listener);
 	}
-
+	
 	/**
 	 * Gets the query string.
 	 *
@@ -212,7 +286,7 @@
 	public String getQueryString() {
 		return querywidget.getQueryString();
 	}
-
+	
 	/**
 	 * Gets the query string.
 	 *
@@ -221,14 +295,14 @@
 	public String getRawString() {
 		return querywidget.getText();
 	}
-
+	
 	/**
 	 * Memorize.
 	 */
 	public void memorize() {
 		querywidget.memorize();
 	}
-
+	
 	/**
 	 * Memorize.
 	 *
@@ -237,32 +311,32 @@
 	public void memorize(String query) {
 		querywidget.memorize(query);
 	}
-
+	
 	/**
 	 * Clears the query test.
 	 */
-	public void clearQuery()	{
+	public void clearQuery() {
 		this.querywidget.setText(""); //$NON-NLS-1$
 	}
-
+	
 	/**
 	 * Sets the text.
 	 *
 	 * @param query the new text
 	 */
 	public void setText(String query) {
-
-		//		if(query.isEmpty())	{
-		//			query = ""; //$NON-NLS-1$
-		//		}
-
+		
+		// if(query.isEmpty()) {
+		// query = ""; //$NON-NLS-1$
+		// }
+		
 		// fix the query
-		//query = query.replaceAll("^\"(.*)\"$","$1"); //$NON-NLS-1$ -> don't work for the '"A" "B"' queries 
-
+		// query = query.replaceAll("^\"(.*)\"$","$1"); //$NON-NLS-1$ -> don't work for the '"A" "B"' queries
+		
 		querywidget.setText(query);
 	}
-
+	
 	public IQuery getQuery() {
 		return this.querywidget.getQuery();
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/QueryAssistDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/QueryAssistDialog.java	(revision 3060)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/QueryAssistDialog.java	(revision 3061)
@@ -513,7 +513,6 @@
 	public class WordField extends Composite {
 		
 		ArrayList<QueryAssistDialog.WordPropertyField> propertyFields = new ArrayList<>();
-		// Combo propertiesAllOrOne;
 		
 		Button targetButton;
 		
@@ -525,7 +524,9 @@
 		
 		private int no;
 		
+		private Button allCriteriaButton;
 		
+		
 		/**
 		 * Instantiates a new word field.
 		 *
@@ -581,15 +582,9 @@
 			propertiesFieldComposite.setLayoutData(propertiesvlayout);
 			propertiesFieldComposite.getLayout().numColumns = 2;
 			
-			// propertiesAllOrOne = new Combo(this, SWT.SINGLE-SWT.READ_ONLY);
-			// propertiesAllOrOne.setToolTipText("ALL=all properties test must match / ONE=one property match is enough");
-			// propertiesAllOrOne.add("ALL");
-			// propertiesAllOrOne.add("ONE");
-			// propertiesAllOrOne.select(0);
-			// propertiesAllOrOne.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
+			allCriteriaButton = new Button(this, SWT.CHECK);
+			allCriteriaButton.setToolTipText("All properties test are verified");
 			
-			addProperty();
-			
 			targetButton = new Button(this, SWT.CHECK);
 			targetButton.setToolTipText("Check to target the word in the query");
 			targetButton.addSelectionListener(new SelectionListener() {
@@ -642,6 +637,8 @@
 				@Override
 				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
+			
+			addProperty();
 		}
 		
 		private void addProperty() {
@@ -660,7 +657,8 @@
 		}
 		
 		private void updateWidgets() {
-			// propertiesAllOrOne.setEnabled(propertyFields.size() > 1);
+			
+			allCriteriaButton.setEnabled(propertyFields.size() > 1);
 			// propertiesAllOrOne.setVisible(propertyFields.size() > 1);
 			// ((GridData)propertiesAllOrOne.getLayoutData()).exclude = propertyFields.size() < 2;
 			if (propertyFields.size() == 0) {
@@ -692,6 +690,11 @@
 			}
 			query += "["; //$NON-NLS-1$
 			
+			String propertiesAllOrOne = " | ";
+			if (allCriteriaButton.getSelection()) {
+				propertiesAllOrOne = " & ";
+			}
+			
 			int nField = 0;
 			for (WordPropertyField f : propertyFields) {
 				Combo propCombo = f.propCombo;
@@ -699,7 +702,7 @@
 				Combo valueT = f.valueT;
 				if (nField > 0) {
 					// query += " "+(propertiesAllOrOne.getText().equals("ALL")?"&":"|")+" ";
-					query += " & ";
+					query += propertiesAllOrOne;
 				}
 				
 				String p = propCombo.getItem(propCombo.getSelectionIndex());
Index: tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 3060)
+++ tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 3061)
@@ -55,6 +55,26 @@
 	public abstract String createQuery(ExecutionEvent event, ISelection isel);
 	
 	/**
+	 * Creates the query.
+	 * 
+	 * @param isel
+	 * @return
+	 */
+	public Integer getIndexResult(ExecutionEvent event, ISelection isel) {
+		return null;
+	}
+	
+	/**
+	 * Creates the query.
+	 * 
+	 * @param isel
+	 * @return
+	 */
+	public Integer getSubIndexResult(ExecutionEvent event, ISelection isel) {
+		return null;
+	}
+	
+	/**
 	 * Creates the queries.
 	 * This method is essentially dedicated to be overridden, if needed.
 	 * 
@@ -74,6 +94,8 @@
 			
 			String query = this.createQuery(event, selection);
 			String queries = this.createQueries(event, selection);
+			Integer index = this.getIndexResult(event, selection);
+			Integer subindex = this.getSubIndexResult(event, selection);
 			
 			if ((query == null || query.isEmpty()) && (queries == null || queries.isEmpty())) {
 				Log.warning(Messages.noQueryWasSetCommandCanceled);
@@ -87,6 +109,8 @@
 			TXMPreferences.put(resultParametersNodePath, TXMPreferences.PARENT_PARAMETERS_NODE_PATH, result.getParametersNodePath());
 			TXMPreferences.put(resultParametersNodePath, TXMPreferences.QUERY, query);
 			TXMPreferences.put(resultParametersNodePath, TXMPreferences.QUERIES, queries);
+			TXMPreferences.put(resultParametersNodePath, TXMPreferences.INDEX, index);
+			TXMPreferences.put(resultParametersNodePath, TXMPreferences.SUB_INDEX, subindex);
 			
 			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), resultParametersNodePath);
 			// TODO we should test if there is already a linked editor and used it. Do to it we must either A) know which editor class is must be opened B) know why a previous editor has been open
Index: tmp/org.txm.searchengine.cqp.core/plugin.xml
===================================================================
--- tmp/org.txm.searchengine.cqp.core/plugin.xml	(revision 3060)
+++ tmp/org.txm.searchengine.cqp.core/plugin.xml	(revision 3061)
@@ -6,6 +6,9 @@
       <SearchEngine
             class="org.txm.searchengine.cqp.CQPSearchEngine">
       </SearchEngine>
+      <SearchEngine
+            class="org.txm.searchengine.cqp.TXTSearchEngine">
+      </SearchEngine>
    </extension>
    <extension
          point="org.eclipse.core.runtime.preferences">
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/TXTSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/TXTSearchEngine.java	(revision 0)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/TXTSearchEngine.java	(revision 3061)
@@ -0,0 +1,104 @@
+package org.txm.searchengine.cqp;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.txm.Toolbox;
+import org.txm.core.engines.EngineType;
+import org.txm.core.results.TXMResult;
+import org.txm.objects.CorpusBuild;
+import org.txm.objects.Match;
+import org.txm.searchengine.core.EmptySelection;
+import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.SearchEngine;
+import org.txm.searchengine.core.SearchEngineProperty;
+import org.txm.searchengine.core.Selection;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.searchengine.cqp.corpus.query.TXTQuery;
+
+public class TXTSearchEngine extends SearchEngine {
+	
+	public static final String NAME = "TXT";
+	
+	/**
+	 * initialization state
+	 */
+	boolean state = false;
+	
+	boolean useNetCQi = false;
+	
+	@Override
+	public String getName() {
+		return TXTSearchEngine.NAME;
+	}
+	
+	/**
+	 * Starts the corpus engine if not remove then launch cqpserver.
+	 *
+	 * @return true, if successful
+	 */
+	@Override
+	public boolean start(IProgressMonitor monitor) throws Exception {
+		return true;
+	}
+	
+	
+	@Override
+	public boolean initialize() {
+		return true;
+	}
+	
+	/**
+	 * Shutdown.
+	 */
+	@Override
+	public boolean stop() {
+		return true;
+	}
+	
+	@Override
+	public boolean isRunning() {
+		return CQPSearchEngine.getEngine().isRunning();
+	}
+	
+	@Override
+	public Selection query(CorpusBuild corpus, IQuery query, String name, boolean saveQuery) throws CqiClientException {
+		if (query instanceof TXTQuery && corpus instanceof CQPCorpus) {
+			TXTQuery tquery = (TXTQuery) query;
+			return CQPSearchEngine.getEngine().query(corpus, tquery.fixQuery(corpus.getLang()), name, saveQuery);
+		}
+		else {
+			return new EmptySelection(query);
+		}
+	}
+	
+	@Override
+	public TXTQuery newQuery() {
+		return new TXTQuery(""); //$NON-NLS-1$
+	}
+	
+	@Override
+	public boolean hasIndexes(CorpusBuild corpus) {
+		return CQPSearchEngine.getEngine().hasIndexes(corpus);
+	}
+	
+	@Override
+	public void notify(TXMResult r, String state) {
+		// nothing to do the CQPEngine will manage the notifications
+	}
+	
+	public static TXTSearchEngine getEngine() {
+		return (TXTSearchEngine) Toolbox.getEngineManager(EngineType.SEARCH).getEngine(TXTSearchEngine.NAME);
+	}
+	
+	@Override
+	public String getValueForProperty(Match match, SearchEngineProperty property) {
+		return CQPSearchEngine.getEngine().getValueForProperty(match, property);
+	}
+	
+	@Override
+	public List<String> getValuesForProperty(Match match, SearchEngineProperty property) {
+		return CQPSearchEngine.getEngine().getValuesForProperty(match, property);
+	}
+}

Property changes on: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/TXTSearchEngine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/TXTQuery.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/TXTQuery.java	(revision 0)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/TXTQuery.java	(revision 3061)
@@ -0,0 +1,68 @@
+package org.txm.searchengine.cqp.corpus.query;
+
+import java.util.ArrayList;
+import java.util.Locale;
+
+import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.SearchEngine;
+import org.txm.searchengine.cqp.TXTSearchEngine;
+import org.txm.tokenizer.SimpleStringTokenizer;
+
+public class TXTQuery implements IQuery {
+	
+	String raw = "";
+	
+	public TXTQuery(String query) {
+		raw = query;
+	}
+	
+	@Override
+	public String getQueryString() {
+		return raw;
+	}
+	
+	@Override
+	public boolean isEmpty() {
+		return raw == null || raw.isEmpty();
+	}
+	
+	@Override
+	public SearchEngine getSearchEngine() {
+		return TXTSearchEngine.getEngine();
+	}
+	
+	@Override
+	public IQuery setQuery(String rawQuery) {
+		raw = rawQuery;
+		return this;
+	}
+	
+	@Override
+	public IQuery fixQuery() {
+		return fixQuery(Locale.getDefault().getCountry());
+	}
+	
+	@Override
+	public boolean equals(IQuery q) {
+		return raw.equals(q.getQueryString());
+	}
+	
+	@Override
+	public String asString() {
+		return raw;
+	}
+	
+	public IQuery fixQuery(String lang) {
+		// SimpleStringTokenizer tokenizer = new SimpleStringTokenizer(lang); // TODO setup the tokenizer to not create tokens * and ? when they are next to letters
+		StringBuilder buffer = new StringBuilder();
+		String[] rs = raw.split(" ");
+		for (int i = 0; i < rs.length; i++) {
+			String r = rs[i];
+			if (i > 0) buffer.append(" ");
+			r = CQLQuery.addBackSlash(r);
+			buffer.append("\"" + r.replace("\\*", ".*") + "\"%cd");
+		}
+		System.out.println("QUERY=" + buffer.toString());
+		return new CQLQuery(buffer.toString());
+	}
+}

Property changes on: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/TXTQuery.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java	(revision 3060)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java	(revision 3061)
@@ -43,19 +43,19 @@
  * @author jmague, mdecorde
  */
 public class Match extends org.txm.objects.Match {
-
+	
 	/** The start. */
 	protected int start;
-
+	
 	/** The end. */
 	protected int end;
 	
 	/** The target position */
 	protected int target = -1;
-
+	
 	/** The query result. */
-	//private QueryResult queryResult;
-
+	// private QueryResult queryResult;
+	
 	/**
 	 * Instantiates a new match.
 	 * 
@@ -67,19 +67,20 @@
 	public Match(int start, int end) {
 		this.start = start;
 		this.end = end;
-		//this.queryResult = queryResult;
+		// this.queryResult = queryResult;
 	}
-
+	
 	public Match(int start, int end, int target) {
-		this(start,end);
+		this(start, end);
 		this.target = target;
 	}
-
+	
 	/**
 	 * Gets the start.
 	 * 
 	 * @return the start
 	 */
+	@Override
 	public int getStart() {
 		return start;
 	}
@@ -89,28 +90,30 @@
 	 * 
 	 * @return the start
 	 */
+	@Override
 	public int getTarget() {
 		return target;
 	}
-
+	
 	/**
 	 * Gets the end.
 	 * 
 	 * @return the end
 	 */
+	@Override
 	public int getEnd() {
 		return end;
 	}
-
-//	/**
-//	 * Gets the query result.
-//	 * 
-//	 * @return the query result
-//	 */
-//	public QueryResult getQueryResult() {
-//		return queryResult;
-//	}
-
+	
+	// /**
+	// * Gets the query result.
+	// *
+	// * @return the query result
+	// */
+	// public QueryResult getQueryResult() {
+	// return queryResult;
+	// }
+	
 	/**
 	 * Gets the value for property for the first position of the match.
 	 * 
@@ -124,11 +127,11 @@
 	 */
 	public String getValueForProperty(Property property)
 			throws CqiClientException {
-		List<Match> match = new ArrayList<Match>();
+		List<Match> match = new ArrayList<>();
 		match.add(this);
 		return Match.getValuesForProperty(property, match).get(0);
 	}
-
+	
 	/**
 	 * Gets the values for property for all the positions of the match.
 	 * 
@@ -147,7 +150,7 @@
 			positions[i] = this.start + i;
 		return getValuesForProperty(property, positions);
 	}
-
+	
 	/**
 	 * Gets the values for property.
 	 * 
@@ -182,13 +185,12 @@
 	 * @throws CqiClientException
 	 *             the cqi client exception
 	 */
-	public static List<String> getValuesForProperty(Property property,
-			org.txm.objects.Match match) throws CqiClientException {
+	public static List<String> getValuesForProperty(Property property, org.txm.objects.Match match) throws CqiClientException {
 		int[] starts = new int[1];
 		starts[0] = match.getStart();
 		return getValuesForProperty(property, starts);
 	}
-
+	
 	/**
 	 * Gets the values for property.
 	 * 
@@ -211,11 +213,13 @@
 						positions);
 				return Arrays.asList(cqiClient.struc2Str(property
 						.getQualifiedName(), struc));
-			} else {
+			}
+			else {
 				return Arrays.asList(cqiClient.cpos2Str(property
 						.getQualifiedName(), positions));
 			}
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			throw new CqiClientException(e);
 		}
 	}
@@ -239,18 +243,20 @@
 		try {
 			if (property instanceof StructuralUnitProperty) {
 				int[] struc = cqiClient.cpos2Struc(property.getQualifiedName(),
-						new int[] {position});
+						new int[] { position });
 				return cqiClient.struc2Str(property
 						.getQualifiedName(), struc)[0];
-			} else {
+			}
+			else {
 				return cqiClient.cpos2Str(property
-						.getQualifiedName(), new int[] {position})[0];
+						.getQualifiedName(), new int[] { position })[0];
 			}
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			throw new CqiClientException(e);
 		}
 	}
-
+	
 	/**
 	 * Gets the ids.
 	 *
@@ -262,30 +268,34 @@
 	public int[] getIds(Property property, int[] positions)
 			throws CqiClientException {
 		AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
-
+		
 		try {
 			if (property instanceof StructuralUnitProperty) {
 				int[] struc = cqiClient.cpos2Struc(property.getQualifiedName(),
 						positions);
 				return struc;
-			} else {
+			}
+			else {
 				int[] ids = cqiClient.cpos2Id(property.getQualifiedName(),
 						positions);
 				return ids;
 			}
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			throw new CqiClientException(e);
 		}
 	}
-
+	
+	@Override
 	public void setEnd(int p) {
 		this.end = p;
 	}
-
+	
+	@Override
 	public void setStart(int p) {
 		this.start = p;
 	}
-
+	
 	@Override
 	public void setTarget(int p) {
 		this.target = p;
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/MatchUtils.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/MatchUtils.java	(revision 3060)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/MatchUtils.java	(revision 3061)
@@ -2,6 +2,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import org.txm.objects.Match;
 
 public class MatchUtils {
 	
@@ -34,7 +35,7 @@
 	 * @param list the list of matches
 	 * @return an array of all positions of the specified list of matches
 	 */
-	public static int[] toPositions(List<Match> list) {
+	public static int[] toPositions(List<? extends Match> list) {
 		ArrayList<Integer> result = new ArrayList<>();
 		for (Match m : list) {
 			if (m.getStart() == m.getEnd()) {
@@ -59,7 +60,7 @@
 	 * @param match
 	 * @return array of int position from a Match
 	 */
-	public int[] toPositions(Match match) {
+	public static int[] toPositions(Match match) {
 		return toPositions(match, match);
 	}
 	
@@ -70,7 +71,7 @@
 	 * @return array of int position from a Match start to another Match end
 	 */
 	public static int[] toPositions(Match match1, Match match2) {
-		return toPositions(match1.start, match2.end);
+		return toPositions(match1.getStart(), match2.getEnd());
 	}
 	
 	/**
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 3060)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 3061)
@@ -20,30 +20,33 @@
 import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
+import org.txm.searchengine.cqp.core.messages.CQPSearchEngineCoreMessages;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.CorpusManager;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.searchengine.cqp.corpus.WordProperty;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
 import org.txm.utils.OSDetector;
 import org.txm.utils.Sh;
 import org.txm.utils.logger.Log;
 
 public class CQPSearchEngine extends SearchEngine {
-
+	
 	public static final String NAME = "CQP";
-
+	
 	/**
 	 * initialization state
 	 */
 	boolean state = false;
+	
 	boolean useNetCQi = false;
-
+	
 	@Override
 	public String getName() {
 		return CQPSearchEngine.NAME;
 	}
-
+	
 	/**
 	 * Starts the corpus engine if not remove then launch cqpserver.
 	 *
@@ -51,92 +54,99 @@
 	 */
 	@Override
 	public boolean start(IProgressMonitor monitor) throws Exception {
-
+		
 		boolean cqiserverok = false;
-
+		
 		if (monitor != null) {
 			monitor.subTask("Starting CQP Engine...");
 		}
-
+		
 		CorpusManager.cleanCorpora();// to be sure to call cqpserver
-
+		
 		useNetCQi = CQPLibPreferences.getInstance().getBoolean(CQPLibPreferences.CQI_NETWORK_MODE);
-
+		
 		Log.fine("Killing CQP processes if any...");
 		killSearchEngine();
-
+		
 		boolean remote = CQPLibPreferences.getInstance().getBoolean(CQPLibPreferences.CQI_SERVER_IS_REMOTE);
 		state = false;
 		// test if must-have properties for CWB are set
-
+		
 		String init_path = CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE);
 		if (init_path.length() > 0 && !new File(init_path).exists()) {
 			Log.warning(TXMCoreMessages.bind("Warning: the given CQP init file path can not be found in {0}.", init_path));
 			init_path = null;
 		}
-
+		
 		if (!remote) {
-
+			
 			if (!useNetCQi) {
 				try {
 					cqiServer = new MemCqiServer("",  //$NON-NLS-1$
-							init_path, 
+							init_path,
 							CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_ADDITIONAL_OPTIONS)
-							+ " -P " + CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT), //$NON-NLS-1$
+									+ " -P " + CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT), //$NON-NLS-1$
 							Boolean.parseBoolean(CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_MONITOR_OUTPUT)));
-				} catch (Exception e) {
+				}
+				catch (Exception e) {
 					// TODO Auto-generated catch block
 					org.txm.utils.logger.Log.printStackTrace(e);
 				}
-			} else {
-
+			}
+			else {
+				
 				String exec_path = CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE);
-
+				
 				if (exec_path == null || exec_path.length() == 0 || new File(exec_path).exists()) {
 					Log.severe(TXMCoreMessages.bind("Error: the '{0}' preference is not set.", CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE));
 				}
-				//				if (new File(exec_path).exists()) {
-				//					System.out.println("Error: the '"+CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
-				//				}
-
+				// if (new File(exec_path).exists()) {
+				// System.out.println("Error: the '"+CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
+				// }
+				
 				cqiServer = new NetCqiServer(exec_path,
 						"",  //$NON-NLS-1$
-						init_path, 
+						init_path,
 						CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_ADDITIONAL_OPTIONS)
-						+ " -P " + CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT), //$NON-NLS-1$
+								+ " -P " + CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT), //$NON-NLS-1$
 						CQPLibPreferences.getInstance().getBoolean(CQPLibPreferences.CQI_SERVER_MONITOR_OUTPUT));
 			}
-
+			
 			if (cqiServer != null) {
 				cqiserverok = cqiServer.start();
 			}
-
+			
 		}
-
+		
 		// create cqi client
 		try {
 			if (cqiserverok) {
 				if (!useNetCQi) {
 					try {
 						cqiClient = new MemCqiClient((MemCqiServer) cqiServer);
-					} catch(Exception e) {
+					}
+					catch (Exception e) {
 						Log.severe(TXMCoreMessages.failedToStartMemCqiClientColon);
 						Log.printStackTrace(e);
 						cqiserverok = false;
 					}
-				} else {
+				}
+				else {
 					int port = CQPLibPreferences.getInstance().getInt(CQPLibPreferences.CQI_SERVER_PORT);
 					String host = CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_HOST);
 					cqiClient = new NetCqiClient(host, port);
 				}
 			}
-		} catch (NumberFormatException e1) {
-			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.errorColonTheConnexionToTheServerFailedColonWrongPortFormat, CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT))); 
-		} catch (ServerNotFoundException e1) {
-			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.errorColonWhileConnectionToSearchEngineWithTheFollowingParametersColon, CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_HOST),
-					CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT))); 
 		}
-
+		catch (NumberFormatException e1) {
+			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.errorColonTheConnexionToTheServerFailedColonWrongPortFormat, CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT)));
+		}
+		catch (ServerNotFoundException e1) {
+			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.errorColonWhileConnectionToSearchEngineWithTheFollowingParametersColon, CQPLibPreferences.getInstance().getString(
+					CQPLibPreferences.CQI_SERVER_HOST),
+					CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT)));
+		}
+		
 		// try connecting to the CWB server
 		try {
 			if (cqiserverok) {
@@ -144,12 +154,13 @@
 				String password = CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PASSWORD);
 				state = cqiClient.connect(login, password);
 			}
-		} catch (Exception e1) {
+		}
+		catch (Exception e1) {
 			Log.severe(Log.toString(e1));
 		}
-
+		
 		if (state == false) {
-			Log.severe(TXMCoreMessages.errorWhileConnectingToSearchEngine); 
+			Log.severe(TXMCoreMessages.errorWhileConnectingToSearchEngine);
 			if (cqiClient instanceof NetCqiClient) {
 				Log.severe(TXMCoreMessages.bind(TXMCoreMessages.wrongLoginOrPasswordOrPortColon, CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_LOGIN),
 						CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PASSWORD), CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_HOST),
@@ -158,13 +169,14 @@
 			if (cqiServer != null && cqiServer instanceof NetCqiServer) {
 				Log.severe(TXMCoreMessages.bind(TXMCoreMessages.orTheEngineWasNotStartedWithTheCommandLineColon, cqiServer.getLastCmdLine()));
 			}
-		} else {
+		}
+		else {
 			if (cqiServer == null || cqiServer instanceof NetCqiServer)
-				Log.fine(TXMCoreMessages.connectedToCQP); 
+				Log.fine(TXMCoreMessages.connectedToCQP);
 		}
-
+		
 		CorpusManager.setCqiClient(cqiClient);
-
+		
 		// wait for CQPSERVER TO BE READY
 		int scount = 0;
 		try {
@@ -175,74 +187,76 @@
 				CorpusManager.getCorpusManager().getCorpora();
 				scount++;
 				if (scount >= 10) {
-					Log.fine(TXMCoreMessages.endOfCQPWaitTest); 
+					Log.fine(TXMCoreMessages.endOfCQPWaitTest);
 					break;
 				}
-			} while (CorpusManager.getCorpusManager().getCorpora().size() == 0);
-		} catch (Exception e) {
+			}
+			while (CorpusManager.getCorpusManager().getCorpora().size() == 0);
+		}
+		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.errorWhileWaitingForCQP, e));
-		} 
-
-		// FIXME: SJ: this test should be moved at start of this method? before running CQP? 
+		}
+		
+		// FIXME: SJ: this test should be moved at start of this method? before running CQP?
 		if (Toolbox.workspace == null) {
 			Log.severe("Can't start CQP with workspace not ready.");
 			return false;
 		}
-
-		////		 initialize pre-configured subcorpus and partition of corpus registered in the default.xml workspace file
-		//		System.out.print(TXMCoreMessages.Toolbox_workspace_init);
-		//		for (Project b : Toolbox.workspace.getProjects()) {
-		//			
-		//			Log.info("Loading CQP corpora of " + b.getName() + " corpus...");
-		//			
-		//			if (!loadCQPCorpora(b, monitor)) {
-		//				Log.severe("Failed to load CQP corpora of " + b.getName() + " corpus.");
-		//			}
-		//		}
-
+		
+		//// initialize pre-configured subcorpus and partition of corpus registered in the default.xml workspace file
+		// System.out.print(TXMCoreMessages.Toolbox_workspace_init);
+		// for (Project b : Toolbox.workspace.getProjects()) {
+		//
+		// Log.info("Loading CQP corpora of " + b.getName() + " corpus...");
+		//
+		// if (!loadCQPCorpora(b, monitor)) {
+		// Log.severe("Failed to load CQP corpora of " + b.getName() + " corpus.");
+		// }
+		// }
+		
 		Log.fine(TXMCoreMessages.common_done);
-
+		
 		return state;
 	}
-
-	//	public boolean loadCQPCorpora(Project base, IProgressMonitor monitor) {
-	//		//System.out.println("Load corpus from params: "+params.corpora);
-	//		for (String corpusname : base.getProjectParameters().corpora.keySet()) {
-	//			Element c = base.getProjectParameters().corpora.get(corpusname);
-	//			try {
-	//				MainCorpus corp = CorpusManager.getCorpusManager().getCorpus(corpusname);
-	//				if (monitor != null) {
-	//					monitor.subTask("Loading " + corp + " subcorpora and partitions of corpus " + corpusname + "...");
-	//				}
-	//				corp.setSelfElement(c);
-	//				corp.setParent(base);
-	//				corp.load(); // don't load corpus right now, wait for the search engine to be ready
-	//				base.addChild(corp);
-	//				if (!corp.getMetadatas().containsKey("lang")) { //$NON-NLS-1$
-	//					corp.setAttribute("lang", c.getAttribute("lang")); //$NON-NLS-1$ //$NON-NLS-2$
-	//				}
-	//			} catch (Exception e) {
-	//				System.out.println(e.getLocalizedMessage());
-	//				org.txm.utils.logger.Log.printStackTrace(e);
-	//				return false;
-	//			}
-	//		}
-	//		return true;
-	//	}
-
+	
+	// public boolean loadCQPCorpora(Project base, IProgressMonitor monitor) {
+	// //System.out.println("Load corpus from params: "+params.corpora);
+	// for (String corpusname : base.getProjectParameters().corpora.keySet()) {
+	// Element c = base.getProjectParameters().corpora.get(corpusname);
+	// try {
+	// MainCorpus corp = CorpusManager.getCorpusManager().getCorpus(corpusname);
+	// if (monitor != null) {
+	// monitor.subTask("Loading " + corp + " subcorpora and partitions of corpus " + corpusname + "...");
+	// }
+	// corp.setSelfElement(c);
+	// corp.setParent(base);
+	// corp.load(); // don't load corpus right now, wait for the search engine to be ready
+	// base.addChild(corp);
+	// if (!corp.getMetadatas().containsKey("lang")) { //$NON-NLS-1$
+	// corp.setAttribute("lang", c.getAttribute("lang")); //$NON-NLS-1$ //$NON-NLS-2$
+	// }
+	// } catch (Exception e) {
+	// System.out.println(e.getLocalizedMessage());
+	// org.txm.utils.logger.Log.printStackTrace(e);
+	// return false;
+	// }
+	// }
+	// return true;
+	// }
+	
 	@Override
 	public boolean initialize() {
 		// all initialization done in the start method because we need CQP executable/lib to restart from the beginning
 		return true;
 	}
-
+	
 	/** The CQI server. */
 	private static AbstractCqiServer cqiServer;
-
+	
 	/** The CQI client. */
 	private static AbstractCqiClient cqiClient;
-
+	
 	/**
 	 * Sets the CQI server.
 	 *
@@ -251,7 +265,7 @@
 	public static void setCqiServer(AbstractCqiServer cqiServer) {
 		CQPSearchEngine.cqiServer = cqiServer;
 	}
-
+	
 	/**
 	 * Gets the cqi client.
 	 *
@@ -260,7 +274,7 @@
 	public static AbstractCqiClient getCqiClient() {
 		return cqiClient;
 	}
-
+	
 	/**
 	 * Sets the cqi client.
 	 *
@@ -269,7 +283,7 @@
 	public static void setCqiClient(NetCqiClient cqiClient) {
 		CQPSearchEngine.cqiClient = cqiClient;
 	}
-
+	
 	/**
 	 * Gets the CQI server.
 	 *
@@ -278,7 +292,7 @@
 	public static AbstractCqiServer getCqiServer() {
 		return cqiServer;
 	}
-
+	
 	/**
 	 * Shuts the toolbox searchengine down.
 	 */
@@ -286,36 +300,37 @@
 	public boolean stop() {
 		try {
 			if (cqiClient != null) {
-
+				
 				if (cqiClient instanceof MemCqiClient) {
-					for (String name : ((MemCqiClient)cqiClient).listCorpora()) {
-						((MemCqiClient)cqiClient).dropCorpus(name);
+					for (String name : ((MemCqiClient) cqiClient).listCorpora()) {
+						((MemCqiClient) cqiClient).dropCorpus(name);
 					}
 				}
 				cqiClient.disconnect();
 			}
-
+			
 			if (cqiServer != null && cqiServer.isRunning()) {
 				cqiServer.stop();
-
+				
 				CorpusManager.clean();
 				if (cqiServer instanceof NetCqiServer) {
 					killSearchEngine();
 				}
-
+				
 				cqiClient = null;
 				cqiServer = null;
 			}
 			System.gc();
-
+			
 			state = false;
-		} catch (Exception e) {
-			Log.severe("Error while closing CQP: "+e.getLocalizedMessage());
+		}
+		catch (Exception e) {
+			Log.severe("Error while closing CQP: " + e.getLocalizedMessage());
 			return false;
 		}
 		return !state;
 	}
-
+	
 	/**
 	 * kill cqpserver process.
 	 */
@@ -328,7 +343,8 @@
 					p.waitFor();
 					p = Runtime.getRuntime().exec("taskkill /IM cqpserver.exe /F"); //$NON-NLS-1$
 					p.waitFor();
-				} catch (IOException e) {
+				}
+				catch (IOException e) {
 					Log.severe(TXMCoreMessages.bind(TXMCoreMessages.failedToExecTaskkillIMCqpserverexeFColon, Log.toString(e)));
 					System.out.println(TXMCoreMessages.bind(TXMCoreMessages.failedToExecTaskkillIMCqpserverexeFColon, Log.toString(e)));
 					try {
@@ -336,24 +352,28 @@
 						p.waitFor();
 						p = Runtime.getRuntime().exec("tskill cqpserver.exe"); //$NON-NLS-1$
 						p.waitFor();
-					} catch (IOException e2) {
+					}
+					catch (IOException e2) {
 						e2.printStackTrace();
 						Log.severe(TXMCoreMessages.bind(TXMCoreMessages.failedToExecTskillCqpserverexeColon, Log.toString(e2)));
 						System.out.println(TXMCoreMessages.bind(TXMCoreMessages.failedToExecTskillCqpserverexeColon, Log.toString(e2)));
-					} catch (InterruptedException e3) {
+					}
+					catch (InterruptedException e3) {
 						e3.printStackTrace();
 						Log.severe(Log.toString(e3));
 						System.out.println(Log.toString(e3));
 					}
-				} catch (InterruptedException e) {
+				}
+				catch (InterruptedException e) {
 					Log.severe(TXMCoreMessages.bind("Error while closing CQP: {0}.", e.getLocalizedMessage()));
 					e.printStackTrace();
 					System.out.println(Log.toString(e));
 				}
-			} else { // Mac, Linux
-				String cmd = "kill `ps aux | grep cqpserver | awk '/-P "+CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT)+"/ {print $2}'`"; // //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			else { // Mac, Linux
+				String cmd = "kill `ps aux | grep cqpserver | awk '/-P " + CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT) + "/ {print $2}'`"; // //$NON-NLS-1$ //$NON-NLS-2$
 				try {
-					//Process p = Runtime.getRuntime().exec("killall -9 cqpserver"); //$NON-NLS-1$
+					// Process p = Runtime.getRuntime().exec("killall -9 cqpserver"); //$NON-NLS-1$
 					// System.out.println("kill `ps aux | grep cqpserver | awk '/-P "
 					// + CQPPreferences.getInstance().getString(CQI_SERVER_PORT) + "/ {print $2}'`");
 					// String[] args =
@@ -368,8 +388,9 @@
 					sh.sh();
 					// Runtime.getRuntime().exec("sh kill `ps aux | grep cqpserver | awk '/-P "
 					// + CQPPreferences.getInstance().getString(CQI_SERVER_PORT) + "/ {print $2}'`");
-
-				} catch (Exception e) {
+					
+				}
+				catch (Exception e) {
 					Log.severe(TXMCoreMessages.bind(TXMCoreMessages.failedToExec, cmd, Log.toString(e)));
 					System.out.println(TXMCoreMessages.bind(TXMCoreMessages.failedToExec, cmd, Log.toString(e)));
 					org.txm.utils.logger.Log.printStackTrace(e);
@@ -377,7 +398,7 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * Restart the toolbox's searchengine.
 	 *
@@ -389,12 +410,13 @@
 			Thread.sleep(10);
 			ret = ret && start(null);
 			return ret;
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			Log.severe(TXMCoreMessages.bind("Error while restarting CQP: {0}.", e.getLocalizedMessage()));
 		}
 		return false;
 	}
-
+	
 	/**
 	 * test if searchEngine is initialized.
 	 *
@@ -403,73 +425,81 @@
 	public static boolean isInitialized() {
 		return Toolbox.getEngineManager(EngineType.SEARCH).getEngine(CQPSearchEngine.NAME).isRunning();
 	}
-
+	
 	@Override
 	public boolean isRunning() {
 		return state;
 	}
-
+	
 	@Override
 	public Selection query(CorpusBuild corpus, IQuery query, String name, boolean saveQuery) throws CqiClientException {
 		if (query instanceof CQLQuery && corpus instanceof CQPCorpus) {
-			return ((CQPCorpus)corpus).query((CQLQuery)query, name, saveQuery);
-		} else {
-			return new EmptySelection(query); 
+			return ((CQPCorpus) corpus).query((CQLQuery) query, name, saveQuery);
 		}
+		else {
+			return new EmptySelection(query);
+		}
 	}
-
+	
 	@Override
 	public IQuery newQuery() {
 		return new CQLQuery(""); //$NON-NLS-1$
 	}
-
+	
 	@Override
 	public boolean hasIndexes(CorpusBuild corpus) {
 		if (corpus instanceof CQPCorpus) return true;
-
+		
 		try {
 			String id = corpus.getID();
-
+			
 			return CorpusManager.getCorpusManager().getCorpus(id) != null;
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			e.printStackTrace();
 			return false;
 		}
 	}
-
+	
 	@Override
 	public void notify(TXMResult r, String state) {
 		// TODO Auto-generated method stub
 	}
-
+	
 	public static CQPSearchEngine getEngine() {
 		return (CQPSearchEngine) Toolbox.getEngineManager(EngineType.SEARCH).getEngine(CQPSearchEngine.NAME);
 	}
-
+	
 	@Override
 	public String getValueForProperty(Match match, SearchEngineProperty property) {
 		if (!(property instanceof Property)) return null;
-		Property p = (Property)property;
+		Property p = (Property) property;
 		try {
 			return org.txm.searchengine.cqp.corpus.query.Match.getValueForProperty(p, match.getStart());
-		} catch (CqiClientException e) {
+		}
+		catch (CqiClientException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
 		return null;
 	}
-
+	
 	@Override
 	public List<String> getValuesForProperty(Match match, SearchEngineProperty property) {
 		if (!(property instanceof Property)) return null;
 		
-		Property p = (Property)property;
+		Property p = (Property) property;
 		try {
 			return org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(p, match);
-		} catch (CqiClientException e) {
+		}
+		catch (CqiClientException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
 		return null;
 	}
-}
\ No newline at end of file
+	
+	public List<String> getValuesForProperty(int[] positions, WordProperty property) throws CqiClientException {
+		return org.txm.searchengine.cqp.corpus.query.Match.getValuesForProperty(property, positions);
+	}
+}
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java	(revision 3060)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java	(revision 3061)
@@ -32,7 +32,7 @@
 	public static final String KEYWORD_VIEW_PROPERTIES = "keyword_view_properties"; //$NON-NLS-1$
 	
 	public static final String RIGHT_VIEW_PROPERTIES = "right_view_properties"; //$NON-NLS-1$
-		
+	
 	/** The default value is "*" -> The concordance will use ref or text_id */
 	public static final String VIEW_REFERENCE_PATTERN = "view_reference_pattern"; //$NON-NLS-1$
 	
@@ -40,8 +40,6 @@
 	
 	public static final String LIMIT_CQL = "limit_cql"; //$NON-NLS-1$
 	
-	public static final String TOP_INDEX = "top_index"; //$NON-NLS-1$
-	
 	/**
 	 * Gets the instance.
 	 * 
@@ -61,7 +59,7 @@
 		Preferences preferences = this.getDefaultPreferencesNode();
 		
 		preferences.putInt(N_LINES_PER_PAGE, 100);
-		preferences.putInt(TOP_INDEX, 0);
+		preferences.putInt(INDEX, 0);
 		preferences.putInt(LEFT_CONTEXT_SIZE, 8);
 		preferences.putInt(RIGHT_CONTEXT_SIZE, 12);
 		
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 3060)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 3061)
@@ -114,8 +114,6 @@
 	
 	private ArrayList<WordProperty> availableRightSortProperties;
 	
-	
-	
 	/** The query. */
 	@Parameter(key = ConcordancePreferences.QUERY)
 	protected IQuery pQuery;
@@ -150,7 +148,7 @@
 	protected Integer pRightContextSize;
 	
 	/** The top line index shown and the number of lines to show per page */
-	@Parameter(key = ConcordancePreferences.TOP_INDEX)
+	@Parameter(key = ConcordancePreferences.INDEX)
 	protected Integer pTopIndex;
 	
 	@Parameter(key = ConcordancePreferences.N_LINES_PER_PAGE)
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java	(revision 3060)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java	(revision 3061)
@@ -649,11 +649,11 @@
 	}
 	
 	/**
-	 * Gets the keyword ids.
+	 * Gets the keyword IDs.
 	 *
-	 * @return the keyword ids
+	 * @return the keyword IDs
 	 */
-	public Collection<? extends String> getKeywordIds() {
+	public List<? extends String> getKeywordIds() {
 		return this.keywordsIdValues;
 	}
 	
Index: tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/view/ElementSearchView.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/view/ElementSearchView.java	(revision 3060)
+++ tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/view/ElementSearchView.java	(revision 3061)
@@ -61,44 +61,66 @@
 import visuAnalec.vue.Vue;
 
 public class ElementSearchView extends ViewPart {
-
+	
 	public static final String ID = ElementSearchView.class.getName();
-
-	private LinkedHashMap<Combo, String> textWidgets = new LinkedHashMap<Combo, String>();
+	
+	private LinkedHashMap<Combo, String> textWidgets = new LinkedHashMap<>();
+	
 	Element currentElement = null;
+	
 	int currentIndex = -1;
-	ArrayList<Element> matchingElements = new ArrayList<Element>();
+	
+	ArrayList<Element> matchingElements = new ArrayList<>();
+	
 	URSAnnotationToolbar toolbar;
-
+	
 	private Composite buttons;
+	
 	private Composite fields;
+	
 	private Text text;
+	
 	private Label label;
+	
 	private Button firstButton;
+	
 	private Button previousButton;
+	
 	private Button nextButton;
+	
 	private Button lastButton;
+	
 	private Button resetButton;
+	
 	private Button searchButton;
+	
 	private Button concordanceButton;
+	
 	RowData cData = new RowData();
+	
 	private GridData lData;
+	
 	private GridData tData;
-
+	
 	private Corpus analecCorpus;
+	
 	private Class clazzSearched;
+	
 	private String typeSearched;
-
+	
 	private Vue vue;
+	
 	private CorpusListener corpusListener = new CorpusListener() {
+		
 		@Override
 		public void traiterEvent(final Message e) {
 			Display.getDefault().syncExec(new Runnable() {
+				
 				@Override
 				public void run() {
-					//System.out.println("EVENT: "+e);
+					// System.out.println("EVENT: "+e);
 					if (fields == null || fields.isDisposed()) return;
-
+					
 					if (e.getType() == TypeMessage.MODIF_STRUCTURE) {
 						needUpdate = true;
 						loadType(corpus, analecCorpus, clazzSearched, typeSearched, toolbar);
@@ -107,24 +129,24 @@
 			});
 		}
 	};
-
+	
 	private boolean needUpdate = false;
-
+	
 	private SelectionListener selectionChangedListener;
-
+	
 	private org.txm.searchengine.cqp.corpus.CQPCorpus corpus;
-
+	
 	private ConcordanceEditor concordanceEditor;
-
+	
 	private IEditorPart fromEditor;
-
+	
 	private Concordance concordance;
-
+	
 	public static void closeView() {
 		try {
 			IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 			ElementSearchView view = (ElementSearchView) page.findView(ElementSearchView.ID);
-
+			
 			// close Element View if opened
 			if (view != null) {
 				view = (ElementSearchView) page.showView(ElementSearchView.ID);
@@ -132,12 +154,14 @@
 			}
 			
 			return;
-		} catch (PartInitException e1) {
-			System.out.println("Part initialisation error: "+e1.getLocalizedMessage());
+		}
+		catch (PartInitException e1) {
+			System.out.println("Part initialisation error: " + e1.getLocalizedMessage());
 			Log.printStackTrace(e1);
 		}
 		return;
 	}
+	
 	public static ElementSearchView openView() {
 		// open Element View if not opened
 		try {
@@ -145,54 +169,58 @@
 			ElementSearchView view = (ElementSearchView) page.findView(ElementSearchView.ID);
 			if (view == null) {
 				view = (ElementSearchView) page.showView(ElementSearchView.ID);
-				if (view != null && !view.fields.isDisposed() && view.fields.getParent() != null) 
+				if (view != null && !view.fields.isDisposed() && view.fields.getParent() != null)
 					view.fields.getParent().layout(); // sometimes the part layout is broken
 			}
 			if (view == null) {
-				System.out.println("Error ElementPropertiesView view not found: "+ElementSearchView.ID);
+				System.out.println("Error ElementPropertiesView view not found: " + ElementSearchView.ID);
 			}
 			return view;
-		} catch (PartInitException e1) {
-			System.out.println("Part initialisation error: "+e1.getLocalizedMessage());
+		}
+		catch (PartInitException e1) {
+			System.out.println("Part initialisation error: " + e1.getLocalizedMessage());
 			Log.printStackTrace(e1);
 		}
 		return null;
 	}
-
+	
 	@Override
 	public void createPartControl(Composite parent) {
-
+		
 		GridLayout layout = new GridLayout();
 		parent.setLayout(layout);
-
-		//previous and next buttons
+		
+		// previous and next buttons
 		buttons = new Composite(parent, SWT.NONE);
 		buttons.setLayout(new GridLayout(10, false));
 		GridData buttons_gdata = new GridData(GridData.FILL, GridData.CENTER, true, false);
 		buttons_gdata.horizontalSpan = 2;
 		buttons.setLayoutData(buttons_gdata);
-
+		
 		searchButton = new Button(buttons, SWT.PUSH);
-		searchButton.setText("OK");
+		searchButton.setImage(IImageKeys.getImage(IImageKeys.START));
 		searchButton.setToolTipText("Search elements using the search fields values");
 		searchButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				search();
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		resetButton = new Button(buttons, SWT.PUSH);
 		resetButton.setImage(IImageKeys.getImage("platform:/plugin/org.txm.rcp/icons/cross.png"));
 		resetButton.setToolTipText("Reset the search field values");
 		resetButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				for (Combo c : textWidgets.keySet()) c.setText("");
-
+				for (Combo c : textWidgets.keySet())
+					c.setText("");
+				
 				ElementSearchView.this.concordanceButton.setEnabled(false);
 				ElementSearchView.this.firstButton.setEnabled(false);
 				ElementSearchView.this.previousButton.setEnabled(false);
@@ -204,142 +232,153 @@
 				currentIndex = -1;
 				updateCurrentLabel();
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		label = new Label(buttons, SWT.NONE);
 		label.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 		label.setText("");
-
+		
 		firstButton = new Button(buttons, SWT.PUSH);
 		firstButton.setImage(IImageKeys.getImage(IImageKeys.CTRLSTART));
 		firstButton.setToolTipText("Select the first match");
 		firstButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				text.setText(""+1);
+				text.setText("" + 1);
 				selectionChangedListener.widgetSelected(null);
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
 		previousButton = new Button(buttons, SWT.PUSH);
 		previousButton.setImage(IImageKeys.getImage(IImageKeys.CTRLREVERSE));
 		previousButton.setToolTipText("Select the previous match");
 		previousButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int current = Integer.parseInt(text.getText());
 				current--;
 				if (current < 1) current = 1;
-				text.setText(""+current);
+				text.setText("" + current);
 				selectionChangedListener.widgetSelected(null);
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		text = new Text(buttons, SWT.BORDER);
 		text.setText("");
 		text.setToolTipText("Set a match number, and select it with the ENTER key");
 		selectionChangedListener = new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				if (toolbar == null || toolbar.isDisposed()) return; 
-				//System.out.println("SELECTED!!");
+				if (toolbar == null || toolbar.isDisposed()) return;
+				// System.out.println("SELECTED!!");
 				try {
-					currentIndex = Integer.parseInt(text.getText())-1;
+					currentIndex = Integer.parseInt(text.getText()) - 1;
 					currentElement = matchingElements.get(currentIndex);
 					toolbar.select(currentElement);
 					updateCurrentLabel();
-				} catch(Exception err) {
-					System.out.println("Could not set current match: "+err.getLocalizedMessage());
 				}
+				catch (Exception err) {
+					System.out.println("Could not set current match: " + err.getLocalizedMessage());
+				}
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		};
 		text.addSelectionListener(selectionChangedListener);
 		text.addKeyListener(new KeyListener() {
+			
 			@Override
 			public void keyReleased(KeyEvent e) {
 				if (currentElement == null) return;
-
+				
 				if (e.keyCode == SWT.HOME) {
-					text.setText(""+1);
+					text.setText("" + 1);
 					selectionChangedListener.widgetSelected(null);
-				} else if (e.keyCode == SWT.END) {
-					text.setText(""+matchingElements.size());
+				}
+				else if (e.keyCode == SWT.END) {
+					text.setText("" + matchingElements.size());
 					selectionChangedListener.widgetSelected(null);
-				} else if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR ) {
+				}
+				else if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
 					selectionChangedListener.widgetSelected(null);
 				}
 			}
-
+			
 			@Override
-			public void keyPressed(KeyEvent e) { }
+			public void keyPressed(KeyEvent e) {}
 		});
-
+		
 		GridData gdata = new GridData(GridData.FILL, GridData.FILL, false, false);
 		gdata.minimumWidth = 100;
 		gdata.widthHint = 100;
 		text.setLayoutData(gdata);
 		label = new Label(buttons, SWT.NONE);
 		label.setText(" / -");
-
+		
 		nextButton = new Button(buttons, SWT.PUSH);
 		nextButton.setImage(IImageKeys.getImage(IImageKeys.CTRLPLAY));
 		nextButton.setToolTipText("Select the next match");
 		nextButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int current = Integer.parseInt(text.getText());
 				current++;
 				if (current > matchingElements.size()) current = matchingElements.size();
-				text.setText(""+current);
+				text.setText("" + current);
 				selectionChangedListener.widgetSelected(null);
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
 		lastButton = new Button(buttons, SWT.PUSH);
 		lastButton.setImage(IImageKeys.getImage(IImageKeys.CTRLEND));
 		lastButton.setToolTipText("Select the last match");
 		lastButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				text.setText(""+matchingElements.size());
+				text.setText("" + matchingElements.size());
 				selectionChangedListener.widgetSelected(null);
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		concordanceButton = new Button(buttons, SWT.PUSH);
 		concordanceButton.setImage(IImageKeys.getImage(ConcordanceEditor.class, IImageKeys.ACTION_CONCORDANCES));
 		concordanceButton.setToolTipText("View the matches in concordances");
 		concordanceButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				try {
 					toConcordances(e);
-				} catch (Exception e1) {
+				}
+				catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		this.searchButton.setEnabled(false);
 		this.concordanceButton.setEnabled(false);
 		this.firstButton.setEnabled(false);
@@ -348,13 +387,13 @@
 		this.lastButton.setEnabled(false);
 		this.text.setEnabled(false);
 		this.resetButton.setEnabled(false);
-
+		
 		fields = new Composite(parent, SWT.NONE);
 		GridData fields_gdata = new GridData(GridData.FILL, GridData.FILL, true, true);
 		fields.setLayoutData(fields_gdata);
 		fields.setLayout(new RowLayout());
 		this.setPartName("Element");
-
+		
 		// GridDatas to use when a new field is added
 		cData.width = 325;
 		lData = new GridData(GridData.FILL, GridData.CENTER, false, false);
@@ -363,17 +402,18 @@
 		tData = new GridData(GridData.FILL, GridData.FILL, true, false);
 		tData.minimumWidth = 150;
 		tData.widthHint = 150;
-
+		
 		updateCurrentLabel();
 	}
-
+	
 	protected void updateCurrentLabel() {
 		if (currentIndex >= 0) {
-			this.setPartName(""+(currentIndex+1)+" / "+matchingElements.size()+" "+typeSearched);
-			text.setText(""+(currentIndex+1));
-			label.setText(" / "+matchingElements.size());
+			this.setPartName("" + (currentIndex + 1) + " / " + matchingElements.size() + " " + typeSearched);
+			text.setText("" + (currentIndex + 1));
+			label.setText(" / " + matchingElements.size());
 			text.setEnabled(true);
-		} else {
+		}
+		else {
 			if (typeSearched != null) this.setPartName(typeSearched);
 			text.setText("1");
 			text.setEnabled(false);
@@ -381,10 +421,10 @@
 		}
 		label.getParent().layout();
 	}
-
+	
 	/**
 	 * 
-	 * @param corpus the CQP corpus 
+	 * @param corpus the CQP corpus
 	 * @param analecCorpus the analec corpus
 	 * @param clazz the search Analec Element class (Unite, Schema, Relation)
 	 * @param type the searched Element type
@@ -392,13 +432,13 @@
 	 */
 	public void loadType(org.txm.searchengine.cqp.corpus.CQPCorpus corpus, Corpus analecCorpus, Class clazz, String type, URSAnnotationToolbar toolbar) {
 		if (toolbar == null || toolbar.isDisposed()) return;
-
+		
 		this.searchButton.setEnabled(true);
-
+		
 		if (this.analecCorpus != null) { // remove corpus listener from previous corpus
 			this.analecCorpus.removeEventListener(corpusListener);
 		}
-
+		
 		this.fromEditor = toolbar.getEditor();
 		if (this.corpus != corpus && concordanceEditor != null) {
 			concordanceEditor = null;
@@ -407,116 +447,121 @@
 		this.analecCorpus = analecCorpus;
 		this.analecCorpus.addEventListener(corpusListener);
 		this.vue = URSCorpora.getVue(analecCorpus);
-
-		if (this.needUpdate  || type.equals(type)) { // no need to rebuild the widgets
+		
+		if (this.needUpdate || type.equals(type)) { // no need to rebuild the widgets
 			needUpdate = false;
 			clear(); // remove all previous widgets
-
+			
 			String[][] props = vue.getChamps(clazz, type);
 			if (props.length > 0)
 				for (String p : props[0]) { // the first is the prop names
-
-					Composite c = new Composite(fields, SWT.NONE);
-					c.setLayoutData(cData);
-					c.setLayout(new GridLayout(2, false));
-					Label l = new Label(c, SWT.None);
-					l.setText(p);
-					l.setLayoutData(lData);
-
-					Combo t = new Combo(c, SWT.BORDER);
-					t.setLayoutData(tData);
-					textWidgets.put(t, p);
-					setItems(t, clazz, type, p);
-					t.addKeyListener(new KeyListener() {
-						@Override
-						public void keyReleased(KeyEvent e) {
-							if (!(e.widget instanceof Combo)) return;
-							if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
-								search();
-							}
+				
+				Composite c = new Composite(fields, SWT.NONE);
+				c.setLayoutData(cData);
+				c.setLayout(new GridLayout(2, false));
+				Label l = new Label(c, SWT.None);
+				l.setText(p);
+				l.setLayoutData(lData);
+				
+				Combo t = new Combo(c, SWT.BORDER);
+				t.setLayoutData(tData);
+				textWidgets.put(t, p);
+				setItems(t, clazz, type, p);
+				t.addKeyListener(new KeyListener() {
+					
+					@Override
+					public void keyReleased(KeyEvent e) {
+						if (!(e.widget instanceof Combo)) return;
+						if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
+							search();
 						}
-
-						@Override
-						public void keyPressed(KeyEvent e) { }
-					});
+					}
+					
+					@Override
+					public void keyPressed(KeyEvent e) {}
+				});
 				}
 			fields.layout();
 			fields.getParent().layout();
 		}
-
+		
 		this.toolbar = toolbar;
 		this.clazzSearched = clazz;
 		this.typeSearched = type;
-
-		this.setPartName(corpus.getName()+" - "+typeSearched);
+		
+		this.setPartName(corpus.getName() + " - " + typeSearched);
 	}
-	public static final String letters = "abcefghijklmnopqrstu";//vwxyz0123456789";
+	
+	public static final String letters = "abcefghijklmnopqrstu";// vwxyz0123456789";
+	
 	public static final int MAXCONCORDANCEQUERYSIZE = 1150; // 1200 in fact
-	//	public static String[] doubleletters = new String[letters.length()+ (letters.length()*letters.length())];
-	//	static {
-	//		for (int i = 0 ; i < letters.length() ; i++) doubleletters[i] = ""+letters.charAt(i);
-	//		for (int i = 0 ; i < letters.length() ; i++) 
-	//			for (int j = 0 ; j < letters.length() ; j++) doubleletters[letters.length()+ i + (j*letters.length())] = ""+letters.charAt(i)+letters.charAt(j);
-	//		System.out.println(Arrays.toString(doubleletters));
-	//	}
-	//	
-	//	/**
-	//	 * just a simple way to create a label using the match length
-	//	 * @param size
-	//	 * @return a uniq String if size is < to doubleletters.length()
-	//	 */
-	//	public static String getLetter(int size) {
-	//		if (size >= doubleletters.length) return "zzz";
-	//		else return doubleletters[size];
-	//	}
+	// public static String[] doubleletters = new String[letters.length()+ (letters.length()*letters.length())];
+	// static {
+	// for (int i = 0 ; i < letters.length() ; i++) doubleletters[i] = ""+letters.charAt(i);
+	// for (int i = 0 ; i < letters.length() ; i++)
+	// for (int j = 0 ; j < letters.length() ; j++) doubleletters[letters.length()+ i + (j*letters.length())] = ""+letters.charAt(i)+letters.charAt(j);
+	// System.out.println(Arrays.toString(doubleletters));
+	// }
+	//
+	// /**
+	// * just a simple way to create a label using the match length
+	// * @param size
+	// * @return a uniq String if size is < to doubleletters.length()
+	// */
+	// public static String getLetter(int size) {
+	// if (size >= doubleletters.length) return "zzz";
+	// else return doubleletters[size];
+	// }
+	
 	public void toConcordances(SelectionEvent e) throws Exception {
 		if (matchingElements.size() == 0) return;
-
-		LinkedHashSet<Unite> unites = new LinkedHashSet<Unite>();
+		
+		LinkedHashSet<Unite> unites = new LinkedHashSet<>();
 		for (Element m : matchingElements) {
 			for (Unite unite : m.getUnitesSousjacentes()) {
 				unites.add(unite);
 			}
 		}
 		
-		List<Unite> unites_list = new ArrayList<Unite>();
+		List<Unite> unites_list = new ArrayList<>();
 		unites_list.addAll(unites);
 		Collections.sort(unites_list);
 		
 		int[] starts = new int[unites.size()];
 		int[] ends = new int[unites.size()];
 		int[] targets = null;
-
+		
 		int i = 0;
 		for (Unite u : unites_list) {
 			starts[i] = u.getDeb();
 			ends[i] = u.getFin();
 			i++;
 		}
-
-		FakeQueryResult fqr = new FakeQueryResult("SearchViewLink", toolbar.getCQPCorpus(), new CQLQuery(""), 
+		
+		FakeQueryResult fqr = new FakeQueryResult("SearchViewLink", toolbar.getCQPCorpus(), new CQLQuery(""),
 				starts, ends, targets);
-
-		HashSet<Integer> sizes = new HashSet<Integer>();
+		
+		HashSet<Integer> sizes = new HashSet<>();
 		for (Unite unite : unites) {
-			int size = unite.getFin() - unite.getDeb()+1;
-			if (size > letters.length()) size = letters.length()-1;
+			int size = unite.getFin() - unite.getDeb() + 1;
+			if (size > letters.length()) size = letters.length() - 1;
 			sizes.add(size);
 		}
-
 		
+		
 		concordance = null;
 		
 		if (concordanceEditor == null || concordanceEditor.isDisposed()) {
 			concordance = new Concordance(corpus);
 			List<WordProperty> viewProperties = Arrays.asList(corpus.getWordProperty());
 			ReferencePattern ref = new ReferencePattern(corpus.getStructuralUnit("text").getProperty("id"));
-			concordance.setParameters(new CQLQuery(""), 
-				viewProperties, viewProperties, viewProperties,
-				viewProperties, viewProperties, viewProperties, 
-				ref, ref, 
-				7, 10);
-		} else {
+			concordance.setParameters(new CQLQuery(""),
+					viewProperties, viewProperties, viewProperties,
+					viewProperties, viewProperties, viewProperties,
+					ref, ref,
+					7, 10);
+		}
+		else {
 			concordance = concordanceEditor.getConcordance();
 		}
 		concordance.setQueryResult(fqr);
@@ -535,33 +580,33 @@
 					}
 					concordanceEditor = (ConcordanceEditor) editor;
 					
-						if (toolbar.getEditor() != null) {
-							SWTEditorsUtils.addEditor(toolbar.getEditor(), concordanceEditor, EModelService.BELOW);
-						}
-						//BackToText.associateEditors(toolbar.getEditor(), concordanceEditor);
-						toolbar.getEditor().addLinkedEditor(concordanceEditor);
-						concordanceEditor.addLinkedEditor(toolbar.getEditor());
+					if (toolbar.getEditor() != null) {
+						SWTEditorsUtils.addEditor(toolbar.getEditor(), concordanceEditor, EModelService.BELOW);
+					}
+					// BackToText.associateEditors(toolbar.getEditor(), concordanceEditor);
+					toolbar.getEditor().addLinkedEditor(concordanceEditor);
+					concordanceEditor.addLinkedEditor(toolbar.getEditor());
 				}
-
+				
 				concordanceEditor.compute(false);
 				IWorkbenchPage attachedPage = concordanceEditor.getEditorSite().getPage();
 				attachedPage.activate(concordanceEditor);
 			}
 		});
 	}
-
+	
 	/**
 	 * start a new search
 	 */
 	public void search() {
 		if (toolbar == null || toolbar.isDisposed()) return;
-
+		
 		ArrayList<? extends Element> elements = analecCorpus.getElements(clazzSearched, typeSearched);
 		matchingElements.clear();
 		for (Element e : elements) {
 			boolean insert = true;
 			for (Combo w : textWidgets.keySet()) {
-				if (w.getText().trim().length() > 0 
+				if (w.getText().trim().length() > 0
 						&& !e.getProp(textWidgets.get(w)).matches(w.getText())) {
 					insert = false;
 					continue;
@@ -569,28 +614,32 @@
 			}
 			if (insert) matchingElements.add(e);
 		}
-
+		
 		if (matchingElements.size() > 0) {
-
+			
 			// sort elements
 			Collections.sort(matchingElements, new Comparator<Element>() {
+				
 				@Override
 				public int compare(Element o1, Element o2) {
 					if (o1 == null) return 1;
 					else if (o2 == null) return -1;
 					else if (o1.getUnite0().getDeb() < o2.getUnite0().getDeb()) {
 						return -1;
-					} else if (o1.getUnite0().getDeb() > o2.getUnite0().getDeb()) {
+					}
+					else if (o1.getUnite0().getDeb() > o2.getUnite0().getDeb()) {
 						return 1;
-					} else if (o1.getUnite0().getFin() < o2.getUnite0().getFin()) {
+					}
+					else if (o1.getUnite0().getFin() < o2.getUnite0().getFin()) {
 						return -1;
-					} else if (o1.getUnite0().getFin() > o2.getUnite0().getFin()) {
+					}
+					else if (o1.getUnite0().getFin() > o2.getUnite0().getFin()) {
 						return 1;
 					}
 					return 0;
 				}
 			});
-
+			
 			currentElement = matchingElements.get(0);
 			currentIndex = 0;
 			toolbar.select(currentElement);
@@ -603,7 +652,8 @@
 			this.lastButton.setEnabled(true);
 			this.text.setEnabled(true);
 			this.resetButton.setEnabled(true);
-		} else {
+		}
+		else {
 			this.concordanceButton.setEnabled(false);
 			this.firstButton.setEnabled(false);
 			this.previousButton.setEnabled(false);
@@ -616,18 +666,18 @@
 			updateCurrentLabel();
 		}
 	}
-
+	
 	private void setItems(Combo t, Class clazz, String type, String prop) {
 		String[] items = vue.getValeursChamp(clazz, type, prop);
 		t.setItems(items);
 		KeyStroke keys = KeyStroke.getInstance(SWT.CONTROL, SWT.SPACE);
 		new TXMAutoCompleteField(t, new ComboContentAdapter(), items, keys);
 	}
-
+	
 	public Corpus getCurrentAnalecCorpus() {
 		return analecCorpus;
 	}
-
+	
 	@Override
 	public void setFocus() {
 		for (Combo w : textWidgets.keySet()) {
@@ -635,13 +685,13 @@
 			return;
 		}
 	}
-
+	
 	public void clear() {
 		Control[] children = fields.getChildren();
-		for (int i = 0 ; i < children.length ; i++) { 
+		for (int i = 0; i < children.length; i++) {
 			children[i].dispose();
 		}
 		textWidgets.clear();
 		fields.layout();
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSSearchPreferencePage.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSSearchPreferencePage.java	(revision 0)
+++ tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSSearchPreferencePage.java	(revision 3061)
@@ -0,0 +1,40 @@
+package org.txm.annotation.urs.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.txm.rcp.Application;
+
+/**
+ * TODO use TXMPreferencesPage
+ * 
+ * @author mdecorde
+ *
+ */
+public class URSSearchPreferencePage extends FieldEditorPreferencePage
+		implements IWorkbenchPreferencePage {
+	
+	ScopedPreferenceStore preferences;
+	
+	
+	public URSSearchPreferencePage() {
+		super();
+		
+		preferences = new ScopedPreferenceStore(org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE, Application.PLUGIN_ID);
+		setPreferenceStore(preferences);
+	}
+	
+	/**
+	 * 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() {
+		
+	}
+	
+	@Override
+	public void init(IWorkbench workbench) {}
+}

Property changes on: tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSSearchPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSPreferencePage.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSPreferencePage.java	(revision 3060)
+++ tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/preferences/URSPreferencePage.java	(revision 3061)
@@ -1,29 +1,32 @@
 package org.txm.annotation.urs.preferences;
 
 import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
 import org.eclipse.jface.preference.RadioGroupFieldEditor;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.txm.annotation.urs.Messages;
 import org.txm.rcp.Application;
+import org.txm.rcp.preferences.TXMPreferencePage;
 
-public class URSPreferencePage  extends FieldEditorPreferencePage
-implements IWorkbenchPreferencePage {
+public class URSPreferencePage extends TXMPreferencePage
+		implements IWorkbenchPreferencePage {
+	
 	private BooleanFieldEditor analec_limit_scheme_field;
+	
 	private BooleanFieldEditor prefix_autocompletion_field;
 	
-//	public static final String SELECTED_UNIT_COLOR = "selected_unit_color";
-//	private ColorFieldEditor selected_unit_color;
-//	public static final String HIGHLIGHTED_UNIT_COLOR = "hightlighted_unit_color";
-//	private ColorFieldEditor hightlighted_unit_color;
+	// public static final String SELECTED_UNIT_COLOR = "selected_unit_color";
+	// private ColorFieldEditor selected_unit_color;
+	// public static final String HIGHLIGHTED_UNIT_COLOR = "hightlighted_unit_color";
+	// private ColorFieldEditor hightlighted_unit_color;
 	
 	ScopedPreferenceStore preferences;
+	
 	public static final String COLOR_PALETTE = "color_palette"; //$NON-NLS-1$
 	
 	private RadioGroupFieldEditor color_palette;
-
+	
 	public URSPreferencePage() {
 		super();
 		
@@ -31,7 +34,7 @@
 				Application.PLUGIN_ID);
 		setPreferenceStore(preferences);
 	}
-
+	
 	/**
 	 * Creates the field editors. Field editors are abstractions of the common
 	 * GUI blocks needed to manipulate various types of preferences. Each field
@@ -49,18 +52,18 @@
 				getFieldEditorParent());
 		addField(prefix_autocompletion_field);
 		
-//		hightlighted_unit_color = new ColorFieldEditor(
-//				HIGHLIGHTED_UNIT_COLOR, "Highlighted units background color",
-//				getFieldEditorParent());
-//		addField(hightlighted_unit_color);
-//		
-//		
-//		selected_unit_color = new ColorFieldEditor(
-//				SELECTED_UNIT_COLOR, "Selected units background color",
-//				getFieldEditorParent());
-//		addField(selected_unit_color);
+		// hightlighted_unit_color = new ColorFieldEditor(
+		// HIGHLIGHTED_UNIT_COLOR, "Highlighted units background color",
+		// getFieldEditorParent());
+		// addField(hightlighted_unit_color);
+		//
+		//
+		// selected_unit_color = new ColorFieldEditor(
+		// SELECTED_UNIT_COLOR, "Selected units background color",
+		// getFieldEditorParent());
+		// addField(selected_unit_color);
 		
-		String[][] values = {{"green","green"}, {"yellow","yellow"}}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+		String[][] values = { { "green", "green" }, { "yellow", "yellow" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		color_palette = new RadioGroupFieldEditor(COLOR_PALETTE, Messages.AnalecPreferencePage_9, 2, values, getFieldEditorParent());
 		addField(color_palette);
 		
@@ -71,5 +74,5 @@
 	}
 	
 	@Override
-	public void init(IWorkbench workbench) { }
+	public void init(IWorkbench workbench) {}
 }
Index: tmp/org.txm.analec.rcp/plugin.xml
===================================================================
--- tmp/org.txm.analec.rcp/plugin.xml	(revision 3060)
+++ tmp/org.txm.analec.rcp/plugin.xml	(revision 3061)
@@ -412,8 +412,14 @@
             category="org.txm.annotation.rcp.preferences.AnnotationPreferencePage"
             class="org.txm.annotation.urs.preferences.URSPreferencePage"
             id="org.txm.annotation.urs.preferences.URSPreferencePage"
-            name="%page.name">
+            name="URS">
       </page>
+      <page
+            category="org.txm.searchengine.rcp.preferences.SearchEnginePreferencesPage"
+            class="org.txm.annotation.urs.preferences.URSSearchPreferencePage"
+            id="org.txm.annotation.urs.preferences.URSSearchPreferencePage"
+            name="URS">
+      </page>
    </extension>
    <extension
          point="org.txm.annotation.rcp.editor.AnnotationArea">
