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 741)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 742)
@@ -72,6 +72,7 @@
 	public final static String RESULT_UUID = "result_uuid"; //$NON-NLS-1$
 	public final static String PARENT_UUID = "parent_uuid"; //$NON-NLS-1$
 	public final static String BUNDLE_ID = "bundle_id"; //$NON-NLS-1$
+	public final static String NAME = "name"; //$NON-NLS-1$
 
 	// to shared strings in some preferences
 	/**
@@ -1064,12 +1065,14 @@
 	}
 
 	/**
-	 * Deletes the local node if exists.
+	 * Deletes the local node if exists and the associated .prefs persistence file.
 	 * @param result
 	 */
 	public static void delete(TXMResult result)	{
 		try {
 			System.err.println("TXMPreferences.delete(): Local preferences for object " + result.getUUID() + " deleted.");
+			scope.getNode(result.getUUID()).clear();
+			scope.getNode(result.getUUID()).flush();
 			scope.getNode(result.getUUID()).removeNode();
 		}
 		catch(BackingStoreException e) {
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 741)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 742)
@@ -61,7 +61,7 @@
 public abstract class TXMResult implements Cloneable, IProgressMonitor {
 
 
-	public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYYYMMDD");
+	public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYYYMMdd");
 	public static final Pattern FILE_NAME_PATTERN = Pattern.compile("[^a-zA-Z0-9\\.-]+"); //$NON-NLS-1$
 	public static final String UNDERSCORE = "_";
 
@@ -103,6 +103,11 @@
 	protected boolean visible;
 
 	/**
+	 * The user name. To rename a result but also to store the simple name for unserialization and lazy loading.
+	 */
+	protected String userName;
+	
+	/**
 	 * The command preferences node qualifier.
 	 */
 	protected String preferencesNodeQualifier;
@@ -194,9 +199,15 @@
 				Log.warning("Parent retrieved from UUID: " + retrievedParent + ".");
 				retrievedParent.addChild(this);
 			}
+			
+			// retrieving user name
+			if (!this.getStringParameterValue(TXMPreferences.NAME).isEmpty()) {
+				this.userName = this.getStringParameterValue(TXMPreferences.NAME);
+			}
 		}
 
 		
