Index: tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 841)
+++ tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 842)
@@ -5,7 +5,6 @@
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.service.prefs.Preferences;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.Parameter;
 
 /**
  * Preferences initializer and manager.
@@ -17,40 +16,23 @@
 
 	public static final String PREFERENCES_NODE = FrameworkUtil.getBundle(IndexPreferences.class).getSymbolicName();
 	
-	public static final String PREFERENCES_PREFIX = "index_"; //$NON-NLS-1$
+	public static final String PROPERTIES = "properties"; //$NON-NLS-1$
 	
-	public static final String PROPERTIES = PREFERENCES_PREFIX + "properties"; //$NON-NLS-1$
-	public static final String QUERY = PREFERENCES_PREFIX + "query"; //$NON-NLS-1$
 	
 	/**
-	 * Minimum frequency filter value.
-	 */
-	public static final String F_MIN = PREFERENCES_PREFIX + "f_min"; //$NON-NLS-1$
-	
-	/**
-	 * Maximum frequency filter value.
-	 */
-	public static final String F_MAX = PREFERENCES_PREFIX + "f_max"; //$NON-NLS-1$
-	
-	/**
-	 * V max filter. 
-	 */
-	public static final String V_MAX = PREFERENCES_PREFIX + "v_max"; //$NON-NLS-1$
-	
-	/**
 	 * Number of lines to display per page.
 	 */
-	public static final String N_LINES_PER_PAGE = PREFERENCES_PREFIX + "n_lines_per_page"; //$NON-NLS-1$
+	public static final String N_LINES_PER_PAGE = "n_lines_per_page"; //$NON-NLS-1$
 	
 	/**
 	 * 
 	 */
-	public static final String PROPERTIES_SEPARATOR = PREFERENCES_PREFIX + "properties_separator"; //$NON-NLS-1$
+	public static final String PROPERTIES_SEPARATOR = "properties_separator"; //$NON-NLS-1$
 	
 	/**
 	 * 
 	 */
-	public static final String N_TOP_INDEX = PREFERENCES_PREFIX + "n_top_index"; //$NON-NLS-1$
+	public static final String N_TOP_INDEX = "n_top_index"; //$NON-NLS-1$
 
 	@Override
 	public void initializeDefaultPreferences() {
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 841)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 842)
@@ -147,31 +147,24 @@
 	protected Integer pVmaxFilter;
 	
 
-	/**
-	 * compute a index, given a corpus, a query and analysis properties.
-	 *
-	 * @param corpus the corpus
-	 * @throws CqiClientException 
-	 * @throws CqiServerError 
-	 * @throws IOException 
-	 */
-	public Index(Corpus corpus) {
-		super(corpus);
-	}
 	
 	/**
-	 * Compute an index per Part of the partition.
-	 *
-	 * @param partition the partition
-	 * @throws CqiClientException 
-	 * @throws CqiServerError 
-	 * @throws IOException 
+	 * 
+	 * @param parent
 	 */
