Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java	(revision 616)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/preferences/IndexPreferencesPage.java	(revision 617)
@@ -19,6 +19,6 @@
 
 	@Override
 	protected void createFieldEditors() {
-		this.addField(new IntegerFieldEditor(IndexPreferences.NLINESPERPAGE, "Number of lines per result page", this.getFieldEditorParent()));
+		this.addField(new IntegerFieldEditor(IndexPreferences.N_LINES_PER_PAGE, "Number of lines per result page", this.getFieldEditorParent()));
 	}
 }
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 616)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java	(revision 617)
@@ -753,25 +753,25 @@
 		if (index.getFilterFmin() != null) {
 			this.fMinSpinner.setSelection(index.getFilterFmin());
 		} else {
-			this.fMinSpinner.setSelection(this.getIntParameterValue(IndexPreferences.FMIN_FILTER));
+			this.fMinSpinner.setSelection(this.getIntParameterValue(IndexPreferences.F_MIN));
 		}
 
 		if (index.getFilterFmax() != null) {
 			this.fMaxSpinner.setSelection(index.getFilterFmax());
 		} else {
-			this.fMaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.FMAX_FILTER));
+			this.fMaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.F_MAX));
 		}
 
 		if (index.getFilterVmax() != null) {
 			this.vMaxSpinner.setSelection(index.getFilterVmax());
 		} else {
-			this.vMaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.VMAX_FILTER));
+			this.vMaxSpinner.setSelection(this.getIntParameterValue(IndexPreferences.V_MAX));
 		}
 
 		if (index.getNLinesPerPage() != null) {
 			this.nLinesPerPageSpinner.setSelection(index.getNLinesPerPage());
 		} else {
-			this.nLinesPerPageSpinner.setSelection(this.getIntParameterValue(IndexPreferences.NLINESPERPAGE));
+			this.nLinesPerPageSpinner.setSelection(this.getIntParameterValue(IndexPreferences.N_LINES_PER_PAGE));
 		}
 
 		queryWidget.setFocus();
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 616)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 617)
@@ -54,8 +54,6 @@
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.CorpusManager;
-import org.txm.searchengine.cqp.corpus.Part;
-import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
@@ -72,13 +70,6 @@
 	/** The corpus. */
 	Corpus corpus;
 	
-	/** The partition. */
-	Partition partition;
-	
-	/** The maxvalue. */
-	@Parameter(key=CQPPreferences.MAXVALUE)
-	Integer pMaxValue;
-	
 	// Numbers
 	/** The T. */
 	int T = 0; // number of word
@@ -126,6 +117,13 @@
 
 	private File diagfile;
 
+	
+	/** The maxvalue. */
+	@Parameter(key=CQPPreferences.MAXVALUE)
+	Integer pMaxValue;
+	
+	
+	
 	/**
 	 * Instantiates a new diagnostic.
 	 *
@@ -641,13 +639,11 @@
 		this.worked(1);
 		
 		String txmhome = TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE);
-		String filename = corpus.getParent().getName()+"-"+corpus.getName(); //$NON-NLS-1$
+		String filename = corpus.getParent().getName() + "-" + corpus.getName(); //$NON-NLS-1$
 		filename = AsciiUtils.buildId(filename);
 		diagfile = new File(txmhome, "results/" + filename + "-infos.html"); //$NON-NLS-1$ //$NON-NLS-2$
 		
 		this.toHTML(diagfile);
-		
-		dirty = false;
 		return true;
 	}
 	
@@ -673,10 +669,11 @@
 		// nothing to do
 		return true;
 	}
+
 	
 	@Override
 	public boolean saveParameters() {
-		if (pMaxValue != null) this.saveParameter(CQPPreferences.MAXVALUE, pMaxValue);
+		// nothing to do
 		return true;
 	}
 }
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 616)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 617)
@@ -199,7 +199,7 @@
 		for (int i = 0; i < partition.getNPart(); i++) {
 			Lexicon l = new Lexicon(partition.getParts().get(i));
 			l.setProperty(this.pProperty);
-			l.compute(null);
+			l.compute(this.monitor);
 			lexicons.add(l);
 		}
 		//System.out.println("time lexicon build "+(System.currentTimeMillis()-time));
@@ -207,7 +207,7 @@
 		// String[] entries = allLexiconEntry.toArray(new String[]{});
 		Lexicon ll = new Lexicon(partition.getCorpus());
 		ll.setProperty(this.pProperty);
-		ll.compute(null);
+		ll.compute(this.monitor);
 
 		ArrayList<String> filteredForms = new ArrayList<String>();
 		//create a copy and filter line with Fmin;
@@ -360,10 +360,10 @@
 			Corpus parentCorpus = subcorpus.getMotherCorpus();
 			Lexicon l1 = new Lexicon(parentCorpus);
 			l1.setProperty(pProperty);
-			l1.compute(null);
+			l1.compute(this.monitor);
 			Lexicon l2 = new Lexicon(subcorpus);
 			l2.setProperty(pProperty);
-			l2.compute(null);
+			l2.compute(this.monitor);
 			this.statsData = new LexicalTableImpl(getNextName(), l1, l2);
 		}
 		else if (this.parent instanceof Partition) {
@@ -413,8 +413,12 @@
 		return true;
 	}
 
+	/**
+	 * 
+	 * @return
+	 */
 	protected static String getNextName() {
-		return SYMBOL_BASE+(LEXICALTABLE_COUNTER++);
+		return SYMBOL_BASE + (LEXICALTABLE_COUNTER++);
 	}
 	
 	@Override
