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 557)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 558)
@@ -39,6 +39,7 @@
 import org.txm.ca.core.statsengine.r.functions.FactoMineRCA;
 import org.txm.ca.core.statsengine.r.functions.ICA;
 import org.txm.chartsengine.core.results.ChartResult;
+import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMParameters;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -82,27 +83,21 @@
 	/** The rowtitles. */
 	String[] rowtitles; // of the rowinfo table
 
-	/** The use Factomine R. */
+	/** The use Factomine R: change this only if you want to use the default R CA package. */
 	boolean useFactoMineR = true;
 
-
 	/**
-	 * Analysis property.
-	 */
-	protected Property pAnalysisProperty;
-
-	/**
 	 * First dimension.
 	 */
+	@Parameter
 	protected Integer pFirstDimension = 1;
 
 	/**
 	 * Second dimension.
 	 */
+	@Parameter
 	protected Integer pSecondDimension = 2;
-
 	
-	
 	/**
 	 * Create a new empty CA.
 	 *
@@ -111,12 +106,10 @@
 	 */
 	public CA(LexicalTable lexicalTable) throws StatException {
 		super(lexicalTable);
-		this.pAnalysisProperty = lexicalTable.getProperty();
 
 		if (useFactoMineR) {
 			ca = new FactoMineRCA(lexicalTable.getData());
-		}
-		else {
+		} else {
 			ca = new org.txm.ca.core.statsengine.r.functions.CA(lexicalTable.getData());
 		}
 	}
@@ -670,8 +663,8 @@
 
 	@Override
 	public String getSimpleName() {
-		if (pAnalysisProperty != null) {
-			return pAnalysisProperty.getName() + " (" + this.getIntParameterValue(CAPreferences.FIRST_DIMENSION) + "," + this.getIntParameterValue(CAPreferences.SECOND_DIMENSION) + ")";
+		if (pFirstDimension != null) {
+			return getParent().getName() + " " + this.pFirstDimension + "," + this.pSecondDimension + ")";
 		}
 		else {
 			return getParent().getName();
@@ -837,6 +830,9 @@
 		return 
 				this.parent != null
 				&& this.getLexicalTable().getNColumns() > 3
+				&& this.pFirstDimension > 0
+				&& this.pSecondDimension > 0
+				&& this.pFirstDimension != this.pSecondDimension
 				;
 	}
 	
@@ -844,6 +840,8 @@
 	public boolean saveParameters() {
 		// TODO Auto-generated method stub
 		System.err.println("CA.saveParameters(): not yet implemented.");
+		this.setParameterValue(CAPreferences.FIRST_DIMENSION, pFirstDimension);
+		this.setParameterValue(CAPreferences.SECOND_DIMENSION, pSecondDimension);
 		return true;
 	}
 
@@ -853,10 +851,11 @@
 		System.err.println("CA.setParameters(): not yet implemented.");
 		return true;
 	}
-	
+
 	@Override
 	public boolean loadParameters() {
 		System.err.println("CA.loadParameters(): not yet implemented.");
 		return true;
 	}
+
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ComputeTXMResult.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ComputeTXMResult.java	(revision 557)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ComputeTXMResult.java	(revision 558)
@@ -16,11 +16,11 @@
 			System.out.println("Active editor is not a TXMEditorPart. Aborting.");
 			return null;
 		}
-		
-		TXMEditorPart editor = (TXMEditorPart)page;
+
+		TXMEditorPart editor = (TXMEditorPart) page;
 		editor.updateResultFromEditor();
 		editor.compute(true);
-		
+
 		return null;
 	}
 }
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 557)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 558)
@@ -932,6 +932,7 @@
 		if(keyExists)	{
 			nodeQualifier = result.getUUID();
 		}
+		
 		// look in the global alternative preferences nodes
 		else if(!keyExists(nodeQualifier, key))	{
 			for(int i = 0; i < alternativeNodesQualifiers.size(); i++) {
@@ -942,14 +943,14 @@
 			}
 		}
 
-		if(nodeQualifier == null)	{
+		if (nodeQualifier == null)	{
 			try {
 				System.err.println("TXMPreferences.findNodeQualifier(): no node qualifier has been founded (key = " + key + ", TXMResult = " + result + ").");
 			}
 			catch(Exception e) {
 			}
 		}
-
+		System.out.println("NODE QUALIFIER FOUND: "+nodeQualifier);
 		return nodeQualifier;
 	}
 
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 557)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 558)
@@ -15,9 +15,11 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.service.prefs.BackingStoreException;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.objects.Base;
 import org.txm.utils.logger.Log;
 
 /**
@@ -74,6 +76,7 @@
 	 * The command preferences node qualifier.
 	 */
 	protected String preferencesNodeQualifier;