-	public Index(Partition partition) {
-		super(partition);
+	public Index(TXMResult parent) {
+		this(null, parent);
 	}
+
+	public Index(String uuid)	{
+		this(uuid, null);
+	}
 	
+	public Index(String uuid, TXMResult parent)	{
+		super(uuid, parent);
+	}
 
+
 	@Override
 	protected boolean _compute() throws Exception {
 		lines.clear();
Index: tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java
===================================================================
--- tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java	(revision 841)
+++ tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java	(revision 842)
@@ -114,7 +114,7 @@
 	public final void _createPartControl() {
 		
 		// Toolbar
-		this.chartToolBar = new ChartEditorToolBar(this, this.getFirstLineComposite(), this.getParametersGroupsComposite(), SWT.FLAT | SWT.RIGHT);
+		this.chartToolBar = new ChartEditorToolBar(this, this.getFirstLineComposite(), null, SWT.FLAT | SWT.RIGHT);
 		this.getFirstLineComposite().getLayout().numColumns += 1;
 		//this.chartToolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_RED));
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java	(revision 841)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java	(revision 842)
@@ -30,7 +30,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.HashMap;
 
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.Platform;
@@ -43,7 +42,7 @@
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 
 /**
- * Content provider of the Corpus view
+ * Content provider of the Corpus view.
  *  
  * @author mdecorde
  */
@@ -77,7 +76,7 @@
 	 */
 	@Override
 	public Object[] getChildren(Object element) {
-		HashMap<Class, Class> managed = CorporaView.getManagedDoubleClickClasses();
+//		HashMap<Class, Class> managed = CorporaView.getManagedDoubleClickClasses();
 		IWorkbenchAdapter adapter = getAdapter(element);
 		if (adapter != null) {
 			Object[] children = adapter.getChildren(element);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 841)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 842)
@@ -121,15 +121,15 @@
 	/**
 	 * stores the class that are managed by a Doubleclick handler
 	 */
-	private static HashMap<Class, Class> managedDoubleClickClasses = new HashMap<Class, Class>();
+	//private static HashMap<Class, Class> managedDoubleClickClasses = new HashMap<Class, Class>();
 
 
 	public static HashMap<String, String> doubleClickInstalledCommands = new HashMap<String, String>();
 
 
-	public static HashMap<Class, Class> getManagedDoubleClickClasses() {
-		return managedDoubleClickClasses;
-	}
+//	public static HashMap<Class, Class> getManagedDoubleClickClasses() {
+//		return managedDoubleClickClasses;
+//	}
 
 
 	/**
@@ -376,20 +376,20 @@
 						BaseAbstractHandler.executeCommand(commandId);
 					}
 
-					// test if a double click listener has been set
-					@Deprecated
-					Class commandClass = managedDoubleClickClasses.get(selectedItem.getClass());
-					//System.out.println("classes: "+managedDoubleClickClasses);
-					if (commandClass != null) {
-
-						IHandlerService handlerService = (IHandlerService) getViewSite().getService(IHandlerService.class);
-						try {
-							handlerService.executeCommand(commandClass.getName(), null);
-						} catch (Exception e) {
-							System.out.println("Error while calling "+ commandClass.getName() + " command.");
-							Log.printStackTrace(e);
-						}
-					}
+//					// test if a double click listener has been set
+//					@Deprecated
+//					Class commandClass = managedDoubleClickClasses.get(selectedItem.getClass());
+//					//System.out.println("classes: "+managedDoubleClickClasses);
+//					if (commandClass != null) {
+//
+//						IHandlerService handlerService = (IHandlerService) getViewSite().getService(IHandlerService.class);
+//						try {
+//							handlerService.executeCommand(commandClass.getName(), null);
+//						} catch (Exception e) {
+//							System.out.println("Error while calling "+ commandClass.getName() + " command.");
+//							Log.printStackTrace(e);
+//						}
+//					}
 				}
 			}
 		});
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 841)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 842)
@@ -20,6 +20,8 @@
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.layout.RowLayout;
@@ -30,12 +32,11 @@
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.ToolItem;
 import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPartSite;
@@ -49,6 +50,7 @@
 import org.txm.rcp.JobsTimer;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.TXMWindows;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.swt.GLComposite;
 import org.txm.rcp.swt.widget.AssistedQueryWidget;
 import org.txm.rcp.swt.widget.FloatSpinner;
@@ -970,6 +972,7 @@
 		composite.setMenu(menu);
 		
 		if(partSite != null && selectionProvider != null)	{
+			partSite.setSelectionProvider(selectionProvider); // Selection provider to retrieve lines/entites of viewer
 			partSite.registerContextMenu(menuManager, selectionProvider);
 		}
 		else	{
@@ -1004,6 +1007,20 @@
 	}
 
 	/**
+	 * Adds a mouse adapter to specified table that executes a command specified by its id on double click event.
+	 * @param table
+	 * @param commandId
+	 */
+	public static void addDoubleClickCommandListener(Table table, final String commandId)	{
+		table.addMouseListener(new MouseAdapter() {
+			@Override
+			public void mouseDoubleClick(MouseEvent e) {
+				BaseAbstractHandler.executeCommand(commandId);
+			}
+		});
+	}
+	
+	/**
 	 * @return the lastComputingParameters
 	 */
 	public HashMap<String, Object> getLastComputingParameters() {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 841)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 842)
@@ -63,7 +63,7 @@
 	 */
 	public TXMEditorToolBar(TXMEditor<? extends TXMResult> editor, Composite parent, GLComposite subWidgetComposite, int style, String toolbarId) {
 		super(parent, style);
-
+		
 		this.editorPart = editor;
 		this.subWidgetComposite = subWidgetComposite;
 		// permit to contribute via plugin.xml menu extension
Index: tmp/org.txm.links.rcp/src/org/txm/links/rcp/___LinkCommands.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/links/rcp/___LinkCommands.java	(revision 0)
+++ tmp/org.txm.links.rcp/src/org/txm/links/rcp/___LinkCommands.java	(revision 842)
@@ -0,0 +1,32 @@
+package org.txm.links.rcp;
+
+/**
+ * Associations between link command types and RCP command ids.
+ * @author sjacquot
+ *
+ */
+public enum ___LinkCommands {
+
+	SEND_TO_CONCORDANCE("org.txm.links.rcp.commands.SendToConcordance"),
+	SEND_TO_INDEX("org.txm.links.rcp.commands.SendToIndex"),
+	SEND_TO_COOCCURRENCE("org.txm.links.rcp.commands.SendToProgression"),
+	SEND_TO_PROGRESSIONE("org.txm.links.rcp.commands.SendToCooccurrence");
+
+	/**
+	 * Command id.
+	 */
+	final private String id;
+
+	/**
+	 * 
+	 * @param commandId
+	 */
+	private ___LinkCommands(String id) {
+		this.id = id;
+	}
+
+	@Override
+	public String toString(){
+	    return this.id;
+	 }
+}

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

Index: tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/CooccurrencesToConcordances.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/CooccurrencesToConcordances.java	(revision 841)
+++ tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/CooccurrencesToConcordances.java	(revision 842)
@@ -1,137 +0,0 @@
-// 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.rcp.commands.link;
-
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-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.cooccurrence.core.functions.Cooccurrence;
-import org.txm.cooccurrence.core.functions.Cooccurrence.CLine;
-import org.txm.cooccurrence.rcp.editors.CooccurrencesEditor;
-import org.txm.rcp.editors.TXMResultEditorInput;
-import org.txm.rcp.messages.TXMUIMessages;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.searchengine.cqp.corpus.WordProperty;
-import org.txm.searchengine.cqp.corpus.query.Query;
-
-// TODO: Auto-generated Javadoc
-/**
- * use the lines of a cooc result to build a concordance @ author mdecorde.
- */
-public class CooccurrencesToConcordances extends AbstractHandler {
-
-	/** The selection. */
-	private IStructuredSelection selection;
-	
-	/** The editor input. */
-	private static TXMResultEditorInput editorInput;
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-
-		CooccurrencesEditor ceditor = null;
-		IEditorPart editor = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor();
-		ceditor = (CooccurrencesEditor) editor;
-		
-		link(ceditor, selection);
-		return null;
-	}
-	
-	/**
-	 * Link.
-	 *
-	 * @param editor the editor
-	 * @param selection the selection
-	 */
-	public static void link(CooccurrencesEditor editor, IStructuredSelection selection)
-	{
-
-		assert (selection.getFirstElement() instanceof CLine);
-
-		Cooccurrence cooc = ((CLine) selection.getFirstElement()).getCooc();
-		
-		int nbProps = cooc.getProperties().size();
-		List<WordProperty> props = cooc.getProperties();
-		List<CLine> list = selection.toList();
-		//System.out.println("Cooc lines "+list);
-
-		String query = "["; //$NON-NLS-1$
-		for (int p = 0; p < nbProps; p++) {
-			query += props.get(p) + "=\""; //$NON-NLS-1$
-			for (int l = 0; l < list.size(); l++) {
-				CLine line = list.get(l);
-				String s = line.props.get(p);
-				s = Query.addBackSlash(s);
-				query += s + "|"; //$NON-NLS-1$
-			}
-			query = query.substring(0, query.length() - 1);
-			query += "\" & "; //$NON-NLS-1$
-		}
-		query = query.substring(0, query.length() - 3);
-		query += "] "; //$NON-NLS-1$
-		
-		int maxempan = Math.max(cooc.getMaxLeft(), cooc.getMaxRight()); 
-		if (cooc.getIncludeXPivot() && maxempan == 0) maxempan = 1;  
-		
-		String maxempanstr = "within " + maxempan + " "; //$NON-NLS-1$ //$NON-NLS-2$
-		if (cooc.getStructure() != null) maxempanstr += cooc.getStructure().getName(); 
-		
-		query = "("+cooc.getQuery()+" []* "+query+") | ("+query+" []* "+cooc.getQuery()+") "+maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-		
-		Corpus corpus = cooc.getCorpus();
-		Concordance concordance = new Concordance(corpus);
-		concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null);
-		editorInput = new TXMResultEditorInput(concordance);
-
-		IWorkbenchPage page = editor.getEditorSite().getWorkbenchWindow().getActivePage();
-		
-		try {
-			ConcordanceEditor conceditor = (ConcordanceEditor) page
-					.openEditor(editorInput, ConcordanceEditor.ID); //$NON-NLS-1$
-		} catch (PartInitException e) {
-			System.err.println("Error: "+e.getLocalizedMessage());
-		}
-	}
-}
Index: tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/___IndexToProgression.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/___IndexToProgression.java	(revision 841)
+++ tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/___IndexToProgression.java	(revision 842)
@@ -1,148 +0,0 @@
-// 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.rcp.commands.link;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.index.core.functions.Line;
-import org.txm.index.rcp.editors.IndexEditor;
-import org.txm.progression.core.functions.Progression;
-import org.txm.progression.rcp.editors.ProgressionEditor;
-import org.txm.rcp.editors.TXMEditor;
-import org.txm.rcp.editors.TXMResultEditorInput;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.searchengine.cqp.corpus.query.Query;
-
-// TODO: Auto-generated Javadoc
-/**
- * use the lines of a index to compute a Progression
- * @author mdecorde
- */
-// FIXME: old version
-public class ___IndexToProgression extends AbstractHandler {
-
-	/** The window. */
-	private IWorkbenchWindow window;
-	
-	/** The selection. */
-	private IStructuredSelection selection;
-	
-	/** The editor input. */
-	private TXMResultEditorInput editorInput;
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		window = HandlerUtil.getActiveWorkbenchWindow(event);
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-
-		assert (selection.getFirstElement() instanceof Line);
-
-		List<Query> queries = getQueries(selection);
-
-		IndexEditor voceditor = (IndexEditor) HandlerUtil
-				.getActiveWorkbenchWindow(event).getActivePage()
-				.getActivePart();
-		Corpus corpus = voceditor.getCorpus();
-
-		Progression progression = new Progression(corpus);
-		progression.setQueries(queries);
-		
-		TXMEditor.openEditor(progression, ProgressionEditor.class.getName());
-		return null;
-	}
-
-	/**
-	 * Link.
-	 *
-	 * @param voceditor the voceditor
-	 * @param selection the selection
-	 * @return the object
-	 */
-	public static Object link(IndexEditor voceditor,
-			IStructuredSelection selection) {
-		// window = HandlerUtil.getActiveWorkbenchWindow(event);
-		// selection = (IStructuredSelection)
-		// HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
-		assert (selection.getFirstElement() instanceof Line);
-
-		List<Query> queries = getQueries(selection);
-		if (queries.size() == 0) return null;
-		
-		Corpus corpus = voceditor.getCorpus();
-
-		Progression progression = new Progression(corpus);
-		progression.setQueries(queries);
-		
-		TXMEditor.openEditor(progression, ProgressionEditor.class.getName());
-		return null;
-	}
-
-	/**
-	 * Gets the queries.
-	 *
-	 * @param selection the selection
-	 * @return the queries
-	 */
-	public static List<Query> getQueries(IStructuredSelection selection) {
-		List<Line> lines = selection.toList();
-		List<Query> queries = new ArrayList<Query>();
-		for (Line line : lines) {
-			String query = ""; //$NON-NLS-1$
-			int nbToken = line.getUnitsProperties().get(0).size();
-			int nbProps = line.getProperties().size();
-			List<List<String>> values = line.getUnitsProperties();
-			List<Property> props = line.getProperties();
-			for (int t = 0; t < nbToken; t++) {
-				query += "["; //$NON-NLS-1$
-				for (int p = 0; p < nbProps; p++) {
-					query += props.get(p) + "=\""; //$NON-NLS-1$
-					String s = values.get(p).get(t);
-					s = Query.addBackSlash(s);
-					query += s;
-					query += "\" & "; //$NON-NLS-1$
-				}
-				query = query.substring(0, query.length() - 3);
-				query += "] "; //$NON-NLS-1$
-			}
-			queries.add(new Query(query));
-		}
-		return queries;
-	}
-}
Index: tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToLexicalTable.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToLexicalTable.java	(revision 841)
+++ tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToLexicalTable.java	(revision 842)
@@ -1,138 +0,0 @@
-// 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.rcp.commands.link;
-
-import java.util.ArrayList;
-
-import org.apache.batik.util.gui.CSSMediaPanel.Dialog;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.index.core.functions.Index;
-import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
-import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.handlers.BaseAbstractHandler;
-import org.txm.rcp.messages.TXMUIMessages;
-// TODO: Auto-generated Javadoc
-/**
- * The Class IndexToLexicalTable.
- */
-public class IndexToLexicalTable extends BaseAbstractHandler {
-
-	/** The window. */
-	private IWorkbenchWindow window;
-	
-	/** The selection. */
-	private IStructuredSelection selection;
-	private static Shell shell;
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		
-		if(!this.checkStatsEngine()) {
-			return null;
-		}
-
-		
-		// TODO Auto-generated method stub
-		window = HandlerUtil.getActiveWorkbenchWindow(event);
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-		shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
-		return null;
-	}
-
-	/**
-	 * Builds the lexical table.
-	 *
-	 * @param voc the voc
-	 * @param from the from
-	 * @param to the to
-	 * @return true, if successful
-	 */
-	public boolean buildLexicalTable(Index voc, int from, int to) {
-		LexicalTable table;
-
-		if (!voc.isComputedWithPartition()) {
-			
-			System.out.println(TXMUIMessages.IndexToLexicalTable_0);
-			StatusLine.setMessage(TXMUIMessages.IndexToLexicalTable_0);
-			return false;
-		}
-
-		System.out.println(LexicalTableUIMessages.ComputeLexicalTable_3);
-		ArrayList<String> choices = new ArrayList<String>();
-		choices.add(LexicalTableUIMessages.ComputeLexicalTable_16);
-		choices.add(LexicalTableUIMessages.ComputeLexicalTable_12);
-		ListSelectionDialog dialog = new ListSelectionDialog(shell, 
-				choices, new ArrayContentProvider(), new LabelProvider(), 
-				LexicalTableUIMessages.ComputeLexicalTable_13);
-		
-		int ret = dialog.open();
-		//System.out.println("ret= "+ret);
-		if (ret == Dialog.OK_OPTION) {
-			
-		} else {
-			return false;
-		}
-		
-		try {
-			table = new LexicalTable(voc);
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			org.txm.rcp.utils.Logger.printStackTrace(e);
-			return false;
-		}
-
-		try {
-			IWorkbenchWindow window = PlatformUI.getWorkbench()
-					.getActiveWorkbenchWindow();
-			IWorkbenchPage page = window.getActivePage();
-			___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
-			StatusLine.setMessage(LexicalTableUIMessages.ComputeLexicalTable_10);
-			page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
-		} catch (PartInitException e) {
-			org.txm.rcp.utils.Logger.printStackTrace(e);
-		} 
-
-		return true;
-	}
-
-}
Index: tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToCooccurrence.java
===================================================================
--- tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToCooccurrence.java	(revision 841)
+++ tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToCooccurrence.java	(revision 842)
@@ -1,153 +0,0 @@
-// 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.rcp.commands.link;
-
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.index.core.functions.Line;
-import org.txm.index.rcp.editors.IndexEditor;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.searchengine.cqp.corpus.query.Query;
-
-// TODO: Auto-generated Javadoc
-/**
- * use the lines of a index to compute a concordance 
- * @author mdecorde.
- */
-// FIXME: should call the ComputeCooccurrence command with some parameters
-public class IndexToCooccurrence extends AbstractHandler {
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IWorkbenchWindow window;
-		IStructuredSelection selection;
-		window = HandlerUtil.getActiveWorkbenchWindow(event);
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-
-		assert (selection.getFirstElement() instanceof Line);
-
-		String query = getQuery(selection);
-
-		// System.out.println(query);
-
-		IndexEditor voceditor = (IndexEditor) HandlerUtil
-				.getActiveWorkbenchWindow(event).getActivePage()
-				.getActivePart();
-		
-		Corpus corpus = voceditor.getCorpus();
-
-		System.out.println("IMPLEMENTATION NOT FINISHED");
-		
-//		try {
-//			CooccurrencesEditor conceditor = (CooccurrencesEditor) TXMEditor.openEditor(new TXMResultEditorInput(corpus, new TXMParameters()), "CooccurrencesEditor"); //$NON-NLS-1$
-//			conceditor.setFocus(query);
-//			conceditor.computeResult(false);
-//		} catch (Exception e) {
-//			System.out.println(Messages.IndexToCooccurrence_0);
-//			org.txm.rcp.utils.Logger.printStackTrace(e);
-//		}
-
-		return null;
-	}
-
-	/**
-	 * 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;
-		
-		System.out.println("IMPLEMENTATION NOT FINISHED");
-		
-//		Corpus corpus = voceditor.getCorpus();
-//		try {
-//			CooccurrencesEditor conceditor = (CooccurrencesEditor) TXMEditor.openEditor(new TXMResultEditorInput(corpus, new TXMParameters()), "CooccurrencesEditor"); //$NON-NLS-1$
-//			conceditor.setFocus(query);
-//			conceditor.computeResult(false);
-//			return conceditor;
-//		} catch (Exception e) {
-//			System.out.println(Messages.IndexToCooccurrence_0);
-//			org.txm.rcp.utils.Logger.printStackTrace(e);
-//		}
-
-		return null;
-	}
-
-	/**
-	 * Gets the query.
-	 *
-	 * @param selection the selection
-	 * @return the query
-	 */
-	private static String getQuery(IStructuredSelection selection) {
-		String query = ""; //$NON-NLS-1$
-
-		Line line = (Line) selection.getFirstElement();
-		int nbToken = line.getUnitsProperties().get(0).size();
-		int nbProps = line.getProperties().size();
-		int nbLines = selection.size();
-		List<Line> lines = selection.toList();
-		List<Property> props = line.getProperties();
-		for (int t = 0; t < nbToken; t++) {
-			query += "["; //$NON-NLS-1$
-			for (int p = 0; p < nbProps; p++) {
-				query += props.get(p) + "=\""; //$NON-NLS-1$
-				for (int l = 0; l < nbLines; l++) {
-					line = lines.get(l);
-					List<List<String>> values = line.getUnitsProperties();
-					String s = values.get(p).get(t);
-					s = Query.addBackSlash(s);
-					query += s + "|"; //$NON-NLS-1$
-				}
-				query = query.substring(0, query.length() - 1);
-				query += "\" & "; //$NON-NLS-1$
-			}
-			query = query.substring(0, query.length() - 3);
-			query += "] "; //$NON-NLS-1$
-		}
-		query = query.substring(0, query.length() - 1);
-		return query;
-	}
-}
Index: tmp/org.txm.links.rcp/OSGI-INF/l10n/bundle.properties
===================================================================
--- tmp/org.txm.links.rcp/OSGI-INF/l10n/bundle.properties	(revision 841)
+++ tmp/org.txm.links.rcp/OSGI-INF/l10n/bundle.properties	(revision 842)
@@ -5,4 +5,4 @@
 
 command.name.3 = Send to progression
 