+		
 		// loads parameters from local result node, current command preferences or default command preferences
 		try {
 			this.autoLoadParametersFromAnnotations(); // auto fill from Parameter annotations
@@ -676,7 +687,7 @@
 	 */
 	public void saveParameter(String key, Object value)	{
 		// FIXME: debug
-		System.err.println("TXMResult.saveParameter(): saving parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ") to node.");
+		Log.info("TXMResult.saveParameter(): saving parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ") to node.");
 
 		TXMPreferences.putLocal(this, key, value);
 	}
@@ -694,6 +705,13 @@
 
 		// internal data to save for unserialization
 		this.saveParameter("class", this.getClass().getName());
+		// store the user name if exists otherwise the simple name
+		if(this.userName != null)	{
+			this.saveParameter(TXMPreferences.NAME, this.userName);
+		}
+		else	{
+			this.saveParameter(TXMPreferences.NAME, this.getSimpleName());
+		}
 		this.saveParameter(TXMPreferences.RESULT_UUID, this.uniqueID);
 		this.saveParameter(TXMPreferences.BUNDLE_ID, this.preferencesNodeQualifier);
 		if(this.parent != null)	{
@@ -870,7 +888,7 @@
 
 			// FIXME: debug
 			if(value != null)	{
-				System.err.println("TXMResult.setParameter(): setting parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ")");
+				Log.info("TXMResult.setParameter(): setting parameter " + key + " = " + value + " for " + this.getClass() + " (" + value.getClass() + ")");
 			}
 
 			targetField.set(this, value);
@@ -1028,7 +1046,7 @@
 	 * @param type
 	 * @return
 	 */
-	synchronized public ArrayList<TXMResult> getChildren(Class type) {
+	synchronized public ArrayList<? extends TXMResult> getChildren(Class type) {
 		return TXMResult.getNodes(this.children, type, false);
 	}
 
@@ -1043,6 +1061,22 @@
 	}
 
 	/**
+	 * Gets the first child result specified by their class.
+	 * @param type
+	 * @return the first child if exists otherwise null
+	 */
+	synchronized public TXMResult getFirstChild(Class type) {
+		 ArrayList<TXMResult> children = this.getChildren(type, false);
+		 try {
+			return children.get(0);
+		}
+		catch (Exception e) {
+			return null;
+		}
+	}
+
+	
+	/**
 	 * Gets the first child.
 	 * @param classSimpleName
 	 * @return
@@ -1171,6 +1205,7 @@
 		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.
@@ -1678,4 +1713,11 @@
 		Log.info(name);
 	}
 
+	/**
+	 * @return the userName
+	 */
+	public String getUserName() {
+		return userName;
+	}
+
 }
Index: tmp/org.txm.core/src/java/org/txm/core/messages/TXMCoreMessages.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/messages/TXMCoreMessages.java	(revision 741)
+++ tmp/org.txm.core/src/java/org/txm/core/messages/TXMCoreMessages.java	(revision 742)
@@ -107,7 +107,7 @@
 	public static String CwbProcess_3;
 	public static String CwbProcess_4;
 	public static String CwbProcess_5;
-	public static String DROP_PARTITION;
+	public static String info_deletingPartition;
 	public static String DROP_QUERYRESULT;
 	public static String DROP_SUBCORPUS;
 	public static String END_SUBCORPUS_SIZE;
Index: tmp/org.txm.core/src/java/org/txm/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/messages/messages_fr.properties	(revision 741)
+++ tmp/org.txm.core/src/java/org/txm/core/messages/messages_fr.properties	(revision 742)
@@ -3,6 +3,10 @@
 
 AbstractCqiClient_2 = Pas d'erreur à notifier.
 
+ApplicationWorkbenchAdvisor_13 = ** Échec de la création du dossier TXMHOME : {0}
+ApplicationWorkbenchAdvisor_39 = Dossier manquant dans le dossier d''installation de TXM : {0}
+ApplicationWorkbenchAdvisor_40 = ** Échec de la copie des fichiers TXM du dossier TXMINSTALL vers TXMHOME : {0}
+
 Base_0  = Dossier binaire 
 Base_22 = L'élément 'corpora' est absent de l'élément 'base'
 Base_3  = \ n'existe pas ?
@@ -70,7 +74,6 @@
 CwbProcess_4 = Processus arrêté : 
 CwbProcess_5 = ** Echec de localisation de CQP : 
 
-DROP_PARTITION   = Suppression de la partition {0}
 DROP_QUERYRESULT = Suppression du résultat de requête {0}
 DROP_SUBCORPUS   = Suppression du sous-corpus {0}
 
@@ -298,6 +301,4 @@
 
 error_error = ** Erreur : {0}.
 
-ApplicationWorkbenchAdvisor_13          = ** Échec de la création du dossier TXMHOME : {0}
-ApplicationWorkbenchAdvisor_39          = Dossier manquant dans le dossier d''installation de TXM : {0}
-ApplicationWorkbenchAdvisor_40          = ** Échec de la copie des fichiers TXM du dossier TXMINSTALL vers TXMHOME : {0}
+info_deletingPartition = Suppression de la partition {0}.
Index: tmp/org.txm.core/src/java/org/txm/core/messages/messages.properties
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/messages/messages.properties	(revision 741)
+++ tmp/org.txm.core/src/java/org/txm/core/messages/messages.properties	(revision 742)
@@ -3,11 +3,11 @@
 
 AbstractCqiClient_2 = No error.
 
-ApplicationWorkbenchAdvisor_13          = ** Could not create TXMHOME directory: {0}
+ApplicationWorkbenchAdvisor_13 = ** Could not create TXMHOME directory: {0}
 ApplicationWorkbenchAdvisor_14 = \ evaluating extension:
 ApplicationWorkbenchAdvisor_15 = Loading extensions...
-ApplicationWorkbenchAdvisor_39          = Missing folder in TXM install dir: {0}
-ApplicationWorkbenchAdvisor_40          = Failed to copy TXM files from TXMINSTALL DIR to TXMHOME: {0}
+ApplicationWorkbenchAdvisor_39 = Missing folder in TXM install dir: {0}
+ApplicationWorkbenchAdvisor_40 = Failed to copy TXM files from TXMINSTALL DIR to TXMHOME: {0}
 ApplicationWorkbenchAdvisor_6  = Exception:
 
 Base_0  = Binary directory 
@@ -77,7 +77,6 @@
 CwbProcess_4 = Process stoped: 
 CwbProcess_5 = ** Can't find CQP location : 
 
-DROP_PARTITION   = Deleting partition {0}
 DROP_QUERYRESULT = Deleting query results {0}
 DROP_SUBCORPUS   = Deleting subcorpus {0}
 
@@ -313,3 +312,5 @@
 common_units           = Units
 
 error_error = ** Error: {0}.
+
+info_deletingPartition = Deleting partition {0}.
Index: tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java
===================================================================
--- tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java	(revision 741)
+++ tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java	(revision 742)
@@ -38,7 +38,7 @@
 			index = new Index(corpus);
 			index.setLexiconMode(true);
 			try {
-				index.setQuery(new Query("[]"));
+				index.setQuery(new Query("[]")); //$NON-NLS-1$
 				index.setProperties(Arrays.asList(corpus.getWordProperty()));
 			} catch (CqiClientException e) {
 				// TODO Auto-generated catch block
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 741)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 742)
@@ -558,11 +558,14 @@
 				if (viewer.getTable().getSortColumn() != keywordColumn) {
 					viewer.getTable().setSortColumn(keywordColumn);
 					viewer.getTable().setSortDirection(SWT.UP);
-				} else if (viewer.getTable().getSortDirection() == SWT.UP) {
+				}
+				else if (viewer.getTable().getSortDirection() == SWT.UP) {
 					viewer.getTable().setSortDirection(SWT.DOWN);
 					comparator = new ReverseComparator(comparator);
-				} else
+				}
+				else {
 					viewer.getTable().setSortDirection(SWT.UP);
+				}
 				comparator.initialize(concordance.getCorpus());
 				currentComparator = comparator;
 				complexsorter.setKey(1);//set ref key