+	//protected IEclipsePreferences preferencesNode;
 
 	/**
 	 * If set, allows the command to notify its progress.
@@ -85,16 +88,14 @@
 	private Semaphore progressSemaphore = new Semaphore(1);
 
 	/**
-	 * This variable ensure the TXMResult class constructor has been called. A lot of necessary things are done in the TXMREsult constructor.
-	 */
-	private boolean constructorCalled;
-
-	/**
 	 * Creates a new TXMResult, child of the specified parent.
 	 * 
 	 * @param parent
 	 */
 	public TXMResult(TXMResult parent) {
+		if (parent == this) {
+			throw new IllegalArgumentException("YOU MAD BRO? parent == this");
+		}
 		this.parent = parent;
 		this.createUUID();
 
@@ -104,9 +105,12 @@
 			parent.addChild(this);
 		}
 		this.children = new ArrayList<TXMResult>(1);
+		//		Base binaryCorpus = this.getBinaryCorpus();
+		//		if (binaryCorpus != null && this.getClass() != Base.class) {
+		//			this.preferencesNode = binaryCorpus.getPreferenceScope().getNode(FrameworkUtil.getBundle(getClass()).getSymbolicName());
 		this.preferencesNodeQualifier = FrameworkUtil.getBundle(getClass()).getSymbolicName();
+		//		}
 
-		this.constructorCalled = true; // if not set the compute method will
 		// always return false
 		// FIXME: Debug
 		// System.out.println("TXMResult.TXMResult(): default preferences node qualifier = "
@@ -121,7 +125,7 @@
 	public TXMResult() {
 		this(null);
 	}
-	
+
 	/**
 	 * Creates and stores an UUID dedicated to persistence for this result.
 	 */
@@ -230,7 +234,7 @@
 	public void setParameterValue(String key, Object value) {
 		TXMPreferences.putLocal(this, key, value);
 	}
-	
+
 	/**
 	 * sets the value of the specified key in parameters, local result node or
 	 * default preferences nodes.
@@ -241,7 +245,7 @@
 	public void setParameterValue(String key, List<?> values) {
 		TXMPreferences.putLocal(this, key, StringUtils.join(values, UNDERSCORE));
 	}
-	
+
 	/**
 	 * Gets the value of the specified key in parameters, local result node or
 	 * default preferences nodes.
@@ -324,14 +328,14 @@
 	 * @return
 	 */
 	public abstract boolean setParameters(TXMParameters parameters);
-	
+
 	/**
 	 * Initialize the @Parameter class members objects using values persisted in the Preference Store
 	 * @return
 	 */
 	public abstract boolean loadParameters();
 
-	
+
 	/**
 	 * Deletes the object from its parent, also deletes the children. The <code>TXMResult.clean()</code> methods of this result and children results are applied before the deletion.
 	 * 
@@ -583,7 +587,21 @@
 		} while (parent != null && node == null);
 
 		return node;
+	}
 
+	/**
+	 * 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 type
+	 * @return null if the TXMResult is not attached to a BinaryCorpus
+	 */
+	synchronized public Base getBinaryCorpus() {
+		Object o = getFirstParent(Base.class);
+		if (o != null) {
+			return (Base)o;
+		} else {
+			return null;
+		}
 	}
 
 	/**
@@ -870,10 +888,6 @@
 			return true;
 		}
 
-		if (!hasBeenConstructorCalled()) {
-			return false;
-		}
-
 		if (!canCompute()) {
 			// FIXME: Debug
 			System.err.println("TXMResult.compute(): missing or wrong parameters, computing aborted.");
@@ -881,6 +895,13 @@
 			return false;
 		}
 
+//		// TODO THIS IS FUCKING LAZY LINE CODES OH YEAH YOU MAD BRO
+		// TODO where do we put this parent compute ? :o
+		//		if (parent != null && !parent.getHasBeenComputedOnce()) { // parent must be computed at least one time
+		//			this.parent.compute(update, monitor);
+		//		}
+
+		
 		if (!_compute(update)) {
 
 			// FIXME: Debug
@@ -925,18 +946,7 @@
 	// return this.compute(monitor);
 	// }
 
-	
-	
 	/**
-	 * 
-	 * @return
-	 */
-	protected boolean hasBeenConstructorCalled() {
-		// TODO Auto-generated method stub
-		return constructorCalled;
-	}
-
-	/**
 	 * Copies the parameters from the local preference node if exists. Also fills the non existent parameters with the command default preferences.
 	 */
 	//public abstract void loadParameters();
