Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 842)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 843)
@@ -41,7 +41,6 @@
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
@@ -386,7 +385,6 @@
 		Composite resultArea = this.getResultArea();
 
 		viewer = new TableViewer(resultArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
-		this.getSite().setSelectionProvider(viewer);
 		
 		viewer.getTable().setLinesVisible(true);
 		viewer.getTable().setHeaderVisible(true);
@@ -407,26 +405,6 @@
 		viewer.setContentProvider(new LineContentProvider());
 		viewer.setInput(new ArrayList<Property>());
 
-		//TODO replace this with command+menucontribution		
-		//		viewer.getTable().addMouseListener(new MouseAdapter() {
-		//			@Override
-		//			public void mouseDoubleClick(MouseEvent e) {
-		//				Point mouseposition = new Point(e.x
-		//						+ viewer.getTable().getHorizontalBar()
-		//						.getSelection(), e.y);
-		//				int col = getPointedColumn(mouseposition);
-		//				if (col == 1) {
-		//					IndexToConcordance.link(IndexEditor.this,
-		//							(IStructuredSelection) viewer
-		//							.getSelection());
-		//				} else if (col == 2) {
-		//					IndexToProgression.link(IndexEditor.this,
-		//							(IStructuredSelection) viewer
-		//							.getSelection());
-		//				}
-		//			}
-		//		});
-
 		nColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
 		nColumn.setText(" "); //$NON-NLS-1$
 		nColumn.pack();
@@ -521,6 +499,9 @@
 		separatorColumn.pack();
 		paramArea.pack();
 
+		// Add double click, "Send to" command
+		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), "org.txm.links.rcp.commands.SendToConcordance"); //$NON-NLS-1$
+
 		// Register the context menu
 		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
 		
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToCooccurrence.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToCooccurrence.java	(revision 0)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToCooccurrence.java	(revision 843)
@@ -0,0 +1,73 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// 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.index.rcp.handlers;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.index.core.functions.Index;
+import org.txm.index.core.functions.Line;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.searchengine.cqp.corpus.Corpus;
+
+/**
+ * Sends the selected lines of an index to compute a cooccurrence.
+ * 
+ * @author mdecorde.
+ */
+public class SendToCooccurrence extends BaseAbstractHandler {
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+		if (selection != null && selection.getFirstElement() instanceof Line) {
+			
+			String query = Index.createQuery(selection.toList());
+
+			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
+
+			// create local result node, store it some parameters and call the linked command
+			String uuid = TXMResult.createUUID();
+			TXMResult parentCorpus = Corpus.getFirstParentCorpus(editor.getResult());
+			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, parentCorpus.getUUID());
+			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
+			BaseAbstractHandler.executeCommand("org.txm.cooccurrence.rcp.handlers.ComputeCooccurrences", uuid); //$NON-NLS-1$
+		}
+		else	{
+			this.logCanNotCompute(selection);
+		}
+		return null;
+	}
+
+
+}

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

Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToProgression.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToProgression.java	(revision 842)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToProgression.java	(revision 843)
@@ -39,10 +39,11 @@
 import org.txm.index.core.functions.Line;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.query.Query;
 
 /**
- * Sends the lines of an index to compute a progression.
+ * Sends the selected lines of an index to compute a progression.
  * 
  * @author mdecorde
  * @author sjacquot
@@ -61,13 +62,10 @@
 
 			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
 
-			// FIXME: tests:
-			// 1) create an UUID for the future TXMResult
-			// 2) store some parameters in the local preference node
-			// 3) call the command in the command target plug-in
-			//String uuid = "test_link_index_to_progression"; 
+			// create local result node, store it some parameters and call the linked command
 			String uuid = TXMResult.createUUID();
-			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, editor.getResult().getParent().getUUID());
+			TXMResult parentCorpus = Corpus.getFirstParentCorpus(editor.getResult());
+			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, parentCorpus.getUUID());
 			TXMPreferences.put(uuid, TXMPreferences.QUERIES, Query.queriesToString(queries));
 			BaseAbstractHandler.executeCommand("org.txm.progression.rcp.handlers.ComputeProgression", uuid); //$NON-NLS-1$
 		}
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToConcordance.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToConcordance.java	(revision 842)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToConcordance.java	(revision 843)
@@ -40,7 +40,7 @@
 import org.txm.searchengine.cqp.corpus.Corpus;
 
 /**
- * Sends the lines of an index to compute a concordance.
+ * Sends the selected lines of an index to compute a concordance.
  * 
  * @author mdecorde
  * @author sjacquot
@@ -60,13 +60,10 @@
 
 			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
 
-			// FIXME: tests:
-			// 1) create an UUID for the future TXMResult
-			// 2) store some parameters in the local preference node
-			// 3) call the command in the command target plug-in
-			//String uuid = "test_link_index_to_concordance";
+			// create local result node, store it some parameters and call the linked command
 			String uuid = TXMResult.createUUID();
-			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, editor.getResult().getParent().getUUID());
+			TXMResult parentCorpus = Corpus.getFirstParentCorpus(editor.getResult());
+			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, parentCorpus.getUUID());
 			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
 			BaseAbstractHandler.executeCommand("org.txm.concordance.rcp.handlers.ComputeConcordance", uuid); //$NON-NLS-1$
 		}
@@ -76,6 +73,7 @@
 		return null;
 	}
 
+	// FIXME: not used anymore?
 //	/**
 //	 * Link.
 //	 *
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java	(revision 842)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java	(revision 843)
@@ -29,6 +29,7 @@
 
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.txm.core.preferences.TXMPreferences;
 import org.txm.index.core.functions.Index;
 import org.txm.index.rcp.editors.IndexEditor;
 import org.txm.rcp.editors.TXMEditor;
@@ -52,31 +53,37 @@
 			return false;
 		}
 
-		Object selection = this.getSelection(event);
+		Index index = null;
 		
-		// New editor from corpus
-		Index index = null;
-		if (selection instanceof Corpus) {
-			index = new Index((Corpus) selection);
+		// From link: creating from UUID and preferences nodes
+		String uuid = event.getParameter(TXMPreferences.RESULT_UUID);
+		if (uuid != null && !uuid.isEmpty()) {
+			index = new Index(uuid);
 		}
-		// New editor from partition
-		else if (selection instanceof Partition) {
-			index = new Index((Partition) selection);
+		// From view result node
+		else	{
+			Object selection = this.getSelection(event);
+			
+			// New editor from corpus
+			if (selection instanceof Corpus) {
+				index = new Index((Corpus) selection);
+			}
+			// New editor from partition
+			else if (selection instanceof Partition) {
+				index = new Index((Partition) selection);
+			}
+			// Reopen an existing result
+			else if (selection instanceof Index) { 
+				index = (Index) selection;
+			}
+			else {
+				return super.logCanNotCompute(selection);
+			}
 		}
-		// Reopen an existing result
-		else if (selection instanceof Index) { 
-			index = (Index) selection;
-		}
-		else {
-			return super.logCanNotCompute(selection);
-		}
 		
-		open(index);
+		TXMEditor.openEditor(index, IndexEditor.class.getName());
 		
 		return null;
 	}
 
-	public static void open(Index index) {
-		TXMEditor.openEditor(index, IndexEditor.class.getName());
-	}
 }
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToIndex.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToIndex.java	(revision 0)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendToIndex.java	(revision 843)
@@ -0,0 +1,137 @@
+// Copyright © 2010-2013 ENS de Lyon.
+// 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.index.rcp.handlers;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.index.core.functions.Index;
+import org.txm.index.core.functions.Line;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+
+/**
+ * Sends the selected lines of a lexicon to compute an index.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ * 
+ */
+public class SendToIndex extends BaseAbstractHandler {
+
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+		if (selection != null && selection.getFirstElement() instanceof Line) {
+			
+			String query = Index.createQuery(selection.toList());
+
+			TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
+
+			// create local result node, store it some parameters and call the linked command
+			String uuid = TXMResult.createUUID();
+			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, editor.getResult().getParent().getUUID());
+			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
+			BaseAbstractHandler.executeCommand("org.txm.index.rcp.handlers.ComputeIndex", uuid); //$NON-NLS-1$
+		}
+		else	{
+			this.logCanNotCompute(selection);
+		}
+		return null;
+	}
+
+	// FIXME: not used anymore?
+//	/**
+//	 * Link.
+//	 *
+//	 * @param voceditor the voceditor
+//	 * @param selection the selection
+//	 * @return the object
+//	 */
+//	public static Object link(IndexEditor voceditor,
+//			IStructuredSelection selection) {
+//		assert (selection.getFirstElement() instanceof Line);
+//		String query = getQuery(selection);
+//		if (query.length() == 0)
+//			return null;
+//		Corpus corpus = voceditor.getCorpus();
+//		Concordance concordance = new Concordance(corpus);
+//		concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null);
+//		TXMResultEditorInput editorInput = new TXMResultEditorInput(concordance);
+////		try {
+////			System.out.println("Compute indexResult query: "+voceditor.getQuery());
+////			QueryResult indexResult = corpus.query(voceditor.getQuery(), "Index", false);
+////			System.out.println("N result: "+indexResult.getNMatch());
+////
+////			System.out.println("Compute indexOccResult query: "+query);
+////			QueryResult indexOccResult = corpus.query(new Query(query), "IndexOcc", false);
+////			System.out.println("N result: "+indexOccResult.getNMatch());
+////
+////			String queryname = "Q"+Corpus.getNextQueryCounter();
+////			String interQueryString = queryname+"=intersect "+indexResult.getQualifiedCqpId()+" "+indexOccResult.getQualifiedCqpId()+";"; 
+////			System.out.println("Compute inter query: "+interQueryString);
+////			((MemCqiClient)CQPSearchEngine.getCqiClient()).query(interQueryString);
+////			
+////			QueryResult inter = new QueryResult(queryname, queryname, corpus, new Query(interQueryString));
+////			System.out.println("indexResult size: "+indexResult.getNMatch());
+////			System.out.println("indexOccResult size: "+indexOccResult.getNMatch());
+////			System.out.println("inter size: "+inter.getNMatch());
+////			
+////			QueryResult inter2 = corpus.query(new Query("intersect "+indexResult.getQualifiedCqpId()+" "+indexOccResult.getQualifiedCqpId()), "Q"+Corpus.getNextQueryCounter(),false);
+////			System.out.println("inter2 size: "+inter2.getNMatch());
+////		} catch (Exception e) {
+////			e.printStackTrace();
+////			try {
+////				System.out.println("CQP error: "+CQPSearchEngine.getCqiClient().getLastError());
+////			} catch (Exception e1) {
+////				e1.printStackTrace();
+////			}
+////		}
+////		
+////		return null;
+//
+//		IWorkbenchPage page = voceditor.getEditorSite().getWorkbenchWindow()
+//				.getActivePage();
+//		try {
+//			ConcordanceEditor conceditor = (ConcordanceEditor) page
+//					.openEditor(editorInput, ConcordanceEditor.ID); //$NON-NLS-1$
+//		} catch (PartInitException e) {
+//			System.err.println("Error: "+e.getLocalizedMessage());
+//		}
+//
+//		return null;
+//	}
+
+
+}

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