@@ -596,10 +599,12 @@
 
 				if (viewer.getTable().getSortColumn() != rightContextColumn) {
 					viewer.getTable().setSortColumn(rightContextColumn);
-				} else if (viewer.getTable().getSortDirection() == SWT.UP) {
+				}
+				else if (viewer.getTable().getSortDirection() == SWT.UP) {
 					viewer.getTable().setSortDirection(SWT.DOWN);
 					comparator = new ReverseComparator(comparator);
-				} else {
+				}
+				else {
 					viewer.getTable().setSortDirection(SWT.UP);
 				}
 				comparator.initialize(concordance.getCorpus());
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 741)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java	(revision 742)
@@ -559,8 +559,9 @@
 	public void dropAllPartitions() throws CqiClientException {
 		List<Partition> _partitions = new ArrayList<Partition>();
 		_partitions.addAll(partitions);
-		for (Partition partition : _partitions)
+		for (Partition partition : _partitions) {
 			this.dropPartition(partition);
+		}
 		_partitions = null;
 	}
 
@@ -572,8 +573,9 @@
 	 */
 	public void dropAllSubcorpora() throws CqiClientException {
 		//System.out.println("!! drop all subcorpora: "+subcorpora.size());
-		while(subcorpora.size() > 0)
+		while(subcorpora.size() > 0) {
 			this.dropSubcorpus(subcorpora.get(0));
+		}
 	}
 
 	/**
@@ -586,7 +588,7 @@
 	 *             the cqi client exception
 	 */
 	public void dropPartition(Partition partition) throws CqiClientException {
-		Log.finest(TXMCoreMessages.DROP_PARTITION + partition.getName());
+		Log.finest(TXMCoreMessages.info_deletingPartition + partition.getName());
 		for (Part part : partition.getParts())
 			try {
 				CorpusManager.getCorpusManager().getCqiClient().dropSubCorpus(part.getQualifiedCqpId());
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 741)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java	(revision 742)
@@ -197,60 +197,42 @@
 	 */
 	protected void _computeFromPartition(Partition partition) throws Exception {
 		
-		//long time = System.currentTimeMillis();
-		List<Lexicon> lexicons = new ArrayList<Lexicon>();
-		// Set<String> allLexiconEntry = new HashSet<String>();
+		// parts lexicons
+		List<Lexicon> partsLexicons = new ArrayList<Lexicon>();
 		for (int i = 0; i < partition.getNPart(); i++) {
-			Lexicon l = new Lexicon(partition.getParts().get(i));
-			l.setProperty(this.property);
-			l.compute(this.monitor);
-			lexicons.add(l);
+			partsLexicons.add(Lexicon.getLexicon(partition.getParts().get(i), this.property, this.monitor));
 		}
-		//System.out.println("time lexicon build "+(System.currentTimeMillis()-time));
-		//time = System.currentTimeMillis();
-		// String[] entries = allLexiconEntry.toArray(new String[]{});
-		Lexicon ll = new Lexicon(partition.getCorpus());
-		ll.setProperty(this.property);
-		ll.compute(this.monitor);
+		
+		// Corpus global lexicon
+		Lexicon corpusLexicon = Lexicon.getLexicon(partition.getCorpus(), this.property, this.monitor);
 
 		ArrayList<String> filteredForms = new ArrayList<String>();
 		//create a copy and filter line with Fmin;
-		for (int i = 0 ; i < ll.getFreq().length ; i++) {
-			if (ll.getFreq()[i] >= this.fMinFilter) {
-				filteredForms.add(ll.getForms()[i]);
+		for (int i = 0 ; i < corpusLexicon.getFreq().length ; i++) {
+			if (corpusLexicon.getFreq()[i] >= this.fMinFilter) {
+				filteredForms.add(corpusLexicon.getForms()[i]);
 			}
 		}
-		//System.out.println("remove freq too low "+(System.currentTimeMillis()-time));
-		//time = System.currentTimeMillis();
 		Map<String, Integer> entries2index = new HashMap<String, Integer>();
 		for (int i = 0; i < filteredForms.size(); i++) {
 			entries2index.put(filteredForms.get(i), i);
 		}
 
-		//System.out.println("entries2index "+(System.currentTimeMillis()-time));
-		//time = System.currentTimeMillis();
-		int[][] mat = new int[filteredForms.size()][lexicons.size()];//DoubleFactory2D.sparse.make(filteredForms.size(), lexicons.size(), 0);
+		int[][] mat = new int[filteredForms.size()][partsLexicons.size()];
 
 
 		Integer id = null;
-		for (int i = 0; i < lexicons.size(); i++) {
-			Lexicon l = lexicons.get(i);
+		for (int i = 0; i < partsLexicons.size(); i++) {
+			Lexicon l = partsLexicons.get(i);
 			String[] ents = l.getForms();
 			int[] freqs = l.getFreq();
 			for (int j = 0; j < freqs.length; j++) {
 				id = entries2index.get(ents[j]);
-				// if (entriesFreqs[id] >= 2)
 				if (id != null) {
-					mat[id][i] = freqs[j]; //mat.setQuick(id, i, freqs[j]);
+					mat[id][i] = freqs[j];
 				}
 			}
 		}
-		//System.out.println("time build matrix "+(System.currentTimeMillis()-time));
-		//time = System.currentTimeMillis();
-		//System.out.println("Entries size " + filteredForms.size());
-		//System.out.println("mat size " + mat.rows());
-		//System.out.println("mat columns " + mat.columns());
-
 		this.statsData = new LexicalTableImpl(mat, filteredForms.toArray(new String[]{}), partition.getPartShortNames().toArray(new String[] {}));
 
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/adapters/TXMResultAdapter.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/adapters/TXMResultAdapter.java	(revision 741)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/adapters/TXMResultAdapter.java	(revision 742)
@@ -30,7 +30,12 @@
 
 	@Override
 	public String getLabel(Object result) {
-		return ((TXMResult) result).getSimpleName(); 
+		if(((TXMResult) result).getUserName() != null)	{
+			return ((TXMResult) result).getUserName();
+		}
+		else	{
+			return ((TXMResult) result).getSimpleName();	
+		}
 	}
 
 	@Override
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java	(revision 741)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java	(revision 742)
@@ -33,6 +33,7 @@
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Map;
 
@@ -189,6 +190,8 @@
 	 * @return
 	 * @throws CqiClientException
 	 */
+	// FIXME: why this method needs to create and delete some new subcorpus???? the computing can't be done directly on the corpus argument???
+	// eg. dist = CorpusManager.getCorpusManager().getCqiClient().fdist1(corpus.getQualifiedCqpId(), 0,	ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
 	protected boolean computewithSubCorpus(Subcorpus corpus, Property property, IProgressMonitor monitor) throws CqiClientException {
 
 		//System.out.println("not found");
@@ -200,19 +203,22 @@
 			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(
-						tmp.getQualifiedCqpId(), 0,
-						ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
+				fdist = CorpusManager.getCorpusManager().getCqiClient().fdist1(tmp.getQualifiedCqpId(), 0, ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
 
-				corpus.dropSubcorpus(tmp); // drop the subcorpus only if correctly created
+				corpus.dropSubcorpus(tmp);
+				tmp.delete();
 			}
 			//System.out.println("nb lines: "+fdist.length);
 		} catch (Exception e) {
 			throw new CqiClientException(e);
 		} finally {
 			if (tmp != null) {
-				try {corpus.dropSubcorpus(tmp);}
-				catch (Exception e2) {}
+				try {
+					corpus.dropSubcorpus(tmp);
+					tmp.delete();
+				}
+				catch (Exception e2) {
+				}
 			}
 		}
 		int lexiconSize = fdist.length;
@@ -579,7 +585,37 @@
 		this.pProperty = property;
 	}
 
+
+	/**
+	 * Gets a Lexicon from the specified corpus.
+	 * If a Lexicon child exists in the Corpus fro the specified property, returns it otherwise creates and computes a new Lexicon.
+	 * @param corpus
+	 * @param property
+	 * @return
+	 * @throws Exception
+	 */
+	public static Lexicon getLexicon(Corpus corpus, Property property, IProgressMonitor monitor) throws Exception {
+		Lexicon lexicon = null;
+		
+		// recycling parent Lexicon if exists 
+		ArrayList<Lexicon> partLexicons = (ArrayList<Lexicon>)corpus.getChildren(Lexicon.class);
+		for (int i = 0; i < partLexicons.size(); i++) {
+			if(partLexicons.get(i).getProperty() == property)	{
+				lexicon = partLexicons.get(i);
+				break;
+			}
+		}
+		
+		// creating new Lexicon
+		if(lexicon == null || lexicon.getProperty() != property)	{
+			lexicon = new Lexicon(corpus);
+			lexicon.setProperty(property);
+			lexicon.compute(monitor);
+		}
+		return lexicon;
+	}
 	
+	
 //	/**
 //	 * Find or build a lexicon given a Corpus (MainCorpus or SubCorpus).
 //	 * 
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 741)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 742)
@@ -223,14 +223,17 @@
 
 		this.filterLines();
 
-		Log.info("Sorting...");
+		this.subTask("Sorting...");
+		
 		this.sortLines(SortMode.FREQUNIT, true);
 
 		this.cut();
 
 		this.dirty = false;
 		this.pTopIndex = 0;
-		Log.info("Index done.");
+		
+		this.subTask("Index done.");
+		
 		return true;
 	}
 	
@@ -416,7 +419,7 @@
 				lexicon.setProperty(property);
 				lexicon.compute(null);
 			} else {
-				lexicon.setParameters(this.pProperties.get(0));
+				lexicon.setProperty(this.pProperties.get(0));
 				lexicon.compute(monitor);
 			}
 
@@ -527,15 +530,6 @@
 	}
 
 	/**
-	 * return all the lines of the index.
-	 *
-	 * @return the all lines
-	 */
-	public List<Line> getAllLines() {
-		return getLines(0, lines.size());
-	}
-
-	/**
 	 * Gets the corpus.
 	 *
 	 * @return the corpus
@@ -693,6 +687,37 @@
 		return selectedLines;
 	}
 
+	
+	/**
+	 * return all the lines of the index.
+	 *
+	 * @return the all lines
+	 */
+	public List<Line> getAllLines() {
+		return getLines(0, lines.size());
+	}
+
+	/**
+	 * update the lines counts.
+	 */
+	protected void setLineCounts() {
+		for (Line line : lines) {// for each Line set its count
+			int[] c = new int[partnames.size()];
+			for (int i = 0; i < partnames.size(); i++) {
+				if (counts.get(line.getSignature()).size() <= i) {
+					c[i] = 0;
+				}
+				else {
+					c[i] = counts.get(line.getSignature()).get(i);
+				}
+			}
+			line.setCounts(c, -1);
+		}
+	}
+	
+
+	
+	
 	@Override
 	public String getName() {
 		try {
@@ -963,24 +988,8 @@
 		this.lexiconMode = mode;
 	}
 
-	/**
-	 * update the lines counts.
-	 */
-	protected void setLineCounts() {
-		for (Line line : lines) {// for each Line set its count
-			int[] c = new int[partnames.size()];
-			for (int i = 0; i < partnames.size(); i++) {
-				if (counts.get(line.getSignature()).size() <= i) {
-					c[i] = 0;
-				}
-				else {
-					c[i] = counts.get(line.getSignature()).get(i);
-				}
-			}
-			line.setCounts(c, -1);
-		}
-	}
 
+
 	public void setNLinesPerPage(int nLinesPerPage) {
 		this.pNLinesPerPage = Math.max(nLinesPerPage, 1);
 	}
@@ -1180,17 +1189,19 @@
 	public void toTxt(File outfile, int from, int to, String encoding, String colseparator, String txtseparator)
 			throws CqiClientException, IOException {
 		// NK: writer declared as class attribute to perform a clean if the operation is interrupted
-		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile),
-				encoding)); 
+		this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding)); 
 		// if ("UTF-8".equals(encoding)) writer.write('\ufeff'); // UTF-8 BOM
 		String header = ""; //$NON-NLS-1$