Index: tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java	(revision 0)
+++ tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java	(revision 558)
@@ -0,0 +1,88 @@
+package org.txm.objects;
+
+import org.eclipse.core.internal.preferences.EclipsePreferences;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+
+public class BasePreferenceScope implements IScopeContext {
+
+	/**
+	 * String constant (value of <code>"project"</code>) used for the 
+	 * scope name for this preference scope.
+	 */
+	public static final String SCOPE = "binarycorpus"; //$NON-NLS-1$
+
+	private Base context;
+	
+	/**
+	 * Create and return a new project scope for the given project. The given
+	 * project must not be <code>null</code>.
+	 * 
+	 * @param context the project
+	 * @exception IllegalArgumentException if the project is <code>null</code>
+	 */
+	public BasePreferenceScope(Base context) {
+		super();
+		if (context == null) {
+			throw new IllegalArgumentException("NULL context");
+		}
+		this.context = context;
+	}
+	
+	/*
+	 * @see org.eclipse.core.runtime.IScopeContext#getNode(java.lang.String)
+	 */
+	@Override
+	public IEclipsePreferences getNode(String qualifier) {
+		if (qualifier == null) {
+			throw new IllegalArgumentException();
+		}
+		return (IEclipsePreferences) Platform.getPreferencesService().getRootNode().node(SCOPE).node(context.getName()).node(qualifier);
+	}
+
+	/*
+	 * @see org.eclipse.core.runtime.preferences.IScopeContext#getLocation()
+	 */
+	@Override
+	public IPath getLocation() {
+		Path location = new Path(context.getBaseDirectory().getAbsolutePath());
+		return location == null ? null : location.append(EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME);
+	}
+
+	/*
+	 * @see org.eclipse.core.runtime.preferences.IScopeContext#getName()
+	 */
+	@Override
+	public String getName() {
+		return SCOPE;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj) {
+			return true;
+		}
+		if (!super.equals(obj)) {
+			return false;
+		}
+		if (!(obj instanceof BasePreferenceScope)) {
+			return false;
+		}
+		BasePreferenceScope other = (BasePreferenceScope) obj;
+		return context.equals(other.context);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#hashCode()
+	 */
+	@Override
+	public int hashCode() {
+		return super.hashCode() + context.getName().hashCode();
+	}
+}

Property changes on: tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 557)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 558)
@@ -48,6 +48,7 @@
 
 /**
  * The Class Project.
+ * TODO: remove this class, to be replace with the usage of a IProject
  */
 public class Project extends TxmObject {
 
Index: tmp/org.txm.core/src/java/org/txm/objects/Base.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Base.java	(revision 557)
+++ tmp/org.txm.core/src/java/org/txm/objects/Base.java	(revision 558)
@@ -68,6 +68,8 @@
 	BaseParameters params;
 
 	private HashMap<String, Alignement> links = new HashMap<String, Alignement>();
+
+	private BasePreferenceScope scope;
 	
 	public String toString() { return params.name;};
 	
@@ -88,7 +90,13 @@
 		if (!name.equals(name.toUpperCase())) {
 			System.out.println("Warning in Base.init: binary corpus name contains lower case letters: "+this.name);
 		}
+		
+		this.scope = new BasePreferenceScope(this);
 	}
+	
+	public BasePreferenceScope getPreferenceScope() {
+		return scope;
+	}
 
 	/**
 	 * Gets the project.
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/DiagnosticEditor.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/DiagnosticEditor.java	(revision 557)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/DiagnosticEditor.java	(revision 558)
@@ -30,7 +30,6 @@
 			this.diag = (Diagnostic) getResultData();
 	}
 	
-	
 	@Override
 	public void createPartControl(Composite parent) {
 		super.createPartControl(parent);
@@ -51,12 +50,10 @@
 		
 		browser = new Browser(displayArea, SWT.NONE);
 		browser.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
-		
 	}
 	
 	@Override
 	public void refresh(boolean update) {
-		super.refresh();
 		File file = diag.getHTMLFile();
 		if (file.exists()) {
 			browser.setUrl(file.getAbsolutePath());
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 557)
+++ tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java	(revision 558)
@@ -61,6 +61,15 @@
 		// FIXME: Debug
 		System.err.println("ChartResult.compute(): computing result of type " + this.getClass() + "...");
 
+		// TODO uncomment this
+//		if (!this.isDirtyFromHistory()) {
+//
+//			// FIXME: Debug
+//			System.err.println("TXMResult.compute(): result parameters have not changed computing skipped.");
+//
+//			return true;
+//		}
+		
 		if(!this.isDirty())	{
 			
 			// FIXME: Debug
@@ -70,16 +79,18 @@
 		}
 		else	{
 		
-			if(!hasBeenConstructorCalled())	{
-				return false;
-			}
-	
 			if (!canCompute()) {
 				// FIXME: Debug
 				System.err.println("ChartResult.compute(): missing or wrong parameters, computing aborted.");
 	
 				return false;
 			}
+			
+//			// TODO THIS IS FUCKING LAZY LINE CODES OH YEAH YOU MAD BRO
+			// TODO where do we put this parent compute ? :o
+			//		if (parent != null && !parent.getHasBeenComputedOnce()) { // parent must be computed at least one time
+			//			this.parent.compute(update, monitor);
+			//		}
 	
 			if (!_compute(update)) {
 				
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 557)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java	(revision 558)
@@ -109,7 +109,6 @@
 	
 	protected int pMaxScore;
 	
-	
 	/**
 	 * Specificities.
 	 *
@@ -123,15 +122,12 @@
 		this.lexicalTable = lexicalTable;
 		this.pMaxScore = maxScore;
 	}
-
-
-
 	
 	@Override
 	protected boolean _compute(boolean update) throws Exception {
 		
 		// compute the lexical table
-		lexicalTable.compute(update);
+		parent.compute(update);
 		
 		if (lexicalTable.getNColumns() < 2) {
 			Log.severe(SpecificitiesCoreMessages.ComputeError_NEED_AT_LEAST_2_PARTS);