Index: tmp/org.txm.index.rcp/build.properties
===================================================================
--- tmp/org.txm.index.rcp/build.properties	(revision 842)
+++ tmp/org.txm.index.rcp/build.properties	(revision 843)
@@ -4,5 +4,4 @@
                .,\
                plugin.xml,\
                icons/,\
-               OSGI-INF/,\
-               OSGI-INF/l10n/bundle.properties
+               OSGI-INF/
Index: tmp/org.txm.index.rcp/plugin.xml
===================================================================
--- tmp/org.txm.index.rcp/plugin.xml	(revision 842)
+++ tmp/org.txm.index.rcp/plugin.xml	(revision 843)
@@ -127,6 +127,21 @@
                style="push">
          </command>
       </menuContribution>
+               <menuContribution
+                     locationURI="popup:org.txm.index.rcp.editors.DictionnaryEditor">
+                  <command
+                        commandId="org.txm.links.rcp.commands.SendToConcordance"
+                        style="push">
+                  </command>
+                  <command
+                        commandId="org.txm.links.rcp.commands.SendToIndex"
+                        style="push">
+                  </command>
+                  <command
+                        commandId="org.txm.links.rcp.commands.SendToProgression"
+                        style="push">
+                  </command>
+               </menuContribution>
       
    </extension>
    <extension