-		for (Property p : pProperties)
+		for (Property p : pProperties) {
 			header += (p + pPropertiesSeparator);
+		}
 		header = txtseparator+ header.substring(0, header.length() - 1) +txtseparator;
 		header += colseparator+ txtseparator+ "F" + txtseparator; //$NON-NLS-1$
-		if (partnames.size() > 1)
-			for (int j = 0; j < partnames.size(); j++)
-				header += colseparator + txtseparator+ partnames.get(j).replace(txtseparator, txtseparator+txtseparator)+txtseparator; 
+		if (partnames.size() > 1) {
+			for (int j = 0; j < partnames.size(); j++) {
+				header += colseparator + txtseparator+ partnames.get(j).replace(txtseparator, txtseparator+txtseparator)+txtseparator;
+			}
+		}
 		header += "\n"; //$NON-NLS-1$
 		writer.write(header);
 
@@ -1198,9 +1209,11 @@
 		for (int i = from; i < to; i++) {
 			Line ligne = lines.get(i);
 			writer.write(txtseparator+ ligne.toString().replace(txtseparator, txtseparator+txtseparator)+ txtseparator + colseparator + ligne.getFrequency()); 
-			if (partnames.size() > 1)
-				for (int j = 0; j < partnames.size(); j++)
-					writer.write(colseparator + ligne.getFrequency(j)); 
+			if (partnames.size() > 1) {
+				for (int j = 0; j < partnames.size(); j++) {
+					writer.write(colseparator + ligne.getFrequency(j));
+				}
+			}
 			writer.write("\n"); //$NON-NLS-1$
 		}
 		writer.flush();
