Index: TXM/trunk/org.txm.treesearch.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.treesearch.rcp/plugin.xml	(revision 3404)
+++ TXM/trunk/org.txm.treesearch.rcp/plugin.xml	(revision 3405)
@@ -48,6 +48,12 @@
             name="Syntactic Tree"
             returnTypeId="org.txm.treesearch.function.TreeSearch">
       </command>
+      <command
+            categoryId="TreeSearch4TXM.commands.category"
+            defaultHandler="org.txm.treesearch.command.ConcordanceLineToTreeSearch"
+            id="org.txm.treesearch.command.ConcordanceLineToTreeSearch"
+            name="Syntactic Tree concordance link">
+      </command>
    </extension>
    <extension
          point="org.eclipse.ui.menus">
@@ -95,7 +101,7 @@
       <menuContribution
             locationURI="popup:org.txm.concordance.rcp.editors.ConcordanceEditor">
          <command
-               commandId="org.txm.treesearch.command.ComputeTreeSearch"
+               commandId="org.txm.treesearch.command.ConcordanceLineToTreeSearch"
                icon="icons/functions/Tree.png"
                label="Send To TreeSearch"
                style="push">
Index: TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ConcordanceLineToTreeSearch.java
===================================================================
--- TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ConcordanceLineToTreeSearch.java	(revision 0)
+++ TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ConcordanceLineToTreeSearch.java	(revision 3405)
@@ -0,0 +1,129 @@
+// 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.treesearch.command;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+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.messages.TXMCoreMessages;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.objects.Match;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.searchengine.core.QueryBasedTXMResult;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+import org.txm.treesearch.editor.TreeSearchEditor;
+import org.txm.treesearch.function.TreeSearch;
+import org.txm.treesearch.function.TreeSearchSelector;
+import org.txm.treesearch.preferences.TreeSearchPreferences;
+import org.txm.utils.logger.Log;
+
+
+/**
+ * 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 ConcordanceLineToTreeSearch extends BaseAbstractHandler {
+	
+	/** The ID. */
+	public static String ID = ConcordanceLineToTreeSearch.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 {
+		
+		TXMResult r = BaseAbstractHandler.getActiveEditorResult(event);
+		
+		if (!(r instanceof Concordance)) {
+			Log.warning("Result is not a concordance: "+r);
+			return null;
+		}
+		
+		ISelection s = HandlerUtil.getCurrentSelection(event);
+		if (!(s instanceof StructuredSelection)) {
+			Log.warning("Selection is not a Line: "+s);
+			return null;
+		}
+		
+		StructuredSelection selection = (StructuredSelection) s;
+		List list = selection.toList();
+		
+		if (list.size() == 0) {
+			Log.warning("No editor selection: "+r);
+			return null;
+		}
+		
+		Concordance concordance = (Concordance)r;
+		Object o = list.get(0);
+		if (!(o instanceof Line)) {
+			Log.warning("Selection is not a Line: "+o);
+			return null;
+		}
+		Line l = (Line)o;
+		//TreeSearchSelector selector = ComputeTreeSearch.getSelectorForCorpus(concordance.getCorpus(), "UD");
+		
+		TreeSearch ts = ComputeTreeSearch.getTreeSearchFor(concordance.getCorpus());
+		
+		ts.setQuery(concordance.getQuery());
+		
+		try {
+			if (ts.compute() &&  ts.getSelection() != null) {
+				int i = 0;
+				
+				for (Match m : ts.getSelection().getMatches()) {
+					if (m.getStart() <= l.getKeywordPosition() && l.getKeywordPosition() <= m.getEnd()) {
+						ts.setIndexAndSubIndex(i, 1);
+						break;
+					}
+					i++;
+				}
+			}
+		}
+		catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		return ComputeTreeSearch.openEditor(ts);
+	}
+}

Property changes on: TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ConcordanceLineToTreeSearch.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 3404)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 3405)
@@ -406,6 +406,16 @@
 				Object selectedItem = selection.getFirstElement();
 				if (selectedItem != null) {
 					String commandId = doubleClickInstalledCommands.get(selectedItem.getClass().getName());
+					
+					if (commandId == null) {
+						for (String clazz : doubleClickInstalledCommands.keySet()) {
+							if (selectedItem.getClass().getSuperclass().getName().equals(clazz)) {
+								commandId = doubleClickInstalledCommands.get(clazz);
+								break;
+							}
+						}
+					}
+					
 					if (commandId != null) {
 						BaseAbstractHandler.executeCommand(commandId);
 					}
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3404)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 3405)
@@ -904,7 +904,7 @@
 		
 		// restrict the computing Job to one at time
 		if (this.computingJob != null && this.computingJob.getResult() == null) {
-			Log.info(NLS.bind("Editor is already computing {0}. Please wait or abort the computing job ({1}).", this.result.getSimpleName(), this.computingJob.getName()));
+			Log.finer(NLS.bind("Editor is already computing {0}. Please wait or abort the computing job ({1}).", this.result, this.computingJob.getName()));
 			return this.computingJob;
 		}
 		
