Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages_fr.properties
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages_fr.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages_fr.properties	(revision 3747)
@@ -0,0 +1,2 @@
+UDSearchEngine_0=Limiter la recherche aux phrases UD
+UDSearchEngine_9=<p>Phrases : 

Property changes on: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages.properties
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages.properties	(revision 0)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages.properties	(revision 3747)
@@ -0,0 +1,2 @@
+UDSearchEngine_0=Limit search to UD sentences
+UDSearchEngine_9=<p>Sentences: 

Property changes on: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/messages.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/function/UDTreeSearch.java
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/function/UDTreeSearch.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/function/UDTreeSearch.java	(revision 3747)
@@ -32,8 +32,6 @@
 
 public class UDTreeSearch extends TreeSearch {
 	
-	protected boolean ready = false;
-	
 	Subcorpus udSentences;
 
 	private QueryResult rawMatches;
@@ -52,7 +50,7 @@
 		
 		this.corpus = getParent();
 		
-		ready = hasUDProperties(corpus, UDPreferences.getInstance().getProjectPreferenceValue(corpus.getProject(), UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX)));
+		
 	}
 	
 	public UDTreeSearch(String parentNodePath) {
@@ -220,7 +218,7 @@
 	}
 	
 	public boolean isReady() {
-		return ready;
+		return hasUDProperties(corpus, UDPreferences.getInstance().getProjectPreferenceValue(corpus.getProject(), UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX)));
 	}
 	
 	public int getNMatchingSentences() {
@@ -301,16 +299,11 @@
 	}
 	
 	@Override