-command.name.65 = IndexToCooccurrence
+command.name.4 = Send to cooccurrence
Index: tmp/org.txm.links.rcp/OSGI-INF/l10n/bundle_fr.properties
===================================================================
--- tmp/org.txm.links.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 841)
+++ tmp/org.txm.links.rcp/OSGI-INF/l10n/bundle_fr.properties	(revision 842)
@@ -1,6 +1,8 @@
 
 command.name.1 = Envoyer vers la concordance
 
-command.name.2 = Envoyer vers l'Index
+command.name.2 = Envoyer vers l'index
 
 command.name.3 = Envoyer vers la progression
+
+command.name.4 = Envoyer vers la cooccurrence
Index: tmp/org.txm.links.rcp/plugin.xml
===================================================================
--- tmp/org.txm.links.rcp/plugin.xml	(revision 841)
+++ tmp/org.txm.links.rcp/plugin.xml	(revision 842)
@@ -18,7 +18,7 @@
       </command>
             <command
                   id="org.txm.links.rcp.commands.SendToCooccurrence"
-                  name="Send to cooccurrence">
+                  name="%command.name.4">
             </command>
            <command
             categoryId="org.txm.synopticedition.rcp.category.txm"
Index: tmp/org.txm.links.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.links.rcp/META-INF/MANIFEST.MF	(revision 841)
+++ tmp/org.txm.links.rcp/META-INF/MANIFEST.MF	(revision 842)
@@ -26,7 +26,8 @@
  sibility:=reexport,org.txm.lexicaltable.rcp;visibility:=reexport,org.
  txm.libs.batik;visibility:=reexport,org.txm.edition.rcp;bundle
  -version="1.0.0";visibility:=reexport