@@ -179,28 +194,13 @@
             id="org.txm.index.rcp.handlers.ComputeLexicon"
             name="%command.name.0">
       </command>
-                        <command
-            defaultHandler="org.txm.synopticedition.rcp.commands.link.IndexToConcordance"
-            id="org.txm.synopticedition.rcp.commands.link.IndexToConcordance"
-            name="%command.label.73">
-      </command>
 
       <command
-            defaultHandler="org.txm.index.rcp.handlers.SendToProgression"
-            id="org.txm.index.rcp.handlers.IndexToProgression"
-            name="%command.label.103">
-      </command>
-      <command
             defaultHandler="org.txm.synopticedition.rcp.commands.link.IndexToLexicalTable"
             id="org.txm.synopticedition.rcp.commands.link.IndexToLexicalTable"
             name="%command.name.43">
       </command>
       
-      <command
-            defaultHandler="org.txm.synopticedition.rcp.commands.link.IndexToCooccurrence"
-            id="org.txm.synopticedition.rcp.commands.link.IndexToCooccurrence"
-            name="%command.name.65">
-      </command>
       
    </extension>
    <extension
@@ -231,6 +231,24 @@
             </iterate>
          </with>
       </definition>
+      <definition
+            id="IndexEditorActive">
+         <with
+               variable="activePart">
+            <instanceof
+                  value="org.txm.index.rcp.editors.IndexEditor">
+            </instanceof>
+         </with>
+      </definition>
+      <definition
+            id="LexiconEditorActive">
+         <with
+               variable="activePart">
+            <instanceof
+                  value="org.txm.index.rcp.editors.DictionnaryEditor">
+            </instanceof>
+         </with>
+      </definition>
    </extension>
    <extension
          point="org.txm.statengine.r.rcp.sendtor">
