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 552)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 553)
@@ -287,7 +287,16 @@
 		return true;
 	}
 
+	
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Index.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	@Override
 	public void clean() {
 		try {
 			if (writer != null) {
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 552)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 553)
@@ -1998,11 +1998,6 @@
 	}
 
 	@Override
-	public boolean isResultUsingParent(TXMResult parent) {
-		return this.concordance.getParent().getName().equals(parent.getName());
-	}
-
-	@Override
 	public Concordance getResultData() {
 		return concordance;
 	}
Index: tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java
===================================================================
--- tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java	(revision 552)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java	(revision 553)
@@ -401,9 +401,7 @@
 		this.fillDisplay();
 		super.refresh(update);
 	}
-	
 
-
 	
 	/**
 	 * Fills display.
@@ -471,20 +469,7 @@
 	
 	
 
-	@Override
-	public boolean isResultUsingParent(TXMResult parent) {
-		if (this.getResultData() == null) {
-			return false;
-		}
-		if (this.getResultData().getCorpus() == null) {
-			return false;
-		}
-		return this.getResultData().getCorpus().getName().equals(parent.getName());
-	}
-
 	
-	
-	
 	// FIXME: old method
 //	@Override
 //	public void computeResult() {
Index: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 552)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 553)
@@ -834,9 +834,18 @@
 				&& this.getLexicalTable().getNColumns() > 3
 				;
 	}
-
+	
 	@Override
 	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("CA.saveParameters(): not yet implemented.");
 		return true;
 	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("CA.setParameters(): not yet implemented.");
+		return true;
+	}
 }
Index: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java	(revision 552)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java	(revision 553)
@@ -6,6 +6,7 @@
 import java.io.File;
 
 import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
 
 /**
@@ -73,7 +74,23 @@
 	public boolean canCompute() throws Exception {
 		return this.parent != null;
 	}
+	
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Eigenvalues.saveParameters(): not yet implemented.");
+		return true;
+	}
 
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Eigenvalues.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+
 	/* (non-Javadoc)
 	 * @see org.txm.core.results.TXMResult#_compute(boolean)
 	 */
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 552)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 553)
@@ -246,7 +246,7 @@
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): direct visible children count = " + ((TXMResult)selectedItem).getChildren(true).size());
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): children count = " + ((TXMResult)selectedItem).getDeepChildren().size());
 				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): root parent = " + ((TXMResult)selectedItem).getRootParent());
-				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): corpus parent = " + ((TXMResult)selectedItem).getParentMainCorpus());
+				System.err.println("CorporaView.createPartControl(...).new SelectionListener() {...}.widgetSelected(): corpus parent = " + Corpus.getParentMainCorpus(((TXMResult)selectedItem)));
 			}
 
 			@Override
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java	(revision 552)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorPart.java	(revision 553)
@@ -535,18 +535,7 @@
 		close(false);
 	}
 	
-	/**
-	 * 
-	 * @param parent
-	 * @return
-	 */
-	// FIXME: what is the usage of this method?
-	public boolean isResultUsingParent(TXMResult parent) {
-		if (this.getResultData() == null) return false;
-		else return this.getResultData().isUsingParent(parent);
-	}
 	
-	
 	/**
 	 * Creates and populates a popup menu with the specified id and attaches it to the specified composite.
 	 * The menu will be accessible through the RCP extension in plugin.xml by its id, eg. "popup:" + menuId. 
Index: tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 552)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 553)
@@ -207,17 +207,17 @@
 	 * @return true this object is connected to the parent
 	 */
 	// FIXME: what is the usage of this method?
-	public boolean isUsingParent(TXMResult parent) {
-		if (this == parent) {
-			return true;
-		}
-		else if (this.parent == null) {
-			return false;
-		}
-		else {
-			return this.parent.isUsingParent(parent);
-		}
-	}
+//	public boolean isUsingParent(TXMResult parent) {
+//		if (this == parent) {
+//			return true;
+//		}
+//		else if (this.parent == null) {
+//			return false;
+//		}
+//		else {
+//			return this.parent.isUsingParent(parent);
+//		}
+//	}
 
 	/**
 	 * Gets the preferences node qualifier of the result command.
@@ -576,17 +576,18 @@
 		return root;
 	}
 
+
 	/**
-	 * Gets the first parent of the specified class simple name, eg. this.getFirstParent("Corpus");
+	 * Gets the first parent of the specified class, eg. this.getFirstParent(Partition.class);
 	 * Returns the object itself if it is of the specified class.
-	 * @param classSimpleName
+	 * @param type
 	 * @return
 	 */