@@ -480,6 +484,10 @@
 		return "";
 	}
 
+	/**
+	 * Gets the columns count.
+	 * @return
+	 */
 	public int getNColumns() {
 		return statsData.getNColumns();
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/TXMResultDebugView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/TXMResultDebugView.java	(revision 616)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/cmdparameters/TXMResultDebugView.java	(revision 617)
@@ -30,8 +30,8 @@
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.part.ViewPart;
 import org.txm.chartsengine.core.results.ChartResult;
 import org.txm.core.results.TXMResult;
@@ -48,7 +48,7 @@
 public class TXMResultDebugView extends ViewPart implements ISelectionChangedListener {
 
 	
-	protected Label currentEditorLabel;
+	protected StyledText displayArea;
 
 	/**
 	 * Creates the view.
@@ -64,7 +64,7 @@
 
 	@Override
 	public void createPartControl(Composite parent) {
-		currentEditorLabel = new Label(parent, SWT.NONE);
+		displayArea = new StyledText (parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
 	}
 
 	@Override
@@ -87,37 +87,31 @@
 			buffer.append("Simple name: " + result.getSimpleName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buffer.append("Name: " + result.getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buffer.append("Valid filename: " + result.getValidFileName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
-			buffer.append("Details:" + result.getDetails() + "\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			buffer.append("Empty name: " + result.getEmptyName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			buffer.append("Details: " + result.getDetails() + "\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
 
-			// FIXME: Debug:
-			buffer.append("selected object = " + result + ", visible = " + result.isVisible());
+			// Command preferences
+			buffer.append("\n");
+			buffer.append(result.dumpPreferences());
+			buffer.append("\n");
+			
+			// Object parameters
+			buffer.append(result.dumpParameters());
+
+			// Hierarchy
+			buffer.append("\n");
+			buffer.append("Selected object = " + result + "\n");
+			buffer.append("Node visible = " + result.isVisible() + "\n");
 			if (result instanceof ChartResult) 	{
-				buffer.append("chart object = " + ((ChartResult)result).getChart() + ", chart type = " + ((ChartResult)result).getChartType());
+				buffer.append("Chart object = " + ((ChartResult)result).getChart() + ", chart type = " + ((ChartResult)result).getChartType() + "\n");
 			}
-			buffer.append("selection full path name = " + result.getFullPathSimpleName() + " - " + result.getName());
-			buffer.append("direct children count = " + result.getResults().size()
-					+ ", direct visible children count = " + result.getChildren(true).size() + ", children count = " + result.getDeepChildren().size());
-			buffer.append("root parent = " + result.getRootParent() + ", main corpus parent = " + Corpus.getParentMainCorpus(result) + ", first parent corpus = " + Corpus.getFirstParentCorpus(result));
+			buffer.append("Selection full path name = " + result.getFullPathSimpleName() + " - " + result.getName() + "\n");
+			buffer.append("Direct children count = " + result.getResults().size() + ", direct visible children count = " + result.getChildren(true).size() + ", children count = " + result.getDeepChildren().size());
+			buffer.append("Root parent = " + result.getRootParent() + ", main corpus parent = " + Corpus.getParentMainCorpus(result) + ", first parent corpus = " + Corpus.getFirstParentCorpus(result));
 
 			
-			try {
-				// Command preferences
-				buffer.append("\n");
-				buffer.append("\n");
-				buffer.append(result.dumpPreferences());
-				buffer.append("\n");
-				
-				// Object parameters
-				buffer.append(result.dumpParameters());
-				
-				
-			}
-			catch(Exception e) {
-				System.out.println("Error: "+e.getLocalizedMessage());
-			}
+			displayArea.setText(buffer.toString());
 			
-			currentEditorLabel.setText(buffer.toString());
-			
 		}
 		
 	}
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 616)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 617)
@@ -41,11 +41,15 @@
 	 * Unique ID of the object built with : class + date + number
 	 */
 	protected String uniqueID;
-	protected String path;
-	public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYYYMMDD");
+	//protected String path;
+	public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYMMDD");
 	/** Editor can use this to test if the result need to be saved */
 	protected boolean hasBeenComputedOnce = false;
 
+	public static final Pattern fileNamePattern = Pattern.compile("[^a-zA-Z0-9\\.-]+"); //$NON-NLS-1$
+	public static final String UNDERSCORE = "_";
+
+	
 	/**
 	 * The weight, essentially used for sorting purpose.
 	 */
@@ -304,11 +308,12 @@
 
 		StringBuilder str = new StringBuilder();
 
-		str.append("Command preferences\n"); //$NON-NLS-1$
-		str.append(TXMPreferences.getKeysAndValues(TXMPreferences.scope, this.preferencesNodeQualifier));
-		str.append("\nDefault preferences\n"); //$NON-NLS-1$
+		str.append("Default command preferences\n"); //$NON-NLS-1$
 		str.append(TXMPreferences.getKeysAndValues(DefaultScope.INSTANCE, this.preferencesNodeQualifier));
 
+		str.append("\nCommand preferences\n"); //$NON-NLS-1$
+		str.append(TXMPreferences.getKeysAndValues(TXMPreferences.scope, this.preferencesNodeQualifier));
+
 		return str.toString();
 	}
 	
@@ -333,12 +338,7 @@
 
 		str.append("Parameters (type = " + parametersType + " / " + Parameter.types[parametersType] + ")\n"); //$NON-NLS-1$
 
-		List<Field> fields = new ArrayList<Field>();
-		Class<?> clazz = this.getClass();
-		while (clazz != Object.class) {
-			fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
-			clazz = clazz.getSuperclass();
-		}
+		List<Field> fields = this.getAllFields();
 
 		for (Field f : fields) {
 			Parameter parameter = f.getAnnotation(Parameter.class);
@@ -1211,14 +1211,6 @@
 	 */
 	public abstract String getDetails();
 
-	// /**
-	// * Gets some details of the result to compute. Shown in progress dialogs.
-	// *
-	// * @return the message to show
-	// */
-	// public abstract String getComputingMessage();
-
-
 	/**
 	 * Convenience method to get a shared name when the result is empty (not yet computed).
 	 * @return the String "*"
@@ -1236,8 +1228,6 @@
 		return this.uniqueID;
 	}
 
-	public static final Pattern filenamePattern = Pattern.compile("[^a-zA-Z0-9\\._-]+"); //$NON-NLS-1$
-	public static final String UNDERSCORE = "_";
 	/**
 	 * Gets a string representing the result and that can be used as a file
 	 * name.
@@ -1247,7 +1237,7 @@
 	// FIXME: to discuss and/or to move in export layer
 	public String getValidFileName() {
 		try {
-			return filenamePattern.matcher(this.getName()).replaceAll(UNDERSCORE); //$NON-NLS-1$
+			 fileNamePattern.matcher(this.getName()).replaceAll(UNDERSCORE); //$NON-NLS-1$
 		} catch (Exception e) {
 		}
 		return "";
Index: tmp/org.txm.lexicon.core/src/org/txm/lexicon/core/corpusengine/cqp/Lexicon.java
===================================================================
--- tmp/org.txm.lexicon.core/src/org/txm/lexicon/core/corpusengine/cqp/Lexicon.java	(revision 616)
+++ tmp/org.txm.lexicon.core/src/org/txm/lexicon/core/corpusengine/cqp/Lexicon.java	(revision 617)
@@ -34,7 +34,6 @@
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
-import java.util.HashSet;
 import java.util.Map;
 
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -63,7 +62,7 @@
  * {@link Subcorpus}) and a {@link Property}.
  * @author sloiseau
  */
-public class Lexicon {
+public class Lexicon extends TXMResult {
 
 	/** The nolex. */
 	protected static int nolex = 1;
@@ -122,47 +121,49 @@
 //	}
 
 	public Lexicon(Corpus corpus) {
+		super(corpus);
 		this.corpus = corpus;
 	}
 
-	/**
-	 * Convert the Lexicon into a Vector object.
-	 *
-	 * @return the vector
-	 * @throws StatException the stat exception
-	 */
-	public Vector asVector() throws StatException {
-		String symbol = prefixR + (nolex++);
-		VectorImpl v = new VectorImpl(freqs, symbol);
-		v.setRNames(getForms());
-		this.symbol = v.getSymbol();
-		return v;
+	
+	@Override
+	public boolean saveParameters() throws Exception {
+		// TODO Auto-generated method stub
+		return true;
 	}
 
-	public boolean compute(IProgressMonitor monitor) throws Exception {
+	@Override
+	public boolean loadParameters() throws Exception {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	@Override
+	public void clean() {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public boolean canCompute() throws Exception {
+		return corpus != null && pProperty != null;
+	}
+
+	@Override
+	protected boolean _compute() throws Exception {
 		if (corpus instanceof MainCorpus) {
 			return computeWithMainCorpus((MainCorpus)corpus, pProperty, monitor);
-		} else if (corpus instanceof Subcorpus) {
+		}
+		else if (corpus instanceof Subcorpus) {
 			return computewithSubCorpus((Subcorpus)corpus, pProperty, monitor);
-		} else {
-			System.out.println("Error: Lexicon parent is nor a Maincorpus nor a Subcorpus.");
+		}
+		else {
+			System.out.println("Error: Lexicon parent is neither a Maincorpus nor a Subcorpus.");
 			return false;
 		}
 	}
-
+	
 	/**
-	 * Compute number of tokens. / this.nbr
-	 */
-	private void computeNumberOfTokens() {
-		numberOfTokens = 0;
-		for (int i = 0; i < freqs.length; i++) {
-			numberOfTokens += freqs[i];
-			// System.out.println(numberOfTokens);
-			// if (freqs[i] != 1) System.out.println(freqs[i]);
-		}
-	}
-
-	/**
 	 * Gets the lexicon relative to a given property.
 	 * 
 	 * @param property
@@ -176,12 +177,11 @@
 	protected boolean computeWithMainCorpus(MainCorpus corpus, Property property, IProgressMonitor monitor) throws CqiClientException {
 		// System.out.println("in "+this.getCqpId()+" look for cached lexicon "+property);
 		// System.out.println("not found");
-		if (monitor != null) monitor.subTask("Computing lexicon size...");
+		this.subTask("Computing lexicon size...");
 		Log.finest(TXMCoreMessages.LEXICON + corpus.getName());
 		int lexiconSize;
 		try {
-			lexiconSize = CorpusManager.getCorpusManager().getCqiClient()
-					.lexiconSize(property.getQualifiedName());
+			lexiconSize = CorpusManager.getCorpusManager().getCqiClient().lexiconSize(property.getQualifiedName());
 		} catch (Exception e) {
 			throw new CqiClientException(e);
 		}
@@ -193,9 +193,8 @@
 
 		int[] freqs;
 		try {
-			if (monitor != null) monitor.subTask("Computing lexicon frequencies...");
-			freqs = CorpusManager.getCorpusManager().getCqiClient().id2Freq(
-					property.getQualifiedName(), ids);
+			this.subTask("Computing lexicon frequencies...");
+			freqs = CorpusManager.getCorpusManager().getCqiClient().id2Freq(property.getQualifiedName(), ids);
 		} catch (Exception e) {
 			throw new CqiClientException(e);
 		}
@@ -204,6 +203,14 @@
 		return true;
 	}
 
+	/**
+	 * 
+	 * @param corpus
+	 * @param property
+	 * @param monitor
+	 * @return
+	 * @throws CqiClientException
+	 */
 	protected boolean computewithSubCorpus(Subcorpus corpus, Property property, IProgressMonitor monitor) throws CqiClientException {
 
 		//System.out.println("not found");
@@ -212,7 +219,7 @@
 		int[][] fdist = null;
 		Subcorpus tmp = null;
 		try {
-			if (monitor != null) monitor.subTask("Computing lexicon frequencies...");
+			this.subTask("Computing lexicon frequencies...");
 			tmp = corpus.createSubcorpus(new Query("[]"), "S"+corpus.getNextSubcorpusCounter(), true); //$NON-NLS-1$
 			if (tmp != null) {
 				fdist = CorpusManager.getCorpusManager().getCqiClient().fdist1(
@@ -242,9 +249,42 @@
 		init(corpus, property, freqs, ids);
 		return true;
 	}
+	
+	
+	/**
+	 * Convert the Lexicon into a Vector object.
+	 *
+	 * @return the vector
+	 * @throws StatException the stat exception
+	 */
+	public Vector asVector() throws StatException {
+		String symbol = prefixR + (nolex++);
+		VectorImpl v = new VectorImpl(freqs, symbol);
+		v.setRNames(getForms());
+		this.symbol = v.getSymbol();
+		return v;
+	}
 
+
+	/**
+	 * Compute number of tokens. / this.nbr
+	 */
+	private void computeNumberOfTokens() {
+		numberOfTokens = 0;
+		for (int i = 0; i < freqs.length; i++) {
+			numberOfTokens += freqs[i];
+			// System.out.println(numberOfTokens);
+			// if (freqs[i] != 1) System.out.println(freqs[i]);
+		}
+	}
+
+
+
+	@Override
 	public boolean delete() {
-		if (corpus != null) corpus.removeData(this);
+		if (corpus != null) {
+			corpus.removeData(this);
+		}
 		return true;
 	}
 
@@ -269,14 +309,15 @@
 	 */
 	@Override
 	public boolean equals(Object obj) {
-		if (!(obj instanceof Lexicon))
+		if (!(obj instanceof Lexicon)) {
 			return false;
+		}
 		Lexicon other = (Lexicon) obj;
 
-		if (other.nbrOfType() != this.nbrOfType())
+		if (other.nbrOfType() != this.nbrOfType()) {
 			return false;
-		return (Arrays.equals(freqs, other.getFreq()) && Arrays.equals(
-				getForms(), other.getForms()));
+		}
+		return (Arrays.equals(freqs, other.getFreq()) && Arrays.equals(getForms(), other.getForms()));
 	}
 
 	/**
@@ -289,24 +330,7 @@
 	}
 
 	public String getDetails() {
-		//FIXME: the hierarchy of Lexicon and Index should be redefined
-		// Index should not store a Lexicon?
-		// + Lexicon should extend Index?
-		//		try {
-		//			Object[] params = new Object[]{this.corpus.getSimpleName(),index.getQuery().getQueryString(), index.getProperties(), index.getFmin(), index.getFmax()}; 
-		//			String str;
-		//			if(this.parent instanceof Partition)	{
-		//				str = LexiconCoreMessages.DetailsFromPartition;
-		//			}
-		//			else	{
-		//				str = LexiconCoreMessages.DetailsFromCorpus;
-		//			}
-		//			return NLS.bind(str, params);
-		//		}
-		//		catch(Exception e) {
-		//			return "";
-		//		}
-		return  this.corpus.getName()+" "+this.pProperty.getName();
+		return  this.corpus.getName() + " " + this.pProperty.getName(); //$NON-NLS-1$
 	}
 
 	//TODO: move this into a Lexicon chart renderer
@@ -337,11 +361,11 @@
 	 */
 	public String[] getForms() {
 		if (forms == null) {
-			if(ids == null)
+			if(ids == null) {
 				return new String[0];
+			}
 			try {
-				forms = CorpusManager.getCorpusManager().getCqiClient().id2Str(
-						pProperty.getQualifiedName(), ids);
+				forms = CorpusManager.getCorpusManager().getCqiClient().id2Str(pProperty.getQualifiedName(), ids);
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
 				org.txm.utils.logger.Log.printStackTrace(e);
@@ -363,12 +387,12 @@
 		if (forms == null) {
 			try {
 				number = Math.min(number, ids.length);
-				if (number <= 0)
+				if (number <= 0) {
 					return new String[0];
+				}
 				int[] subpositions = new int[number];
 				System.arraycopy(ids, 0, subpositions, 0, number);
-				return CorpusManager.getCorpusManager().getCqiClient().id2Str(
-						pProperty.getQualifiedName(), subpositions);
+				return CorpusManager.getCorpusManager().getCqiClient().id2Str(pProperty.getQualifiedName(), subpositions);
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
 				org.txm.utils.logger.Log.printStackTrace(e);
@@ -376,8 +400,9 @@
 			}
 		} else {
 			number = Math.min(number, ids.length);
-			if (number <= 0)
+			if (number <= 0) {
 				return new String[0];
+			}
 			String[] subforms = new String[number];
 			System.arraycopy(ids, 0, subforms, 0, number);
 			return subforms;
@@ -408,7 +433,7 @@
 		}
 		catch(Exception e) {
 		}
-		return "";
+		return ""; //$NON-NLS-1$
 	}
 
 	/**
@@ -434,8 +459,7 @@
 	 *
 	 * @return the symbol
 	 */
-	public String getSymbol()
-	{
+	public String getSymbol() {
 		return this.symbol;
 	}
 
@@ -474,8 +498,9 @@
 	 * {@link Subcorpus#getLexicon(Property)}.
 	 */
 	protected void init(TXMResult corpus, Property property, int[] freq, int[] ids) {
-		if (freq.length != ids.length)
+		if (freq.length != ids.length) {
 			throw new IllegalArgumentException(LexiconCoreMessages.Lexicon_0);
+		}
 		this.freqs = freq;
 		this.ids = ids;
 		this.forms = null;
@@ -490,8 +515,9 @@
 	 * @return the size of the corpus or subcorpus.
 	 */
 	public int nbrOfToken() {
-		if (numberOfTokens <= 0)
+		if (numberOfTokens <= 0) {
 			computeNumberOfTokens();
+		}
 		return numberOfTokens;
 	}
 
@@ -509,6 +535,7 @@
 		this.pProperty = property;
 	}
 
+	@Override
 	public boolean setParameters(TXMParameters parameters) {
 		try {
 			Property p = (Property) parameters.get("properties");
@@ -570,11 +597,9 @@
 		return true;
 	}
 
-	public boolean validateParameters() {
-		return corpus != null && pProperty != null;
-	}
-
 	public void setProperty(Property property) {
 		this.pProperty = property;
 	}
+
+
 }
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 616)
+++ tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java	(revision 617)
@@ -103,19 +103,6 @@
 	/** The nlines. */
 	int nlines;
 
-	/** The hierarchic sort. */
-	@Parameter(key=ReferencerPreferences.SORTBYFREQ)
-	private boolean pHierarchicSort;
-	@Parameter
-	List<StructuralUnitProperty> pPattern;
-	/** The prop. */
-	@Parameter
-	Property pProperty;
-
-	/** The query. */
-	@Parameter
-	Query pQuery;
-
 	/** The processed idx. */
 	HashMap<Integer, Line> processedIdx;
 
@@ -127,7 +114,30 @@
 
 	/** The writer. */
 	private BufferedWriter writer;
-
+
+	
+	
+	
+	
+	/** The hierarchic sort. */
+	@Parameter(key=ReferencerPreferences.SORT_BY_FREQ)
+	private boolean pHierarchicSort;
+	
+	@Parameter
+	List<StructuralUnitProperty> pPattern;
+	
+	/** The prop. */
+	@Parameter
+	Property pProperty;
+
+	/** The query. */
+	@Parameter
+	Query pQuery;
+
+	
+	
+	
+	
 	/**
 	 * Instantiates a new referencer.
 	 *
@@ -216,7 +226,6 @@
 				return false;
 		}
 		catch(CqiClientException e) {
-			// TODO Auto-generated catch block
 			e.printStackTrace();
 			return false;
 		}
@@ -323,7 +332,7 @@
 	 * @return the name
 	 */
 	public String getName() {
-		return getCorpus().getName()+": "+pQuery; //$NON-NLS-1$
+		return getCorpus().getName() + ": " + pQuery; //$NON-NLS-1$
 	}
 
 	/**
@@ -402,8 +411,12 @@
 
 	@Override
 	public String getSimpleName() {
-		if (pQuery != null) return pQuery.toString();
-		else return getName();
+		if (pQuery != null) {
+			return pQuery.toString();
+		}
+		else {
+			return getName();
+		}
 	}
 
 	/**
@@ -416,7 +429,9 @@
 	}
 
 	public int getV() {
-		if (matches == null) return 0;
+		if (matches == null) {
+			return 0;
+		}
 		return matches.size();
 	}
 
@@ -553,8 +568,6 @@
 
 		s = this.getStringParameterValue(ReferencerPreferences.PROPERTY);
 		this.pProperty = getCorpus().getProperty(s);
-
-		//this.pHierarchicSort = this.getBooleanParameterValue(ReferencerPreferences.SORTBYFREQ);
 		return true;
 	}
 
Index: tmp/org.txm.referencer.core/src/org/txm/functions/referencer/ReferencerPreferences.java
===================================================================
--- tmp/org.txm.referencer.core/src/org/txm/functions/referencer/ReferencerPreferences.java	(revision 616)
+++ tmp/org.txm.referencer.core/src/org/txm/functions/referencer/ReferencerPreferences.java	(revision 617)
@@ -11,7 +11,7 @@
 
 	/** The Constant SORTBYFREQ. */
 	//FIXME: to extract to referencer plug-in
-	public static final String SORTBYFREQ = "sorttype"; //$NON-NLS-1$
+	public static final String SORT_BY_FREQ = "sorttype"; //$NON-NLS-1$
 
 	public static final String QUERY = "query"; //$NON-NLS-1$
 	public static final String PROPERTY = "property"; //$NON-NLS-1$
@@ -21,7 +21,7 @@
 	public void initializeDefaultPreferences() {
 		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
 
-		preferences.putBoolean(SORTBYFREQ, false); //$NON-NLS-1$
+		preferences.putBoolean(SORT_BY_FREQ, false); //$NON-NLS-1$
 
 		preferences.put(QUERY, ""); //$NON-NLS-1$
 		preferences.put(PROPERTY, "word"); //$NON-NLS-1$
Index: tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 616)
+++ tmp/org.txm.index.core/src/org/txm/index/core/preferences/IndexPreferences.java	(revision 617)
@@ -18,13 +18,13 @@
 	
 	public static final String PROPERTIES = "properties"; //$NON-NLS-1$
 	public static final String QUERY = "query"; //$NON-NLS-1$
-	public static final String FMIN_FILTER = "fmin"; //$NON-NLS-1$
-	public static final String FMAX_FILTER = "fmax"; //$NON-NLS-1$
-	public static final String VMAX_FILTER = "vmax"; //$NON-NLS-1$
-	public static final String NLINESPERPAGE = "nlines"; //$NON-NLS-1$
+	public static final String F_MIN = "fmin"; //$NON-NLS-1$
+	public static final String F_MAX = "fmax"; //$NON-NLS-1$
+	public static final String V_MAX = "vmax"; //$NON-NLS-1$
+	public static final String N_LINES_PER_PAGE = "nlines"; //$NON-NLS-1$
 	public static final String PROPERTIES_SEPARATOR = "properties_separator"; //$NON-NLS-1$
 
-	public static final String NTOPINDEX = "n_top_index";
+	public static final String N_TOP_INDEX = "n_top_index";
 
 	@Override
 	public void initializeDefaultPreferences() {
@@ -33,10 +33,10 @@
 		preferences.put(PROPERTIES, "word"); //$NON-NLS-1$
 		preferences.put(PROPERTIES_SEPARATOR, "_"); //$NON-NLS-1$
 		preferences.put(QUERY, ""); //$NON-NLS-1$
-		preferences.putInt(FMIN_FILTER, 1);
-		preferences.putInt(FMAX_FILTER, Integer.MAX_VALUE);
-		preferences.putInt(VMAX_FILTER, Integer.MAX_VALUE);
-		preferences.putInt(NLINESPERPAGE, 100);
+		preferences.putInt(F_MIN, 1);
+		preferences.putInt(F_MAX, Integer.MAX_VALUE);
+		preferences.putInt(V_MAX, Integer.MAX_VALUE);
+		preferences.putInt(N_LINES_PER_PAGE, 100);
 
 		// FIXME: shared charts rendering preferences
 		//ChartsEnginePreferences.initializeChartsEngineSharedPreferences(preferences);
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 616)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 617)
@@ -95,75 +95,44 @@
 	/** The partnames. The corpus name if built with a Corpus or the parts names if built with a Partition */
 	protected List<String> partnames = new ArrayList<String>();
 	
+	/** The writer. */
+	private BufferedWriter writer;
+
+	
 	/** The fmax filter value parameter. */
-	@Parameter(key=IndexPreferences.FMAX_FILTER)
+	@Parameter(key=IndexPreferences.F_MAX)
 	protected Integer pFmaxFilter;
+	
 	/** The fmin filter value parameter. */
-	@Parameter(key=IndexPreferences.FMIN_FILTER)
+	@Parameter(key=IndexPreferences.F_MIN)
 	protected Integer pFminFilter;
+	
 	/**	The number of lines shown per page parameter */
-	@Parameter(key=IndexPreferences.NLINESPERPAGE)
+	@Parameter(key=IndexPreferences.N_LINES_PER_PAGE)
 	protected Integer pNLinesPerPage;
+	
 	/** The word properties shown. */
 	@Parameter
 	protected List<Property> pProperties;
+	
 	/** The string used to separated property values. */
 	@Parameter(key=IndexPreferences.PROPERTIES_SEPARATOR)
 	protected String pPropertiesSeparator; // the separator of properties values //$NON-NLS-1$
+	
 	/** The CQP query. */
 	@Parameter
 	protected Query pQuery;
+	
 	/** The line index of the current index page. */
-	@Parameter(key=IndexPreferences.NTOPINDEX)
+	@Parameter(key=IndexPreferences.N_TOP_INDEX)
 	private Integer pTopIndex;
+	
 	/** The vmax filter value parameter. */
-	@Parameter(key=IndexPreferences.VMAX_FILTER)
+	@Parameter(key=IndexPreferences.V_MAX)
 	protected Integer pVmaxFilter;
 	
-	/** The writer. */
-	private BufferedWriter writer;
 
 	/**
-	 * Create a CQL query using an Index lines
-	 *
-	 * @param selection the selection
-	 * @return the query
-	 */
-	public static String createQuery(List<Line> lines) {
-		String query = ""; //$NON-NLS-1$
-		if (lines.size() == 0) return query;
-		
-		Line line = lines.get(0);
-		int nbToken = line.getUnitsProperties().get(0).size();
-		int nbProps = line.getProperties().size();
-		int nbLines = lines.size();
-		List<Property> props = line.getProperties();
-		for (int t = 0; t < nbToken; t++) {
-			query += "["; //$NON-NLS-1$
-			for (int p = 0; p < nbProps; p++) {
-				if (props.get(p) instanceof StructuralUnitProperty) {
-					query += "_."+((StructuralUnitProperty)props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
-				} else {
-					query += props.get(p) + "=\""; //$NON-NLS-1$
-				}
-				for (int l = 0; l < nbLines; l++) {
-					line = lines.get(l);
-					List<List<String>> values = line.getUnitsProperties();
-					String s = values.get(p).get(t);
-					s = Query.addBackSlash(s);
-					query += s + "|"; //$NON-NLS-1$
-				}
-				query = query.substring(0, query.length() - 1);
-				query += "\" & "; //$NON-NLS-1$
-			}
-			query = query.substring(0, query.length() - 3);
-			query += "] "; //$NON-NLS-1$
-		}
-		query = query.substring(0, query.length() - 1);
-		return query;
-	}
-
-	/**
 	 * compute a index, given a corpus, a query and analysis properties.
 	 *
 	 * @param corpus the corpus
@@ -187,6 +156,7 @@
 		super(partition);
 	}
 	
+
 	@Override
 	protected boolean _compute() throws Exception {
 		lines.clear();
@@ -228,7 +198,7 @@
 				getAllLines();
 
 			} else {
-				System.out.println("Error: Index parent is nor a Corpus nor a partition.");
+				System.out.println("Error: Index parent is neither a Corpus nor a partition.");
 				return false;
 			}
 		}
@@ -246,7 +216,52 @@
 		return true;
 	}
 	
+	
+	
 	/**
+	 * Create a CQL query using an Index lines
+	 *
+	 * @param selection the selection
+	 * @return the query
+	 */
+	public static String createQuery(List<Line> lines) {
+		String query = ""; //$NON-NLS-1$
+		if (lines.size() == 0) return query;
+		
+		Line line = lines.get(0);
+		int nbToken = line.getUnitsProperties().get(0).size();
+		int nbProps = line.getProperties().size();
+		int nbLines = lines.size();
+		List<Property> props = line.getProperties();
+		for (int t = 0; t < nbToken; t++) {
+			query += "["; //$NON-NLS-1$
+			for (int p = 0; p < nbProps; p++) {
+				if (props.get(p) instanceof StructuralUnitProperty) {
+					query += "_."+((StructuralUnitProperty)props.get(p)).getFullName() + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
+				} else {
+					query += props.get(p) + "=\""; //$NON-NLS-1$
+				}
+				for (int l = 0; l < nbLines; l++) {
+					line = lines.get(l);
+					List<List<String>> values = line.getUnitsProperties();
+					String s = values.get(p).get(t);
+					s = Query.addBackSlash(s);
+					query += s + "|"; //$NON-NLS-1$
+				}
+				query = query.substring(0, query.length() - 1);
+				query += "\" & "; //$NON-NLS-1$
+			}
+			query = query.substring(0, query.length() - 3);
+			query += "] "; //$NON-NLS-1$
+		}
+		query = query.substring(0, query.length() - 1);
+		return query;
+	}
+
+
+	
+	
+	/**
 	 * This method alter the index first column frequencies using a table stored in the R workspace
 	 * 
 	 * @param referenceCorpus the R table variable name
@@ -300,11 +315,11 @@
 	@Override
 	public boolean saveParameters() {
 		
-		if (pFmaxFilter != null) this.saveParameter(IndexPreferences.FMAX_FILTER, this.pFmaxFilter);
+		if (pFmaxFilter != null) this.saveParameter(IndexPreferences.F_MAX, this.pFmaxFilter);
 		
-		if (pFminFilter != null) this.saveParameter(IndexPreferences.FMIN_FILTER, this.pFminFilter);
+		if (pFminFilter != null) this.saveParameter(IndexPreferences.F_MIN, this.pFminFilter);
 		
-		if (pNLinesPerPage != null) this.saveParameter(IndexPreferences.NLINESPERPAGE, this.pNLinesPerPage);
+		if (pNLinesPerPage != null) this.saveParameter(IndexPreferences.N_LINES_PER_PAGE, this.pNLinesPerPage);
 		
 		if (pProperties != null) this.saveParameter(IndexPreferences.PROPERTIES, WordProperty.fromListToPreferenceString(pProperties));
 		
@@ -312,9 +327,9 @@
 		
 		if (pQuery != null) this.saveParameter(IndexPreferences.QUERY, this.pQuery.getQueryString());
 		
-		if (pTopIndex != null) this.saveParameter(IndexPreferences.NTOPINDEX, this.pTopIndex);
+		if (pTopIndex != null) this.saveParameter(IndexPreferences.N_TOP_INDEX, this.pTopIndex);
 		
-		if (pVmaxFilter != null) this.saveParameter(IndexPreferences.VMAX_FILTER, this.pVmaxFilter);
+		if (pVmaxFilter != null) this.saveParameter(IndexPreferences.V_MAX, this.pVmaxFilter);
 		
 		return true;
 	}
