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 1396)
+++ tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java	(revision 1397)
@@ -702,6 +702,8 @@
 	 // FIXME: try to use a ViewerSorter instead of this but also manage the result sorting for export
 		public void sort(TableViewerColumn col, int index) {
 
+			if (lexicalTable.getData() == null) return;
+			
 			if (index == previousSortedCol) {
 				reverse = !reverse;
 			} else {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java	(revision 1396)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreateSubcorpusDialog.java	(revision 1397)
@@ -155,7 +155,7 @@
 		nameLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
 
 		name = new Text(nameComposite, SWT.BORDER);
-		name.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+		name.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
 
 		// Param panel
 		final TabFolder tabFolder = new TabFolder(inclosing, SWT.NONE);
@@ -189,10 +189,8 @@
 				GridData.CENTER, false, false));
 
 		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN);
-		queryText.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-				true, false));
-		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true,
-				false);
+		queryText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+		GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false);
 		gridData.widthHint = convertHeightInCharsToPixels(20);
 		queryText.setLayoutData(gridData);
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 1396)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 1397)
@@ -27,8 +27,13 @@
 //
 package org.txm.rcp.actions;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Properties;
 
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -49,6 +54,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
@@ -64,6 +70,7 @@
 import org.txm.searchengine.cqp.corpus.Partition;
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.utils.io.IOUtils;
 import org.txm.utils.logger.Log;
 // TODO: Auto-generated Javadoc
 /**
@@ -313,14 +320,14 @@
 		advancedTab.setText(TXMUIMessages.advanced);
 
 		Composite advanceContainer = new Composite(tabFolder, SWT.NONE);
-		GridLayout advanceLayout = new GridLayout(1, true);
+		GridLayout advanceLayout = new GridLayout(2, false);
 		advanceContainer.setLayout(advanceLayout);
 		advancedTab.setControl(advanceContainer);
 
 		scrollComposite = new ScrolledComposite(advanceContainer, SWT.V_SCROLL
 				| SWT.BORDER);
 		scrollComposite.setLayoutData(new GridData(GridData.FILL,
-				GridData.FILL, true, true));
+				GridData.FILL, true, true, 2, 1));
 
 		Button plusButton = new Button(advanceContainer, SWT.NONE);
 		plusButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER,
@@ -329,9 +336,37 @@
 		plusButton.addListener(SWT.Selection, new Listener() {
 			@Override
 			public void handleEvent(Event event) {
-				addQueryField(compositeForAdvanced);
+				addQueryField();
 			}
 		});
+		
+		Button importButton = new Button(advanceContainer, SWT.NONE);
+		importButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER,
+				GridData.FILL, false, false));
+		importButton.setText("Import from properties file..."); //$NON-NLS-1$
+		importButton.addListener(SWT.Selection, new Listener() {
+			@Override
+			public void handleEvent(Event event) {
+				FileDialog d = new FileDialog(event.display.getActiveShell());
+				d.setFilterExtensions(new String[] {"*.properties"});
+				d.setText("Select a properties file containing CQL queries");
+				String path = d.open();
+				if (path != null) {
+					Properties props = new Properties();
+					try {
+						props.load(IOUtils.getReader(new File(path)));
+						for (Object key : props.keySet()) {
+							String value = props.getProperty(key.toString());
+							QueryWidget qw = addQueryField(key.toString().substring(0, Math.min(20, key.toString().length())), value);
+						}
+					} catch (Exception e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+				
+			}
+		});
 
 		compositeForAdvanced = new Composite(scrollComposite, SWT.NONE);
 		GridLayout layoutForAdvanced = new GridLayout(3, false);
@@ -437,7 +472,7 @@
 	 * @param composite the composite
 	 */
 	private void createAdvancedQueryField() {
-		addQueryField(compositeForAdvanced);
+		addQueryField();
 		Rectangle r = scrollComposite.getClientArea();
 		scrollComposite.setMinSize(compositeForAdvanced.computeSize(r.width,
 				SWT.DEFAULT));
@@ -448,16 +483,29 @@
 	 *
 	 * @param composite the composite
 	 */
-	private void addQueryField(final Composite composite) {
-		final Text advancedPartLabel = new Text(composite, SWT.NONE);
+	private QueryWidget addQueryField() {
+		return addQueryField(null, null);
+	}
+	
+	/**
+	 * Adds the query field.
+	 *
+	 * @param name the query name
+	 * @param value the query
+	 */
+	private QueryWidget addQueryField(String name, String value) {
+		final Text advancedPartLabel = new Text(compositeForAdvanced, SWT.BORDER);
 		advancedPartLabel.setText(TXMUIMessages.part
 				+ (partNames.size() + 1)); 
-		advancedPartLabel.setLayoutData(new GridData(GridData.END,
+		advancedPartLabel.setLayoutData(new GridData(GridData.FILL,
 				GridData.CENTER, false, false));
+		if (name != null && name.length() > 0) {
+			advancedPartLabel.setText(name);
+		}
 		partNames.add(advancedPartLabel);
 
 		final QueryWidget queryText;
-		queryText = new QueryWidget(composite, SWT.DROP_DOWN);
+		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN);
 		queryText.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
 				true, false));
 		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true,
@@ -465,8 +513,10 @@
 		// gridData.widthHint = convertHeightInCharsToPixels(20);
 		queryText.setLayoutData(gridData);
 		queries.add(queryText);
-
-		final Button minusButton = new Button(composite, SWT.NONE);
+		if (value != null) {
+			queryText.setText(value);
+		}
+		final Button minusButton = new Button(compositeForAdvanced, SWT.NONE);
 		minusButton.setText("-"); //$NON-NLS-1$
 		// minusButton.setData(queryText);
 		minusButton.addListener(SWT.Selection, new Listener() {
@@ -477,6 +527,7 @@
 				advancedPartLabel.dispose();
 				queryText.dispose();
 				minusButton.dispose();
+				compositeForAdvanced.layout(true);
 			}
 		});
 		Rectangle r = scrollComposite.getClientArea();
@@ -484,8 +535,10 @@
 				SWT.DEFAULT));
 		scrollComposite.update();
 		scrollComposite.layout();
-		composite.update();
-		composite.layout();
+		compositeForAdvanced.update();
+		compositeForAdvanced.layout();
+		
+		return queryText;
 	}
 
 	/* (non-Javadoc)
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java	(revision 1396)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPLexicon.java	(revision 1397)
@@ -422,7 +422,7 @@
 		}
 		this.freqs = freq;
 		this.ids = ids;
-		this.forms = null;
+		this.forms = getForms();
 		this.pProperty = property;
 	}
 
@@ -544,6 +544,7 @@
 		if(lexicon == null || !lexicon.getProperty().getFullName().equals(property.getFullName()))	{
 			lexicon = new CQPLexicon(corpus);
 			lexicon.setProperty(property);
+			lexicon._compute();
 		}
 		System.out.println("Lexicon="+lexicon+" "+lexicon.hashCode());
 		return lexicon;