-	synchronized public TXMResult getFirstParent(String classSimpleName) {
+	synchronized public TXMResult getFirstParent(Class type) {
 		TXMResult node = null;
 		TXMResult parent = this;
 		do {
-			if(parent.getClass().getSimpleName().equals(classSimpleName)) {
+			if(parent.getClass().equals(type)) {
 				node = parent;	
 			}
 
@@ -594,37 +595,10 @@
 		} while (parent != null && node == null);
 
 		return node;
-	}
 
-	/**
-	 * Gets the main corpus parent.
-	 * @return the first parent of class "MainCorpus" or the object itself if it is its class name.
-	 */
-	synchronized public TXMResult getParentMainCorpus() {
-		return this.getFirstParent("MainCorpus"); //$NON-NLS-1$
 	}
 
 	/**
-	 * Returns the first parent object that is a SubCorpus, a Corpus or a MainCorpus.
-	 * Returns the object itself if its class is one of the the three listed below.
-	 * @return
-	 */
-	synchronized public TXMResult getFirstParentCorpus() {
-
-		// FIXME: need to validate/prove this method
-		System.err.println("TXMResult.getFirstCorpusParent(): need to validate/prove this method.");
-
-		TXMResult corpus = this.getFirstParent("Subcorpus"); //$NON-NLS-1$
-		if(corpus == null)	{
-			corpus = this.getFirstParent("Corpus"); //$NON-NLS-1$
-		}
-		if(corpus == null)	{
-			corpus = this.getParentMainCorpus();
-		}
-		return corpus;
-	}
-
-	/**
 	 * Gets the sibling nodes of this node result.
 	 */
 	synchronized public ArrayList<TXMResult> getSiblings() {
@@ -930,10 +904,10 @@
 		updateLastComputeParameters(); // store last used parameters
 
 		if (!saveParameters()) {
-			System.out.println("Warning: "+this.getName()+" parameters are not saved.");
+			System.out.println("Warning: " + this.getName() + " parameters are not saved.");
 		}
 
-		this.dirty = false; // the _compute was successful the result is no more dirty
+		this.dirty = false; // the computing was successful, the result is no more dirty
 		this.hasBeenComputedOnce = true; 
 		// FIXME: Debug
 		System.err.println("TXMResult.compute(): computing done.");
Index: tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java	(revision 552)
+++ tmp/org.txm.core/src/java/org/txm/objects/TxmObject.java	(revision 553)
@@ -261,7 +261,8 @@
 	@Override
 	public boolean canCompute() {
 		// TODO Auto-generated method stub
-		return false;
+		System.err.println("TxmObject.canCompute(): not yet implemented.");
+		return true;
 	}
 
 	@Override
@@ -278,16 +279,18 @@
 	
 	@Override
 	public boolean saveParameters() {
-		// not implemented in TxmObjects
-		return false;
+		// TODO Auto-generated method stub
+		System.err.println("TxmObject.saveParameters(): not yet implemented.");
+		return true;
 	}
 
 	@Override
 	public boolean setParameters(TXMParameters parameters) {
-		// // not implemented in TxmObjects
-		return false;
+		// TODO Auto-generated method stub
+		System.err.println("TxmObject.setParameters(): not yet implemented.");
+		return true;
 	}
-
+	
 	@Override
 	public boolean loadParameters() {
 		// // not implemented in TxmObjects
Index: tmp/org.txm.core/src/java/org/txm/objects/Corpus.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Corpus.java	(revision 552)
+++ tmp/org.txm.core/src/java/org/txm/objects/Corpus.java	(revision 553)
@@ -1087,4 +1087,8 @@
 	public void setDefaultViewProperty(String defaultViewProperty) {
 		this.defaultViewProperty = defaultViewProperty;
 	}
+	
+
+
+	
 }
Index: tmp/org.txm.internalview.core/src/org/txm/functions/internal/InternalView.java
===================================================================
--- tmp/org.txm.internalview.core/src/org/txm/functions/internal/InternalView.java	(revision 552)
+++ tmp/org.txm.internalview.core/src/org/txm/functions/internal/InternalView.java	(revision 553)
@@ -89,7 +89,16 @@
 				pStructProperties.size() > 0;
 	}
 
+	
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("InternalView.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	@Override
 	public void clean() {
 		// TODO Auto-generated method stub
 	}
Index: tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java
===================================================================
--- tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java	(revision 552)
+++ tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java	(revision 553)
@@ -56,17 +56,18 @@
 
 
 
-//	public boolean setParameters(TXMParameters parameters) {
-//		try {
-//			this.setParameters((boolean)parameters.get(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE));
-//			return true;
-//		}
-//		catch(Exception e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-//		return false;
-//	}
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		try {
+			this.setParameters((boolean)parameters.get(PartitionDimensionsPreferences.CHART_DIMENSIONS_SORTED_BY_SIZE));
+			return true;
+		}
+		catch(Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return false;
+	}
 
 
 	/**
@@ -179,4 +180,13 @@
 
 
 
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("PartitionDimensions.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+
+
 }
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 552)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 553)
@@ -344,7 +344,17 @@
 		return true;
 	}
 
+	
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Cooccurrence.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	
+	@Override
 	public void clean() {
 		try {
 			if (writer != null) {
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 552)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 553)
@@ -156,6 +156,21 @@
 
 
 	
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Progression.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Progression.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
 	/**
 	 * 
 	 * @param structuralUnit
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 552)
+++ tmp/org.txm.links.rcp/src/org/txm/rcp/commands/link/IndexToLexicalTable.java	(revision 553)
@@ -46,7 +46,7 @@
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
 import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditorInput;
+import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
 import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.RCPMessages;
 import org.txm.rcp.StatusLine;
@@ -129,7 +129,7 @@
 			IWorkbenchWindow window = PlatformUI.getWorkbench()
 					.getActiveWorkbenchWindow();
 			IWorkbenchPage page = window.getActivePage();
-			LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
+			___LexicalTableEditorInput editorInput = new ___LexicalTableEditorInput(table);
 			StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
 			page.openEditor(editorInput, "org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
 		} catch (PartInitException e) {
Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 552)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 553)
@@ -336,7 +336,22 @@
 	}
 
 
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("TextsBalance.saveParameters(): not yet implemented.");
+		return true;
+	}
 
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("TextsBalance.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+
 	/**
 	 * @return the groupByTexts
 	 */
Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 552)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 553)
@@ -203,7 +203,26 @@
 		return source != null;
 	}
 
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("WordCloud.saveParameters(): not yet implemented.");
+		return true;
+	}
 
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("WordCloud.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	/**
+	 * 
+	 * @param lang
+	 * @return
+	 */
 	private String getQueryForLang(String lang) {
 		if ("fr".equals(lang)) {
 			return "[frpos=\"NOM|NAM|ADJ|VER.*\"  & frlemma!=\"être|avoir|faire|pouvoir|devoir|vouloir|falloir|aller|dire|savoir\"]"; // requete de Serge pour le français TT
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 552)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 553)
@@ -114,16 +114,16 @@
 	protected PropertiesSelector propsArea;
 	// seuils
 	/** The Fmin spinner. */
-	protected Spinner FminSpinner;
+	protected Spinner fMinSpinner;
 
 	/** The Fmax spinner. */
-	protected Spinner FmaxSpinner;
+	protected Spinner fMaxSpinner;
 
 	/** The Tmax spinner. */
-	protected Spinner VmaxSpinner;
+	protected Spinner vMaxSpinner;
 
 	/** The N ligne p page spinner. */
-	protected Spinner NLignePPageSpinner;
+	protected Spinner nLinesPerPageSpinner;
 	// infos
 	/** The navigation area. */
 	protected NavigationWidget navigationArea;
@@ -155,36 +155,10 @@
 	/** The separator column. */
 	protected TableColumn separatorColumn;
 
-//	/** The top line. */
-//	protected int topLine;
-//
-//	/** The bottom line. */
-//	protected int bottomLine;
-//
-//	/** The nblinesperpage. */
-//	protected int nblinesperpage;
-//
-//	/** The nblinesmax. */
-//	protected int nblinesmax;
-//
-//	/** The prop separator. */
-//	protected String propSeparator = "_"; //$NON-NLS-1$
 
-	//	/** The scroll composite. */
-	//	private ScrolledComposite scrollComposite;
-	//
-	//	/** The head composite. */
-	//	private Composite headComposite;
-
 	/** The title. */
 	String title;
 
-	/**
-	 * Instantiates a new index editor.
-	 */
-	public IndexEditor() {
-		super();
-	}
 
 	/**
 	 * Inits the editor result.
@@ -200,46 +174,35 @@
 		super.init(site, input);
 
 		TXMResult result = ((TXMResultEditorInput) input).getResult();
-		if (result != null && result instanceof Index)
+		if (result != null && result instanceof Index) {
 			this.index = (Index) result;
-		else 
-			throw new PartInitException("TXMResult input is not an Index: "+result);
+		}
+		else { 
+			throw new PartInitException("TXMResult input is not an Index: " + result);
+		}
 	}
 
-	/**
-	 * Checks if is save as allowed.
-	 *
-	 * @return true, if is save as allowed
-	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
-	 */
-	@Override
-	public boolean isSaveAsAllowed() {
-		return false;
-	}
 
 	@Override
-	public boolean isSaveOnCloseNeeded() {
-		return false;
-	}
-
-	public void setResultParameters() {
+	public void updateResultFromEditor() {
 		final Query query = new Query("");
 		if (!queryWidget.isDisposed() && !queryWidget.getQueryString().equals("\"\"")) { //$NON-NLS-1$
 			query.setQueryString(queryWidget.getQueryString());
 		}
 
-		final Integer Fmin = Integer.parseInt(FminSpinner.getText());
-		final Integer Fmax = Integer.parseInt(FmaxSpinner.getText());
-		final Integer Tmax = Integer.parseInt(this.VmaxSpinner.getText());
-		final Integer nLines = Integer.parseInt(this.NLignePPageSpinner.getText());
+		final Integer fMin = Integer.parseInt(fMinSpinner.getText());
+		final Integer fMax = Integer.parseInt(fMaxSpinner.getText());
+		final Integer tMax = Integer.parseInt(this.vMaxSpinner.getText());
+		final Integer nLines = Integer.parseInt(this.nLinesPerPageSpinner.getText());
 		final List<Property> properties = propsArea.getProperties();
 		
-		index.setNLinesPerPage(NLignePPageSpinner.getSelection());
-		index.setVMax(VmaxSpinner.getSelection());
+		index.setNLinesPerPage(nLinesPerPageSpinner.getSelection());
+		index.setVMax(vMaxSpinner.getSelection());
 		
-		index.setParameters(query, properties, Fmin, Fmax, Tmax, nLines);
+		index.setParameters(query, properties, fMin, fMax, tMax, nLines);
 		index.setDirty();
 	}
+
 	
 	/**
 	 * Computes index.
@@ -248,59 +211,59 @@
 	public void refresh(final boolean update) {
 		
 		//System.out.println("PROPERTIES: "+properties);
-		title = "Index...";
-		try {
-			JobHandler jobhandler = new JobHandler(title) {
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					this.runInit(monitor);
-					try {
-						JobsTimer.start();
+//		title = "Index...";
+//		try {
+//			JobHandler jobhandler = new JobHandler(title) {
+//				@Override
+//				protected IStatus run(IProgressMonitor monitor) {
+//					this.runInit(monitor);
+//					try {
+//						JobsTimer.start();
+//
+//						monitor.worked(95);
+//						// refresh ui
+//						syncExec(new Runnable() {
+//							@Override
+//							public void run() {
 
-						if (monitor.isCanceled())
-							return Status.CANCEL_STATUS;
-
-						monitor.worked(95);
-						// refresh ui
-						syncExec(new Runnable() {
-							@Override
-							public void run() {
-
 								QueriesView.refresh();
 								RVariablesView.refresh();
 
-								if (!queryWidget.isDisposed()) queryWidget.memorize();
+								if (!queryWidget.isDisposed()) {
+									queryWidget.memorize();
+								}
 								
 								fillDisplayArea();
 
 								viewer.getTable().setFocus();
-							}
-						});
-
-					} catch (ThreadDeath td) {
-						return Status.CANCEL_STATUS;
-					} catch (Exception e) {
-						e.printStackTrace();
-						System.out.println(e.getLocalizedMessage());
-						try {
-							System.out.println(RCPMessages.LastCQPError+CQPEngine.getCqiClient().getLastCQPError());
-						} catch (Exception e1) {
-							System.out.println(IndexUIMessages.IndexEditor_10+e1);
-							org.txm.rcp.utils.Logger.printStackTrace(e1);
-						}
-						Log.severe("Error while computing Index: "+e.getLocalizedMessage());
-					} finally {
-						monitor.done();
-						JobsTimer.stopAndPrint();
-					}
-					return Status.OK_STATUS;
-				}
-			};
-			jobhandler.startJob();
-
-		} catch (Exception e1) {
-			org.txm.rcp.utils.Logger.printStackTrace(e1);
-		}
+								super.refresh(update);
+//							}
+//						});
+//
+//					} catch (ThreadDeath td) {
+//						return Status.CANCEL_STATUS;
+//					} catch (Exception e) {
+//						e.printStackTrace();
+//						System.out.println(e.getLocalizedMessage());
+//						try {
+//							System.out.println(RCPMessages.LastCQPError+CQPEngine.getCqiClient().getLastCQPError());
+//						} catch (Exception e1) {
+//							System.out.println(IndexUIMessages.IndexEditor_10+e1);
+//							org.txm.rcp.utils.Logger.printStackTrace(e1);
+//						}
+//						Log.severe("Error while computing Index: "+e.getLocalizedMessage());
+//					} finally {
+//						monitor.done();
+//						JobsTimer.stopAndPrint();
+//					}
+//					return Status.OK_STATUS;
+//				}
+//			};
+//			jobhandler.startJob();
+//
+//		} catch (Exception e1) {
+//			org.txm.rcp.utils.Logger.printStackTrace(e1);
+//		}
 	}
 
 	/**
@@ -351,7 +314,7 @@
 			@Override
 			public void keyPressed(KeyEvent e) {
 				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
-					setResultParameters();
+					updateResultFromEditor();
 					compute(true);
 				}
 			}
@@ -369,7 +332,7 @@
 			@Override
 			public void handleEvent(Event event) {
 				if (!initializing && TXMPreferences.getBoolean(RCPPreferences.AUTO_UPDATE_EDITOR, RCPPreferences.PREFERENCES_NODE)) {
-					setResultParameters();
+					updateResultFromEditor();
 					compute(false);
 				}
 			}
@@ -393,7 +356,7 @@
 		SelectionListener listener2 = new SelectionListener() {
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				setResultParameters();
+				updateResultFromEditor();
 				compute(true);
 			}
 			@Override
@@ -426,56 +389,56 @@
 		GridData fieldsGridData = new GridData(GridData.VERTICAL_ALIGN_END);
 		fieldsGridData.minimumWidth = 100;
 
-		FminSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		FminSpinner.setMinimum(0);
-		FminSpinner.setMaximum(9999999);
-		FminSpinner.setIncrement(1);
-		FminSpinner.setPageIncrement(100);
-		FminSpinner.setLayoutData(fieldsGridData);
-		FminSpinner.addKeyListener(listener);
+		fMinSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		fMinSpinner.setMinimum(0);
+		fMinSpinner.setMaximum(9999999);
+		fMinSpinner.setIncrement(1);
+		fMinSpinner.setPageIncrement(100);
+		fMinSpinner.setLayoutData(fieldsGridData);
+		fMinSpinner.addKeyListener(listener);
 
 		Label lFmax = new Label(filtercontrols, SWT.NONE);
 		lFmax.setText(TXMCoreMessages.FMAX_1);
 		lFmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 
-		FmaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		FmaxSpinner.setMinimum(0);
-		FmaxSpinner.setMaximum(9999999);
-		FmaxSpinner.setIncrement(1);
-		FmaxSpinner.setPageIncrement(100);
-		FmaxSpinner.setLayoutData(fieldsGridData);
-		FmaxSpinner.addKeyListener(listener);
+		fMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		fMaxSpinner.setMinimum(0);
+		fMaxSpinner.setMaximum(9999999);
+		fMaxSpinner.setIncrement(1);
+		fMaxSpinner.setPageIncrement(100);
+		fMaxSpinner.setLayoutData(fieldsGridData);
+		fMaxSpinner.addKeyListener(listener);
 
 		Label lVmax = new Label(filtercontrols, SWT.NONE);
 		lVmax.setText(TXMCoreMessages.VMAX_1);
 		lVmax.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 
-		VmaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		VmaxSpinner.setMinimum(0);
-		VmaxSpinner.setMaximum(9999999);
-		VmaxSpinner.setIncrement(1);
-		VmaxSpinner.setPageIncrement(100);
-		VmaxSpinner.setLayoutData(fieldsGridData);
-		VmaxSpinner.addKeyListener(listener);
+		vMaxSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		vMaxSpinner.setMinimum(0);
+		vMaxSpinner.setMaximum(9999999);
+		vMaxSpinner.setIncrement(1);
+		vMaxSpinner.setPageIncrement(100);
+		vMaxSpinner.setLayoutData(fieldsGridData);
+		vMaxSpinner.addKeyListener(listener);
 
 		Label lNLigneppage = new Label(filtercontrols, SWT.NONE);
 		lNLigneppage.setText(IndexUIMessages.IndexEditor_8);
 		lNLigneppage.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
 
-		NLignePPageSpinner = new Spinner(filtercontrols, SWT.BORDER);
-		NLignePPageSpinner.setMinimum(0);
-		NLignePPageSpinner.setMaximum(99999);
-		NLignePPageSpinner.setIncrement(1);
-		NLignePPageSpinner.setPageIncrement(100);
-		NLignePPageSpinner.setLayoutData(fieldsGridData);
-		NLignePPageSpinner.addSelectionListener(new SelectionListener() {
+		nLinesPerPageSpinner = new Spinner(filtercontrols, SWT.BORDER);
+		nLinesPerPageSpinner.setMinimum(0);
+		nLinesPerPageSpinner.setMaximum(99999);
+		nLinesPerPageSpinner.setIncrement(1);
+		nLinesPerPageSpinner.setPageIncrement(100);
+		nLinesPerPageSpinner.setLayoutData(fieldsGridData);
+		nLinesPerPageSpinner.addSelectionListener(new SelectionListener() {
 			@Override
 			public void widgetSelected(SelectionEvent e) { }
 
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {
 				index.setTopLine(0);
-				index.setNLinesPerPage(NLignePPageSpinner.getSelection());
+				index.setNLinesPerPage(nLinesPerPageSpinner.getSelection());
 				fillDisplayArea();
 				viewer.getTable().select(0);
 				viewer.getTable().showSelection();
@@ -497,7 +460,7 @@
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				index.setTopLine(0);
-				index.setNLinesPerPage(NLignePPageSpinner.getSelection());
+				index.setNLinesPerPage(nLinesPerPageSpinner.getSelection());
 				fillDisplayArea();
 				viewer.getTable().select(0);
 				viewer.getTable().showSelection();
@@ -510,8 +473,8 @@
 
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				int i = (index.getV()/NLignePPageSpinner.getSelection());
-				int top = i*NLignePPageSpinner.getSelection();
+				int i = (index.getV()/nLinesPerPageSpinner.getSelection());
+				int top = i*nLinesPerPageSpinner.getSelection();
 				
 				index.setTopLine(top);
 				fillDisplayArea();
@@ -715,8 +678,6 @@
 		createContextMenu(viewer);
 		viewer.getTable().pack();
 		parent.layout(true);
-
-		//compute(true);
 	}
 
 	/**
@@ -790,32 +751,34 @@
 
 		// min, max
 		if (index.getFilterFmin() != null) {
-			this.FminSpinner.setSelection(index.getFilterFmin());
+			this.fMinSpinner.setSelection(index.getFilterFmin());
 		} else {
-			this.FminSpinner.setSelection(this.getIntParameterValue(IndexPreferences.FMIN_FILTER));
+			this.fMinSpinner.setSelection(this.getIntParameterValue(IndexPreferences.FMIN_FILTER));
 		}
 
 		if (index.getFilterFmax() != null) {
-			this.FmaxSpinner.setSelection(index.getFilterFmax());
+			this.fMaxSpinner.setSelection(index.getFilterFmax());
 		} else {
-			this.FmaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.FMAX_FILTER));
+			this.fMaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.FMAX_FILTER));
 		}
 
 		if (index.getFilterVmax() != null) {
-			this.VmaxSpinner.setSelection(index.getFilterVmax());
+			this.vMaxSpinner.setSelection(index.getFilterVmax());
 		} else {
-			this.VmaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.VMAX_FILTER));
+			this.vMaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.VMAX_FILTER));
 		}
 
 		if (index.getNLinesPerPage() != null) {
-			this.NLignePPageSpinner.setSelection(index.getNLinesPerPage());
+			this.nLinesPerPageSpinner.setSelection(index.getNLinesPerPage());
 		} else {
-			this.NLignePPageSpinner.setSelection(this.getIntParameterValue(IndexPreferences.NLINESPERPAGE));
+			this.nLinesPerPageSpinner.setSelection(this.getIntParameterValue(IndexPreferences.NLINESPERPAGE));
 		}
 
 		queryWidget.setFocus();
 
-		if (queryWidget != null && !queryWidget.isDisposed()) queryWidget.setFocus();
+		if (queryWidget != null && !queryWidget.isDisposed()) {
+			queryWidget.setFocus();
+		}
 
 		initializing = false;
 	}
@@ -871,6 +834,7 @@
 			col.pack();
 		}
 		viewer.getControl().setRedraw(true);
+		
 	}
 
 	/**
@@ -880,8 +844,9 @@
 	 */
 	@Override
 	public void setFocus() {
-		if (!this.queryWidget.isDisposed())
+		if (!this.queryWidget.isDisposed()) {
 			this.queryWidget.setFocus();
+		}
 		StatusLine.setMessage(IndexUIMessages.IndexEditor_29);
 	}
 
@@ -907,24 +872,5 @@
 		return queryWidget.getQuery();
 	}
 
-	/**
-	 * Do save.
-	 *
-	 * @param arg0 the arg0
-	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	@Override
-	public void doSave(IProgressMonitor arg0) {
-		// TODO Auto-generated method stub
-	}
 
-	/**
-	 * Do save as.
-	 *
-	 * @see org.eclipse.lyon gournd zeroui.part.EditorPart#doSaveAs()
-	 */
-	@Override
-	public void doSaveAs() {
-		// TODO Auto-generated method stub
-	}
 }
Index: tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java
===================================================================
--- tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 552)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 553)
@@ -90,7 +90,7 @@
 			}
 	
 			if (!saveParameters()) {
-				return false;
+				System.out.println("ChartResult.compute(): saving parameters failed.");
 			}
 	
 			this.dirty = false; // the _compute was successful the result is no more dirty
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java	(revision 553)
@@ -66,8 +66,7 @@
 		this.name = shortName;
 		this.partition = partition;
 
-		// FIXME: to validate
-//		this.partition.addChild(this);
+		this.partition.addChild(this);
 	}
 
 	/**
@@ -88,13 +87,13 @@
 	 *             the cqi client exception
 	 */
 	public int getNTexts() throws CqiClientException {
-		if (nTexts < 0)
+		if (nTexts < 0) {
 			try {
-				nTexts = CorpusManager.getCorpusManager().getCqiClient()
-						.subCorpusSize(getQualifiedCqpId());
+				nTexts = CorpusManager.getCorpusManager().getCqiClient().subCorpusSize(getQualifiedCqpId());
 			} catch (Exception e) {
 				throw new CqiClientException(e);
 			}
+		}
 		return nTexts;
 	}
 
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java	(revision 553)
@@ -44,6 +44,7 @@
 
 import org.eclipse.osgi.util.NLS;
 import org.txm.core.messages.TXMCoreMessages;
+import org.txm.core.results.TXMParameters;
 import org.txm.objects.TxmObject;
 import org.txm.searchengine.cqp.CQPEngine;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -721,7 +722,23 @@
 		return getCorpus() != null;
 	}
 
+	
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Partition.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Partition.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	@Override
 	protected boolean _compute(boolean update) throws Exception {
 		// TODO Auto-generated method stub
 		return false;
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java	(revision 553)
@@ -1368,4 +1368,34 @@
 			textIdStructuralUnitProperty = getTextStructuralUnit().getProperty(ID);
 		return textIdStructuralUnitProperty;
 	}
+	
+	/**
+	 * Gets the main corpus parent.
+	 * @return the first parent of class MainCorpus or the object itself if it is its class.
+	 */
+	synchronized public static TXMResult getParentMainCorpus(TXMResult result) {
+		return result.getFirstParent(MainCorpus.class);
+	}
+	
+
+	/**
+	 * Returns the first parent object that is a Subcorpus, a Corpus or a MainCorpus.
+	 * Returns the object itself if its class is one of the the three listed below.
+	 * @return
+	 */
+	synchronized public static TXMResult getFirstParentCorpus(TXMResult result) {
+		
+		// FIXME: need to validate/prove this method
+		System.err.println("Corpus.getFirstCorpusParent(): need to validate/prove this method.");
+		
+		TXMResult corpus = result.getFirstParent(Subcorpus.class);
+		if(corpus == null)	{
+			corpus = result.getFirstParent(Corpus.class);
+		}
+		if(corpus == null)	{
+			corpus = getParentMainCorpus(result);
+		}
+		return corpus;
+	}
+	
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 553)
@@ -41,6 +41,7 @@
 import org.txm.Toolbox;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.___CorpusScope;
+import org.txm.core.results.TXMParameters;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.objects.Base;
 import org.txm.objects.BaseParameters;
@@ -56,7 +57,6 @@
 import org.txm.searchengine.cqp.serverException.CqiServerError;
 import org.txm.utils.DeleteDir;
 