@@ -250,11 +268,51 @@
       <handler
             class="org.txm.index.rcp.handlers.SendToProgression"
             commandId="org.txm.links.rcp.commands.SendToProgression">
+         <activeWhen>
+         <or>
+           <reference
+                 definitionId="IndexEditorActive">
+           </reference>
+           <reference
+                 definitionId="LexiconEditorActive">
+           </reference>
+         
+         </or>
+         
+         </activeWhen>
       </handler>
       <handler
             class="org.txm.index.rcp.handlers.SendToConcordance"
             commandId="org.txm.links.rcp.commands.SendToConcordance">
+         <activeWhen>
+            <or>
+               <reference
+                     definitionId="IndexEditorActive">
+               </reference>
+               <reference
+                     definitionId="LexiconEditorActive">
+               </reference>
+            </or>
+         </activeWhen>
       </handler>
+      <handler
+            class="org.txm.index.rcp.handlers.SendToCooccurrence"
+            commandId="org.txm.links.rcp.commands.SendToCooccurrence">
+         <activeWhen>
+               <reference
+                     definitionId="IndexEditorActive">
+               </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="org.txm.index.rcp.handlers.SendToIndex"
+            commandId="org.txm.links.rcp.commands.SendToIndex">
+         <activeWhen>
+               <reference
+                     definitionId="LexiconEditorActive">
+               </reference>
+         </activeWhen>
+      </handler>
    </extension>
 
 </plugin>
