Index: TXM/trunk/org.txm.referencer.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.referencer.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.referencer.rcp/plugin.xml	(revision 3382)
@@ -141,6 +141,9 @@
                   definitionId="ReferencerEditorActive">
             </reference>
             <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+            <reference
                   definitionId="SendSelectionContextNotActive">
             </reference>
             </and>
Index: TXM/trunk/org.txm.queryindex.rcp/src/org/txm/queryindex/rcp/commands/function/ComputeQueryIndex.java
===================================================================
--- TXM/trunk/org.txm.queryindex.rcp/src/org/txm/queryindex/rcp/commands/function/ComputeQueryIndex.java	(revision 3381)
+++ TXM/trunk/org.txm.queryindex.rcp/src/org/txm/queryindex/rcp/commands/function/ComputeQueryIndex.java	(revision 3382)
@@ -40,6 +40,7 @@
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.TXMWindows;
 import org.txm.rcp.editors.TXMResultEditorInput;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.utils.logger.Log;
@@ -49,7 +50,7 @@
  * 
  * @author mdecorde.
  */
-public class ComputeQueryIndex extends AbstractHandler {
+public class ComputeQueryIndex extends BaseAbstractHandler {
 
 	/** The ID. */
 	public static String ID = "org.txm.rcp.commands.function.ComputeQueryIndex"; //$NON-NLS-1$
@@ -63,7 +64,7 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		Log.info("Compute QueryIndex: start");
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		selection = this.getCorporaViewSelection(event);
 
 		Object s = selection.getFirstElement();
 		if (s instanceof CQPCorpus) {
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java	(revision 3381)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java	(revision 3382)
@@ -12,6 +12,7 @@
 import org.eclipse.core.commands.ParameterValuesException;
 import org.eclipse.core.commands.ParameterizedCommand;
 import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -86,6 +87,28 @@
 	 * @param event the ExecutionEvent that provoke the command call.
 	 * @return the corpora view current selection
 	 */
+	public IStructuredSelection getCorporaViewSelection(ExecutionEvent event) {
+		
+		// FIXME: check this, because it may be too linked to the Corpora view
+		return (IStructuredSelection) (CorporaView.getInstance().getTreeViewer().getSelection());
+//		// otherwise use this code
+//		// yeah but selection might be tricky
+//		// Object o = (IStructuredSelection) HandlerUtil.getCurrentSelection(event).getFirstElement();
+//		if (o == null) {
+//			Log.severe("BaseAbstractHandler.getCorporaViewSelectedObject(): current selection is null.");
+//		}
+//		
+//		Log.fine("BaseAbstractHandler.getCorporaViewSelectedObject(): selected object = " + o);
+//		
+//		return o;
+	}
+	
+	/**
+	 * Gets the current selected object.
+	 * 
+	 * @param event the ExecutionEvent that provoke the command call.
+	 * @return the corpora view current selected object
+	 */
 	public Object getCorporaViewSelectedObject(ExecutionEvent event) {
 		
 		// FIXME: check this, because it may be too linked to the Corpora view
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 3381)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 3382)
@@ -73,6 +73,7 @@
 import org.txm.core.results.TXMResult;
 import org.txm.objects.Project;
 import org.txm.objects.Workspace;
+import org.txm.rcp.CorporaSourceProvider;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.commands.workspace.OpenCorpus;
@@ -315,6 +316,8 @@
 				if (sel.length == 0)
 					return;
 				
+				CorporaSourceProvider.updateSelection(treeViewer.getSelection());
+				
 				CorporaView.this.setFocus(); // force focus on the corpora view -> ensure the active selection is the corpora view selection
 				
 				ISelection tsel = treeViewer.getSelection();
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenBrowser.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenBrowser.java	(revision 3381)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenBrowser.java	(revision 3382)
@@ -29,6 +29,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.net.URLEncoder;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
@@ -73,10 +74,8 @@
 		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
 				.getShell();
 		
-		String filename = event
-				.getParameter("org.txm.rcp.commands.commandParameter2"); //$NON-NLS-1$
-		if (filename != null && !filename.matches("") && !filename.matches(" ")) //$NON-NLS-1$ //$NON-NLS-2$
-		{
+		String filename = event.getParameter("org.txm.rcp.commands.commandParameter2"); //$NON-NLS-1$
+		if (filename != null && !filename.matches("") && !filename.matches(" ")) { //$NON-NLS-1$ //$NON-NLS-2$
 			openfile(filename);
 			return null;
 		}
@@ -94,6 +93,7 @@
 		}
 		
 		if (file == null) {
+			
 			FileDialog dialog = new FileDialog(shell, SWT.OPEN);
 			String txmhome = Toolbox.getTxmHomePath();
 			if (LastOpened.getFile(ID) != null) {
@@ -104,8 +104,7 @@
 				dialog.setFilterPath(txmhome);
 			}
 			if (dialog.open() != null) {
-				String filepath = dialog.getFilterPath()
-						+ "/" + dialog.getFileName(); //$NON-NLS-1$
+				String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
 				LastOpened.set(ID, dialog.getFilterPath(), dialog.getFileName());
 				if (dialog.getFileName().length() > 0) {
 					lastopenedfile = filepath;
@@ -118,8 +117,7 @@
 				FileDialog dialog = new FileDialog(shell, SWT.OPEN);
 				dialog.setFilterPath(file.getAbsolutePath());
 				if (dialog.open() == null) return null;
-				String filepath = dialog.getFilterPath()
-						+ "/" + dialog.getFileName(); //$NON-NLS-1$
+				String filepath = dialog.getFilterPath() + "/" + dialog.getFileName(); //$NON-NLS-1$
 				LastOpened.set(ID, dialog.getFilterPath(), dialog.getFileName());
 				lastopenedfile = filepath;
 				return openfile(filepath);
@@ -179,15 +177,23 @@
 	public static TXMBrowserEditor openEdition(String filepath, String editorname) {
 		try {
 
-			WebBrowserEditorInput editorInput;
 			File localfile = new File(filepath);
-			if (filepath == null || filepath.length() == 0)
-				editorInput = new WebBrowserEditorInput(null, BrowserViewer.BUTTON_BAR | BrowserViewer.LOCATION_BAR);
-			else if (localfile.exists())
-				editorInput = new WebBrowserEditorInput(localfile.toURI().toURL(), BrowserViewer.BUTTON_BAR | BrowserViewer.LOCATION_BAR);
-			else
-				editorInput = new WebBrowserEditorInput(new URL(filepath), BrowserViewer.BUTTON_BAR | BrowserViewer.LOCATION_BAR);
+			URL url = null;
+			if (filepath == null || filepath.length() == 0) {
+
+			} else if (localfile.exists()) {
+				url = localfile.toURI().toURL();
+			} else {
+				url = new URL(filepath);
+			}
 			
+			String s = url.toString();
+			int begin = s.indexOf(":/");
+			String start = s.substring(0, begin);
+			String end = URLEncoder.encode(s.substring(begin+2));
+			
+			WebBrowserEditorInput editorInput = new WebBrowserEditorInput(new URL(start+":/"+end), BrowserViewer.BUTTON_BAR | BrowserViewer.LOCATION_BAR);
+			
 			IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
 			IWorkbenchPage page = window.getActivePage();
 			
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/CorporaSourceProvider.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/CorporaSourceProvider.java	(revision 0)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/CorporaSourceProvider.java	(revision 3382)
@@ -0,0 +1,75 @@
+package org.txm.rcp;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.AbstractSourceProvider;
+import org.txm.utils.logger.Log;
+
+public class CorporaSourceProvider extends AbstractSourceProvider {
+	
+	public static final String NAME = "corporaSelection";
+	public static final String[] NAMES = {NAME};
+	HashMap<String, ISelection> currentState = new HashMap<String, ISelection>();
+	
+	public static CorporaSourceProvider instance = null;
+	
+	public CorporaSourceProvider() {
+		
+		currentState.put(NAME, null);
+		instance = this;
+	}
+	
+	public static void updateSelection(ISelection selection) {
+		if (instance != null) {
+			instance.currentState.put(NAME, selection);
+			instance.fireSourceChanged(1, NAME, selection);
+			Log.fine("UPDATE SOURCE: "+selection);
+		}
+	}
+	
+	@Override
+	public void dispose() {
+		
+	}
+	
+	@Override
+	public Map<String, ISelection> getCurrentState() {
+		
+		return currentState;
+	}
+	
+	//	// Selection SourceProvider
+	//
+	//	ISelection selection;
+	//	private IWorkbench workbench;
+	//	
+	//	@Override
+	//	public void initialize(IServiceLocator locator) {
+	////		this.locator = locator;
+	//		super.initialize(locator);
+	//		IWorkbenchLocationService wls = locator.getService(IWorkbenchLocationService.class);
+	//		workbench = wls.getWorkbench();
+	//	}
+	//	
+	//	private IWorkbenchWindow getActiveWindow() {
+	//		final Shell newActiveShell = workbench.getDisplay().getActiveShell();
+	//		final IContextService contextService = workbench.getService(IContextService.class);
+	//		if (contextService != null) {
+	//			final int shellType = contextService.getShellType(newActiveShell);
+	//			if (shellType != IContextService.TYPE_DIALOG) {
+	//				return workbench.getActiveWorkbenchWindow();
+	//			}
+	//		}
+	//		return null;
+	//	}
+	
+	
+	@Override
+	public String[] getProvidedSourceNames() {
+		
+		return NAMES;
+	}
+	
+}

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

Index: TXM/trunk/org.txm.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.rcp/plugin.xml	(revision 3382)
@@ -30,10 +30,10 @@
       <product
             application="org.txm.rcp.Application"
             description="%product.description"
-            name="TXM">
+            name="TXM 0.8.2">
          <property
                name="appName"
-               value="TXM">
+               value="TXM 0.8.2">
          </property>
          <property
                name="windowImages"
@@ -3136,6 +3136,19 @@
                   </iterate>
                </with>
             </definition>
+            <definition
+                  id="SelectionIsNotEmpty">
+               <with
+                     variable="selection">
+                  <iterate
+                        ifEmpty="false"
+                        operator="and">
+                     <instanceof
+                           value="java.lang.Object">
+                     </instanceof>
+                  </iterate>
+               </with>
+            </definition>
    </extension>
   
    <extension
@@ -3349,5 +3362,15 @@
             name="Paths">
       </page>
    </extension>
+   <extension
+         point="org.eclipse.ui.services">
+      <sourceProvider
+            provider="org.txm.rcp.CorporaSourceProvider">
+         <variable
+               name="corporaSelection"
+               priorityLevel="workbench">
+         </variable>
+      </sourceProvider>
+   </extension>
 
 </plugin>
Index: TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ComputeTreeSearch.java
===================================================================
--- TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ComputeTreeSearch.java	(revision 3381)
+++ TXM/trunk/org.txm.treesearch.rcp/src/org/txm/treesearch/command/ComputeTreeSearch.java	(revision 3382)
@@ -40,6 +40,7 @@
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMResult;
 import org.txm.rcp.editors.TXMEditor;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.treesearch.editor.TreeSearchEditor;
 import org.txm.treesearch.function.TreeSearch;
@@ -53,7 +54,7 @@
  * 
  * @author mdecorde.
  */
-public class ComputeTreeSearch extends AbstractHandler {
+public class ComputeTreeSearch extends BaseAbstractHandler {
 	
 	/** The ID. */
 	public static String ID = ComputeTreeSearch.class.getName();
@@ -73,7 +74,7 @@
 			s = TXMResult.getResult(parametersNodePath); // a TreeSearch or a CQPCorpus
 		}
 		else { // From view result node
-			IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+			IStructuredSelection selection = this.getCorporaViewSelection(event);
 			s = selection.getFirstElement();
 		}
 		
Index: TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeInterTextDistance.java
===================================================================
--- TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeInterTextDistance.java	(revision 3381)
+++ TXM/trunk/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeInterTextDistance.java	(revision 3382)
@@ -1,17 +1,16 @@
 package org.txm.lexicaltable.rcp.handlers;
 
-import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.IHandlerListener;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.functions.intertextualdistance.InterTextDistance;
 import org.txm.lexicaltable.core.functions.LexicalTable;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.utils.logger.Log;
 
-public class ComputeInterTextDistance extends AbstractHandler {
+public class ComputeInterTextDistance extends BaseAbstractHandler {
 	
 	private IStructuredSelection selection;
 	
@@ -25,10 +24,9 @@
 		super.dispose();
 	}
 	
-	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		selection = this.getCorporaViewSelection(event);
 		
 		Object s = selection.getFirstElement();
 		if (!(s instanceof LexicalTable))
Index: TXM/trunk/org.txm.lexicaltable.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.lexicaltable.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.lexicaltable.rcp/plugin.xml	(revision 3382)
@@ -230,7 +230,7 @@
       <definition
             id="OneLexicalTableSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeValuesOfQuery.java
===================================================================
--- TXM/trunk/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeValuesOfQuery.java	(revision 3381)
+++ TXM/trunk/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeValuesOfQuery.java	(revision 3382)
@@ -50,6 +50,7 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.functions.cql2lsa.ValuesOfQuery;
 import org.txm.rcp.JobsTimer;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.swt.widget.AssistedQueryWidget;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -64,7 +65,7 @@
  * 
  * @author mdecorde.
  */
-public class ComputeValuesOfQuery extends AbstractHandler {
+public class ComputeValuesOfQuery extends BaseAbstractHandler {
 	
 	/** The ID. */
 	public static String ID = "org.txm.rcp.commands.function.ComputeQueryIndex"; //$NON-NLS-1$
@@ -79,7 +80,7 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		Log.info("Compute QueryIndex: start");
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		selection = this.getCorporaViewSelection(event);
 		
 		Object s = selection.getFirstElement();
 		if (!(s instanceof CQPCorpus)) return null;
Index: TXM/trunk/org.txm.specificities.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.specificities.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.specificities.rcp/plugin.xml	(revision 3382)
@@ -170,7 +170,7 @@
       <definition
             id="OneSpecificitiesResultSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.index.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.index.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.index.rcp/plugin.xml	(revision 3382)
@@ -288,7 +288,7 @@
       <definition
             id="OneIndexSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -301,7 +301,7 @@
       <definition
             id="OneLexiconSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -341,7 +341,7 @@
       <definition
             id="OnePartitionIndexSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -385,6 +385,9 @@
          
          </or>
          <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+         <reference
                definitionId="SendSelectionContextNotActive">
          </reference>
          </and>
@@ -406,9 +409,10 @@
                      definitionId="PartitionIndexEditorActive">
                </reference>
             </or>
-            
-            
                <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+               <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
             
@@ -431,6 +435,9 @@
                      definitionId="PartitionIndexEditorActive">
                </reference>
             </or>
+            <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
                <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
@@ -446,6 +453,9 @@
                      definitionId="LexiconEditorActive">
                </reference>
                <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+               <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
             </and>
Index: TXM/trunk/org.txm.chartsengine.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.chartsengine.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.chartsengine.rcp/plugin.xml	(revision 3382)
@@ -246,7 +246,7 @@
       <definition
             id="OneChartResultSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.progression.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.progression.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.progression.rcp/plugin.xml	(revision 3382)
@@ -154,7 +154,7 @@
       <definition
             id="OneProgressionSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -185,6 +185,9 @@
                      definitionId="ProgressionEditorActive">
                </reference>
                <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+               <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
             </and>
Index: TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3381)
+++ TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3382)
@@ -1467,7 +1467,7 @@
 		try {
 			QueriesView.refresh();
 			
-			this.fillDisplayArea(update );
+			this.fillDisplayArea(update);
 			
 			boolean b = concordance.getQueryResultParameter() == null;
 			this.queryWidget.setEnabled(b); // disable the widget if a QueryResult was provided
@@ -1614,6 +1614,7 @@
 		concordance.setRefViewPattern(referencePattern);
 		sort();
 		this.resetLeftTableColumnWidths();
+		getResultArea().layout(true, true);
 	}
 	
 	/**
@@ -2311,8 +2312,9 @@
 		
 		((FormData) sash.getLayoutData()).left = new FormAttachment(0, 25 + (int) (refMax * W));
 		
-		referenceColumn.setWidth(2 * (int) (refMax * W));
-		getResultArea().layout(true, true);
+		int s = 2 * (int) (refMax * W);
+		referenceColumn.setWidth(s);
+//		System.out.println("REFSIZE="+s);
 	}
 	
 	/**
@@ -2341,10 +2343,13 @@
 				max = MAX_CHARS_LENGTH_TO_SHOW;
 			}
 			
-			column.setWidth(15 + (int) (max * W));
+			int s = 15 + (int) (max * W);
+			column.setWidth(s);
+//			System.out.println(column.getText()+"SIZE="+s);
 		}
 		
 		viewerRight.getTable().layout(true, true);
+		
 		tableResizeListener.handleEvent(null); // center on keyword column
 		return n;
 	}
@@ -2358,8 +2363,13 @@
 	 * @return the number of lines in the table
 	 */
 	public int resetColumnWidths() {
+		if (!concordance.hasBeenComputedOnce()) return 0;
+		
+		
 		resetLeftTableColumnWidths();
-		return resetRightTableColumnWidths();
+		int c = resetRightTableColumnWidths();
+		getResultArea().layout(true, true);
+		return c;
 	}
 	
 	public Composite getExtensionButtonComposite() {
Index: TXM/trunk/org.txm.concordance.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.concordance.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.concordance.rcp/plugin.xml	(revision 3382)
@@ -21,7 +21,7 @@
       <definition
             id="OneConcordanceSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -234,6 +234,9 @@
                   </reference>
                </or>
                <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+               <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
             </and>
Index: TXM/trunk/org.txm.querycooccurrences.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.querycooccurrences.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.querycooccurrences.rcp/plugin.xml	(revision 3382)
@@ -55,7 +55,7 @@
       <definition
             id="OneQueryCooccurrenceSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryAutoCooccurrence.java
===================================================================
--- TXM/trunk/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryAutoCooccurrence.java	(revision 3381)
+++ TXM/trunk/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryAutoCooccurrence.java	(revision 3382)
@@ -58,6 +58,7 @@
 import org.txm.queryindex.core.functions.QueryIndex;
 import org.txm.queryindex.core.functions.QueryIndexLine;
 import org.txm.rcp.JobsTimer;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.views.QueriesView;
@@ -77,7 +78,7 @@
  * if the selection is a corpus, open an empty Cooc editor if the selection is a
  * concordance, open a Cooc editor already computed @ author mdecorde.
  */
-public class ComputeQueryAutoCooccurrence extends AbstractHandler {
+public class ComputeQueryAutoCooccurrence extends BaseAbstractHandler {
 
 	float reqtime = 0.5f;
 
@@ -86,7 +87,8 @@
 	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		
+		IStructuredSelection selection = this.getCorporaViewSelection(event);
 		final Object element = selection.getFirstElement();
 
 		final Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
Index: TXM/trunk/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryCooccurrence.java
===================================================================
--- TXM/trunk/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryCooccurrence.java	(revision 3381)
+++ TXM/trunk/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryCooccurrence.java	(revision 3382)
@@ -61,6 +61,7 @@
 import org.txm.functions.coocmatrix.QueryCooccurrence;
 //import org.txm.functions.queryindex.*;
 import org.txm.rcp.JobsTimer;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.views.QueriesView;
@@ -79,7 +80,7 @@
  * if the selection is a corpus, open an empty Cooc editor if the selection is a
  * concordance, open a Cooc editor already computed @ author mdecorde.
  */
-public class ComputeQueryCooccurrence extends AbstractHandler {
+public class ComputeQueryCooccurrence extends BaseAbstractHandler {
 
 	float reqtime = 0.5f;
 
@@ -88,7 +89,8 @@
 	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+		
+		IStructuredSelection selection = this.getCorporaViewSelection(event);
 		final Object element = selection.getFirstElement();
 
 		final Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
Index: TXM/trunk/org.txm.searchengine.cqp.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.searchengine.cqp.rcp/plugin.xml	(revision 3382)
@@ -386,7 +386,7 @@
       <definition
             id="OneMainCorpusSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -402,7 +402,7 @@
       <definition
             id="OneSubCorpusSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   operator="and">
                <instanceof
@@ -417,7 +417,7 @@
       <definition
             id="OneCorpusSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java	(revision 3381)
+++ TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java	(revision 3382)
@@ -12,6 +12,7 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.Toolbox;
+import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -19,7 +20,7 @@
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.searchengine.cqp.corpus.Subcorpus;
 
-public class ComputeIntersection extends AbstractHandler {
+public class ComputeIntersection extends BaseAbstractHandler {
 	
 	@Override
 	public void addHandlerListener(IHandlerListener handlerListener) {
@@ -34,7 +35,8 @@
 	
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		ISelection isel = HandlerUtil.getCurrentSelection(event);
+		
+		ISelection isel = this.getCorporaViewSelection(event);
 		if (!(isel instanceof IStructuredSelection)) return null;
 		IStructuredSelection selection = (IStructuredSelection) isel;
 		List list = selection.toList();
Index: TXM/trunk/org.txm.internalview.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.internalview.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.internalview.rcp/plugin.xml	(revision 3382)
@@ -96,7 +96,7 @@
       <definition
             id="OneInternalViewSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -126,6 +126,9 @@
                             <reference
                                   definitionId="InternalViewEditorActive">
                             </reference>
+                            <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
                                      <reference
                                            definitionId="SendSelectionContextNotActive">
                                      </reference>
@@ -140,6 +143,9 @@
                          <reference
                                definitionId="InternalViewEditorActive">
                          </reference>
+                         <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
                                   <reference
                                         definitionId="SendSelectionContextNotActive">
                                   </reference>
@@ -154,6 +160,9 @@
                             <reference
                                   definitionId="InternalViewEditorActive">
                             </reference>
+                            <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
                                      <reference
                                            definitionId="SendSelectionContextNotActive">
                                      </reference>
Index: TXM/trunk/org.txm.edition.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.edition.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.edition.rcp/plugin.xml	(revision 3382)
@@ -136,6 +136,9 @@
             commandId="org.txm.concordance.rcp.handlers.ComputeConcordance">
          <activeWhen>
             <and>
+            <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
                <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
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 3381)
+++ TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java	(revision 3382)
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -782,7 +783,10 @@
 	@Override
 	public void setURL(String url) {
 		if (!this.browser.isDisposed()) {
-			super.setURL(url);
+			int begin = url.indexOf(":/");
+			String start = url.substring(0, begin);
+			String end = URLEncoder.encode(url.substring(begin+2));
+			super.setURL(start+":/"+end);
 		}
 	}
 	
Index: TXM/trunk/org.txm.wordcloud.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.wordcloud.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.wordcloud.rcp/plugin.xml	(revision 3382)
@@ -133,7 +133,7 @@
       <definition
             id="OneWordCloudSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.partition.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.partition.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.partition.rcp/plugin.xml	(revision 3382)
@@ -112,7 +112,7 @@
       <definition
             id="OnePartitionSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.cooccurrence.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.cooccurrence.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.cooccurrence.rcp/plugin.xml	(revision 3382)
@@ -158,7 +158,7 @@
       <definition
             id="OneCooccurrenceSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -189,6 +189,9 @@
                      definitionId="CooccurrenceEditorActive">
                </reference>
                <reference
+                     definitionId="SelectionIsNotEmpty">
+               </reference>
+               <reference
                      definitionId="SendSelectionContextNotActive">
                </reference>
             </and></activeWhen>
Index: TXM/trunk/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java
===================================================================
--- TXM/trunk/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 3381)
+++ TXM/trunk/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java	(revision 3382)
@@ -90,8 +90,10 @@
 		
 		ISelection selection = HandlerUtil.getCurrentSelection(event);
 		
-		if (selection != null) {
+		if (selection != null && !selection.isEmpty()) {
 			
+			
+			
 			String query = this.createQuery(event, selection);
 			String queries = this.createQueries(event, selection);
 			Integer index = this.getIndexResult(event, selection);
Index: TXM/trunk/org.txm.ca.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.ca.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.ca.rcp/plugin.xml	(revision 3382)
@@ -148,7 +148,7 @@
       <definition
             id="OneICAComputableSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
@@ -161,7 +161,7 @@
       <definition
             id="OneCASelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
Index: TXM/trunk/org.txm.ahc.rcp/plugin.xml
===================================================================
--- TXM/trunk/org.txm.ahc.rcp/plugin.xml	(revision 3381)
+++ TXM/trunk/org.txm.ahc.rcp/plugin.xml	(revision 3382)
@@ -131,7 +131,7 @@
       <definition
             id="OneCAHSelected">
          <with
-               variable="selection">
+               variable="corporaSelection">
             <iterate
                   ifEmpty="false"
                   operator="and">