@@ -1235,10 +1248,12 @@
 		for (int i = 0; i < lines.size(); i++) {
 			Line line = lines.get(i);
 			int f = line.getFrequency();
-			if (f < Fmin)
+			if (f < Fmin) {
 				Fmin = f;
-			if (f > Fmax)
+			}
+			if (f > Fmax) {
 				Fmax = f;
+			}
 		}
 	}
 }
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 741)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java	(revision 742)
@@ -34,7 +34,6 @@
 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;
@@ -48,11 +47,9 @@
 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;
@@ -60,13 +57,13 @@
 import org.txm.core.results.Parameter;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.preferences.LexicalTablePreferences;
-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.StatusLine;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.editors.TableKeyListener;
 import org.txm.rcp.messages.TXMUIMessages;
+import org.txm.rcp.swt.widget.structures.PropertiesComboViewer;
 import org.txm.rcp.views.QueriesView;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
@@ -79,7 +76,7 @@
  * 
  * @author mdecorde
  */
-public class LexicalTableEditor extends TXMEditor	{
+public class LexicalTableEditor extends TXMEditor<LexicalTable>	{
 
 	
 	public static final String ID = LexicalTableEditor.class.getName();
@@ -118,6 +115,13 @@
 
 
 	
+	/**
+	 * Unit property.
+	 */
+	@Parameter(key=LexicalTablePreferences.UNIT_PROPERTY)
+	protected PropertiesComboViewer unitPropertyComboViewer;
+
+	
 	/** The minfreqspinner. */
 //	@Parameter(key=LexicalTablePreferences.F_MIN)
 	protected Spinner fMin;
@@ -139,269 +143,255 @@
 	@Override
 	public void _createPartControl(final Composite parent) {
 		
-		lexicalTable = (LexicalTable) this.getResult();
-		
-		Composite paramArea = this.getCommandParametersGroup();
-		
-		// 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, vMax.getSelection(), fMin.getSelection()));
+		try {
+			lexicalTable = (LexicalTable) this.getResult();
+			
+			Composite parametersArea = this.getCommandParametersGroup();
+			
+			// Apply button
+			Button keepTop = new Button(parametersArea, 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, vMax.getSelection(), fMin.getSelection()));
 
-				MessageBox messageBox = new MessageBox(e.display.getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
-				messageBox.setMessage(TXMUIMessages.common_areYouSure);
-				int response = messageBox.open();
-				if (response != SWT.YES) {
-					return;
+					MessageBox messageBox = new MessageBox(e.display.getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
+					messageBox.setMessage(TXMUIMessages.common_areYouSure);
+					int response = messageBox.open();
+					if (response != SWT.YES) {
+						return;
+					}
+
+					try {
+						updateResultFromEditor();
+						refresh(false);
+					} catch (Exception e1) {
+						// TODO Auto-generated catch block
+						org.txm.rcp.utils.Logger.printStackTrace(e1);
+						StatusLine.setMessage("LexicalTable: sorting error."); //$NON-NLS-1$
+					}
 				}
 
-				try {
-					updateResultFromEditor();
-					refresh(false);
-				} catch (Exception e1) {
-					// TODO Auto-generated catch block
-					org.txm.rcp.utils.Logger.printStackTrace(e1);
-					StatusLine.setMessage("LexicalTable: sorting error."); //$NON-NLS-1$
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
 				}
-			}
+			});
+			
+			// Number of lines
+			Label nLines = new Label(parametersArea, SWT.NONE);
+			nLines.setText(TXMCoreMessages.common_numberOfLines);
+			vMax = new Spinner(parametersArea, SWT.BORDER);
 
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-		});
-		
-		// Number of lines
-		Label nLines = new Label(paramArea, SWT.NONE);
-		nLines.setText(TXMCoreMessages.common_numberOfLines);
-		vMax = new Spinner(paramArea, SWT.BORDER);
+			// Fmin
+			Label fmin = new Label(parametersArea, SWT.NONE);
+			fmin.setText(TXMCoreMessages.common_fMin);
+			fMin = new Spinner(parametersArea, SWT.BORDER);
 