-Export-Package: org.txm.links.rcp,org.txm.rcp.commands.link
+Export-Package: org.txm.links.rcp,
+ org.txm.rcp.commands.link
 Bundle-Vendor: Textometrie.org
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: Links RCP
Index: tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java
===================================================================
--- tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java	(revision 841)
+++ tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/editors/CooccurrencesEditor.java	(revision 842)
@@ -383,26 +383,6 @@
 			viewer.getTable().setFont(font);
 		}
 
-		// TODO replace this with a 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);
-		// //System.out.println("col "+col);
-		// switch(col)
-		// {
-		// default:
-		// IStructuredSelection selection = (IStructuredSelection)
-		// viewer.getSelection();
-		// CooccurrencesToConcordances.link(CooccurrencesEditor.this,
-		// selection);
-		// }
-		// }
-		// });
-
 		viewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
 
 		viewer.setLabelProvider(new LineLabelProvider());
@@ -496,10 +476,35 @@
 		setColComparator(new ScoreComparator(), scoreColumn);
 		sort();
 		
+		
+		// Add double click, "Send to" command
+		TXMEditor.addDoubleClickCommandListener(viewer.getTable(), "org.txm.links.rcp.commands.SendToConcordance"); //$NON-NLS-1$
+
+		// TODO replace this with a 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);
+		// //System.out.println("col "+col);
+		// switch(col)
+		// {
+		// default:
+		// IStructuredSelection selection = (IStructuredSelection)
+		// viewer.getSelection();
+		// CooccurrencesToConcordances.link(CooccurrencesEditor.this,
+		// selection);
+		// }
+		// }
+		// });
+
 		// Register the context menu
 		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer);
