Index: tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/CAHChartEditor.java
===================================================================
--- tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/CAHChartEditor.java	(revision 409)
+++ tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/editors/CAHChartEditor.java	(revision 410)
@@ -19,7 +19,7 @@
 import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.chartsengine.rcp.messages.SWTComponentsProviderMessages;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.core.results.ITXMResult;
+import org.txm.core.results.TXMResult;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.JobsTimer;
 import org.txm.rcp.commands.editor.CustomizableEditor;
@@ -81,7 +81,7 @@
 		computeColumns.setImage(IImageKeys.getImage(CAHChartEditor.class, "icons/compute_columns.png")); //$NON-NLS-1$
 		// FIXME: keep this for offering an option "large icons" with text in buttons ?
 		//computeColumns.setText(CAUIPMessages.ComputeClassification_5);
-		computeColumns.setSelection(TXMPreferences.getBoolean(CAHPreferences.PREFERENCES_NODE, this.getResultData(), CAHPreferences.COLUMNS_COMPUTING));
+		computeColumns.setSelection(this.getBooleanParameterValue(CAHPreferences.COLUMNS_COMPUTING));
 
 		// Rows
 		final ToolItem computeRows = new ToolItem(this.toolBar, SWT.RADIO);
@@ -89,14 +89,14 @@
 		computeRows.setImage(IImageKeys.getImage(CAHChartEditor.class, "icons/compute_rows.png")); //$NON-NLS-1$
 		// FIXME: keep this for offering an option "large icons" with text in buttons ?
 		//computeRows.setText(CAUIPMessages.ComputeClassification_6);
-		computeRows.setSelection(!TXMPreferences.getBoolean(CAHPreferences.PREFERENCES_NODE, this.getResultData(), CAHPreferences.COLUMNS_COMPUTING));
+		computeRows.setSelection(!this.getBooleanParameterValue(CAHPreferences.COLUMNS_COMPUTING));
 
 		
 		// 2D/3D
 		final Combo displayCombo = new Combo(this.toolBar, SWT.READ_ONLY);
 		String items[] = { "2D", "3D" }; //$NON-NLS-1$ //$NON-NLS-2$
 		displayCombo.setItems(items);