-// TODO: Auto-generated Javadoc
 /**
  * The Class MainCorpus for mirroring CQP corpora.
  *
@@ -595,19 +595,37 @@
 	}
 
 	@Override
+	protected boolean _compute(boolean update) throws Exception {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
+		// TODO Auto-generated method stub
+		return false;
+	}
+	
+	@Override
 	public boolean canCompute() {
+		// TODO Auto-generated method stub
+		System.err.println("MainCorpus.canCompute(): not yet implemented.");
 		return true;
 	}
 
 	@Override
-	protected boolean _compute(boolean update) throws Exception {
+	public boolean saveParameters() {
 		// TODO Auto-generated method stub
-		return false;
+		System.err.println("MainCorpus.saveParameters(): not yet implemented.");
+		return true;
 	}
 
 	@Override
-	public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
+	public boolean setParameters(TXMParameters parameters) {
 		// TODO Auto-generated method stub
-		return false;
+		System.err.println("MainCorpus.setParameters(): not yet implemented.");
+		return true;
 	}
+
+	
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 553)
@@ -33,6 +33,7 @@
 
 import org.eclipse.osgi.util.NLS;
 import org.txm.core.messages.TXMCoreMessages;
+import org.txm.core.results.TXMParameters;
 import org.txm.functions.selection.SelectionResult;
 import org.txm.objects.Base;
 import org.txm.objects.TxmObject;
@@ -81,12 +82,6 @@
 		this(cqpId, name, parent, query, true);
 	}
 	
-	public Corpus getMotherCorpus() {
-		if (motherSubcorpus != null) return motherSubcorpus;
-		
-		return motherMainCorpus;
-	}
-	
 	/**
 	 * Instantiates a new subcorpus.
 	 * 
@@ -129,6 +124,14 @@
 		return motherSubcorpus;
 	}
 
+	public Corpus getMotherCorpus() {
+		if (motherSubcorpus != null) return motherSubcorpus;
+		
+		return motherMainCorpus;
+	}
+	
+
+	
 	/**
 	 * Returns the number of occurrences in the subcorpus.
 	 * 
@@ -532,6 +535,21 @@
 	@Override
 	public boolean canCompute() {
 		// TODO Auto-generated method stub
-		return false;
+		System.err.println("Subcorpus.canCompute(): not yet implemented.");
+		return true;
 	}
+
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Subcorpus.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Subcorpus.setParameters(): not yet implemented.");
+		return true;
+	}
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/summary/Summary.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/summary/Summary.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/summary/Summary.java	(revision 553)
@@ -265,8 +265,23 @@
 	}
 
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Summary.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Summary.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	@Override
 	protected boolean _compute(boolean update) throws Exception {
-		System.out.println("Summary.compute() not implemented");
+		System.err.println("Summary.compute() not implemented");
 		return false;
 	}
 
@@ -276,10 +291,4 @@
 		return false;
 	}
 
-
-	@Override
-	public boolean saveParameters() {
-		// TODO Auto-generated method stub
-		return false;
-	}
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/preview/Preview.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/preview/Preview.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/preview/Preview.java	(revision 553)
@@ -92,6 +92,21 @@
 	}
 
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Preview.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Preview.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	@Override
 	protected boolean _compute(boolean update) throws Exception {
 		if (partition != null) {
 			return computePartition();
@@ -105,11 +120,4 @@
 		// TODO Auto-generated method stub
 		return false;
 	}
-
-
-	@Override
-	public boolean saveParameters() {
-		// TODO Auto-generated method stub
-		return false;
-	}
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 553)
@@ -654,4 +654,22 @@
 	public boolean canCompute() {
 		return corpus != null;
 	}
+	
+
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Diagnostic.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Diagnostic.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/selection/Selection.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/selection/Selection.java	(revision 552)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/selection/Selection.java	(revision 553)
@@ -494,8 +494,24 @@
 	}
 
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Selection.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Selection.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	
+	@Override
 	protected boolean _compute(boolean update) throws Exception {
-		System.out.println("Selection.compute() not implemented");
+		System.err.println("Selection.compute() not implemented");
 		return false;
 	}
 
Index: tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java
===================================================================
--- tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java	(revision 552)
+++ tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java	(revision 553)
@@ -533,11 +533,19 @@
 		return getCorpus() != null;
 	}
 
+	
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Reference.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	
 	/**
 	 * The Class Line.
 	 */
-	public class Line
-	{
+	public class Line {
 
 		/** The id. */
 		int id;
Index: tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Chi2.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Chi2.java	(revision 552)
+++ tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Chi2.java	(revision 553)
@@ -57,4 +57,18 @@
 		return itable != null;
 	}
 
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Chi2.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Chi2.setParameters(): not yet implemented.");
+		return true;
+	}
+
 }
Index: tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Specificites2.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Specificites2.java	(revision 552)
+++ tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Specificites2.java	(revision 553)
@@ -53,5 +53,20 @@
 	public boolean canCompute() {
 		return itable != null;
 	}
+	
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Specificites2.saveParameters(): not yet implemented.");
+		return true;
+	}
 
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Specificites2.setParameters(): not yet implemented.");
+		return true;
+	}
+
+
 }
Index: tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/RelativeFrequency.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/RelativeFrequency.java	(revision 552)
+++ tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/RelativeFrequency.java	(revision 553)
@@ -1,16 +1,9 @@
 package org.txm.functions.contrasts;
 
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.TXMParameters;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Partition;
-import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.searchengine.cqp.corpus.Subcorpus;
-import org.txm.statsengine.core.StatException;
 import org.txm.statsengine.r.core.RWorkspace;
 
 public class RelativeFrequency extends Contrast {
@@ -63,4 +56,19 @@
 		return itable != null;
 	}
 
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("RelativeFrequency.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("RelativeFrequency.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
 }
Index: tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/AbsoluteFrequency.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/AbsoluteFrequency.java	(revision 552)
+++ tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/AbsoluteFrequency.java	(revision 553)
@@ -16,10 +16,6 @@
 		super(table);
 	}
 	
-	public boolean setParameters(TXMParameters parameters) {
-		return false;
-	}
-
 	@Override
 	protected boolean _compute(boolean update) throws StatException {
 		itable = table.getData();
@@ -58,4 +54,18 @@
 		return itable != null;
 	}
 
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("AbsoluteFrequency.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("AbsoluteFrequency.setParameters(): not yet implemented.");
+		return true;
+	}
+
 }
Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java	(revision 552)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java	(revision 553)
@@ -37,6 +37,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicon.core.corpusengine.cqp.Lexicon;
@@ -614,5 +615,24 @@
 	public void setMaxScore(int maxScore) {
 		this.pMaxScore = maxScore;
 	}
+	
+	
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("Specificities.saveParameters(): not yet implemented.");
+		return true;
+	}
 
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("Specificities.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+
+	
+
 }
Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java	(revision 552)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java	(revision 553)
@@ -6,6 +6,7 @@
 import java.io.File;
 
 import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.core.results.TXMParameters;
 
 /**
  * A selection from a Specificities result dedicated to export or chart creation.
@@ -138,10 +139,28 @@
 	 */
 	@Override
 	protected boolean _compute(boolean update) throws Exception {
+		// does nothing
+		return true;
+	}
+
+	
+	@Override
+	public boolean saveParameters() {
 		// TODO Auto-generated method stub
+		System.err.println("SpecificitiesSelection.saveParameters(): not yet implemented.");
 		return true;
 	}
 
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("SpecificitiesSelection.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+
+	
 	/* (non-Javadoc)
 	 * @see org.txm.core.results.TXMResult#toTxt(java.io.File, java.lang.String, java.lang.String, java.lang.String)
 	 */
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ImportTable.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ImportTable.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ImportTable.java	(revision 553)
@@ -37,7 +37,7 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditor2;
+import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
 import org.txm.rcp.swt.dialog.LastOpened;
 
 // TODO: Auto-generated Javadoc
@@ -54,8 +54,8 @@
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		IWorkbenchPart editor = HandlerUtil.getActiveWorkbenchWindow(event)
 				.getActivePage().getActivePart();
-		if (editor instanceof LexicalTableEditor2) {
-			LexicalTableEditor2 LTeditor = (LexicalTableEditor2) editor;
+		if (editor instanceof LexicalTableEditor) {
+			LexicalTableEditor LTeditor = (LexicalTableEditor) editor;
 			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
 					.getShell();
 			FileDialog d = new FileDialog(shell, SWT.OPEN);
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ComputeLexicalTable.java	(revision 553)
@@ -41,6 +41,7 @@
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.window.Window;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PartInitException;
@@ -54,20 +55,19 @@
 import org.txm.lexicaltable.core.preferences.LexicalTablePreferences;
 import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
 import org.txm.lexicaltable.rcp.editors.LexicalTableDialog;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditor2;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditorInput;
+import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
+import org.txm.lexicaltable.rcp.editors.___LexicalTableEditorInput;
 import org.txm.rcp.JobsTimer;
 import org.txm.rcp.RCPMessages;
 import org.txm.rcp.StatusLine;
+import org.txm.rcp.editors.TXMEditorPart;
 import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.utils.JobHandler;
 import org.txm.rcp.views.QueriesView;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.statsengine.r.core.data.QuantitativeDataStructureImpl;
 import org.txm.statsengine.r.rcp.views.RVariablesView;
-import org.txm.utils.logger.Log;
 // TODO: Auto-generated Javadoc
 /**
  * if the selection is a Partition : creates a lexical table already filled if
@@ -108,14 +108,13 @@
 			return null;
 		}
 
-		window = HandlerUtil.getActiveWorkbenchWindow(event);
-		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
-
-		Object s = selection.getFirstElement();
-
-		if (s instanceof Index) {
-			List<Index> vocabularies = selection.toList();
-
+		Object selection = this.getSelection(event);
+		LexicalTable lexicalTable = null;
+		
+		// Creating from Index
+		if (selection instanceof Index) {
+			List<Index> vocabularies = ((IStructuredSelection) HandlerUtil.getCurrentSelection(event)).toList();
+			
 			System.out.println(RCPMessages.ComputeLexicalTable_3);
 			ArrayList<String> choices = new ArrayList<String>();
 			choices.add(RCPMessages.ComputeLexicalTable_16);
@@ -131,199 +130,203 @@
 			//System.out.println("ret= "+ret);
 			if (ret == Dialog.OK_OPTION) {
 				//System.out.println("ok");
-				if(dialog.getResult().length == 0)
+				if(dialog.getResult().length == 0) {
 					return null;
+				}
 				String sel = (String) dialog.getResult()[0];
-				if(sel.equals(RCPMessages.ComputeLexicalTable_16))
+				if(sel.equals(RCPMessages.ComputeLexicalTable_16)) {
 					useAllOccurrences = true;
+				}
 			} else {
 				//System.out.println("cancel");
 				return false;
 			}
 
-			computeWithVocabularies(vocabularies, useAllOccurrences);
-			return null;
+			//computeWithVocabularies(vocabularies, useAllOccurrences);
+			//return null;
 			//		} else if (s instanceof QueryIndex) {
 			//			List<QueryIndex> qindexes = selection.toList();
 			//			computeWithQueryIndexes(qindexes);
 			//			return null;
-		} else if (s instanceof Partition) {
-			computeWithPartition((Partition) s);
-			return null;
-		} else if (s instanceof LexicalTable) {
-			computeWithLexicalTableAble((LexicalTable) s);
-			return null;
-		} else
-			return null;
-	}
-
-	/**
-	 * Compute with partition.
-	 *
-	 * @param partition the partition
-	 */
-	private void computeWithLexicalTableAble(final LexicalTable lexicalTableAble) {
-
-		JobHandler jobhandler = new JobHandler(
-				RCPMessages.ComputeLexicalTable_0) {
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				this.runInit(monitor);
-				try {
-					JobsTimer.start();
-					monitor.beginTask(NLS.bind(RCPMessages.ComputeLexicalTable_1, lexicalTableAble.getName(), "none"), 100);
-
-					this.acquireSemaphore();
-					//table = lexicalTableAble.toLexicalTable();
-					table = lexicalTableAble;
-					this.releaseSemaphore();
-
-					monitor.worked(45);
-
-					lexicalTableAble.getParent().addChild(table);
-
-					monitor.worked(5);
-
-					//monitor.subTask(Messages.ComputeSpecifities_10);
-					syncExec(new Runnable() {
-						@Override
-						public void run() {
-							IWorkbenchPage page = window.getActivePage();
-							LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
-							try {
-								StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
-								page.openEditor(editorInput, LexicalTableEditor2.ID);
-							} catch (PartInitException e) {
-								org.txm.rcp.utils.Logger.printStackTrace(e);
-							} 
-						}
-					});
-
-					monitor.worked(50);
-					if (monitor.isCanceled())
-						return Status.CANCEL_STATUS;
-
-					//monitor.subTask(Messages.ComputeSpecifities_2);
-					syncExec(new Runnable() {
-						@Override
-						public void run() {
-							CorporaView.refresh();
-							CorporaView.expand(table.getParent());
-							QueriesView.refresh();
-							RVariablesView.refresh();
-						}
-					});
-
-					monitor.worked(100);
-				} catch (ThreadDeath td) {
-					return Status.CANCEL_STATUS;
-				} catch (Exception e) {
-					org.txm.rcp.utils.Logger.printStackTrace(e);
-				} finally {
-					monitor.done();
-					JobsTimer.stopAndPrint();
-				}
-				return Status.OK_STATUS;
+		}
+		// Creating from Partition
+		else if (selection instanceof Partition) {
+			final Property property;
+			final int Fmin;
+			final int vmax;
+			
+			final Partition partition = (Partition) selection;
+			
+			String title = RCPMessages.bind(RCPMessages.ComputeLexicalTable_0, partition.getName());
+			
+			LexicalTableDialog d = new LexicalTableDialog(Display.getDefault().getActiveShell(), partition.getCorpus(), title);
+			d.setFminAndVMax(TXMPreferences.getInt(LexicalTablePreferences.F_MIN, LexicalTablePreferences.PREFERENCES_NODE), 
+							TXMPreferences.getInt(LexicalTablePreferences.V_MAX, LexicalTablePreferences.PREFERENCES_NODE));
+			
+			if (d.open() == Window.OK) {
+				property = d.getProperty();
+				Fmin = d.getFmin();
+				vmax = d.getMaxLines();
+				
+				lexicalTable = new LexicalTable(partition, property, Fmin);
+				lexicalTable.setVMax(vmax);
+				
+				
+				// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(CorporaView.ID);
+//				JobHandler jobhandler = new JobHandler(RCPMessages.bind(RCPMessages.ComputeLexicalTable_0, partition.getName())) {
+//					@Override
+//					protected IStatus run(IProgressMonitor monitor) {
+//						this.runInit(monitor);
+//						try {
+//							JobsTimer.start();
+//							monitor.beginTask(NLS.bind(RCPMessages.ComputeLexicalTable_1, partition.getName(), property), 100);
+//
+//							this.acquireSemaphore();
+//							table = LexicalTableFactory.getLexicalTable(partition, property, Fmin);
+//							this.releaseSemaphore();
+//							
+//							this.acquireSemaphore();
+//							table.getData().cut(vmax);
+//							this.releaseSemaphore();
+//
+//							monitor.worked(45);
+//							if (monitor.isCanceled() || table == null) {
+//								return Status.CANCEL_STATUS;
+//							}
+//
+//							partition.addChild(table);
+//
+//							monitor.worked(5);
+//
+//							//monitor.subTask(Messages.ComputeSpecifities_10);
+//							syncExec(new Runnable() {
+//								@Override
+//								public void run() {
+//									IWorkbenchPage page = window.getActivePage();
+//									LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
+//									try {
+//										StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
+//										page.openEditor(editorInput, LexicalTableEditor.ID); //$NON-NLS-1$
+//									} catch (PartInitException e) {
+//										org.txm.rcp.utils.Logger.printStackTrace(e);
+//									} 
+//								}
+//							});
+//
+//							monitor.worked(50);
+//							if (monitor.isCanceled())
+//								return Status.CANCEL_STATUS;
+//
+//							//monitor.subTask(Messages.ComputeSpecifities_2);
+//							syncExec(new Runnable() {
+//								@Override
+//								public void run() {
+//									QueriesView.refresh();
+//									RVariablesView.refresh();
+//								}
+//							});
+//
+//							monitor.worked(100);
+//						} catch (ThreadDeath td) {
+//							return Status.CANCEL_STATUS;
+//						} catch (Exception e) {
+//							org.txm.rcp.utils.Logger.printStackTrace(e);
+//						} finally {
+//							monitor.done();
+//							JobsTimer.stopAndPrint();
+//						}
+//						return Status.OK_STATUS;
+//					}
+//				};
+//				jobhandler.startJob();
 			}
-		};
-		jobhandler.startJob();
-
-		return;
-	}
-
-	/**
-	 * Compute with partition.
-	 *
-	 * @param partition the partition
-	 */
-	private void computeWithPartition(final Partition partition) {
-
-		final Property property;
-		final int Fmin;
-		final int vmax;
+		}
+		// Reopening from existing result
+		else if (selection instanceof LexicalTable) {
+			lexicalTable = (LexicalTable) selection;
+		}
 		
-		String title = RCPMessages.bind(RCPMessages.ComputeLexicalTable_0, partition.getName());
-		LexicalTableDialog d = new LexicalTableDialog(window.getShell(), partition.getCorpus(), title);
+		TXMEditorPart.openEditor(lexicalTable, LexicalTableEditor.ID);
 		
-		d.setFminAndVMax(TXMPreferences.getInt(LexicalTablePreferences.F_MIN, LexicalTablePreferences.PREFERENCES_NODE), 
-						TXMPreferences.getInt(LexicalTablePreferences.V_MAX, LexicalTablePreferences.PREFERENCES_NODE));
-		
-		if (d.open() == Window.OK) {
-			property = d.getProperty();
-			Fmin = d.getFmin();
-			vmax = d.getMaxLines();
-			// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(CorporaView.ID);
-			JobHandler jobhandler = new JobHandler(
-					RCPMessages.bind(RCPMessages.ComputeLexicalTable_0, partition.getName())) {
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					this.runInit(monitor);
-					try {
-						JobsTimer.start();
-						monitor.beginTask(NLS.bind(RCPMessages.ComputeLexicalTable_1, partition.getName(), property), 100);
+		return true;
+	}
 
-						this.acquireSemaphore();
-						table = LexicalTableFactory.getLexicalTable(partition, property, Fmin);
-						this.releaseSemaphore();
-						
-						this.acquireSemaphore();
-						table.getData().cut(vmax);
-						this.releaseSemaphore();
+//	/**
+//	 * Compute with partition.
+//	 *
+//	 * @param partition the partition
+//	 */
+//	private void computeWithLexicalTableAble(final LexicalTable lexicalTableAble) {
+//
+//		JobHandler jobhandler = new JobHandler(
+//				RCPMessages.ComputeLexicalTable_0) {
+//			@Override
+//			protected IStatus run(IProgressMonitor monitor) {
+//				this.runInit(monitor);
+//				try {
+//					JobsTimer.start();
+//					monitor.beginTask(NLS.bind(RCPMessages.ComputeLexicalTable_1, lexicalTableAble.getName(), "none"), 100);
+//
+//					this.acquireSemaphore();
+//					//table = lexicalTableAble.toLexicalTable();
+//					table = lexicalTableAble;
+//					this.releaseSemaphore();
+//
+//					monitor.worked(45);
+//
+//					lexicalTableAble.getParent().addChild(table);
+//
+//					monitor.worked(5);
+//
+//					//monitor.subTask(Messages.ComputeSpecifities_10);
+//					syncExec(new Runnable() {
+//						@Override
+//						public void run() {
+//							IWorkbenchPage page = window.getActivePage();
+//							LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
+//							try {
+//								StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
+//								page.openEditor(editorInput, LexicalTableEditor.ID);
+//							} catch (PartInitException e) {
+//								org.txm.rcp.utils.Logger.printStackTrace(e);
+//							} 
+//						}
+//					});
+//
+//					monitor.worked(50);
+//					if (monitor.isCanceled())
+//						return Status.CANCEL_STATUS;
+//
+//					//monitor.subTask(Messages.ComputeSpecifities_2);
+//					syncExec(new Runnable() {
+//						@Override
+//						public void run() {
+//							CorporaView.refresh();
+//							CorporaView.expand(table.getParent());
+//							QueriesView.refresh();
+//							RVariablesView.refresh();
+//						}
+//					});
+//
+//					monitor.worked(100);
+//				} catch (ThreadDeath td) {
+//					return Status.CANCEL_STATUS;
+//				} catch (Exception e) {
+//					org.txm.rcp.utils.Logger.printStackTrace(e);
+//				} finally {
+//					monitor.done();
+//					JobsTimer.stopAndPrint();
+//				}
+//				return Status.OK_STATUS;
+//			}
+//		};
+//		jobhandler.startJob();
+//
+//		return;
+//	}
 
-						monitor.worked(45);
-						if (monitor.isCanceled() || table == null) {
-							return Status.CANCEL_STATUS;
-						}
 
-						partition.addChild(table);
 
-						monitor.worked(5);
-
-						//monitor.subTask(Messages.ComputeSpecifities_10);
-						syncExec(new Runnable() {
-							@Override
-							public void run() {
-								IWorkbenchPage page = window.getActivePage();
-								LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
-								try {
-									StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
-									page.openEditor(editorInput, LexicalTableEditor2.ID); //$NON-NLS-1$
-								} catch (PartInitException e) {
-									org.txm.rcp.utils.Logger.printStackTrace(e);
-								} 
-							}
-						});
-
-						monitor.worked(50);
-						if (monitor.isCanceled())
-							return Status.CANCEL_STATUS;
-
-						//monitor.subTask(Messages.ComputeSpecifities_2);
-						syncExec(new Runnable() {
-							@Override
-							public void run() {
-								QueriesView.refresh();
-								RVariablesView.refresh();
-							}
-						});
-
-						monitor.worked(100);
-					} catch (ThreadDeath td) {
-						return Status.CANCEL_STATUS;
-					} catch (Exception e) {
-						org.txm.rcp.utils.Logger.printStackTrace(e);
-					} finally {
-						monitor.done();
-						JobsTimer.stopAndPrint();
-					}
-					return Status.OK_STATUS;
-				}
-			};
-			jobhandler.startJob();
-		}
-		return;
-	}
-
 	//	/**
 	//	 * Compute with query index.
 	//	 *