-
 		
+		
+		
 		initializeFields();
 
 		for (TableColumn col : viewer.getTable().getColumns()) {
Index: tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/___CooccurrencesToConcordances.java
===================================================================
--- tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/___CooccurrencesToConcordances.java	(revision 0)
+++ tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/___CooccurrencesToConcordances.java	(revision 842)
@@ -0,0 +1,132 @@
+// 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.cooccurrence.rcp.handlers;
+
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.concordance.core.functions.Concordance;
+import org.txm.cooccurrence.core.functions.Cooccurrence;
+import org.txm.cooccurrence.core.functions.Cooccurrence.CLine;
+import org.txm.cooccurrence.rcp.editors.CooccurrencesEditor;
+import org.txm.rcp.editors.TXMResultEditorInput;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.WordProperty;
+import org.txm.searchengine.cqp.corpus.query.Query;
+
+// TODO: Auto-generated Javadoc
+/**
+ * use the lines of a cooc result to build a concordance @ author mdecorde.
+ */
+public class ___CooccurrencesToConcordances extends AbstractHandler {
+
+	/** The selection. */
+	private IStructuredSelection selection;
+	
+	/** The editor input. */
+	private static TXMResultEditorInput editorInput;
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
+		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+		CooccurrencesEditor ceditor = null;
+		IEditorPart editor = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor();
+		ceditor = (CooccurrencesEditor) editor;
+		
+		link(ceditor, selection);
+		return null;
+	}
+	
+	/**
+	 * Link.
+	 *
+	 * @param editor the editor
+	 * @param selection the selection
+	 */
+	public static void link(CooccurrencesEditor editor, IStructuredSelection selection)
+	{
+
+		assert (selection.getFirstElement() instanceof CLine);
+
+		Cooccurrence cooc = ((CLine) selection.getFirstElement()).getCooc();
+		
+		int nbProps = cooc.getProperties().size();
+		List<WordProperty> props = cooc.getProperties();
+		List<CLine> list = selection.toList();
+		//System.out.println("Cooc lines "+list);
+
+		String query = "["; //$NON-NLS-1$
+		for (int p = 0; p < nbProps; p++) {
+			query += props.get(p) + "=\""; //$NON-NLS-1$
+			for (int l = 0; l < list.size(); l++) {
+				CLine line = list.get(l);
+				String s = line.props.get(p);
+				s = Query.addBackSlash(s);
+				query += s + "|"; //$NON-NLS-1$
+			}
+			query = query.substring(0, query.length() - 1);
+			query += "\" & "; //$NON-NLS-1$
+		}
+		query = query.substring(0, query.length() - 3);
+		query += "] "; //$NON-NLS-1$
+		
+		int maxempan = Math.max(cooc.getMaxLeft(), cooc.getMaxRight()); 
+		if (cooc.getIncludeXPivot() && maxempan == 0) maxempan = 1;  
+		
+		String maxempanstr = "within " + maxempan + " "; //$NON-NLS-1$ //$NON-NLS-2$
+		if (cooc.getStructure() != null) maxempanstr += cooc.getStructure().getName(); 
+		
+		query = "("+cooc.getQuery()+" []* "+query+") | ("+query+" []* "+cooc.getQuery()+") "+maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+		
+		Corpus corpus = cooc.getCorpus();
+		Concordance concordance = new Concordance(corpus);
+		concordance.setParameters(new Query(query), null, null, null, null, null, null, null, null, null, null);
+		editorInput = new TXMResultEditorInput(concordance);
+
+		IWorkbenchPage page = editor.getEditorSite().getWorkbenchWindow().getActivePage();
+		
+//		try {
+//			ConcordanceEditor conceditor = (ConcordanceEditor) page
+//					.openEditor(editorInput, ConcordanceEditor.ID); //$NON-NLS-1$
+//		} catch (PartInitException e) {
+//			System.err.println("Error: "+e.getLocalizedMessage());
+//		}
+	}
+}

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