-		// Fmin
-		Label fmin = new Label(paramArea, SWT.NONE);
-		fmin.setText(TXMCoreMessages.common_fMin);
-		fMin = new Spinner(paramArea, SWT.BORDER);
+			// unit property
+			new Label(parametersArea, SWT.NONE).setText(TXMCoreMessages.common_property);
+			this.unitPropertyComboViewer = new PropertiesComboViewer(parametersArea, this, true,
+					Corpus.getFirstParentCorpus(this.getResult()).getOrderedProperties(),
+					this.getResult().getProperty(), false);
 
-		// 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);
+			
+			
+			// Merge or delete columns button
+			Button fusionCol = new Button(parametersArea, 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.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();
+						if (d.doMerge()) {
+							String newname = d.getMergeName();
 
-						System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_11, colindices));
-						double[] firstcol = cols.get(colindices.get(0));
+							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++) {
+							// 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++) {
-								firstcol[j] += cols.get(colindices.get(i))[j];
+								lexicalTable.getData().set(j, colindices.get(0), firstcol[j]);
 							}
-						}
 
-						// update first col of the Lexical table
-						for (int j = 0; j < lexicalTable.getNRows(); j++) {
-							lexicalTable.getData().set(j, colindices.get(0), firstcol[j]);
-						}
+							// and its name
+							lexicalTable.getColNames().setString(colindices.get(0), newname);
 