Index: TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java
===================================================================
--- TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java	(revision 3404)
+++ TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java	(revision 3405)
@@ -9,6 +9,7 @@
 import org.txm.conllu.core.preferences.UDPreferences;
 import org.txm.core.results.TXMParameters;
 import org.txm.libs.deptreeviz.UDPrintTree;
+import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -54,6 +55,10 @@
 		return matches != null;
 	}
 	
+	public Selection getSelection() {
+		return matches;
+	}
+	
 	public boolean toSVG(File svgFile, int sent, int sub, String T, String NT) {
 		if (!isDrawn()) return false; // no result
 		try {
Index: TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java
===================================================================
--- TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java	(revision 3404)
+++ TXM/trunk/org.txm.treesearch.core/src/org/txm/treesearch/function/TreeSearch.java	(revision 3405)
@@ -7,6 +7,7 @@
 import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
 import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.treesearch.preferences.TreeSearchPreferences;
 
@@ -141,5 +142,11 @@
 		
 		return this.subIndex;
 	}
+
+	public void setQuery(IQuery query) {
+		this.pQuery = query;
+	}
+
+	public abstract Selection getSelection();
 	
 }
Index: TXM/trunk/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCTextsBalanceSpiderChartCreator.java
===================================================================
--- TXM/trunk/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCTextsBalanceSpiderChartCreator.java	(revision 3404)
+++ TXM/trunk/org.txm.textsbalance.core/src/org/txm/textsbalance/core/chartsengine/jfreechart/JFCTextsBalanceSpiderChartCreator.java	(revision 3405)
@@ -72,12 +72,11 @@
 		while (it.hasNext()) {
 			Comparable[] key = it.next();
 			Integer value = data.get(key);
-			System.out.println("JFCTextsBalanceSpiderChartCreator.updateChart(): adding " + key + ", " + key[0] + ", " + key[1] + " to dataset."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+			//System.out.println("JFCTextsBalanceSpiderChartCreator.updateChart(): adding " + key + ", " + key[0] + ", " + key[1] + " to dataset."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			dataset.addValue(value, key[0], key[1]);
 		}
 		
-		chart.setTitle("metadata = " + textsBalance.getStructuralUnitProperty() + ", N = " + textsBalance.getValues().size() + ", fmin = " + textsBalance.getFMin() +
-				", fmax = " + textsBalance.getFMax() + ", counting " + (textsBalance.groupingByTexts()?"texts":"words"));
+		chart.setTitle("metadata = " + textsBalance.getStructuralUnitProperty() + ", N = " + textsBalance.getValues().size() + ", fmin = " + textsBalance.getFMin() + ", fmax = " + textsBalance.getFMax() + ", counting " + (textsBalance.groupingByTexts()?"texts":"words"));
 		
 		plot.setMaxValue(textsBalance.getFMax());
 		
Index: TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java
===================================================================
--- TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 3404)
+++ TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 3405)
@@ -10,6 +10,7 @@
 import org.txm.core.results.TXMParameters;
 import org.txm.objects.CorpusBuild;
 import org.txm.searchengine.core.SearchEnginesManager;
+import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
@@ -324,4 +325,11 @@
 		
 		return "platform:/plugin/org.txm.tigersearch.rcp/icons/functions/TS.png";
 	}
+
+	@Override
+	public Selection getSelection() {
+		
+		// TODO Auto-generated method stub
+		return null;
+	}
 }
Index: TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java
===================================================================
--- TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 3404)
+++ TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 3405)
@@ -812,9 +812,13 @@
 	public void setURL(String url) {
 		
 		if (!this.browser.isDisposed()) {
+			
 			if ("webkit".equals(this.browser.getBrowserType())) {
-				super.setURL(URLUtils.encodeURL(url));
+				String u = URLUtils.encodeURL(url);
+				Log.finer("setting encoded URL: "+u);
+				super.setURL(u);
 			} else {
+				Log.finer("setting URL: "+url);
 				super.setURL(url);
 			}
 		}