Index: tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java
===================================================================
--- tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java	(revision 841)
+++ tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java	(revision 842)
@@ -37,6 +37,7 @@
 import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
 import org.txm.cooccurrence.rcp.editors.CooccurrencesEditor;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.progression.core.functions.Progression;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.handlers.BaseAbstractHandler;
@@ -49,18 +50,17 @@
 import org.txm.utils.logger.Log;
 
 /**
- * If the selection is a corpus, opens an empty Cooc editor,
- * if the selection is a concordance, opens a Cooc editor already computed.
+ * If the selection is a corpus, opens an empty Cooc editor, if the selection is
+ * a concordance, opens a Cooc editor already computed.
  * 
  * @author mdecorde
  * 
  */
 public class ComputeCooccurrences extends BaseAbstractHandler {
-	
-	
+
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		
+
 		if (!this.checkStatsEngine()) {
 			return null;
 		}
@@ -68,63 +68,72 @@
 		if (!this.checkCorpusEngine()) {
 			return null;
 		}
-		
-		Object selection = this.getSelection(event);
+
 		Cooccurrence cooc = null;
-		
-		if (selection instanceof Concordance) {
 
-			int minleft = 1;
-			int maxleft = 50;
-			int minright = 1;
-			int maxright = 50;
+		// From link: creating from UUID and preferences nodes
+		String uuid = event.getParameter(TXMPreferences.RESULT_UUID);
+		if (uuid != null && !uuid.isEmpty()) {
+			cooc = new Cooccurrence(uuid);
+		}
+		// From view result node
+		else {
 
-			int minf = TXMPreferences.getInt(CooccurrencePreferences.MIN_FREQ, CooccurrencePreferences.PREFERENCES_NODE);
-			int mincof = TXMPreferences.getInt(CooccurrencePreferences.MIN_COUNT, CooccurrencePreferences.PREFERENCES_NODE);
-			int minscore = (int) TXMPreferences.getDouble(CooccurrencePreferences.MIN_SCORE, CooccurrencePreferences.PREFERENCES_NODE);
-			boolean buildLexicalTableWithCooccurrents = TXMPreferences.getBoolean(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, CooccurrencePreferences.PREFERENCES_NODE);
-			
-			StructuralUnit limit = null;
-			Query query = null;
-			List<WordProperty> properties = null;
+			Object selection = this.getSelection(event);
 
-			Concordance conc = (Concordance) selection;
-			Corpus corpus = conc.getCorpus();
-			maxleft = conc.getLeftContextSize();
-			maxright = conc.getRightContextSize();
-			properties = new ArrayList<WordProperty>();
-			properties.addAll(conc.getAnalysisProperty());
-			query = conc.getQuery();
-			
-			try {
-				cooc = new Cooccurrence(corpus);
-				cooc.setParameters(query, properties, limit,
-				maxleft, minleft, minright, maxright, minf, mincof,
-				minscore, false, buildLexicalTableWithCooccurrents);
-			} catch (Exception e) {
-				Log.printStackTrace(e);
-				return null;
+			// Creating from Concordance
+			if (selection instanceof Concordance) {
+
+				int minleft = 1;
+				int maxleft = 50;
+				int minright = 1;
+				int maxright = 50;
+
+				int minf = TXMPreferences.getInt(CooccurrencePreferences.MIN_FREQ, CooccurrencePreferences.PREFERENCES_NODE);
+				int mincof = TXMPreferences.getInt(CooccurrencePreferences.MIN_COUNT, CooccurrencePreferences.PREFERENCES_NODE);
+				int minscore = (int) TXMPreferences.getDouble(CooccurrencePreferences.MIN_SCORE, CooccurrencePreferences.PREFERENCES_NODE);
+				boolean buildLexicalTableWithCooccurrents = TXMPreferences.getBoolean(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE, CooccurrencePreferences.PREFERENCES_NODE);
+
+				StructuralUnit limit = null;
+				Query query = null;
+				List<WordProperty> properties = null;
+
+				Concordance conc = (Concordance) selection;
+				Corpus corpus = conc.getCorpus();
+				maxleft = conc.getLeftContextSize();
+				maxright = conc.getRightContextSize();
+				properties = new ArrayList<WordProperty>();
+				properties.addAll(conc.getAnalysisProperty());
+				query = conc.getQuery();
+
+				try {
+					cooc = new Cooccurrence(corpus);
+					cooc.setParameters(query, properties, limit, maxleft, minleft, minright, maxright, minf, mincof, minscore, false, buildLexicalTableWithCooccurrents);
+				}
+				catch (Exception e) {
+					Log.printStackTrace(e);
+					return null;
+				}
+
 			}
-
-		} else if (selection instanceof Corpus) { // new editor from corpus
-			cooc = new Cooccurrence((Corpus)selection); 
-		} else if (selection instanceof Cooccurrence) { // reopening an existing result
-			cooc = (Cooccurrence)selection;
-		} else {
-			System.out.println(TXMUIMessages.ComputeCooccurrences_1 + selection);
-			return null;
+			// Creating from Corpus
+			else if (selection instanceof Corpus) {
+				cooc = new Cooccurrence((Corpus) selection);
+			}
+			// Reopening an existing result
+			else if (selection instanceof Cooccurrence) {
+				cooc = (Cooccurrence) selection;
+			}
+			// Error
+			else {
+				return this.logCanNotCompute(selection);
+			}
 		}
-		
-		try {
-			StatusLine.setMessage(TXMUIMessages.ComputeCooccurrences_0);
 
-			//System.out.println("DEBUG: opening cooc: "+cooc+" corpus="+cooc.getCorpus());
-			TXMEditor.openEditor(cooc, CooccurrencesEditor.ID);
-			
-			return true;
-		} catch (Exception e) {
-			Log.printStackTrace(e);
-			return false;
-		}
+		StatusLine.setMessage(TXMUIMessages.ComputeCooccurrences_0);
+
+		TXMEditor.openEditor(cooc, CooccurrencesEditor.ID);
+
+		return null;
 	}
 }
Index: tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/SendToConcordance.java
===================================================================
--- tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/SendToConcordance.java	(revision 0)
+++ tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/SendToConcordance.java	(revision 842)
@@ -0,0 +1,76 @@
+// 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.cooccurrence.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.cooccurrence.core.functions.Cooccurrence;
+import org.txm.cooccurrence.core.functions.Cooccurrence.CLine;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.core.results.TXMResult;
+import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+
+/**
+ * Sends the selected lines of a cooccurrence to compute a concordance.
+ * 
+ * @author mdecorde
+ * @author sjacquot
+ * 
+ */
+public class SendToConcordance extends BaseAbstractHandler {
+
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		
+		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+		System.err.println("SendToConcordance.execute() class of line = " + selection.getFirstElement().getClass());
+		
+		if (selection != null && selection.getFirstElement() instanceof CLine) {
+			
+			String query = Cooccurrence.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.concordance.rcp.handlers.ComputeConcordance", uuid); //$NON-NLS-1$
+		}
+		else	{
+			this.logCanNotCompute(selection);
+		}
+		return null;
+	}
+
+}

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