-	public boolean saveParameters() throws Exception {
+	public boolean _loadParameters() throws Exception {
 		return true;
 	}
 	
 	@Override
-	public boolean loadParameters() throws Exception {
-		return super.loadParameters();
-	}
-	
-	@Override
 	protected boolean _compute(TXMProgressMonitor monitor) throws Exception {
 		
 		String prefix = UDPreferences.getInstance().getProjectPreferenceValue(corpus.getProject(), UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX));
Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/search/UDSearchEngine.java
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/search/UDSearchEngine.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/search/UDSearchEngine.java	(revision 3747)
@@ -4,6 +4,7 @@
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.Toolbox;
+import org.txm.conllu.core.Messages;
 import org.txm.conllu.core.function.UDTreeSearch;
 import org.txm.conllu.core.preferences.UDPreferences;
 import org.txm.core.engines.EngineType;
@@ -30,7 +31,7 @@
  */
 public class UDSearchEngine extends SearchEngine {
 
-	public static final String NAME = "UD";
+	public static final String NAME = "UD"; //$NON-NLS-1$
 
 	CQPSearchEngine CQI;
 
@@ -39,19 +40,19 @@
 		if (CQI == null) {
 			CQI = CQPSearchEngine.getEngine();
 		}
-		return CQI;
+		return CQI; 
 	}
 
 	public String getOptionForSearchengine() {
-		return "CQP";
+		return "CQP"; //$NON-NLS-1$
 	}
 
 	public String getOptionNameForSearchengine() {
-		return "ud-s";
+		return "ud-s"; //$NON-NLS-1$
 	}
 
 	public String getOptionDescriptionForSearchengine() {
-		return "Work with the ud-s subcorpus of the UD sentences";
+		return Messages.UDSearchEngine_0;
 	}
 
 	@Override
@@ -83,7 +84,7 @@
 
 	@Override
 	public String getName() {
-		return "UD";
+		return "UD"; //$NON-NLS-1$
 	}
 
 	@Override
@@ -130,26 +131,35 @@
 
 	public static Subcorpus getSentenceSubcorpus(CQPCorpus corpus, String prefix) throws CqiClientException, InterruptedException {
 
-		Subcorpus udSentences = corpus.getSubcorpusByName(corpus.getName()+TXMPreferences.PARENT_NAME_SEPARATOR+"ud-s");
+		Subcorpus udSentences = corpus.getSubcorpusByName(corpus.getName()+TXMPreferences.PARENT_NAME_SEPARATOR+"ud-s"); //$NON-NLS-1$
 		if (udSentences != null) udSentences.compute(false);
 
-		CQLQuery sentencesQuery = new CQLQuery("["+prefix+"id=\"1\"] ["+prefix+"id !=\"1\"]+ [:"+prefix+"id=\"1|__UNDEF__\":]");
+		CQLQuery sentencesQuery = new CQLQuery(getUDSCQPQueryString(prefix));
 		if (udSentences == null) { // no ud-s subcorpus, create it
-			udSentences = corpus.createSubcorpus(sentencesQuery, "ud-s");
+			udSentences = corpus.createSubcorpus(sentencesQuery, "ud-s"); //$NON-NLS-1$
 			udSentences.setVisible(false);
 		}
 		if (!udSentences.getQuery().equals(sentencesQuery)) { // the subcorpus exists but its query differs 
-			udSentences = corpus.createSubcorpus(sentencesQuery, "ud-s");
+			udSentences = corpus.createSubcorpus(sentencesQuery, "ud-s"); //$NON-NLS-1$
 			udSentences.setVisible(false);
 		}
 
 		return udSentences;
 	}
+	
+	/**
+	 * 
+	 * @param prefix the UD prefix of the CQP properties
+	 * @return A CQL query to build a Subcorpus of UD sentences
+	 */
+	public static String getUDSCQPQueryString(String prefix) {
+		return "["+prefix+"id=\"1\"] ["+prefix+"id !=\"1\"]+ [:"+prefix+"id=\"1|__UNDEF__\":]";  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+	}
 
 	public String hasAdditionalDetailsForResult(TXMResult result) {
 		if (result instanceof CQPCorpus) {
 			CQPCorpus corpus = (CQPCorpus)result;
-			return UDTreeSearch.hasUDProperties(corpus)?"Syntax":null;
+			return UDTreeSearch.hasUDProperties(corpus)?"Syntax":null; //$NON-NLS-1$
 		}
 		return null;
 	}
@@ -160,14 +170,14 @@
 			if (UDTreeSearch.hasUDProperties(corpus)) {
 				StringBuilder buffer = new StringBuilder();
 
-				buffer.append("<h3>CoNLLU</h3>\n");
+				buffer.append("<h3>CoNLLU</h3>\n"); //$NON-NLS-1$
 
 				String prefix = UDPreferences.getInstance().getProjectPreferenceValue(corpus.getProject(), UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX));
-				buffer.append("<p>UD prefix: '"+prefix+"'</p>\n");
+				buffer.append("<p>UD prefix: '"+prefix+"'</p>\n"); //$NON-NLS-2$
 
 				try {
 					Subcorpus udSentences = getSentenceSubcorpus(corpus, prefix);
-					buffer.append("<p>Sentences: "+udSentences.getNMatch()+"</p>\n");
+					buffer.append(Messages.UDSearchEngine_9+udSentences.getNMatch()+"</p>\n"); //$NON-NLS-2$
 				} catch (Exception e) {
 					// TODO Auto-generated catch block
 					e.printStackTrace();
Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/Messages.java
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/Messages.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/Messages.java	(revision 3747)
@@ -0,0 +1,19 @@
+package org.txm.conllu.core;
+
+import org.eclipse.osgi.util.NLS;
+import org.txm.utils.messages.Utf8NLS;
+
+public class Messages extends NLS {
+	
+	private static final String BUNDLE_NAME = Messages.class.getPackageName() + ".messages"; //$NON-NLS-1$
+	public static String UDSearchEngine_0;
+	public static String UDSearchEngine_9;
+	
+	static {
+		// initialize resource bundle
+		Utf8NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+	}
+
+	private Messages() {
+	}
+}

Property changes on: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/Messages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/bundles/org.txm.conllu.rcp/src/org/txm/conllu/rcp/commands/CoNLLUCorpusPreferences.java
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.rcp/src/org/txm/conllu/rcp/commands/CoNLLUCorpusPreferences.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.conllu.rcp/src/org/txm/conllu/rcp/commands/CoNLLUCorpusPreferences.java	(revision 3747)
@@ -28,19 +28,19 @@
 package org.txm.conllu.rcp.commands;
 
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.kohsuke.args4j.Option;
 import org.osgi.service.prefs.Preferences;
 import org.txm.conllu.core.preferences.UDPreferences;
-import org.txm.rcp.swt.widget.parameters.ParametersDialog;
+import org.txm.rcp.swt.dialog.MultipleValueDialog;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.treesearch.preferences.TreeSearchPreferences;
 import org.txm.utils.logger.Log;
 
 /**
@@ -49,40 +49,67 @@
  * @author mdecorde.
  */
 public class CoNLLUCorpusPreferences extends AbstractHandler {
-	
+
 	public static final String ID = CoNLLUCorpusPreferences.class.getName();
-	
-	
+
+
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
 	public Object execute(final ExecutionEvent event) throws ExecutionException {
-		
+
 		Object s = CorporaView.getFirstSelectedObject();
-		
+
 		if (!(s instanceof MainCorpus)) {
 			Log.warning("Selection is not a corpus. Aborting.");
 			return null;
 		}
-		
+
 		MainCorpus c = (MainCorpus)s;
-		
+
 		Preferences customNode = c.getProject().getPreferencesScope().getNode(UDPreferences.getInstance().getPreferencesNodeQualifier());
 		String udPrefix = customNode.get(UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX));
-		
-		InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), "CoNLL-U Corpus preferences", "Prefix of the CQP properties encoding the UD fields", udPrefix, null);
-		
-		if (dialog.open() == InputDialog.OK) {
-			if (dialog.getValue().length() == 0) {
+		customNode = c.getProject().getPreferencesScope().getNode(TreeSearchPreferences.getInstance().getPreferencesNodeQualifier());
+		String defaultEngine = customNode.get(TreeSearchPreferences.DEFAULT_VISUALISATION, TreeSearchPreferences.getInstance().getString(TreeSearchPreferences.DEFAULT_VISUALISATION));
+
+		LinkedHashMap<String, String> valuesMap = new LinkedHashMap<String, String>();
+		valuesMap.put(UDPreferences.UDPREFIX, udPrefix);
+		valuesMap.put(TreeSearchPreferences.DEFAULT_VISUALISATION, defaultEngine);
+
+
+		MultipleValueDialog multiInputddialog = new MultipleValueDialog(HandlerUtil.getActiveShell(event),  "CoNLL-U Corpus preferences", valuesMap);
+		if (multiInputddialog.open() == InputDialog.OK) {
+			HashMap<String, String> newValues = multiInputddialog.getValues();
+
+			customNode = c.getProject().getPreferencesScope().getNode(UDPreferences.getInstance().getPreferencesNodeQualifier());
+			if (newValues.get(UDPreferences.UDPREFIX) == null  || newValues.get(UDPreferences.UDPREFIX).isEmpty()) {
 				Log.warning("UD prefix cannot be empty");
-				return null;
+			} else {
+				customNode.put(UDPreferences.UDPREFIX, newValues.get(UDPreferences.UDPREFIX));
 			}
-			customNode.put(UDPreferences.UDPREFIX, dialog.getValue());
-			Log.info("Set "+c.getName()+" prefix to "+dialog.getValue());
-			return s;
+
+			customNode = c.getProject().getPreferencesScope().getNode(TreeSearchPreferences.getInstance().getPreferencesNodeQualifier());
+			if (newValues.get(TreeSearchPreferences.DEFAULT_VISUALISATION) == null  || newValues.get(TreeSearchPreferences.DEFAULT_VISUALISATION).isEmpty()) {
+				Log.warning("Default tree representation cannot be empty");
+			} else {
+				customNode.put(TreeSearchPreferences.DEFAULT_VISUALISATION, newValues.get(TreeSearchPreferences.DEFAULT_VISUALISATION));
+			}
 		}
+
+//		InputDialog dialog = new InputDialog(HandlerUtil.getActiveShell(event), "CoNLL-U Corpus preferences", "Prefix of the CQP properties encoding the UD fields", udPrefix, null);
+//		
+//		if (dialog.open() == InputDialog.OK) {
+//			if (dialog.getValue().length() == 0) {
+//				
+//				return null;
+//			}
+//			customNode.put(UDPreferences.UDPREFIX, dialog.getValue());
+//			Log.info("Set "+c.getName()+" prefix to "+dialog.getValue());
+//			return s;
+//		}
+
 		return null;
 	}
 }
Index: TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java
===================================================================
--- TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java	(revision 3747)
@@ -5,6 +5,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.osgi.util.NLS;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.Parameter;
@@ -13,6 +14,7 @@
 import org.txm.searchengine.core.IQuery;
 import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.searchengine.cqp.corpus.WordProperty;
 import org.txm.treesearch.preferences.TreeSearchPreferences;
 
 public abstract class TreeSearch extends TXMResult {
@@ -122,7 +124,7 @@
 	}
 	
 	@Override
-	public boolean loadParameters() throws Exception {
+	public final boolean loadParameters() throws Exception {
 		
 		this.T = new ArrayList<>();
 		String values = getStringParameterValue(TreeSearchPreferences.TFEATURE);
@@ -131,9 +133,37 @@
 			this.T.addAll(Arrays.asList(values.split(",")));
 		}
 		
+		this.NT = new ArrayList<>();
+		values = getStringParameterValue(TreeSearchPreferences.TFEATURE);
+
+		if (values != null && !values.isEmpty() && values.length() > 0) {
+			this.NT.addAll(Arrays.asList(values.split(",")));
+		}
+		
+		String squery = getStringParameterValue(TreeSearchPreferences.QUERY);
+		if (squery != null && !squery.isEmpty() && squery.length() > 0) {
+			this.pQuery = IQuery.fromPrefString(squery);
+		}
+		
+		return _loadParameters();
+	}
+	
+	@Override
+	public boolean saveParameters() throws Exception {
+		
+		if (pQuery != null) {
+			this.saveParameter(TreeSearchPreferences.QUERY, IQuery.toPrefString(pQuery));
+		}
+		
+		this.saveParameter(TreeSearchPreferences.TFEATURE, StringUtils.join(this.T, ","));
+		
+		this.saveParameter(TreeSearchPreferences.NTFEATURE, StringUtils.join(this.NT, ","));
+		
 		return true;
 	}
 	
+	public abstract boolean _loadParameters() throws Exception;
+	
 	public abstract boolean hasSubMatchesStrategy();
 	
 	@Override
Index: TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/editor/TreeSearchEditor.java
===================================================================
--- TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/editor/TreeSearchEditor.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/editor/TreeSearchEditor.java	(revision 3747)
@@ -30,6 +30,7 @@
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
+import org.osgi.service.prefs.Preferences;
 import org.txm.Toolbox;
 import org.txm.concordance.rcp.messages.ConcordanceUIMessages;
 import org.txm.core.preferences.TXMPreferences;
@@ -222,19 +223,21 @@
 		l1.setText("T "); //$NON-NLS-1$
 		l1.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
 		
-		TCombo = new org.eclipse.swt.widgets.List(line2, SWT.READ_ONLY|SWT.MULTI);
-		GridData gdata = new GridData(SWT.FILL, SWT.CENTER, true, true);
+		TCombo = new org.eclipse.swt.widgets.List(line2, SWT.READ_ONLY|SWT.MULTI|SWT.V_SCROLL);
+		GridData gdata = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gdata.heightHint = 100;
 		TCombo.setLayoutData(gdata);
-		TCombo.addSelectionListener(selChangedListener);
+		//TCombo.addSelectionListener(selChangedListener);
 		
 		Label l2 = new Label(line2, SWT.NONE);
 		l2.setText("NT "); //$NON-NLS-1$
 		l2.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
 		
-		NTCombo = new org.eclipse.swt.widgets.List(line2, SWT.READ_ONLY|SWT.MULTI);
-		gdata = new GridData(SWT.FILL, SWT.CENTER, true, true);
+		NTCombo = new org.eclipse.swt.widgets.List(line2, SWT.READ_ONLY|SWT.MULTI|SWT.V_SCROLL);
+		gdata = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gdata.heightHint = 100;
 		NTCombo.setLayoutData(gdata);
-		NTCombo.addSelectionListener(selChangedListener);
+		//NTCombo.addSelectionListener(selChangedListener);
 		
 		// bottom toolbar
 		
@@ -493,6 +496,7 @@
 			representationCombo.setItems(values);
 			
 			String defaultEngine = ts.getEngine();// TreeSearchPreferences.getInstance().getString(TreeSearchPreferences.DEFAULT_REPRESENTATION);
+			
 			representationCombo.select(Arrays.binarySearch(values, defaultEngine));
 			
 			if (representationCombo.getItemCount() == 1) {
Index: TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ComputeTreeSearch.java
===================================================================
--- TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ComputeTreeSearch.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ComputeTreeSearch.java	(revision 3747)
@@ -146,7 +146,12 @@
 	}
 	
 	public static TreeSearch getTreeSearchFor(CQPCorpus corpus) {
-		TreeSearchSelector s = getSelectorForCorpus(corpus, TreeSearchPreferences.getInstance().getString(TreeSearchPreferences.DEFAULT_VISUALISATION));
+		
+		Preferences customNode = corpus.getProject().getPreferencesScope().getNode(TreeSearchPreferences.getInstance().getPreferencesNodeQualifier());
+		String defaultEngine = customNode.get(TreeSearchPreferences.DEFAULT_VISUALISATION, TreeSearchPreferences.getInstance().getString(TreeSearchPreferences.DEFAULT_VISUALISATION));
+		
+		TreeSearchSelector s = getSelectorForCorpus(corpus, defaultEngine);
+		if (s == null) s = getSelectorForCorpus(corpus, null);
 		if (s != null) return s.getTreeSearch(corpus);
 		
 		return null;
Index: TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/command/SendToTreeSearch.java
===================================================================
--- TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/command/SendToTreeSearch.java	(revision 3746)
+++ TXM/trunk/bundles/org.txm.treesearch.rcp/src/org/txm/treesearch/command/SendToTreeSearch.java	(revision 3747)
@@ -198,7 +198,7 @@
 					for (Match m : matches) {
 						if (m.getStart() <= kp && kp <= m.getEnd()) {
 //							System.out.println("set index "+(i+1));
-							ts.setIndexAndSubIndex(i+1, 1);
+							ts.setIndexAndSubIndex(i, 1);
 							break;
 						}
 						i++;