-						// and its name
-						lexicalTable.getColNames().setString(colindices.get(0), newname);
+							// keep only the first col
+							List<Integer> coltodelete = colindices.subList(1, colindices.size());
+							lexicalTable.getData().removeCols(coltodelete);
 
-						// keep only the first col
-						List<Integer> coltodelete = colindices.subList(1, colindices.size());
-						lexicalTable.getData().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;
+							}
 
-						// refresh stuff
-						collist = new ArrayList<Object>();// update col name
-						// list
-						try {
-							for (String colname : lexicalTable.getColNames().asStringsArray()) {
-								collist.add(colname);
+							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
 							}
-						} catch (StatException e1) {
-							org.txm.rcp.utils.Logger.printStackTrace(e1);
-							return;
-						}
+							viewer.getTable().getColumns()[colindices.get(0) + 3].setText(newname);
+							refreshTable(true);
+						} else// delete
+						{
+							System.out.println(NLS.bind(LexicalTableUIMessages.LexicalTableEditor_12, colindices));
+							lexicalTable.getData().removeCols(colindices);
 
-						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));
-						lexicalTable.getData().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;
+							}
 
-						collist = new ArrayList<Object>();
-						Vector colnames = lexicalTable.getColNames();
-						try {
-							for (String colname : colnames.asStringsArray()) {
-								collist.add(colname);
+							Collections.sort(colindices);
+							for (int i = colindices.size() - 1; i >= 0; i--) {
+								viewer.getTable().getColumns()[colindices
+								                                        .get(i) + 3].dispose();
 							}
-						} catch (StatException e1) {
-							org.txm.rcp.utils.Logger.printStackTrace(e1);
-							return;
+							refreshTable(true);
 						}
-
-						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$
 				}
-				StatusLine.setMessage(""); //$NON-NLS-1$
-			}
 
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-		});
+				@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) {
+			// Merge or delete lines button
+			Button mergeDeleteRows = new Button(parametersArea, 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++;
+					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 {
-						lexicalTable.getData().removeRows(rowindices);
-						refreshTable();
-						viewer.getTable().deselectAll();
+						if (d.doMerge()) {
+							MergeLines.mergeLines(LexicalTableEditor.this, d
+									.getMergeName(), rowindices);
+						} else {
+							lexicalTable.getData().removeRows(rowindices);
+							refreshTable(true);
+							viewer.getTable().deselectAll();
+						}
 					}
 				}
-			}
 
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-		});
+				@Override
+				public void widgetDefaultSelected(SelectionEvent e) {
+				}
+			});
 