-		if(TXMPreferences.getBoolean(CAHPreferences.PREFERENCES_NODE, this.getResultData(), CAHPreferences.DISPLAY_2D))	{
+		if(this.getBooleanParameterValue(CAHPreferences.DISPLAY_2D))	{
 			displayCombo.select(0);
 		}
 		else	{
@@ -118,7 +118,6 @@
 				// Numbers of clusters
 				if(e.getSource() == numbersOfClusters)	{
 					
-					TXMPreferences.putLocalInt(cah, CAHPreferences.N_CLUSTERS, ((Spinner)e.getSource()).getSelection());
 					cah.setNCluster(((Spinner)e.getSource()).getSelection());
 				}
 				// Compute columns or rows
@@ -130,13 +129,10 @@
 //						return;
 //					}
 					
-					
-					TXMPreferences.putLocalBoolean(cah, CAHPreferences.COLUMNS_COMPUTING, computeColumns.getSelection());
 					cah.setColumnsComputing(computeColumns.getSelection());
 					
 					// reset the number of clusters
-					TXMPreferences.putLocalInt(cah, CAHPreferences.N_CLUSTERS, TXMPreferences.getInt(CAHPreferences.PREFERENCES_NODE, CAHPreferences.N_CLUSTERS));
-					cah.setNCluster(TXMPreferences.getInt(CAHPreferences.PREFERENCES_NODE, CAHPreferences.N_CLUSTERS));
+					cah.setNCluster(TXMPreferences.getInt(CAHPreferences.N_CLUSTERS, CAHPreferences.PREFERENCES_NODE));
 
 					updateNumbersOfClustersCurrentValue();
 					// Update the maximum value of the number of clusters spinner according to the new CAH configuration 
@@ -182,7 +178,7 @@
 				try {
 
 					this.acquireSemaphore();
-					getResultData().stepCompute();
+					getResultData().compute(this);
 					this.releaseSemaphore();
 
 					if(!update)	{
@@ -197,10 +193,6 @@
 							    updateNumbersOfClustersMaxValue();
 							    updateNumbersOfClustersCurrentValue();
 
-								
-								// Refresh UI
-								CorporaView.refresh();
-								CorporaView.expand(getResultData().getParent());
 								QueriesView.refresh();
 								RVariablesView.refresh();
 							}
@@ -212,6 +204,7 @@
 					computeChart(update);
 					
 				}
+				// for user direct canceling
 				catch (ThreadDeath td) {
 					return Status.CANCEL_STATUS;
 				}
@@ -262,7 +255,7 @@
 	@Override
 	public void setSource(Object source) {
 		if (source instanceof CAH)
-			getEditorInput().setResult((ITXMResult) source);
+			getEditorInput().setResult((TXMResult) source);
 	}
 
 	@Override
Index: tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/handlers/ComputeCAH.java
===================================================================
--- tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/handlers/ComputeCAH.java	(revision 409)
+++ tmp/org.txm.cah.rcp/src/org/txm/cah/rcp/handlers/ComputeCAH.java	(revision 410)
@@ -49,6 +49,8 @@
 import org.txm.cah.core.preferences.CAHPreferences;
 import org.txm.cah.rcp.messages.CAHUIMessages;
 import org.txm.chartsengine.rcp.SWTChartsComponentsProvider;
+import org.txm.chartsengine.rcp.editors.ChartEditorInput;
+import org.txm.chartsengine.rcp.editors.ChartEditorPart;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.functions.LexicalTableFactory;
@@ -87,23 +89,26 @@
 			return null;
 		}
 
-
-		CAH cah = null;
+		Object selection = this.getSelection();
+		ChartEditorInput editorInput = null;
+		
+		
+		
 		CA ca = null;
-		LexicalTable lexicaltable = null;
-		Partition partition = null;
-		IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
 
 		
-		// Build the CA or not depending on the selection
-		if (selection.getFirstElement() instanceof CAH) {
-			cah = (CAH) selection.getFirstElement();
-		} else if (selection.getFirstElement() instanceof CA) {
-			//System.out.println("Compute CAH with CA : "+((CA)selection.getFirstElement()).getName());
-			ca = (CA) selection.getFirstElement();
-		} else if (selection.getFirstElement() instanceof LexicalTable) {
+		// reopening an existing result
+		if (selection instanceof CAH) {
+			editorInput = new ChartEditorInput((CAH) selection);
+		}
+		// creates from CA
+		else if (selection instanceof CA) {
+			ca = (CA) selection;
+		}
+		// creates from LexicalTable
+		else if (selection instanceof LexicalTable) {
 			//System.out.println("Compute CAH with LT : "+((LexicalTable)selection.getFirstElement()).getName());
-			lexicaltable = (LexicalTable) selection.getFirstElement();
+			LexicalTable lexicaltable = (LexicalTable) selection;
 			
 			try {
 				ca = new CA(lexicaltable);
@@ -117,13 +122,15 @@
 //				lexicaltable.getPartition().storeResult(ca);
 //			else if (lexicaltable.getCorpus() != null)
 //				lexicaltable.getCorpus().storeResult(ca);
-		} else if (selection.getFirstElement() instanceof Partition) {
+		}
+		// creates from Partition
+		else if (selection instanceof Partition) {
 			//System.out.println("Compute CAH with Partition : "+((Partition)selection.getFirstElement()).getName());
-			partition = (Partition)selection.getFirstElement();
+			Partition partition = (Partition)selection;
 			try {
 				String title = CAHUIMessages.bind(CAHUIMessages.ComputeCAH_0, partition.getName());
-				int vmax = TXMPreferences.getInt(CAPreferences.PREFERENCES_NODE, CAPreferences.V_MAX);
-				int fmin = TXMPreferences.getInt(CAPreferences.PREFERENCES_NODE, CAPreferences.F_MIN);
+				int vmax = TXMPreferences.getInt(CAPreferences.V_MAX, CAPreferences.PREFERENCES_NODE);
+				int fmin = TXMPreferences.getInt(CAPreferences.F_MIN, CAPreferences.PREFERENCES_NODE);
 				Shell shell = Display.getCurrent().getActiveShell();
 				LexicalTableDialog d = new LexicalTableDialog(shell, partition.getCorpus(), title);
 				d.setFminAndVMax(fmin, vmax);
@@ -133,7 +140,7 @@
 					fmin = d.getFmin();
 					vmax = d.getMaxLines();
 					
-					lexicaltable = LexicalTableFactory.getLexicalTable(partition, property, fmin); // use the CAPreferencePage Fmin
+					LexicalTable lexicaltable = LexicalTableFactory.getLexicalTable(partition, property, fmin); // use the CAPreferencePage Fmin
 					lexicaltable.getData().cut(vmax);
 					partition.addResult(lexicaltable);
 					
@@ -150,26 +157,25 @@
 			} 
 		}
 
-		// Use existent CAH (used when reopening an editor from a CAH result node)
-		//FIXME: why we remove the result from the parent here? it shouldn't be necessary
-		if (cah != null)	{
-			if (cah.getParent() != null)	{
-				cah.getParent().removeResult(cah);
-			}
-		} else {
-//			if (ca == null) cah = new CAH(lexicaltable, computeColumns, method, metric, ncluster, display2D);
-//			else 
-				cah = new CAH(ca,
-						TXMPreferences.getBoolean(CAHPreferences.PREFERENCES_NODE, CAHPreferences.COLUMNS_COMPUTING),
-						TXMPreferences.getString(CAHPreferences.PREFERENCES_NODE, CAHPreferences.METHOD),
-						TXMPreferences.getString(CAHPreferences.PREFERENCES_NODE, CAHPreferences.METRIC),
-						TXMPreferences.getInt(CAHPreferences.PREFERENCES_NODE, CAHPreferences.N_CLUSTERS)
-						);
+		if (ca != null)	{
+			editorInput = new ChartEditorInput(
+					new CAH(
+							ca,
+							TXMPreferences.getBoolean(CAHPreferences.COLUMNS_COMPUTING, CAHPreferences.PREFERENCES_NODE),
+							TXMPreferences.getString(CAHPreferences.METHOD, CAHPreferences.PREFERENCES_NODE),
+							TXMPreferences.getString(CAHPreferences.METRIC, CAHPreferences.PREFERENCES_NODE),
+							TXMPreferences.getInt(CAHPreferences.N_CLUSTERS, CAHPreferences.PREFERENCES_NODE)
+					));
 		}
-	
-		//compute(cah, null);
-		SWTChartsComponentsProvider.getCurrent().openEditor(cah, CAHPreferences.PREFERENCES_NODE);
+		
+		ChartEditorPart editor = SWTChartsComponentsProvider.getCurrent().openEditor(editorInput);
 
+		// computes if not reopening a result
+		if(!(selection instanceof CAH))	{
+			editor.computeResult(false);
+		}
+		
+
 		return null;
 	}
 
@@ -179,6 +185,7 @@
 	/**
 	 * The Class CAHParamDialog.
 	 */
+	// FIXME: not used?
 	public class CAHParamDialog extends Dialog {
 
 		//protected Combo methodsCombo;
@@ -246,7 +253,7 @@
 			nclusterSpinner = new Spinner(composite, SWT.BORDER);
 			nclusterSpinner.setMinimum(2);
 			nclusterSpinner.setIncrement(1);
-			nclusterSpinner.setSelection(TXMPreferences.getInt(CAHPreferences.PREFERENCES_NODE, CAHPreferences.N_CLUSTERS));
+			nclusterSpinner.setSelection(TXMPreferences.getInt(CAHPreferences.N_CLUSTERS, CAHPreferences.PREFERENCES_NODE));
 			nclusterSpinner.setMaximum(50);
 
 			// ROWS OR COLS