@@ -421,107 +424,111 @@
 	//		return true;
 	//	}
 
-	/**
-	 * Compute with vocabularies.
-	 *
-	 * @param fullvocabularies the fullvocabularies
-	 * @return true, if successful
-	 */
-	private boolean computeWithVocabularies(List<Index> fullvocabularies, final boolean useAllOccurrences) {
-		if (fullvocabularies.size() == 0) {
-			return false;
-		}
-
-		final List<Index> vocabularies = fullvocabularies.subList(0, 1);
-		for (Index voc : vocabularies) {
-			if (!voc.isComputedWithPartition()) {
-				System.out.println(RCPMessages.ComputeLexicalTable_5);
-				StatusLine.setMessage(RCPMessages.ComputeLexicalTable_5);
-				return false;
-			}
-		}
-		
-		List<Property> properties = vocabularies.get(0).getProperties();
-		for (Index voc : vocabularies) {
-			if (!properties.equals(voc.getProperties())) {
-				Log.warning(NLS.bind(RCPMessages.ComputeLexicalTable_6, properties));
-				return false;
-			}
-		}
-		
-		final Index firstIndex = vocabularies.get(0);
-		Partition firstPartition = firstIndex.getPartition();
-		for (Index voc : vocabularies) {
-			if (!firstPartition.equals(voc.getPartition())) {
-				Log.warning(NLS.bind(RCPMessages.ComputeLexicalTable_7, firstPartition));
-				return false;
-			}
-		}
-		
-		final Property property = properties.get(0);
-
-		JobHandler jobhandler = new JobHandler(RCPMessages.bind(RCPMessages.ComputeLexicalTable_0, firstIndex.getName())) {
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				this.runInit(monitor);
-				try {
-					monitor.beginTask("Computing Lexical table with Index: "+firstIndex+" property: "+property, 100);
-					this.acquireSemaphore();
-					table = new LexicalTable(firstIndex);
-					table.setParameters(null, null, null, useAllOccurrences);
-					table.compute(true, monitor);
-					monitor.worked(45);
-					this.releaseSemaphore();
-					if (monitor.isCanceled() || table == null)
-						return Status.CANCEL_STATUS;
-
-					firstIndex.addChild(table);
-					monitor.worked(5);
-
-					monitor.subTask(RCPMessages.ComputeLexicalTable_10);
-					syncExec(new Runnable() {
-						@Override
-						public void run() {
-							IWorkbenchPage page = window.getActivePage();
-							LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
-							try {
-								StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
-								page.openEditor(editorInput,
-										"org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
-							} catch (PartInitException e) {
-								org.txm.rcp.utils.Logger.printStackTrace(e);
-							} 
-						}
-					});
-
-					monitor.worked(50);
-					if (monitor.isCanceled())
-						return Status.CANCEL_STATUS;
-
-					monitor.subTask(RCPMessages.ComputeSpecifities_2);
-					syncExec(new Runnable() {
-						@Override
-						public void run() {
-							CorporaView.refresh();
-							CorporaView.expand(table.getParent());
-							QueriesView.refresh();
-							RVariablesView.refresh();
-						}
-					});
-
-					monitor.worked(100);
-				} catch (ThreadDeath td) { 
-					return Status.CANCEL_STATUS;
-				} catch (Exception e) {
-					org.txm.rcp.utils.Logger.printStackTrace(e);
-				} finally {
-					monitor.done();
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		jobhandler.startJob();
-
-		return true;
-	}
+//	/**
+//	 * Compute with vocabularies.
+//	 *
+//	 * @param fullvocabularies the fullvocabularies
+//	 * @return true, if successful
+//	 */
+//	private boolean computeWithVocabularies(List<Index> fullvocabularies, final boolean useAllOccurrences) {
+//		if (fullvocabularies.size() == 0) {
+//			return false;
+//		}
+//
+//		final List<Index> vocabularies = fullvocabularies.subList(0, 1);
+//		for (Index voc : vocabularies) {
+//			if (!voc.isComputedWithPartition()) {
+//				System.out.println(RCPMessages.ComputeLexicalTable_5);
+//				StatusLine.setMessage(RCPMessages.ComputeLexicalTable_5);
+//				return false;
+//			}
+//		}
+//		
+//		List<Property> properties = vocabularies.get(0).getProperties();
+//		for (Index voc : vocabularies) {
+//			if (!properties.equals(voc.getProperties())) {
+//				Log.warning(NLS.bind(RCPMessages.ComputeLexicalTable_6, properties));
+//				return false;
+//			}
+//		}
+//		
+//		final Index firstIndex = vocabularies.get(0);
+//		Partition firstPartition = firstIndex.getPartition();
+//		for (Index voc : vocabularies) {
+//			if (!firstPartition.equals(voc.getPartition())) {
+//				Log.warning(NLS.bind(RCPMessages.ComputeLexicalTable_7, firstPartition));
+//				return false;
+//			}
+//		}
+//		
+//		final Property property = properties.get(0);
+//
+//		JobHandler jobhandler = new JobHandler(RCPMessages.bind(RCPMessages.ComputeLexicalTable_0, firstIndex.getName())) {
+//			@Override
+//			protected IStatus run(IProgressMonitor monitor) {
+//				this.runInit(monitor);
+//				try {
+//					monitor.beginTask("Computing Lexical table with Index: "+firstIndex+" property: "+property, 100);
+//					this.acquireSemaphore();
+//					table = new LexicalTable(firstIndex);
+//					table.setParameters(null, null, null, useAllOccurrences);
+//					table.compute(true, monitor);
+//					monitor.worked(45);
+//					this.releaseSemaphore();
+//					if (monitor.isCanceled() || table == null)
+//						return Status.CANCEL_STATUS;
+//
+//					firstIndex.addChild(table);
+//					monitor.worked(5);
+//
+//					monitor.subTask(RCPMessages.ComputeLexicalTable_10);
+//					syncExec(new Runnable() {
+//						@Override
+//						public void run() {
+//							IWorkbenchPage page = window.getActivePage();
+//							LexicalTableEditorInput editorInput = new LexicalTableEditorInput(table);
+//							try {
+//								StatusLine.setMessage(RCPMessages.ComputeLexicalTable_10);
+//								page.openEditor(editorInput,
+//										"org.txm.rcp.editors.lexicaltable.LexicalTableEditor"); //$NON-NLS-1$
+//							} catch (PartInitException e) {
+//								org.txm.rcp.utils.Logger.printStackTrace(e);
+//							} 
+//						}
+//					});
+//
+//					monitor.worked(50);
+//					if (monitor.isCanceled())
+//						return Status.CANCEL_STATUS;
+//
+//					monitor.subTask(RCPMessages.ComputeSpecifities_2);
+//					syncExec(new Runnable() {
+//						@Override
+//						public void run() {
+//							CorporaView.refresh();
+//							CorporaView.expand(table.getParent());
+//							QueriesView.refresh();
+//							RVariablesView.refresh();
+//						}
+//					});
+//
+//					monitor.worked(100);
+//				} catch (ThreadDeath td) { 
+//					return Status.CANCEL_STATUS;
+//				} catch (Exception e) {
+//					org.txm.rcp.utils.Logger.printStackTrace(e);
+//				} finally {
+//					monitor.done();
+//				}
+//				return Status.OK_STATUS;
+//			}
+//		};
+//		jobhandler.startJob();
+//
+//		return true;
+//	}
+	
+	
+	
+	
 }
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/MergeLines.java	(revision 553)
@@ -39,7 +39,7 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditor2;
+import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
 import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
 import org.txm.rcp.RCPMessages;
 import org.txm.rcp.StatusLine;
@@ -60,8 +60,8 @@
 
 		IWorkbenchPart editor = HandlerUtil.getActiveWorkbenchWindow(event)
 				.getActivePage().getActivePart();
-		if (editor instanceof LexicalTableEditor2) {
-			LexicalTableEditor2 LTeditor = (LexicalTableEditor2) editor;
+		if (editor instanceof LexicalTableEditor) {
+			LexicalTableEditor LTeditor = (LexicalTableEditor) editor;
 			int[] selection = LTeditor.getlineTableViewer().getTable()
 					.getSelectionIndices();
 			if (selection.length == 0)
@@ -90,7 +90,7 @@
 	 * @param newname the newname
 	 * @param selection the selection
 	 */
-	static public void mergeLines(LexicalTableEditor2 LTeditor, String newname,
+	static public void mergeLines(LexicalTableEditor LTeditor, String newname,
 			int[] selection) {
 		// sum the lines
 		StatusLine.setMessage(LexicalTableUIMessages.LexicalTableEditor_18);
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ExportLexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ExportLexicalTable.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/ExportLexicalTable.java	(revision 553)
@@ -37,7 +37,7 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditor2;
+import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
 import org.txm.rcp.commands.EditFile;
 import org.txm.rcp.swt.dialog.LastOpened;
 
@@ -55,8 +55,8 @@
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		IWorkbenchPart editor = HandlerUtil.getActiveWorkbenchWindow(event)
 				.getActivePage().getActivePart();
-		if (editor instanceof LexicalTableEditor2) {
-			LexicalTableEditor2 LTeditor = (LexicalTableEditor2) editor;
+		if (editor instanceof LexicalTableEditor) {
+			LexicalTableEditor LTeditor = (LexicalTableEditor) editor;
 			Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
 					.getShell();
 			FileDialog dialog = new FileDialog(shell, SWT.SAVE);
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/DeleteLines.java	(revision 553)
@@ -36,7 +36,7 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditor2;
+import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
 import org.txm.rcp.RCPMessages;
 /**
  * Allow the user to delete lines in a Lexical Table.
@@ -58,14 +58,14 @@
 
 		IWorkbenchPart editor = HandlerUtil.getActiveWorkbenchWindow(event)
 				.getActivePage().getActivePart();
-		if (editor instanceof LexicalTableEditor2) {
-			LexicalTableEditor2 LTeditor = (LexicalTableEditor2) editor;
+		if (editor instanceof LexicalTableEditor) {
+			LexicalTableEditor LTeditor = (LexicalTableEditor) editor;
 			deleteLexicalTableLines(LTeditor);
 		}
 		return null;
 	}
 
-	public static void deleteLexicalTableLines(LexicalTableEditor2 LTeditor) {
+	public static void deleteLexicalTableLines(LexicalTableEditor LTeditor) {
 		int[] selection = LTeditor.getlineTableViewer().getTable()
 				.getSelectionIndices();
 		if (selection.length == 0)
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/___MergeCols.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/___MergeCols.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/handlers/___MergeCols.java	(revision 553)
@@ -40,7 +40,7 @@
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.lexicaltable.rcp.editors.LexicalTableEditor2;
+import org.txm.lexicaltable.rcp.editors.LexicalTableEditor;
 import org.txm.rcp.RCPMessages;
 import org.txm.statsengine.core.StatException;
 /**
@@ -59,8 +59,8 @@
 
 		IWorkbenchPart editor = HandlerUtil.getActiveWorkbenchWindow(event)
 				.getActivePage().getActivePart();
-		if (editor instanceof LexicalTableEditor2) {
-			LexicalTableEditor2 LTeditor = (LexicalTableEditor2) editor;
+		if (editor instanceof LexicalTableEditor) {
+			LexicalTableEditor LTeditor = (LexicalTableEditor) editor;
 			int[] selection = LTeditor.getlineTableViewer().getTable()
 					.getSelectionIndices();
 			if (selection.length == 0)
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditorInput.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditorInput.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditorInput.java	(revision 553)
@@ -1,175 +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.lexicaltable.rcp.editors;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.EditorPart;
-import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.rcp.editors.TXMResultEditorInput;
-import org.txm.rcp.RCPMessages;
-import org.txm.rcp.editors.Tablable;
-import org.txm.rcp.editors.input.AbstractTablable;
-import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.statsengine.core.StatException;
-// TODO: Auto-generated Javadoc
-/**
- * The Class LexicalTableEditorInput.
- *
- * @author sloiseau
- */
-public class LexicalTableEditorInput extends TXMResultEditorInput {
-
-	/** The editors. */
-	private List<EditorPart> editors;
-	
-	/** The inputs. */
-	private List<IEditorInput> inputs;
-
-	/**
-	 * Instantiates a new lexical table editor input.
-	 *
-	 * @param table the table
-	 * @param partition the partition
-	 * @param property the property
-	 */
-	public LexicalTableEditorInput(final LexicalTable table) {
-		super(table);
-		
-		editors = new ArrayList<EditorPart>();
-		editors.add(new TableEditor());
-
-		inputs = new ArrayList<IEditorInput>();
-
-		class LexicalTableLabelProvider extends LabelProvider implements
-				ITableLabelProvider {
-
-			@Override
-			public Image getColumnImage(Object element, int columnIndex) {
-				return null;
-			}
-
-			@Override
-			public String getColumnText(Object element, int columnIndex) {
-				int[] val = (int[]) element;
-				return String.valueOf(val[columnIndex]);
-			}
-
-		}
-
-		Tablable asTable = new AbstractTablable() {
-
-			@Override
-			public String[] getColumnTitles() {
-				return new String[] { RCPMessages.FrequencyListEditorInput_3,
-						RCPMessages.FrequencyListEditorInput_4 };
-			}
-
-			@Override
-			public String[] getColumnTypes() {
-				return new String[] { RCPMessages.FrequencyListEditorInput_5,
-						RCPMessages.FrequencyListEditorInput_6 };
-			}
-
-			@Override
-			public IStructuredContentProvider getContentProvider() {
-				return new IStructuredContentProvider() {
-					@Override
-					public Object[] getElements(Object inputElement) {
-						LexicalTable res = (LexicalTable) inputElement;
-						List<int[]> row = new ArrayList<int[]>();
-						for (int i = 0; i < res.getNRows(); i++) {
-							int[] v = null;
-							try {
-								v = res.getRow(i).asIntArray();
-							} catch (StatException e) {
-								System.err.println(NLS.bind(
-										RCPMessages.GraphicalLogger_0, e));
-							}
-							row.add(v);
-						}
-						return row.toArray();
-					}
-
-					@Override
-					public void dispose() {
-						// TODO Auto-generated method stub
-					}
-
-					@Override
-					public void inputChanged(Viewer viewer, Object oldInput,
-							Object newInput) {
-						// TODO Auto-generated method stub
-					}
-
-				};
-			}
-
-			@Override
-			public Object getInput() {
-				return table;
-			}
-
-			@Override
-			public LabelProvider getLabelProvider() {
-				return new LexicalTableLabelProvider();
-			}
-
-		};
-		inputs.add(asTable);
-
-	}
-
-
-	/**
-	 * Gets the lexical table.
-	 *
-	 * @return the lexicon
-	 */
-	public LexicalTable getLexicalTable() {
-		return (LexicalTable) this.result;
-	}
-
-	/**
-	 * Gets the property.
-	 *
-	 * @return the property
-	 */
-	public Property getProperty() {
-		return this.getLexicalTable().getProperty();
-	}
-
-}
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor2.java	(revision 553)
@@ -1,744 +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.lexicaltable.rcp.editors;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.window.Window;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.results.TXMResult;
-import org.txm.lexicaltable.core.functions.LexicalTable;
-import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
-import org.txm.lexicaltable.rcp.handlers.MergeLines;
-import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
-import org.txm.rcp.RCPMessages;
-import org.txm.rcp.StatusLine;
-import org.txm.rcp.editors.TXMEditorPart;
-import org.txm.rcp.editors.TableKeyListener;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.statsengine.core.StatException;
-import org.txm.statsengine.core.data.Vector;
-/**
- * display the lexical table tools to merge/delete lines or columns and display
- * the lexical table too
- * 
- * @author mdecorde
- */
-public class LexicalTableEditor2 extends TXMEditorPart	{
-
-	
-	public static final String ID = LexicalTableEditor2.class.getName();
-	
-	/** The table. */
-	LexicalTable table;
-	ILexicalTable itable;
-	
-	// params
-	/** The line table viewer. */
-	TableViewer viewer;
-
-	/** The form column. */
-	TableViewerColumn formColumn;
-
-	/** The freq column. */
-	TableViewerColumn freqColumn;
-	// org.eclipse.swt.widgets.List colCombo;
-
-	/** The minfreqspinner. */
-	Spinner minfreqspinner;
-
-	/** The top spinner. */
-	Spinner nLinesSpinner;
-
-	/** The cols. */
-	private List<double[]> cols;
-
-	/** The rows. */
-	private List<String> rows;
-
-	/** The collist. */
-	List<Object> collist;
-
-	/** The freqs. */
-	//private List<Integer> freqs;
-
-	/** The previous sorted col. */
-	private int previousSortedCol;
-	boolean DEFAULTREVERSE = false;
-	boolean reverse = DEFAULTREVERSE;
-
-	/**
-	 * Inits the.
-	 *
-	 * @param site the site
-	 * @param input the input
-	 * @throws PartInitException the part init exception
-	 * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite,
-	 * org.eclipse.ui.IEditorInput)
-	 */
-	@Override
-	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-		super.init(site, input);
-		
-		table = ((LexicalTableEditorInput) input).getLexicalTable();
-		itable = table.getData();
-	}
-
-	
-
-	/**
-	 * Sort.
-	 *
-	 * @param col the col
-	 * @param index the index
-	 */
-	public void sort(TableViewerColumn col, int index) {
-
-		if (index == previousSortedCol) {
-			reverse = !reverse;
-		} else {
-			reverse = DEFAULTREVERSE;
-		}
-
-		if (index == -2) {// rownames
-			itable.sortRowNames(reverse);
-		} else if (index == -1) { // freqs
-			try {
-				itable.sortByFreqs(reverse);
-				StatusLine.setMessage(RCPMessages.SORT_DONE);
-			} catch (Exception e2) {
-				org.txm.rcp.utils.Logger.printStackTrace(e2);
-			}
-		} else if (index >= 0) {
-			itable.sort(index, reverse);
-		}
-
-		previousSortedCol = index;
-		refreshTable();
-
-		viewer.getTable().setSortColumn(col.getColumn());
-		if (reverse)
-			viewer.getTable().setSortDirection(SWT.DOWN);
-		else
-			viewer.getTable().setSortDirection(SWT.UP);
-	}
-
-	/**
-	 * Creates the part control.
-	 *
-	 * @param parent the parent
-	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-	 */
-	@Override
-	public void createPartControl(final Composite parent) {
-		
-		super.createPartControl(parent);
-		
-		Composite paramArea = new Composite(this.getCommandParametersGroup(), SWT.NONE);
-
-		GridLayout paramLayout = new GridLayout(5, false);
-		paramArea.setLayout(paramLayout);
-
-		// Apply button
-		Button keepTop = new Button(paramArea, SWT.PUSH);
-		keepTop.setText(LexicalTableUIMessages.LexicalTableEditor_4);
-		keepTop.addSelectionListener(new SelectionListener() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				StatusLine.setMessage(LexicalTableUIMessages.LexicalTableEditor_16);
-				System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_5, nLinesSpinner.getSelection(), minfreqspinner.getSelection()));
-
-				MessageBox messageBox = new MessageBox(e.display.getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
-				messageBox.setMessage(RCPMessages.DeleteLines_1);
-				int response = messageBox.open();
-				if (response != SWT.YES)
-					return;
-
-				try {
-					itable.filter(nLinesSpinner.getSelection(), minfreqspinner.getSelection());
-					refresh();
-					StatusLine.setMessage(""); //$NON-NLS-1$
-				} catch (Exception e1) {
-					// TODO Auto-generated catch block
-					org.txm.rcp.utils.Logger.printStackTrace(e1);
-					StatusLine.setMessage("LT: sort error"); //$NON-NLS-1$
-				}
-			}
-
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-		});
-		
-		// Number of lines
-		Label nLines = new Label(paramArea, SWT.NONE);
-		nLines.setText(LexicalTableUIMessages.LexicalTableEditor_8);
-		nLinesSpinner = new Spinner(paramArea, SWT.BORDER);
-
-		// Fmin
-		Label fmin = new Label(paramArea, SWT.NONE);
-		fmin.setText(LexicalTableUIMessages.LexicalTableEditor_6);
-		minfreqspinner = new Spinner(paramArea, SWT.BORDER);
-
-		// Merge or delete columns button
-		Button fusionCol = new Button(paramArea, SWT.PUSH);
-		fusionCol.setText(LexicalTableUIMessages.LexicalTableEditor_10);
-		fusionCol.addSelectionListener(new SelectionListener() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				StatusLine.setMessage(LexicalTableUIMessages.LexicalTableEditor_18);
-				ArrayList<Object> selection = new ArrayList<Object>();
-				MergeDeleteDialog d = new MergeDeleteDialog(e.display
-						.getActiveShell(), new ArrayList<Object>(collist),
-						selection, -1);
-
-				if (d.open() == Window.OK) {
-					List<Integer> colindices = new ArrayList<Integer>();
-					for (int i = 0; i < collist.size(); i++) {
-						if (selection.contains(collist.get(i)))
-							colindices.add(i);
-					}
-
-					if (d.doMerge()) {
-						String newname = d.getMergeName();
-
-						System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_11, colindices));
-						double[] firstcol = cols.get(colindices.get(0));
-
-						// merge selected cols into the first one
-						for (int i = 1; i < colindices.size(); i++) {
-							for (int j = 0; j < table.getNRows(); j++) {
-								firstcol[j] += cols.get(colindices.get(i))[j];
-							}
-						}
-
-						// update first col of the Lexical table
-						for (int j = 0; j < table.getNRows(); j++) {
-							itable.set(j, colindices.get(0), firstcol[j]);
-						}
-
-						// and its name
-						table.getColNames().setString(colindices.get(0),
-								newname);
-
-						// keep only the first col
-						List<Integer> coltodelete = colindices.subList(1,
-								colindices.size());
-						itable.removeCols(coltodelete);
-
-						// refresh stuff
-						collist = new ArrayList<Object>();// update col name
-						// list
-						try {
-							for (String colname : table.getColNames()
-									.asStringsArray()) {
-								collist.add(colname);
-							}
-						} catch (StatException e1) {
-							org.txm.rcp.utils.Logger.printStackTrace(e1);
-							return;
-						}
-
-						Collections.sort(colindices);// update table viewer cols
-						for (int i = colindices.size() - 1; i >= 1; i--) {
-							viewer.getTable().getColumns()[colindices
-							                                        .get(i) + 3].dispose();// +3 = separator,
-							// form, freq
-						}
-						viewer.getTable().getColumns()[colindices.get(0) + 3].setText(newname);
-						refreshTable();
-					} else// delete
-					{
-						System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_12, colindices));
-						itable.removeCols(colindices);
-
-						collist = new ArrayList<Object>();
-						Vector colnames = table.getColNames();
-						try {
-							for (String colname : colnames.asStringsArray()) {
-								collist.add(colname);
-							}
-						} catch (StatException e1) {
-							org.txm.rcp.utils.Logger.printStackTrace(e1);
-							return;
-						}
-
-						Collections.sort(colindices);
-						for (int i = colindices.size() - 1; i >= 0; i--) {
-							viewer.getTable().getColumns()[colindices
-							                                        .get(i) + 3].dispose();
-						}
-						refreshTable();
-					}
-				}
-				StatusLine.setMessage(""); //$NON-NLS-1$
-			}
-
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-		});
-
-		// Merge or delete lines button
-		Button mergeDeleteRows = new Button(paramArea, SWT.PUSH);
-		mergeDeleteRows.setText(LexicalTableUIMessages.LexicalTableEditor_13);
-		mergeDeleteRows.addSelectionListener(new SelectionListener() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-
-				ArrayList<Object> selection = new ArrayList<Object>();
-				MergeDeleteDialog d = new MergeDeleteDialog(e.display
-						.getActiveShell(), new ArrayList<Object>(rows),
-						selection, -1);
-				int count = 0;
-				if (d.open() == Window.OK) {
-					int[] rowindices = new int[selection.size()];
-					for (int i = 0; i < rows.size(); i++) {
-						if (selection.contains(rows.get(i))) {
-							rowindices[count] = i;
-							count++;
-						}
-					}
-
-					if (d.doMerge()) {
-						MergeLines.mergeLines(LexicalTableEditor2.this, d
-								.getMergeName(), rowindices);
-					} else {
-						itable.removeRows(rowindices);
-						refreshTable();
-						viewer.getTable().deselectAll();
-					}
-				}
-			}
-
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-		});
-
-		// result
-		Composite resultArea = new Composite(parent, SWT.NONE);
-		
-		GridData gd = new GridData(GridData.FILL_BOTH);
-		gd.grabExcessVerticalSpace = true;
-		gd.grabExcessHorizontalSpace = true;
-		//gd.horizontalSpan = 2;
-		resultArea.setLayoutData(gd);
-		
-		FormLayout resultLayout = new FormLayout();
-		resultArea.setLayout(resultLayout);
-
-		viewer = new TableViewer(resultArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER | SWT.VIRTUAL);
-		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
-		viewer.getTable().setLinesVisible(true);
-		viewer.getTable().setHeaderVisible(true);
-
-		FormData tableLayoutData = new FormData();
-		tableLayoutData.top = new FormAttachment(0);
-		tableLayoutData.bottom = new FormAttachment(100);
-		tableLayoutData.left = new FormAttachment(0);
-		tableLayoutData.right = new FormAttachment(100);
-		viewer.getTable().setLayoutData(tableLayoutData);
-		CellLabelProvider clp = new CellLabelProvider() {
-			@Override
-			public void update(ViewerCell cell) { }
-		};
-		TableViewerColumn nColumn = new TableViewerColumn(viewer, SWT.RIGHT);
-		nColumn.getColumn().setText(" "); //$NON-NLS-1$
-		nColumn.getColumn().pack();
-		nColumn.setLabelProvider(clp);
-		
-		formColumn = new TableViewerColumn(viewer, SWT.LEFT);
-		formColumn.getColumn().setText(this.table.getProperty().getName()); 
-		formColumn.getColumn().setWidth(200);
-		formColumn.getColumn().addSelectionListener(new ColumnSelectionListener(formColumn, -2));
-		formColumn.setLabelProvider(clp);
-		
-		freqColumn = new TableViewerColumn(viewer, SWT.LEFT);
-		freqColumn.getColumn().setText(RCPMessages.FrequencyListEditorInput_4); 
-		freqColumn.getColumn().setWidth(200);
-		freqColumn.getColumn().addSelectionListener(new ColumnSelectionListener(freqColumn, -1));
-		freqColumn.setLabelProvider(clp);
-		
-		collist = new ArrayList<Object>();
-		Vector colnames = table.getColNames();
-		
-		try {
-			int[] colmargins = table.getColMarginsVector().asIntArray();
-			int i = 0;
-			for (String colname : colnames.asStringsArray()) {
-				// partColumn = new TableColumn(lineTableViewer.getTable(),
-				// SWT.RIGHT);
-				TableViewerColumn partColumn = new TableViewerColumn(viewer, SWT.RIGHT);
-				partColumn.getColumn().setText(colname+" t="+colmargins[i]); //$NON-NLS-1$
-				partColumn.getColumn().setToolTipText(colname); 
-				collist.add(colname);
-				partColumn.getColumn().setWidth(200);
-				partColumn.getColumn().addSelectionListener(new ColumnSelectionListener(partColumn, i));
-				partColumn.setLabelProvider(clp);
-				i++;
-			}
-		} catch (StatException e1) {
-			org.txm.rcp.utils.Logger.printStackTrace(e1);
-			return;
-		}
-
-//		nColumn = new TableViewerColumn(viewer, SWT.RIGHT);
-//		nColumn.getColumn().setText(""); //$NON-NLS-1$
-//		nColumn.getColumn().pack();
-
-		viewer.setContentProvider(new LineContentProvider());
-		viewer.setInput(table);
-		parent.layout();
-
-		viewer.refresh();
-		viewer.getTable().setSortColumn(formColumn.getColumn());
-		viewer.getTable().setSortDirection(SWT.UP);
-
-		refresh();
-		
-		createContextMenu(viewer);
-		
-		//this.commandParametersGroup.pack();
-	}
-
-	private void refreshColNames() throws StatException, CqiClientException {
-		TableColumn[] cols = viewer.getTable().getColumns();
-		String[] colnames = table.getColNames().asStringsArray();
-
-		for (int i = 0 ; i < cols.length ; i++) {
-			cols[i].setText(colnames[i]+ "T="+table.getPartition().getParts().get(i).getSize()); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Refreshes the description area.
-	 */
-	public void refreshInfos() {
-		try {
-			this.setContentDescription(TXMCoreMessages.T + itable.getTotal()
-					+ TXMCoreMessages.V + itable.getNRows()
-					+ TXMCoreMessages.FMIN_2 + itable.getFmin()
-					+ TXMCoreMessages.FMAX_2 + itable.getFmax());
-		} catch (Exception e3) {
-			// TODO Auto-generated catch block
-			org.txm.rcp.utils.Logger.printStackTrace(e3);
-		}
-	}
-
-	/**
-	 * Refresh table.
-	 */
-	public void refreshTable() {
-		
-		LineLabelProvider labelprovider = new LineLabelProvider(table);
-		viewer.setLabelProvider(labelprovider);
-		this.cols = labelprovider.getCols();
-		this.rows = labelprovider.getRows();
-		//this.freqs = labelprovider.getFreqs();
-
-
-		// Refresh and pack the columns
-		viewer.getControl().setRedraw(false);
-		viewer.refresh();
-		for (TableColumn col : viewer.getTable().getColumns()) {
-			col.pack();
-		}
-		viewer.getControl().setRedraw(true);
-		
-		initializeFields();
-		
-		viewer.getTable().setFocus();
-	}
-	
-	@Override
-	public void refresh(boolean update)	{
-		this.refreshTable();
-		this.viewer.getTable().deselectAll();
-		this.refreshInfos();
-		super.refresh();
-	}
-	
-	/**
-	 * Creates the context menu.
-	 *
-	 * @param tableViewer the table viewer
-	 */
-	private void createContextMenu(TableViewer tableViewer) {
-
-		MenuManager menuManager = new MenuManager();
-		Menu menu = menuManager.createContextMenu(tableViewer.getTable());
-		tableViewer.getTable().setMenu(menu);
-		getSite().registerContextMenu(menuManager, tableViewer);
-		getSite().setSelectionProvider(tableViewer);
-	}
-
-	
-	/**
-	 * Sets the col comparator.
-	 *
-	 * @param comp the comp
-	 * @param col the col
-	 */
-	private void setColComparator(Comparator comp, TableColumn col) {
-		/*
-		 * currentComparator = comp;
-		 * if (lineTableViewer.getTable().getSortColumn()!=col){
-		 * lineTableViewer.getTable().setSortColumn(col);
-		 * lineTableViewer.getTable().setSortDirection(SWT.UP); } else
-		 * if (lineTableViewer.getTable().getSortDirection() ==SWT.UP){
-		 * lineTableViewer.getTable().setSortDirection(SWT.DOWN);
-		 * currentComparator = new ReverseComparator(currentComparator); } else
-		 * lineTableViewer.getTable().setSortDirection(SWT.UP);
-		 * currentComparator.initialize(cooc.getCorpus());
-		 */
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
-	 */
-	@Override
-	public void setFocus() {
-
-	}
-
-	/**
-	 * Gets the corpus.
-	 *
-	 * @return the corpus
-	 */
-	public Corpus getCorpus() {
-		return null;
-	}
-
-	/**
-	 * The listener interface for receiving columnSelection events.
-	 * The class that is interested in processing a columnSelection
-	 * event implements this interface, and the object created
-	 * with that class is registered with a component using the
-	 * component's <code>addColumnSelectionListener<code> method. When
-	 * the columnSelection event occurs, that object's appropriate
-	 * method is invoked.
-	 *
-	 * @see ColumnSelectionEvent
-	 */
-	public class ColumnSelectionListener implements SelectionListener {
-
-		/** The col. */
-		TableViewerColumn col;
-
-		/** The index. */
-		int index;
-
-		/**
-		 * Instantiates a new column selection listener.
-		 *
-		 * @param formColumn the form column
-		 * @param index the index
-		 */
-		public ColumnSelectionListener(TableViewerColumn formColumn, int index) {
-			this.col = formColumn;
-			this.index = index;
-		}
-
-		/* (non-Javadoc)
-		 * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
-		 */
-		@Override
-		public void widgetDefaultSelected(SelectionEvent e) {
-		}
-
-		/* (non-Javadoc)
-		 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-		 */
-		@Override
-		public void widgetSelected(SelectionEvent e) {
-			StatusLine.setMessage(RCPMessages.SORT_COLUMN);
-			sort(col, index);
-			StatusLine.setMessage(""); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Gets the line table viewer.
-	 *
-	 * @return the line table viewer
-	 */
-	public TableViewer getlineTableViewer() {
-		return viewer;
-	}
-
-	/**
-	 * Gets the lexical table.
-	 *
-	 * @return the lexical table
-	 */
-	public LexicalTable getLexicalTable() {
-		return table;
-	}
-
-	/**
-	 * Gets the cols.
-	 *
-	 * @return the cols
-	 */
-	public List<double[]> getCols() {
-		return cols;
-	}
-
-	/**
-	 * Export data.
-	 *
-	 * @param file the file
-	 */
-	 @Deprecated
-	public void exportData(File file) {
-		itable.exportData(file, "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/**
-	 * Import data.
-	 *
-	 * @param file the file
-	 */
-	 @Deprecated
-	public void importData(File file) {
-		try {
-			if (itable.importData(file)) {
-				// fix col names
-				String[] colnames = table.getColNames().asStringsArray();
-				TableColumn[] cols = viewer.getTable().getColumns();
-				if (colnames.length > cols.length) {
-					System.out.println(LexicalTableUIMessages.LexicalTableEditor_1+Arrays.toString(cols)+LexicalTableUIMessages.LexicalTableEditor_7+Arrays.toString(colnames)+" ");  //$NON-NLS-1$
-					return;
-				}
-				for (int i = 0; i < colnames.length ; i++) {
-					//System.out.println("set col name "+colnames[i]);
-					cols[3 + i].setText(colnames[i]);
-				}
-				viewer.refresh();
-				viewer.setInput(table);
-				viewer.getTable().getParent().layout();
-				refreshTable();
-			} else {
-				System.out.println(LexicalTableUIMessages.LexicalTableEditor_14);
-			}
-		} catch(Exception e) {
-			System.out.println(LexicalTableUIMessages.LexicalTableEditor_15+e);
-			org.txm.rcp.utils.Logger.printStackTrace(e);
-		}
-	}
-
-
-	@Override
-	public boolean isResultUsingParent(TXMResult parent) {
-		Corpus c = getCorpus();
-		if (c == null) return false;
-		return c.getName().equals(parent.getName());
-	}
-
-	/**
-	 * Do save.
-	 *
-	 * @param arg0 the arg0
-	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	@Override
-	public void doSave(IProgressMonitor arg0) {
-
-	}
-
-	/**
-	 * Do save as.
-	 *
-	 * @see org.eclipse.lyon gournd zeroui.part.EditorPart#doSaveAs()
-	 */
-	@Override
-	public void doSaveAs() {
-
-	}
-
-	/**
-	 * Checks if is save as allowed.
-	 *
-	 * @return true, if is save as allowed
-	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
-	 */
-	@Override
-	public boolean isSaveAsAllowed() {
-		return false;
-	}
-
-	@Override
-	public void computeResult() {
-		// FIXME! not yet implemented
-		System.err.println("LexicalTableEditor2.computeResult(): not yet implemented.");
-	}
-
-
-
-
-	protected void initializeFields() {
-		nLinesSpinner.setMinimum(1);
-		nLinesSpinner.setMaximum(itable.getNRows());
-		nLinesSpinner.setSelection(itable.getNRows());
-		minfreqspinner.setMinimum(itable.getFmin());
-		minfreqspinner.setMaximum(itable.getFmax());
-	}
-}
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditor.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditor.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditor.java	(revision 553)
@@ -73,7 +73,7 @@
 		parent.setLayout(parentLayout);
 
 //		Lexicon lexicon = null; // ((LexicalTableEditorInput)getEditorInput()).getLexicon();
-		Property property = ((LexicalTableEditorInput) getEditorInput()).getProperty();
+		Property property = ((___LexicalTableEditorInput) getEditorInput()).getProperty();
 
 		Composite corpusInfo = new Composite(parent, SWT.NONE);
 		GridLayout corpusInfoLayout = new GridLayout(1, false);
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditorInput.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditorInput.java	(revision 0)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/___LexicalTableEditorInput.java	(revision 553)
@@ -0,0 +1,171 @@
+// 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.lexicaltable.rcp.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.EditorPart;
+import org.txm.lexicaltable.core.functions.LexicalTable;
+import org.txm.rcp.editors.TXMResultEditorInput;
+import org.txm.rcp.RCPMessages;
+import org.txm.rcp.editors.Tablable;
+import org.txm.rcp.editors.input.AbstractTablable;
+import org.txm.searchengine.cqp.corpus.Property;
+import org.txm.statsengine.core.StatException;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class LexicalTableEditorInput.
+ *
+ * @author sloiseau
+ */
+public class ___LexicalTableEditorInput extends TXMResultEditorInput {
+
+	/** The editors. */
+	private List<EditorPart> editors;
+	
+	/** The inputs. */
+	private List<IEditorInput> inputs;
+
+	/**
+	 * Instantiates a new lexical table editor input.
+	 *
+	 * @param table the table
+	 * @param partition the partition
+	 * @param property the property
+	 */
+	public ___LexicalTableEditorInput(final LexicalTable table) {
+		super(table);
+		
+		editors = new ArrayList<EditorPart>();
+		editors.add(new TableEditor());
+
+		inputs = new ArrayList<IEditorInput>();
+
+		class LexicalTableLabelProvider extends LabelProvider implements
+				ITableLabelProvider {
+
+			@Override
+			public Image getColumnImage(Object element, int columnIndex) {
+				return null;
+			}
+
+			@Override
+			public String getColumnText(Object element, int columnIndex) {
+				int[] val = (int[]) element;
+				return String.valueOf(val[columnIndex]);
+			}
+
+		}
+
+		Tablable asTable = new AbstractTablable() {
+
+			@Override
+			public String[] getColumnTitles() {
+				return new String[] { RCPMessages.FrequencyListEditorInput_3,
+						RCPMessages.FrequencyListEditorInput_4 };
+			}
+
+			@Override
+			public String[] getColumnTypes() {
+				return new String[] { RCPMessages.FrequencyListEditorInput_5,
+						RCPMessages.FrequencyListEditorInput_6 };
+			}
+
+			@Override
+			public IStructuredContentProvider getContentProvider() {
+				return new IStructuredContentProvider() {
+					@Override
+					public Object[] getElements(Object inputElement) {
+						LexicalTable res = (LexicalTable) inputElement;
+						List<int[]> row = new ArrayList<int[]>();
+						for (int i = 0; i < res.getNRows(); i++) {
+							int[] v = null;
+							try {
+								v = res.getRow(i).asIntArray();
+							} catch (StatException e) {
+								System.err.println(NLS.bind(
+										RCPMessages.GraphicalLogger_0, e));
+							}
+							row.add(v);
+						}
+						return row.toArray();
+					}
+
+					@Override
+					public void dispose() {
+						// TODO Auto-generated method stub
+					}
+
+					@Override
+					public void inputChanged(Viewer viewer, Object oldInput,
+							Object newInput) {
+						// TODO Auto-generated method stub
+					}
+
+				};
+			}
+
+			@Override
+			public Object getInput() {
+				return table;
+			}
+
+			@Override
+			public LabelProvider getLabelProvider() {
+				return new LexicalTableLabelProvider();
+			}
+
+		};
+		inputs.add(asTable);
+
+	}
+
+
+	@Override
+	public LexicalTable getResult() {
+		return (LexicalTable) this.result;
+	}
+
+	/**
+	 * Gets the property.
+	 *
+	 * @return the property
+	 */
+	public Property getProperty() {
+		return this.getResult().getProperty();
+	}
+
+}

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

Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/TableEditor.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/TableEditor.java	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/TableEditor.java	(revision 553)
@@ -172,9 +172,9 @@
 
 		tableSorter = new TableSorter();
 		tableSorter.setColumnTypes(tableInput.getColumnTypes());
-		if (this.iEditorInput instanceof LexicalTableEditorInput) {
-			LexicalTableEditorInput ed = (LexicalTableEditorInput) this.iEditorInput;
-			tableSorter.setLocale(ed.getLexicalTable().getPartition().getCorpus().getLocale());
+		if (this.iEditorInput instanceof ___LexicalTableEditorInput) {
+			___LexicalTableEditorInput ed = (___LexicalTableEditorInput) this.iEditorInput;
+			tableSorter.setLocale(ed.getResult().getPartition().getCorpus().getLocale());
 		}
 		viewer.setSorter(tableSorter);
 
Index: tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java
===================================================================
--- tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java	(revision 0)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java	(revision 553)
@@ -0,0 +1,678 @@
+// 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.lexicaltable.rcp.editors;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.CellLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.TableColumn;
+import org.txm.core.messages.TXMCoreMessages;
+import org.txm.lexicaltable.core.functions.LexicalTable;
+import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
+import org.txm.lexicaltable.rcp.handlers.MergeLines;
+import org.txm.lexicaltable.rcp.messages.LexicalTableUIMessages;
+import org.txm.rcp.RCPMessages;
+import org.txm.rcp.StatusLine;
+import org.txm.rcp.editors.TXMEditorPart;
+import org.txm.rcp.editors.TableKeyListener;
+import org.txm.rcp.views.QueriesView;
+import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.statsengine.core.StatException;
+import org.txm.statsengine.core.data.Vector;
+import org.txm.statsengine.r.rcp.views.RVariablesView;
+/**
+ * display the lexical table tools to merge/delete lines or columns and display
+ * the lexical table too
+ * 
+ * @author mdecorde
+ */
+public class LexicalTableEditor extends TXMEditorPart	{
+
+	
+	public static final String ID = LexicalTableEditor.class.getName();
+	
+	/** The table. */
+	LexicalTable lexicalTable;
+	ILexicalTable iTable;
+	
+	// params
+	/** The line table viewer. */
+	TableViewer viewer;
+
+	/** The form column. */
+	TableViewerColumn formColumn;
+
+	/** The freq column. */
+	TableViewerColumn freqColumn;
+	// org.eclipse.swt.widgets.List colCombo;
+
+	/** The minfreqspinner. */
+	Spinner minfreqspinner;
+
+	/** The top spinner. */
+	Spinner nLinesSpinner;
+
+	/** The cols. */
+	private List<double[]> cols;
+
+	/** The rows. */
+	private List<String> rows;
+
+	/** The collist. */
+	List<Object> collist;
+
+	/** The freqs. */
+	//private List<Integer> freqs;
+
+	/** The previous sorted col. */
+	private int previousSortedCol;
+	boolean DEFAULTREVERSE = false;
+	boolean reverse = DEFAULTREVERSE;
+
+
+	/**
+	 * Sort.
+	 *
+	 * @param col the col
+	 * @param index the index
+	 */
+	public void sort(TableViewerColumn col, int index) {
+
+		if (index == previousSortedCol) {
+			reverse = !reverse;
+		} else {
+			reverse = DEFAULTREVERSE;
+		}
+
+		if (index == -2) {// rownames
+			iTable.sortRowNames(reverse);
+		} else if (index == -1) { // freqs
+			try {
+				iTable.sortByFreqs(reverse);
+				StatusLine.setMessage(RCPMessages.SORT_DONE);
+			} catch (Exception e2) {
+				org.txm.rcp.utils.Logger.printStackTrace(e2);
+			}
+		} else if (index >= 0) {
+			iTable.sort(index, reverse);
+		}
+
+		previousSortedCol = index;
+		refreshTable();
+
+		viewer.getTable().setSortColumn(col.getColumn());
+		if (reverse) {
+			viewer.getTable().setSortDirection(SWT.DOWN);
+		}
+		else {
+			viewer.getTable().setSortDirection(SWT.UP);
+		}
+	}
+
+	/**
+	 * Creates the part control.
+	 *
+	 * @param parent the parent
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	public void createPartControl(final Composite parent) {
+		
+		super.createPartControl(parent);
+		
+		
+		lexicalTable = (LexicalTable) this.getResultData();
+		iTable = lexicalTable.getData();
+
+		
+		Composite paramArea = new Composite(this.getCommandParametersGroup(), SWT.NONE);
+
+		GridLayout paramLayout = new GridLayout(5, false);
+		paramArea.setLayout(paramLayout);
+
+		// Apply button
+		Button keepTop = new Button(paramArea, SWT.PUSH);
+		keepTop.setText(LexicalTableUIMessages.LexicalTableEditor_4);
+		keepTop.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				StatusLine.setMessage(LexicalTableUIMessages.LexicalTableEditor_16);
+				System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_5, nLinesSpinner.getSelection(), minfreqspinner.getSelection()));
+
+				MessageBox messageBox = new MessageBox(e.display.getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
+				messageBox.setMessage(RCPMessages.DeleteLines_1);
+				int response = messageBox.open();
+				if (response != SWT.YES)
+					return;
+
+				try {
+					iTable.filter(nLinesSpinner.getSelection(), minfreqspinner.getSelection());
+					refresh();
+					StatusLine.setMessage(""); //$NON-NLS-1$
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					org.txm.rcp.utils.Logger.printStackTrace(e1);
+					StatusLine.setMessage("LT: sort error"); //$NON-NLS-1$
+				}
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+			}
+		});
+		
+		// Number of lines
+		Label nLines = new Label(paramArea, SWT.NONE);
+		nLines.setText(LexicalTableUIMessages.LexicalTableEditor_8);
+		nLinesSpinner = new Spinner(paramArea, SWT.BORDER);
+
+		// Fmin
+		Label fmin = new Label(paramArea, SWT.NONE);
+		fmin.setText(LexicalTableUIMessages.LexicalTableEditor_6);
+		minfreqspinner = new Spinner(paramArea, SWT.BORDER);
+
+		// Merge or delete columns button
+		Button fusionCol = new Button(paramArea, SWT.PUSH);
+		fusionCol.setText(LexicalTableUIMessages.LexicalTableEditor_10);
+		fusionCol.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				StatusLine.setMessage(LexicalTableUIMessages.LexicalTableEditor_18);
+				ArrayList<Object> selection = new ArrayList<Object>();
+				MergeDeleteDialog d = new MergeDeleteDialog(e.display
+						.getActiveShell(), new ArrayList<Object>(collist),
+						selection, -1);
+
+				if (d.open() == Window.OK) {
+					List<Integer> colindices = new ArrayList<Integer>();
+					for (int i = 0; i < collist.size(); i++) {
+						if (selection.contains(collist.get(i)))
+							colindices.add(i);
+					}
+
+					if (d.doMerge()) {
+						String newname = d.getMergeName();
+
+						System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_11, colindices));
+						double[] firstcol = cols.get(colindices.get(0));
+
+						// merge selected cols into the first one
+						for (int i = 1; i < colindices.size(); i++) {
+							for (int j = 0; j < lexicalTable.getNRows(); j++) {
+								firstcol[j] += cols.get(colindices.get(i))[j];
+							}
+						}
+
+						// update first col of the Lexical table
+						for (int j = 0; j < lexicalTable.getNRows(); j++) {
+							iTable.set(j, colindices.get(0), firstcol[j]);
+						}
+
+						// and its name
+						lexicalTable.getColNames().setString(colindices.get(0), newname);
+
+						// keep only the first col
+						List<Integer> coltodelete = colindices.subList(1, colindices.size());
+						iTable.removeCols(coltodelete);
+
+						// refresh stuff
+						collist = new ArrayList<Object>();// update col name
+						// list
+						try {
+							for (String colname : lexicalTable.getColNames().asStringsArray()) {
+								collist.add(colname);
+							}
+						} catch (StatException e1) {
+							org.txm.rcp.utils.Logger.printStackTrace(e1);
+							return;
+						}
+
+						Collections.sort(colindices);// update table viewer cols
+						for (int i = colindices.size() - 1; i >= 1; i--) {
+							viewer.getTable().getColumns()[colindices.get(i) + 3].dispose();// +3 = separator,
+							// form, freq
+						}
+						viewer.getTable().getColumns()[colindices.get(0) + 3].setText(newname);
+						refreshTable();
+					} else// delete
+					{
+						System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_12, colindices));
+						iTable.removeCols(colindices);
+
+						collist = new ArrayList<Object>();
+						Vector colnames = lexicalTable.getColNames();
+						try {
+							for (String colname : colnames.asStringsArray()) {
+								collist.add(colname);
+							}
+						} catch (StatException e1) {
+							org.txm.rcp.utils.Logger.printStackTrace(e1);
+							return;
+						}
+
+						Collections.sort(colindices);
+						for (int i = colindices.size() - 1; i >= 0; i--) {
+							viewer.getTable().getColumns()[colindices
+							                                        .get(i) + 3].dispose();
+						}
+						refreshTable();
+					}
+				}
+				StatusLine.setMessage(""); //$NON-NLS-1$
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+			}
+		});
+
+		// Merge or delete lines button
+		Button mergeDeleteRows = new Button(paramArea, SWT.PUSH);
+		mergeDeleteRows.setText(LexicalTableUIMessages.LexicalTableEditor_13);
+		mergeDeleteRows.addSelectionListener(new SelectionListener() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+
+				ArrayList<Object> selection = new ArrayList<Object>();
+				MergeDeleteDialog d = new MergeDeleteDialog(e.display
+						.getActiveShell(), new ArrayList<Object>(rows),
+						selection, -1);
+				int count = 0;
+				if (d.open() == Window.OK) {
+					int[] rowindices = new int[selection.size()];
+					for (int i = 0; i < rows.size(); i++) {
+						if (selection.contains(rows.get(i))) {
+							rowindices[count] = i;
+							count++;
+						}
+					}
+
+					if (d.doMerge()) {
+						MergeLines.mergeLines(LexicalTableEditor.this, d
+								.getMergeName(), rowindices);
+					} else {
+						iTable.removeRows(rowindices);
+						refreshTable();
+						viewer.getTable().deselectAll();
+					}
+				}
+			}
+
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) {
+			}
+		});
+
+		// result
+		Composite resultArea = new Composite(parent, SWT.NONE);
+		
+		GridData gd = new GridData(GridData.FILL_BOTH);
+		gd.grabExcessVerticalSpace = true;
+		gd.grabExcessHorizontalSpace = true;
+		//gd.horizontalSpan = 2;
+		resultArea.setLayoutData(gd);
+		
+		FormLayout resultLayout = new FormLayout();
+		resultArea.setLayout(resultLayout);
+
+		viewer = new TableViewer(resultArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER | SWT.VIRTUAL);
+		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
+		viewer.getTable().setLinesVisible(true);
+		viewer.getTable().setHeaderVisible(true);
+
+		FormData tableLayoutData = new FormData();
+		tableLayoutData.top = new FormAttachment(0);
+		tableLayoutData.bottom = new FormAttachment(100);
+		tableLayoutData.left = new FormAttachment(0);
+		tableLayoutData.right = new FormAttachment(100);
+		viewer.getTable().setLayoutData(tableLayoutData);
+		CellLabelProvider clp = new CellLabelProvider() {
+			@Override
+			public void update(ViewerCell cell) { }
+		};
+		TableViewerColumn nColumn = new TableViewerColumn(viewer, SWT.RIGHT);
+		nColumn.getColumn().setText(" "); //$NON-NLS-1$
+		nColumn.getColumn().pack();
+		nColumn.setLabelProvider(clp);
+		
+		formColumn = new TableViewerColumn(viewer, SWT.LEFT);
+		formColumn.getColumn().setText(this.lexicalTable.getProperty().getName()); 
+		formColumn.getColumn().setWidth(200);
+		formColumn.getColumn().addSelectionListener(new ColumnSelectionListener(formColumn, -2));
+		formColumn.setLabelProvider(clp);
+		
+		freqColumn = new TableViewerColumn(viewer, SWT.LEFT);
+		freqColumn.getColumn().setText(RCPMessages.FrequencyListEditorInput_4); 
+		freqColumn.getColumn().setWidth(200);
+		freqColumn.getColumn().addSelectionListener(new ColumnSelectionListener(freqColumn, -1));
+		freqColumn.setLabelProvider(clp);
+		
+		collist = new ArrayList<Object>();
+		Vector colnames = lexicalTable.getColNames();
+		
+		try {
+			int[] colmargins = lexicalTable.getColMarginsVector().asIntArray();
+			int i = 0;
+			for (String colname : colnames.asStringsArray()) {
+				// partColumn = new TableColumn(lineTableViewer.getTable(),
+				// SWT.RIGHT);
+				TableViewerColumn partColumn = new TableViewerColumn(viewer, SWT.RIGHT);
+				partColumn.getColumn().setText(colname+" t="+colmargins[i]); //$NON-NLS-1$
+				partColumn.getColumn().setToolTipText(colname); 
+				collist.add(colname);
+				partColumn.getColumn().setWidth(200);
+				partColumn.getColumn().addSelectionListener(new ColumnSelectionListener(partColumn, i));
+				partColumn.setLabelProvider(clp);
+				i++;
+			}
+		} catch (StatException e1) {
+			org.txm.rcp.utils.Logger.printStackTrace(e1);
+			return;
+		}
+
+//		nColumn = new TableViewerColumn(viewer, SWT.RIGHT);
+//		nColumn.getColumn().setText(""); //$NON-NLS-1$
+//		nColumn.getColumn().pack();
+
+		viewer.setContentProvider(new LineContentProvider());
+		viewer.setInput(lexicalTable);
+		parent.layout();
+
+		viewer.refresh();
+		viewer.getTable().setSortColumn(formColumn.getColumn());
+		viewer.getTable().setSortDirection(SWT.UP);
+
+		refresh();
+		
+		createContextMenu(viewer);
+		
+		//this.commandParametersGroup.pack();
+	}
+
+	private void refreshColNames() throws StatException, CqiClientException {
+		TableColumn[] cols = viewer.getTable().getColumns();
+		String[] colnames = lexicalTable.getColNames().asStringsArray();
+
+		for (int i = 0 ; i < cols.length ; i++) {
+			cols[i].setText(colnames[i]+ "T="+lexicalTable.getPartition().getParts().get(i).getSize()); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Refreshes the description area.
+	 */
+	public void refreshInfos() {
+		try {
+			this.setContentDescription(TXMCoreMessages.T + iTable.getTotal()
+					+ TXMCoreMessages.V + iTable.getNRows()
+					+ TXMCoreMessages.FMIN_2 + iTable.getFmin()
+					+ TXMCoreMessages.FMAX_2 + iTable.getFmax());
+		} catch (Exception e3) {
+			// TODO Auto-generated catch block
+			org.txm.rcp.utils.Logger.printStackTrace(e3);
+		}
+	}
+
+	/**
+	 * Refresh table.
+	 */
+	public void refreshTable() {
+		
+		LineLabelProvider labelprovider = new LineLabelProvider(this.lexicalTable);
+		this.viewer.setLabelProvider(labelprovider);
+		this.cols = labelprovider.getCols();
+		this.rows = labelprovider.getRows();
+		//this.freqs = labelprovider.getFreqs();
+
+
+		// Refresh and pack the columns
+		TXMEditorPart.packColumns(this.viewer);
+		
+		updateEditorFromResult();
+		
+		this.viewer.getTable().setFocus();
+	}
+	
+	@Override
+	public void refresh(boolean update)	{
+		this.refreshTable();
+		this.viewer.getTable().deselectAll();
+		this.refreshInfos();
+		super.refresh();
+		
+		QueriesView.refresh();
+		RVariablesView.refresh();
+	}
+	
+	/**
+	 * Creates the context menu.
+	 *
+	 * @param tableViewer the table viewer
+	 */
+	private void createContextMenu(TableViewer tableViewer) {
+
+		MenuManager menuManager = new MenuManager();
+		Menu menu = menuManager.createContextMenu(tableViewer.getTable());
+		tableViewer.getTable().setMenu(menu);
+		getSite().registerContextMenu(menuManager, tableViewer);
+		getSite().setSelectionProvider(tableViewer);
+	}
+
+	
+	/**
+	 * Sets the col comparator.
+	 *
+	 * @param comp the comp
+	 * @param col the col
+	 */
+	private void setColComparator(Comparator comp, TableColumn col) {
+		/*
+		 * currentComparator = comp;
+		 * if (lineTableViewer.getTable().getSortColumn()!=col){
+		 * lineTableViewer.getTable().setSortColumn(col);
+		 * lineTableViewer.getTable().setSortDirection(SWT.UP); } else
+		 * if (lineTableViewer.getTable().getSortDirection() ==SWT.UP){
+		 * lineTableViewer.getTable().setSortDirection(SWT.DOWN);
+		 * currentComparator = new ReverseComparator(currentComparator); } else
+		 * lineTableViewer.getTable().setSortDirection(SWT.UP);
+		 * currentComparator.initialize(cooc.getCorpus());
+		 */
+	}
+
+	/**
+	 * Gets the corpus.
+	 *
+	 * @return the corpus
+	 */
+	public Corpus getCorpus() {
+		return null;
+	}
+
+	/**
+	 * The listener interface for receiving columnSelection events.
+	 * The class that is interested in processing a columnSelection
+	 * event implements this interface, and the object created
+	 * with that class is registered with a component using the
+	 * component's <code>addColumnSelectionListener<code> method. When
+	 * the columnSelection event occurs, that object's appropriate
+	 * method is invoked.
+	 *
+	 * @see ColumnSelectionEvent
+	 */
+	public class ColumnSelectionListener implements SelectionListener {
+
+		/** The col. */
+		TableViewerColumn col;
+
+		/** The index. */
+		int index;
+
+		/**
+		 * Instantiates a new column selection listener.
+		 *
+		 * @param formColumn the form column
+		 * @param index the index
+		 */
+		public ColumnSelectionListener(TableViewerColumn formColumn, int index) {
+			this.col = formColumn;
+			this.index = index;
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+		 */
+		@Override
+		public void widgetDefaultSelected(SelectionEvent e) {
+		}
+
+		/* (non-Javadoc)
+		 * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+		 */
+		@Override
+		public void widgetSelected(SelectionEvent e) {
+			StatusLine.setMessage(RCPMessages.SORT_COLUMN);
+			sort(col, index);
+			StatusLine.setMessage(""); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Gets the line table viewer.
+	 *
+	 * @return the line table viewer
+	 */
+	public TableViewer getlineTableViewer() {
+		return viewer;
+	}
+
+	/**
+	 * Gets the lexical table.
+	 *
+	 * @return the lexical table
+	 */
+	public LexicalTable getLexicalTable() {
+		return lexicalTable;
+	}
+
+	/**
+	 * Gets the cols.
+	 *
+	 * @return the cols
+	 */
+	public List<double[]> getCols() {
+		return cols;
+	}
+
+	/**
+	 * Export data.
+	 *
+	 * @param file the file
+	 */
+	 @Deprecated
+	public void exportData(File file) {
+		iTable.exportData(file, "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/**
+	 * Import data.
+	 *
+	 * @param file the file
+	 */
+	 @Deprecated
+	public void importData(File file) {
+		try {
+			if (iTable.importData(file)) {
+				// fix col names
+				String[] colnames = lexicalTable.getColNames().asStringsArray();
+				TableColumn[] cols = viewer.getTable().getColumns();
+				if (colnames.length > cols.length) {
+					System.out.println(LexicalTableUIMessages.LexicalTableEditor_1+Arrays.toString(cols)+LexicalTableUIMessages.LexicalTableEditor_7+Arrays.toString(colnames)+" ");  //$NON-NLS-1$
+					return;
+				}
+				for (int i = 0; i < colnames.length ; i++) {
+					//System.out.println("set col name "+colnames[i]);
+					cols[3 + i].setText(colnames[i]);
+				}
+				viewer.refresh();
+				viewer.setInput(lexicalTable);
+				viewer.getTable().getParent().layout();
+				refreshTable();
+			} else {
+				System.out.println(LexicalTableUIMessages.LexicalTableEditor_14);
+			}
+		} catch(Exception e) {
+			System.out.println(LexicalTableUIMessages.LexicalTableEditor_15+e);
+			org.txm.rcp.utils.Logger.printStackTrace(e);
+		}
+	}
+
+
+	 @Override
+	public void updateEditorFromResult() {
+		super.updateEditorFromResult();
+		nLinesSpinner.setMinimum(1);
+		nLinesSpinner.setMaximum(iTable.getNRows());
+		nLinesSpinner.setSelection(iTable.getNRows());
+		minfreqspinner.setMinimum(iTable.getFmin());
+		minfreqspinner.setMaximum(iTable.getFmax());
+
+	}
+
+
+	@Override
+	public void updateResultFromEditor() {
+		// TODO Auto-generated method stub
+		
+	}
+}

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

Index: tmp/org.txm.lexicaltable.rcp/plugin.xml
===================================================================
--- tmp/org.txm.lexicaltable.rcp/plugin.xml	(revision 552)
+++ tmp/org.txm.lexicaltable.rcp/plugin.xml	(revision 553)
@@ -144,10 +144,10 @@
    <extension
          point="org.eclipse.ui.editors">
       <editor
-            class="org.txm.lexicaltable.rcp.editors.LexicalTableEditor2"
+            class="org.txm.lexicaltable.rcp.editors.LexicalTableEditor"
             default="false"
             icon="icons/lexicaltable.png"
-            id="LexicalTableEditor"
+            id="org.txm.lexicaltable.rcp.editors.LexicalTableEditor"
             name="%editor.name">
       </editor>
    </extension>
Index: tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java	(revision 552)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/r/data/LexicalTableImpl.java	(revision 553)
@@ -34,28 +34,14 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
-
-
-
-
-
 import org.rosuda.REngine.REXPMismatchException;
-//import org.txm.functions.queryindex.*;
-import org.txm.index.core.functions.Index;
-import org.txm.index.core.functions.Line;
 import org.txm.lexicaltable.core.messages.LexicalTableCoreMessages;
+import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
 import org.txm.lexicon.core.corpusengine.cqp.Lexicon;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
-import org.txm.searchengine.cqp.corpus.Corpus;
-import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.statsengine.core.StatException;
-import org.txm.statsengine.core.data.QuantitativeDataStructure;
 import org.txm.statsengine.core.data.Vector;
 import org.txm.statsengine.r.core.RWorkspace;
 import org.txm.statsengine.r.core.data.ContingencyTableImpl;
@@ -65,11 +51,10 @@
 import cern.colt.Arrays;
 import cern.colt.matrix.DoubleFactory2D;
 import cern.colt.matrix.DoubleMatrix2D;
+//import org.txm.functions.queryindex.*;
 
-import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
 
 
-
 // TODO: Auto-generated Javadoc
 /**
  * Implementation of the {@link ILexicalTable} interface, wrapping a R matrix.
Index: tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 552)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 553)
@@ -8,6 +8,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
 import org.txm.index.core.functions.Index;
 import org.txm.index.core.functions.Line;
@@ -50,10 +51,12 @@
 
 	protected Boolean pUseAllOccurrences;
 
-	protected static String getNextName() {
-		return SYMBOL_BASE+(LEXICALTABLE_COUNTER++);
-	}
-
+	/**
+	 * 
+	 * @param corpus
+	 * @param analysisProperty
+	 * @param itable
+	 */
 	public LexicalTable(Corpus corpus, Property analysisProperty, LexicalTableImpl itable) {
 		super(corpus);
 		this.pProperty = analysisProperty;
@@ -76,15 +79,22 @@
 	 * 
 	 * @param partition
 	 * @param analysisProperty
-	 * @param fmin
+	 * @param fMin
 	 * @param itable
 	 */
-	public LexicalTable(Partition partition, Property analysisProperty, int fmin, LexicalTableImpl itable) {
+	public LexicalTable(Partition partition, Property analysisProperty, int fMin, LexicalTableImpl itable) {
 		super(partition);
+		this.pFminFilter = fMin;
 		this.pProperty = analysisProperty;
 		this.data = itable;
 	}
 
+	
+	public LexicalTable(Partition partition, Property analysisProperty, int fMin) {
+		this(partition, analysisProperty, fMin, null);
+	}
+
+	
 	public LexicalTable(Subcorpus subcorpus) throws Exception {
 		this(subcorpus, subcorpus.getProperty("word")); //$NON-NLS-1$
 	}
@@ -193,16 +203,21 @@
 	@Override
 	protected boolean _compute(boolean update) throws Exception {
 
-		if (parent instanceof Subcorpus) {
-			Subcorpus subcorpus = (Subcorpus) parent;
+		if (this.parent instanceof Subcorpus) {
+			Subcorpus subcorpus = (Subcorpus) this.parent;
 			Corpus parentCorpus = subcorpus.getMotherCorpus();
-			data = new LexicalTableImpl(getNextName(), new Lexicon(parentCorpus), new Lexicon(subcorpus));
-		} else if (parent instanceof Partition) {
-			_computeForPartition((Partition)parent);
-		} else if (parent instanceof Index) {
-			_computeForIndex(Arrays.asList((Index)parent));
+			this.data = new LexicalTableImpl(getNextName(), new Lexicon(parentCorpus), new Lexicon(subcorpus));
 		}
-		return false;
+		else if (this.parent instanceof Partition) {
+			_computeForPartition((Partition)this.parent);
+		}
+		else if (parent instanceof Index) {
+			_computeForIndex(Arrays.asList((Index)this.parent));
+		}
+		
+		this.data.cut(this.pVMaxFilter);
+
+		return true;
 	}
 
 	/**
@@ -262,7 +277,7 @@
 		//System.out.println("mat size " + mat.rows());
 		//System.out.println("mat columns " + mat.columns());
 
-		data = new LexicalTableImpl(mat, filteredForms.toArray(new String[]{}), partition.getPartShortNames().toArray(new String[] {}));
+		this.data = new LexicalTableImpl(mat, filteredForms.toArray(new String[]{}), partition.getPartShortNames().toArray(new String[] {}));
 
 	}
 
@@ -271,7 +286,29 @@
 		return this.parent != null; // can be computed on partition or corpus
 	}
 
+	
 	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("LexicalTable.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("LexicalTable.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	protected static String getNextName() {
+		return SYMBOL_BASE+(LEXICALTABLE_COUNTER++);
+	}
+
+
+	
+	
+	@Override
 	public void clean() {
 		try {
 			RWorkspace.getRWorkspaceInstance().removeVariableFromWorkspace(data.getSymbol());
@@ -335,14 +372,20 @@
 	}
 
 	/**
-	 * Get the partition this lexical table is bound to.
+	 * Gets the partition this lexical table is bound to.
 	 * 
 	 * @return the partition
 	 */
 	public Partition getPartition() {
-		if (parent instanceof Partition) return ((Partition)parent);
-		if (parent instanceof Index) return ((Index)parent).getPartition();
-		else return null;
+		if (parent instanceof Partition) {
+			return ((Partition)parent);
+		}
+		if (parent instanceof Index) {
+			return ((Index)parent).getPartition();
+		}
+		else {
+			return null;
+		}
 	}
 
 	/**
@@ -369,22 +412,29 @@
 	@Override
 	public String getSimpleName() {
 		StringBuilder strb = new StringBuilder();
-		if (pProperty != null) strb.append(pProperty.getName()+" ");
-		if (data != null) strb.append(data.getFmin() + " / " + this.getNRows());
+		if (pProperty != null) {
+			strb.append(pProperty.getName()+" ");
+		}
+		if (data != null) {
+			strb.append(data.getFmin() + " / " + this.getNRows());
+		}
 		return strb.toString();
 	}
 
-	public int getVmax() {
+	public int getVMax() {
 		return pVMaxFilter;
 	}
 
-	@Override
-	public boolean saveParameters() {
-		// TODO Auto-generated method stub
-		return false;
-	}
 
 	/**
+	 * 
+	 * @param vMax
+	 */
+	public void setVMax(int vMax)	{
+		this.pVMaxFilter = vMax;
+	}
+	
+	/**
 	 * see LexicalTablePreferences.PROPERTY, LexicalTablePreferences.F_MIN, LexicalTablePreferences.V_MAX and LexicalTablePreferences.USEALLOCCURENCES
 	 */
 //	public boolean setParameters(TXMParameters parameters) {
Index: tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java
===================================================================
--- tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java	(revision 552)
+++ tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java	(revision 553)
@@ -153,6 +153,23 @@
 				&& pNCluster >= 2;
 	}
 	
+	
+	@Override
+	public boolean saveParameters() {
+		// TODO Auto-generated method stub
+		System.err.println("AHC.saveParameters(): not yet implemented.");
+		return true;
+	}
+
+	@Override
+	public boolean setParameters(TXMParameters parameters) {
+		// TODO Auto-generated method stub
+		System.err.println("AHC.setParameters(): not yet implemented.");
+		return true;
+	}
+
+	
+	
 	/**
 	 * Resets the cached data so the next getter calls will request the values from R.
 	 */