-		Composite resultArea = this.getResultArea();
-		
-		
-		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);
+			Composite resultArea = this.getResultArea();
+			
+			
+			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);
+			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(this, formColumn, -2));
-		formColumn.setLabelProvider(clp);
-		
-		freqColumn = new TableViewerColumn(viewer, SWT.LEFT);
-		freqColumn.getColumn().setText(TXMCoreMessages.common_frequency); 
-		freqColumn.getColumn().setWidth(200);
-		freqColumn.getColumn().addSelectionListener(new ColumnSelectionListener(this, 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);
+			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().setWidth(200);
+			formColumn.getColumn().addSelectionListener(new ColumnSelectionListener(this, formColumn, -2));
+			formColumn.setLabelProvider(clp);
+			
+			freqColumn = new TableViewerColumn(viewer, SWT.LEFT);
+			freqColumn.getColumn().setText(TXMCoreMessages.common_frequency); 
+			freqColumn.getColumn().setWidth(200);
+			freqColumn.getColumn().addSelectionListener(new ColumnSelectionListener(this, freqColumn, -1));
+			freqColumn.setLabelProvider(clp);
+			
+			// creating the part columns
+			for (int i = 0; i < this.getResult().getPartition().getParts().size(); i++) {
 				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(this, 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.setContentProvider(new LineContentProvider());
-		viewer.setInput(lexicalTable);
-		parent.layout();
+			viewer.getTable().setSortColumn(formColumn.getColumn());
+			viewer.getTable().setSortDirection(SWT.UP);
 
-		viewer.refresh();
-		viewer.getTable().setSortColumn(formColumn.getColumn());
-		viewer.getTable().setSortDirection(SWT.UP);
+			// Register the context menu
+			TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer); // $NON-NLS-1$
 
-		this.updateEditorFromResult(false);
-		
-		// Register the context menu
-		TXMEditor.initContextMenu(this.viewer.getTable(), this.getSite(), this.viewer); // $NON-NLS-1$
-
-		
-		//this.commandParametersGroup.pack();
+		}
+		catch (CqiClientException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
 	}
 
 
@@ -432,10 +422,43 @@
 		}
 	}
 
+	public void refreshTable() {
+		this.refreshTable(false);
+	}
+	
 	/**
 	 * Refresh table.
 	 */
-	public void refreshTable() {
+	public void refreshTable(boolean update) {
+
+//		if(!update)	{
+			
+			formColumn.getColumn().setText(this.lexicalTable.getProperty().getName()); 
+
+			collist = new ArrayList<Object>();
+			Vector colnames = lexicalTable.getColNames();
+			
+			try {
+				int[] colmargins = lexicalTable.getColMarginsVector().asIntArray();
+				
+				int i = 3;
+				for (String colname : colnames.asStringsArray()) {
+					TableColumn partColumn = viewer.getTable().getColumn(i);
+					partColumn.setText(colname+" t="+colmargins[i - 3]); //$NON-NLS-1$
+					partColumn.setToolTipText(colname); 
+					collist.add(colname);
+					i++;
+				}
+				
+				viewer.setInput(lexicalTable);
+
+				
+			} catch (StatException e1) {
+				org.txm.rcp.utils.Logger.printStackTrace(e1);
+				return;
+			}
+//		}
+
 		
 		LineLabelProvider labelprovider = new LineLabelProvider(this.lexicalTable);
 		this.viewer.setLabelProvider(labelprovider);
@@ -545,7 +568,7 @@
 				viewer.refresh();
 				viewer.setInput(lexicalTable);
 				viewer.getTable().getParent().layout();
-				refreshTable();
+				refreshTable(false);
 			} else {
 				System.out.println(LexicalTableUIMessages.LexicalTableEditor_14);
 			}
@@ -585,7 +608,7 @@
 			}
 
 			previousSortedCol = index;
-			refreshTable();
+			refreshTable(true);
 
 			viewer.getTable().setSortColumn(col.getColumn());
 			if (reverse) {
@@ -606,7 +629,7 @@
 		fMin.setMinimum(lexicalTable.getData().getFMin());
 		fMin.setMaximum(lexicalTable.getData().getFMax());
 		
-		this.refreshTable();
+		this.refreshTable(update);
 		this.refreshInfos();
 		
 		QueriesView.refresh();
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 741)
+++ tmp/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java	(revision 742)
@@ -169,8 +169,6 @@
 			TableColumn separatorColumn = new TableColumn(specificitesTable, SWT.NONE);
 			separatorColumn.setResizable(false);
 
-
-
 			specificitesTable.setHeaderVisible(true);
 
 			// Horizontal bar on second table takes up a little extra space.
@@ -245,12 +243,12 @@
 
 			
 			// units
-			String[] typeNames = getResult().getTypeNames();
+			String[] typeNames = this.getResult().getTypeNames();
 			// units' total freq
-			int[] typeFreq = getResult().getFormFrequencies();
+			int[] typeFreq = this.getResult().getFormFrequencies();
 			// units' index fr each part
-			double[][] specIndex = getResult().getSpecificitesIndex();
-			int[][] specFreqs = getResult().getFrequency();
+			double[][] specIndex = this.getResult().getSpecificitesIndex();
+			int[][] specFreqs = this.getResult().getFrequency();
 			
 			// units' total in parts
 			//final int[] sortedPartIndexes = specificitesResult.getSortedPartIndexes();