Index: tmp/org.txm.cooccurrence.rcp/plugin.xml
===================================================================
--- tmp/org.txm.cooccurrence.rcp/plugin.xml	(revision 841)
+++ tmp/org.txm.cooccurrence.rcp/plugin.xml	(revision 842)
@@ -95,8 +95,7 @@
       <menuContribution
             locationURI="popup:org.txm.cooccurrence.rcp.editors.CooccurrencesEditor">
          <command
-               commandId="org.txm.rcp.commands.link.CooccurrencesToConcordances"
-               label="%command.label.102"
+               commandId="org.txm.links.rcp.commands.SendToConcordance"
                style="push">
          </command>
       </menuContribution>
@@ -126,6 +125,26 @@
             </iterate>
          </with>
       </definition>
+      <definition
+            id="CooccurrenceEditorActive">
+         <with
+               variable="activePart">
+            <instanceof
+                  value="org.txm.cooccurrence.rcp.editors.CooccurrencesEditor">
+            </instanceof>
+         </with>
+      </definition>
    </extension>
+   <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="org.txm.cooccurrence.rcp.handlers.SendToConcordance"
+            commandId="org.txm.links.rcp.commands.SendToConcordance">
+         <activeWhen>
+            <reference
+                  definitionId="CooccurrenceEditorActive">
+            </reference></activeWhen>
+      </handler>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF	(revision 841)
+++ tmp/org.txm.cooccurrence.rcp/META-INF/MANIFEST.MF	(revision 842)
@@ -2,17 +2,18 @@
 Export-Package: org.txm.cooccurrence.rcp.adapters,org.txm.cooccurrence
  .rcp.editors,org.txm.cooccurrence.rcp.handlers,org.txm.cooccurrence.r
  cp.messages,org.txm.cooccurrence.rcp.preferences
-Require-Bundle: org.txm.utils;visibility:=reexport,org.eclipse.osgi;bu
- ndle-version="3.10.2";visibility:=reexport,org.eclipse.core.runtime;b
- undle-version="3.10.0";visibility:=reexport,org.txm.searchengine.cqp.
- core;bundle-version="1.1.0";visibility:=reexport,org.txm.cooccurrence
- .core;bundle-version="1.0.0";visibility:=reexport,org.txm.concordance
- .core;bundle-version="1.0.0";visibility:=reexport,org.txm.statsengine
- .r.rcp;bundle-version="1.0.0";visibility:=reexport,org.eclipse.ui;bun
- dle-version="3.106.1";visibility:=reexport,org.txm.core;visibility:=r
- eexport,org.txm.rcp;visibility:=reexport,org.eclipse.core.expressions
- ;bundle-version="3.4.600";visibility:=reexport,org.txm.searchengine.c
- ore;bundle-version="1.0.0";visibility:=reexport
+Require-Bundle: org.txm.utils;visibility:=reexport,
+ org.eclipse.osgi;bundle-version="3.10.2";visibility:=reexport,
+ org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
+ org.txm.searchengine.cqp.core;bundle-version="1.1.0";visibility:=reexport,
+ org.txm.cooccurrence.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.concordance.core;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.statsengine.r.rcp;bundle-version="1.0.0";visibility:=reexport,
+ org.eclipse.ui;bundle-version="3.106.1";visibility:=reexport,
+ org.txm.core;visibility:=reexport,
+ org.txm.rcp;visibility:=reexport,
+ org.eclipse.core.expressions;bundle-version="3.4.600";visibility:=reexport,
+ org.txm.searchengine.core;bundle-version="1.0.0";visibility:=reexport
 Bundle-Vendor: Textometrie.org
 Bundle-Version: 1.0.0.qualifier
 Bundle-Name: Cooccurence RCP
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 841)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 842)
@@ -98,7 +98,25 @@
 	 */
 	public static final String PROPERTIES =  "properties"; //$NON-NLS-1$
 
+	
 	/**
+	 * Minimum frequency filter value.
+	 */
+	public static final String F_MIN = "f_min"; //$NON-NLS-1$
+	
+	/**
+	 * Maximum frequency filter value.
+	 */
+	public static final String F_MAX = "f_max"; //$NON-NLS-1$
+	
+	/**
+	 * V max filter (max number of lines). 
+	 */
+	public static final String V_MAX = "v_max"; //$NON-NLS-1$
+	
+
+	
+	/**
 	 * Separator used when converting list from and to string.
 	 */
 	public static final String LIST_SEPARATOR =  "\t"; //$NON-NLS-1$
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 841)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 842)
@@ -60,6 +60,7 @@
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.QueryResult;
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
+import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
 import org.txm.searchengine.cqp.corpus.WordProperty;
 import org.txm.searchengine.cqp.corpus.query.Match;
 import org.txm.searchengine.cqp.corpus.query.Query;
@@ -226,17 +227,23 @@
 
 
 	
-	
-	
-	
+	public Cooccurrence(Corpus corpus)	{
+		this(null, corpus);
+	}
+
+	public Cooccurrence(String uuid)	{
+		this(uuid, null);
+	}
+
 	/**
 	 * Creates an empty <link>Cooccurrence</link> object, child of the specified <link>Corpus</link>.
 	 * @param corpus
 	 */
-	public Cooccurrence(Corpus corpus) {
-		super(corpus);
+	public Cooccurrence(String uuid, Corpus corpus)	{
+		super(uuid, corpus);
 	}
 
+
 	/**
 	 * 
 	 * @param watcher
@@ -263,54 +270,61 @@
 		//System.out.println("cooc: "+corpus+" "+query+" "+properties+" "+limit+" "+maxLeft+" "+minLeft+" "+minRight+" "+maxRight+" "+minFreq+" "+minCof+" "+minScore+" "+includeXpivot);
 
 		this.subTask(CooccurrenceCoreMessages.info_buildingQueries);
-			if (lines != null) this.lines.clear();
-			if (allsignaturesstr != null) this.allsignaturesstr.clear();
-			if (conclines != null) this.conclines.clear();
-			if (count != null) this.count.clear();
-			if (counted != null) this.counted.clear();
-			if (counts != null) this.counts.clear();
-			if (dist != null) this.dist.clear();
-			if (distances != null) this.distances.clear();
-			if (distancescounts != null) this.distancescounts.clear();
-			if (indexfreqs != null) this.indexfreqs.clear();
-			if (keysToString != null) this.keysToString.clear();
-			if (occproperties != null) this.occproperties.clear();
+		
+		// clear data
+		try {
+			this.lines.clear();
+			this.allsignaturesstr.clear();
+			this.conclines.clear();
+			this.count.clear();
+			this.counted.clear();
+			this.counts.clear();
+			this.dist.clear();
+			this.distances.clear();
+			this.distancescounts.clear();
+			this.indexfreqs.clear();
+			this.keysToString.clear();
+			this.occproperties.clear();
+		}
+		catch (Exception e) {
+		}
 			
-			if (!this.stepQueryLimits()) {
-				return false;
-			}	
+		if (!this.stepQueryLimits()) {
+			return false;
+		}	
 
-			this.subTask(CooccurrenceCoreMessages.info_retreivingMatches);
-			if (!this.stepGetMatches()) {
-				return false;
-			}
-			this.worked(10);
+		this.subTask(CooccurrenceCoreMessages.info_retreivingMatches);
+		if (!this.stepGetMatches()) {
+			return false;
+		}
+		this.worked(10);
 
-			this.subTask(CooccurrenceCoreMessages.info_buildingLineSignatures);
-			if (!this.stepBuildSignatures())
-				return false;
-			this.worked(10);
+		this.subTask(CooccurrenceCoreMessages.info_buildingLineSignatures);
+		if (!this.stepBuildSignatures()) {
+			return false;
+		}
+		this.worked(10);
 
-			this.subTask(CooccurrenceCoreMessages.info_counting);
-			if (!this.stepCount())	{
-				return false;
-			}
-			this.worked(10);
+		this.subTask(CooccurrenceCoreMessages.info_counting);
+		if (!this.stepCount())	{
+			return false;
+		}
+		this.worked(10);
 
-			this.subTask(CooccurrenceCoreMessages.info_buildingLexicalTable);
-			if (!this.stepBuildLexicalTable())	{
-				return false;
-			}
-			this.worked(10);
+		this.subTask(CooccurrenceCoreMessages.info_buildingLexicalTable);
+		if (!this.stepBuildLexicalTable())	{
+			return false;
+		}
+		this.worked(10);
 
-			this.subTask(CooccurrenceCoreMessages.info_computingSpecificitiesScores);
-			if (!this.stepGetScores())	{
-				return false;
-			}
+		this.subTask(CooccurrenceCoreMessages.info_computingSpecificitiesScores);
+		if (!this.stepGetScores())	{
+			return false;
+		}
+		
+		this.clearMemory();
+		this.worked(10);
 			
-			this.clearMemory();
-			this.worked(10);
-			
 
 		return true;
 	}
@@ -909,7 +923,7 @@
 				index = new Index(corpus);
 				index.setParameters(new Query(pCooccurentQueryFilter), pProperties, null, null, null, null);
 				if (!index.compute(monitor)) {
-					System.out.println("Cooccurrence internal Index compute failed. Aborting.");
+					Log.severe("Cooccurrence internal Index compute failed. Aborting.");
 					return false;
 				}
 			} catch (Exception e){
@@ -1436,6 +1450,43 @@
 		this.pQuery = query;
 	}
 	
+	/**
+	 * Creates a CQL query string from the specified lines.
+	 *
+	 * @param lines
+	 * @return the query
+	 */
+	public static String createQuery(List<CLine> lines) {
+		
+		Cooccurrence cooc = lines.get(0).getCooc();
+		int nbProps = cooc.getProperties().size();
+		List<WordProperty> props = cooc.getProperties();
+
+		String query = "["; //$NON-NLS-1$
+		for (int p = 0; p < nbProps; p++) {
+			query += props.get(p) + "=\""; //$NON-NLS-1$
+			for (int l = 0; l < lines.size(); l++) {
+				CLine line = lines.get(l);
+				String s = line.props.get(p);
+				s = Query.addBackSlash(s);
+				query += s + "|"; //$NON-NLS-1$
+			}
+			query = query.substring(0, query.length() - 1);
+			query += "\" & "; //$NON-NLS-1$
+		}
+		query = query.substring(0, query.length() - 3);
+		query += "] "; //$NON-NLS-1$
+		
+		int maxempan = Math.max(cooc.getMaxLeft(), cooc.getMaxRight()); 
+		if (cooc.getIncludeXPivot() && maxempan == 0) maxempan = 1;  
+		
+		String maxempanstr = "within " + maxempan + " "; //$NON-NLS-1$ //$NON-NLS-2$
+		if (cooc.getStructure() != null) maxempanstr += cooc.getStructure().getName(); 
+		
+		query = "("+cooc.getQuery()+" []* "+query+") | ("+query+" []* "+cooc.getQuery()+") "+maxempanstr; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+		
+		return query;
+	}
 	
 
 	/**
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java	(revision 841)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/preferences/CooccurrencePreferences.java	(revision 842)
@@ -64,8 +64,8 @@
 		preferences.putDouble(MIN_SCORE, 2.0);
 		
 		preferences.putInt(MAX_LEFT, 10);
-		preferences.putInt(MIN_LEFT, 0);
-		preferences.putInt(MIN_RIGHT, 0);
+		preferences.putInt(MIN_LEFT, 1);
+		preferences.putInt(MIN_RIGHT, 1);
 		preferences.putInt(MAX_RIGHT, 10);
 		
 		preferences.put(PROPERTIES, TXMPreferences.DEFAULT_UNIT_PROPERTY);
