Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java	(revision 0)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java	(revision 2947)
@@ -0,0 +1,59 @@
+package org.txm.searchengine.cqp.corpus;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A CQP property at token/word level
+ * 
+ * @author mdecorde
+ *
+ */
+public class VirtualProperty extends Property {
+	
+	/**
+	 * Creates a new WordProperty.
+	 * 
+	 * @param name
+	 * @param corpus
+	 */
+	public VirtualProperty(String name, CQPCorpus corpus) {
+		super(name, corpus);
+	}
+	
+	@Override
+	public String getFullName() {
+		return "<" + getName() + ">";
+	}
+	
+	/**
+	 * Creates a readable formated string from the specified properties list.
+	 * 
+	 * @param properties
+	 * @return
+	 */
+	public static String asString(List<VirtualProperty> properties) {
+		
+		String str = "";
+		for (int i = 0; i < properties.size(); i++) {
+			if (i > 0) {
+				str += "_";
+			}
+			str += properties.get(i).getFullName();
+		}
+		return "@" + str;
+	}
+	
+	public String getValue(int position) {
+		return Integer.toString(position);
+	}
+	
+	public List<String> getValues(int[] positions) {
+		ArrayList<String> rez = new ArrayList<>();
+		for (int p : positions) {
+			rez.add(getValue(p));
+		}
+		return rez;
+	}
+}
+

Property changes on: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/VirtualProperty.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 2946)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 2947)
@@ -86,10 +86,12 @@
 		
 		@Override
 		public int compare(WordProperty o1, WordProperty o2) {
-			if (o1.getName().equals("word"))
+			if (o1.getName().equals("word")) {
 				return -1;
-			if (o2.getName().equals("word"))
+			}
+			if (o2.getName().equals("word")) {
 				return 1;
+			}
 			return o1.compareTo(o2);
 		}
 	};
@@ -102,8 +104,9 @@
 	 * @return
 	 */
 	public static Object cache(Object toCache) {
-		if (toCache == null)
+		if (toCache == null) {
 			return null;
+		}
 		
 		ArrayList<?> ocCache = getObjectCacheForClass(toCache.getClass());
 		if (ocCache.size() > CACHE_MAXIMUM_SIZE) {
@@ -189,9 +192,9 @@
 	 * @return
 	 */
 	public static ArrayList<?> uncache(Class classToUnCache) {
-		if (classToUnCache == null)
+		if (classToUnCache == null) {
 			return null;
-		
+		}
 		return cache.remove(classToUnCache);
 	}
 	
@@ -203,9 +206,9 @@
 	 * @return
 	 */
 	public static boolean uncache(Object toUnCache) {
-		if (toUnCache == null)
+		if (toUnCache == null) {
 			return false;
-		
+		}
 		ArrayList<?> ocCache = getObjectCacheForClass(toUnCache.getClass());
 		return ocCache.remove(toUnCache);
 	}
@@ -413,8 +416,9 @@
 			NodeList partitionElems = preBuildElem.getElementsByTagName("partition"); //$NON-NLS-1$
 			for (int i = 0; i < partitionElems.getLength(); i++) {
 				Element partitionElem = (Element) partitionElems.item(i);
-				if (!partitionElem.getParentNode().equals(preBuildElem))
+				if (!partitionElem.getParentNode().equals(preBuildElem)) {
 					continue; // level 1 elements
+				}
 				String name = partitionElem.getAttribute("name"); //$NON-NLS-1$
 				List<String> names = new ArrayList<>();
 				List<String> queries = new ArrayList<>();
@@ -482,8 +486,9 @@
 		if (this.pID == null) {
 			return -1;
 		}
-		if (o.getSimpleName() == null)
+		if (o.getSimpleName() == null) {
 			return 1;
+		}
 		if (output == 0) {
 			output = this.getSimpleName().compareTo(o.getSimpleName());
 		}
@@ -993,6 +998,22 @@
 	public abstract List<WordProperty> getProperties() throws CqiClientException;
 	
 	/**
+	 * Gets the virtual properties of this corpus.
+	 * 
+	 * current implementation only returns the "position" virtual property
+	 * 
+	 * @return the properties
+	 * 
+	 * @throws CqiClientException
+	 *             the cqi client exception
+	 */
+	public List<VirtualProperty> getVirtualProperties() {
+		ArrayList<VirtualProperty> rez = new ArrayList<>();
+		rez.add(new VirtualProperty("position", this));
+		return rez;
+	}
+	
+	/**
 	 * Gets a property from its name.
 	 * 
 	 * @param name
@@ -1395,4 +1416,8 @@
 	public void setLanguage(String corpusLanguage) {
 		this.lang = corpusLanguage;
 	}
+	
+	public Property getVirtualProperty(String s) {
+		return new VirtualProperty(s, this);
+	}
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java	(revision 2946)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ReferencePattern.java	(revision 2947)
@@ -37,6 +37,7 @@
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.VirtualProperty;
 import org.txm.utils.logger.Log;
 
 // TODO: Auto-generated Javadoc
@@ -46,10 +47,10 @@
  * @author mdecorde
  */
 public class ReferencePattern implements Iterable<Property> {
-
+	
 	/** The properties. */
-	private List<Property> properties = new ArrayList<Property>();
-
+	private List<Property> properties = new ArrayList<>();
+	
 	/**
 	 * 
 	 * @param corpus
@@ -61,10 +62,13 @@
 			ReferencePattern props = new ReferencePattern();
 			if (v == null) return props;
 			if (v.length() == 0) return props;
-
+			
 			String[] split = v.split("\t");
 			for (String s : split) {
-				if (s.contains("_")) {
+				if (s.startsWith("<") && s.endsWith(">")) {
+					props.addProperty(corpus.getVirtualProperty(s));
+				}
+				else if (s.contains("_")) {
 					String[] split2 = s.split("_", 2);
 					StructuralUnit su = corpus.getStructuralUnit(split2[0]);
 					if (su != null) {
@@ -73,7 +77,8 @@
 							props.addProperty(prop);
 						}
 					}
-				} else {
+				}
+				else {
 					Property prop = corpus.getProperty(s);
 					if (prop != null) {
 						props.addProperty(prop);
@@ -81,41 +86,42 @@
 				}
 			}
 			return props;
-		} catch (Exception e) {
-			System.out.println("Error: "+v+" property not found in "+corpus);
+		}
+		catch (Exception e) {
+			System.out.println("Error: " + v + " property not found in " + corpus);
 			return null;
 		}
 	}
-
+	
 	/**
 	 * Instantiates a new reference pattern.
 	 */
 	public ReferencePattern() {
-		properties = new ArrayList<Property>();
+		properties = new ArrayList<>();
 	}
-
+	
 	/**
 	 * Instantiates a new reference pattern.
 	 *
 	 * @param parameters the properties
 	 */
 	public ReferencePattern(Property prop) {
-		List<Property> properties = new ArrayList<Property>();
+		List<Property> properties = new ArrayList<>();
 		properties.add(prop);
 		this.properties = properties;
 	}
-
+	
 	/**
 	 * Instantiates a new reference pattern.
 	 *
 	 * @param parameters the properties
 	 */
 	public ReferencePattern(StructuralUnitProperty prop) {
-		List<Property> properties = new ArrayList<Property>();
+		List<Property> properties = new ArrayList<>();
 		properties.add(prop);
 		this.properties = properties;
 	}
-
+	
 	/**
 	 * Instantiates a new reference pattern.
 	 *
@@ -124,7 +130,7 @@
 	public ReferencePattern(List<Property> properties) {
 		this.properties = properties;
 	}
-
+	
 	/**
 	 * Adds the property.
 	 *
@@ -135,15 +141,16 @@
 		this.properties.add(property);
 		return this;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Iterable#iterator()
 	 */
 	@Override
 	public Iterator<Property> iterator() {
 		return properties.iterator();
 	}
-
+	
 	/**
 	 * Gets the properties.
 	 *
@@ -152,8 +159,9 @@
 	public List<Property> getProperties() {
 		return properties;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see java.lang.Object#toString()
 	 */
 	@Override
@@ -164,7 +172,7 @@
 		}
 		return buffer.toString().trim();
 	}
-
+	
 	/**
 	 * Gets the title.
 	 *
@@ -172,52 +180,59 @@
 	 */
 	public String getTitle() {
 		if (this.properties == null || this.properties.size() == 0) return "none";
-
+		
 		String title = ""; //$NON-NLS-1$
 		for (Property p : this.properties) {
 			if (p == null) continue;
-			if (p instanceof StructuralUnitProperty)
-			{
-				StructuralUnitProperty sp = (StructuralUnitProperty)p;
-				title += sp.getFullName()+", "; //$NON-NLS-1$
+			if (p instanceof StructuralUnitProperty) {
+				StructuralUnitProperty sp = (StructuralUnitProperty) p;
+				title += sp.getFullName() + ", "; //$NON-NLS-1$
 			}
-			else
-				title += p.getName()+", "; //$NON-NLS-1$
+			else if (p instanceof VirtualProperty) {
+				VirtualProperty sp = (VirtualProperty) p;
+				title += sp.getFullName() + ", "; //$NON-NLS-1$
+			}
+			else {
+				title += p.getName() + ", "; //$NON-NLS-1$
+			}
 		}
 		if (title.length() == 0)
 			title = TXMCoreMessages.common_reference;
 		else
-			title = title.substring(0, title.length()-2);
+			title = title.substring(0, title.length() - 2);
 		return title;
 	}
-
+	
 	public static String referenceToString(ReferencePattern pViewRefPattern) {
-		ArrayList<String> names = new ArrayList<String>();
+		ArrayList<String> names = new ArrayList<>();
 		for (Property p : pViewRefPattern.getProperties()) {
 			names.add(p.getFullName());
 		}
 		return StringUtils.join(names, "\t"); //$NON-NLS-1$
 	}
-
+	
 	public CQPCorpus getCorpus() {
 		if (properties.size() == 0) {
 			return null;
 		}
 		return properties.get(0).getCorpus();
 	}
-
+	
 	public static List<Property> getPossibleValues(CQPCorpus corpus) {
-		List<Property> availableReferenceItems = new ArrayList<Property>();
+		List<Property> availableReferenceItems = new ArrayList<>();
 		try {
 			// add word properties
 			availableReferenceItems.addAll(corpus.getOrderedProperties());
-
+			
 			// add structural units properties
 			for (StructuralUnit unit : corpus.getOrderedStructuralUnits()) {
 				availableReferenceItems.addAll(unit.getOrderedProperties());
 			}
-
-		} catch (Exception e) {
+			
+			// add virtual properties
+			availableReferenceItems.addAll(corpus.getVirtualProperties());
+		}
+		catch (Exception e) {
 			Log.printStackTrace(e);
 		}
 		return availableReferenceItems;
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/AbstractCqiClient.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/AbstractCqiClient.java	(revision 2946)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/AbstractCqiClient.java	(revision 2947)
@@ -45,6 +45,7 @@
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.QueryResult;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.VirtualProperty;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
 import org.txm.searchengine.cqp.corpus.query.Match;
 import org.txm.searchengine.cqp.serverException.CqiCqpErrorNoSuchCorpus;
@@ -64,7 +65,6 @@
 	
 	String lastError;
 	
-	
 	/**
 	 * Check wether <code>id</code> is a valid CQi for a corpus.
 	 *
@@ -113,10 +113,13 @@
 	}
 	
 	public List<String> getSingleData(Property prop, int[] positions) throws UnexpectedAnswerException, IOException, CqiServerError {
-		boolean isWordProperty = !(prop instanceof StructuralUnitProperty);
 		String qname = prop.getQualifiedName();
 		AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
-		if (!isWordProperty) {
+		if (prop instanceof VirtualProperty) {
+			return ((VirtualProperty) prop).getValues(positions);
+			
+		}
+		else if (prop instanceof StructuralUnitProperty) {
 			int[] strucs = cqiClient.cpos2Struc(qname, positions);
 			return Arrays.asList(cqiClient.struc2Str(qname, strucs));
 			
@@ -147,13 +150,16 @@
 		// conversion from List<Integer> to int[]
 		int[] cpos = new int[allPositionsNeeded.size()];
 		int c = 0;
-		for (int i : allPositionsNeeded)
+		for (int i : allPositionsNeeded) {
 			cpos[c++] = i;
+		}
 		
 		// get values for positions
 		String[] values;
-		boolean isWordProperty = !(prop instanceof StructuralUnitProperty);
-		if (!isWordProperty) {
+		if (prop instanceof VirtualProperty) {
+			values = ((VirtualProperty) prop).getValues(cpos).toArray(new String[cpos.length]);
+		}
+		else if (prop instanceof StructuralUnitProperty) {
 			String qname = ((StructuralUnitProperty) prop).getQualifiedName();
 			int[] structs = this.cpos2Struc(qname, cpos);
 			values = this.struc2Str(qname, structs);
@@ -198,8 +204,8 @@
 		QueryResult tmp = corpus.query(new CQLQuery("<" + property.getFullName() + ">[]"), UUID.randomUUID().toString(), false); //$NON-NLS-1$ //$NON-NLS-2$
 		List<Match> matches = tmp.getMatches();
 		tmp.drop();
-		ArrayList<String> ret = new ArrayList<>(new HashSet<>(Match
-				.getValuesForProperty(property, matches)));
+		
+		ArrayList<String> ret = new ArrayList<>(new HashSet<>(Match.getValuesForProperty(property, matches)));
 		return ret;
 	}
 	
@@ -212,14 +218,14 @@
 	 */
 	public List<String> getData(StructuralUnitProperty prop, int number) throws CqiClientException {
 		
-		QueryResult tmp = prop.getCorpus()
-				.query(
-						new CQLQuery("<" + prop.getFullName() + ">[] expand to " + prop.getName()), UUID.randomUUID().toString(), false); //$NON-NLS-1$ //$NON-NLS-2$
-		if (number > tmp.getNMatch()) number = tmp.getNMatch();
+		QueryResult tmp = prop.getCorpus().query(new CQLQuery("<" + prop.getFullName() + ">[] expand to " + prop.getName()), UUID.randomUUID().toString(), false); //$NON-NLS-1$ //$NON-NLS-2$
+		if (number > tmp.getNMatch()) {
+			number = tmp.getNMatch();
+		}
 		List<Match> matches = tmp.getMatches(0, number);
 		tmp.drop();
-		return new ArrayList<>(new HashSet<>(Match
-				.getValuesForProperty(prop, matches)));
+		
+		return new ArrayList<>(new HashSet<>(Match.getValuesForProperty(prop, matches)));
 		// System.out.println("Data "+property.getQualifiedName()+": "+data);
 		
 	}
@@ -238,6 +244,7 @@
 	// None
 	/**
 	 * Disconnect.
+	 * T
 	 * 
 	 * @return true, if successful
 	 */
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy	(revision 2946)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy	(revision 2947)
@@ -37,7 +37,7 @@
 	HashMap<String, String> columnsToRenameRules = new HashMap<>();
 	HashMap<String, String[]> searchAndReplaceRules = new HashMap<>();
 	
-	String normalizePattern = "[ \p{P}\p{L}]"
+	List<String> normalizeSearchAndReplacePattern = [" ++", " "]
 	
 	columnsSelection = Arrays.asList(
 	"Identifiant de la notice", "Titre propre", "Notes du titre", "Date de diffusion", "Durée", "Nom fichier segmenté (info)", "antract_video",
@@ -54,7 +54,7 @@
 	searchAndReplaceRules.put("textorder", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3$2$1'] as String[]); // not working yet
 	searchAndReplaceRules.put("annee", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3'] as String[]); // not working yet
 	
-	process(excel, table2File, lineRules, columnsSelection, columnsToCopy, searchAndReplaceRules, columnsToRenameRules)
+	process(excel, table2File, lineRules, columnsSelection, columnsToCopy, searchAndReplaceRules, columnsToRenameRules, normalizeSearchAndReplacePattern)
 }
 
 if (buildSujetsMetadata) {
@@ -66,7 +66,7 @@
 	HashMap<String, String> columnsToRenameRules = new HashMap<>();
 	HashMap<String, String[]> searchAndReplaceRules = new HashMap<>();
 	
-	String normalizePattern = "[ \p{P}\p{L}]"
+	List<String> normalizeSearchAndReplacePattern = [" ++", " "]
 	
 	columnsSelection = Arrays.asList(
 		"Identifiant de la notice", "Titre propre", "Notes du titre", "Lien notice principale",
@@ -74,17 +74,15 @@
 		"Nom fichier segmenté (info)", "antract_video", "antract_debut", "antract_fin", "antract_duree", "antract_tc_type", "antract_tc_date",
 		"Résumé", "Séquences", "Descripteurs (Aff. Lig.)", "Générique (Aff. Lig.)");
 	
-	
-	
 	lineRules.put("Type de notice", "Notice sujet");
 
-	searchAndReplaceRules.put("textorder", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3$2$1'] as String[]); // not working yet
-	searchAndReplaceRules.put("annee", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3'] as String[]); // not working yet
+	searchAndReplaceRules.put("textorder", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3$2$1'] as String[]);
+	searchAndReplaceRules.put("annee", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3'] as String[]);
 		
-	process(excel, table2File, lineRules, columnsSelection, columnsToCopy, searchAndReplaceRules, columnsToRenameRules)
+	process(excel, table2File, lineRules, columnsSelection, columnsToCopy, searchAndReplaceRules, columnsToRenameRules, normalizeSearchAndReplacePattern)
 }
 
-def process(ReadExcel excel, File table2File, def lineRules, def columnsSelection, def columnsToCopy, def searchAndReplaceRules, def columnsToRenameRules) {
+def process(ReadExcel excel, File table2File, def lineRules, def columnsSelection, def columnsToCopy, def searchAndReplaceRules, def columnsToRenameRules, def normalizeSearchAndReplacePattern) {
 	System.out.println("Writing: $table2File");
 	
 	table2File.delete();
@@ -95,13 +93,20 @@
 		return;
 	}
 	
+	System.out.println(" Normalize Search&Replace in columns: " + columnsSelection);
+	def normalizePatternRules = new HashMap<>();
+	for (String col: columnsSelection) {
+		normalizePatternRules.put(col, normalizeSearchAndReplacePattern as String[]);
+	}
+	excel2.searchAndReplaceInLines(normalizePatternRules);
+	
 	if (columnsToCopy.size() > 0) {
 		System.out.println(" Copying column: " + columnsToCopy);
 		excel2.copyColumns(columnsToCopy);
 	}
-	
+		
 	if (searchAndReplaceRules.size() > 0) {
-		System.out.println(" Search&replace column: " + searchAndReplaceRules);
+		System.out.println(" Search&Replace in columns: " + searchAndReplaceRules);
 		excel2.searchAndReplaceInLines(searchAndReplaceRules);
 	}
 	
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java	(revision 2946)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java	(revision 2947)
@@ -52,22 +52,24 @@
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.VirtualProperty;
+
 /**
  * Action to build the reference pattern.
  *
  * @author mdecorde
  */
 public class DefineSortReferencePattern extends Action implements IWorkbenchAction {
-
+	
 	/** The Constant ID. */
 	private static final String ID = "org.txm.rcp.editors.concordances.definereferencepattern"; //$NON-NLS-1$
-
+	
 	/** The window. */
 	private IWorkbenchWindow window;
-
+	
 	/** The concordance editor. */
 	private ConcordanceEditor concordanceEditor;
-
+	
 	/**
 	 * Instantiates a new define reference pattern.
 	 *
@@ -82,60 +84,64 @@
 		setText(TXMUIMessages.referencesAmpsortOptions);
 		setToolTipText(TXMUIMessages.referencesSortOptions);
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
 	 */
 	@Override
-	public void dispose() {
-	}
-
-	/* (non-Javadoc)
+	public void dispose() {}
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.action.Action#run()
 	 */
 	@Override
 	public void run() {
 		List<StructuralUnit> structuralUnits = null;
-		List<Property> availableReferenceItems = new ArrayList<Property>();
+		List<Property> availableReferenceItems = new ArrayList<>();
 		try {
 			structuralUnits = concordanceEditor.getCorpus().getOrderedStructuralUnits();
 			availableReferenceItems.addAll(concordanceEditor.getCorpus().getOrderedProperties());
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
-
+		
 		for (StructuralUnit unit : structuralUnits) {
 			availableReferenceItems.addAll(unit.getOrderedProperties());
 		}
-
+		
 		// System.out.println("selected "+concordanceEditor.getSelectedReferences());
 		// System.out.println("before avail"+availableReferenceItems);
 		availableReferenceItems.removeAll(concordanceEditor.getSelectedSortReferences());
-
+		
+		availableReferenceItems.addAll(concordanceEditor.getCorpus().getVirtualProperties());
+		
 		// System.out.println("after avail"+availableReferenceItems);
 		DefineReferencePatternDialog d = null;
 		d = new DefineReferencePatternDialog(window.getShell(),
 				availableReferenceItems, concordanceEditor
-				.getSelectedSortReferences());
-
+						.getSelectedSortReferences());
+		
 		if (d.open() == Window.OK) {
 			concordanceEditor.setRefSortPattern(new ReferencePattern(d
 					.getSelectesdReferenceItems()));
-			//System.out.println(concordanceEditor.getSortReferencePattern());
+			// System.out.println(concordanceEditor.getSortReferencePattern());
 		}
 	}
-
+	
 	/**
 	 * The Class DefineReferencePatternDialog.
 	 */
 	private class DefineReferencePatternDialog extends Dialog {
-
+		
 		/** The available reference items. */
 		private List<Property> availableReferenceItems;
-
+		
 		/** The selected reference items. */
 		private List<Property> selectedReferenceItems;
-
+		
 		/**
 		 * Instantiates a new define reference pattern dialog.
 		 *
@@ -147,13 +153,13 @@
 				List<Property> availableReferenceItems,
 				List<Property> selectedReferences) {
 			super(parentShell);
-
+			
 			this.availableReferenceItems = availableReferenceItems;
 			this.selectedReferenceItems = selectedReferences;
 			this.availableReferenceItems.removeAll(selectedReferences);
-			this.setShellStyle(this.getShellStyle() | SWT.RESIZE);	
+			this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
 		}
-
+		
 		/**
 		 * Gets the selectesd reference items.
 		 *
@@ -162,154 +168,172 @@
 		public List<Property> getSelectesdReferenceItems() {
 			return selectedReferenceItems;
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
 		 */
 		@Override
 		protected void configureShell(Shell shell) {
 			super.configureShell(shell);
 			shell.setText(TXMUIMessages.referencesSortOptions);
-
+			
 			shell.setSize(400, 500);
 			shell.setLocation(shell.getParent().getLocation());
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 		 */
 		@Override
 		protected Control createDialogArea(Composite parent) {
-
+			
 			Composite mainArea = new Composite(parent, SWT.NONE);
 			mainArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
 					true, true));
 			mainArea.setLayout(new GridLayout(4, false));
-
+			
 			final org.eclipse.swt.widgets.List availbleItems = new org.eclipse.swt.widgets.List(
 					mainArea, SWT.BORDER | SWT.V_SCROLL);
 			for (Property property : availableReferenceItems) {
-				if (property instanceof StructuralUnitProperty) {
+				if (property instanceof VirtualProperty) {
+					VirtualProperty sProperty = (VirtualProperty) property;
+					availbleItems.add(sProperty.getFullName());
+				}
+				else if (property instanceof StructuralUnitProperty) {
 					StructuralUnitProperty sProperty = (StructuralUnitProperty) property;
 					availbleItems.add(sProperty.getStructuralUnit().getName()
 							+ ": " + property.getName()); //$NON-NLS-1$
-				} else {
+				}
+				else {
 					availbleItems.add(property.getName());
 				}
 			}
-
+			
 			GridData gridData = new GridData(GridData.FILL, GridData.FILL,
 					true, true);
-			//Point size = availbleItems.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-			//gridData.widthHint = size.x;
+			// Point size = availbleItems.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+			// gridData.widthHint = size.x;
 			availbleItems.setLayoutData(gridData);
-
+			
 			Composite selectionButtons = new Composite(mainArea, SWT.NONE);
 			selectionButtons.setLayout(new GridLayout(1, false));
 			Button select = new Button(selectionButtons, SWT.ARROW | SWT.RIGHT);
 			Button unselect = new Button(selectionButtons, SWT.ARROW | SWT.LEFT);
-
+			
 			final org.eclipse.swt.widgets.List selectedItems = new org.eclipse.swt.widgets.List(
 					mainArea, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
 			selectedItems.setLayoutData(gridData);
 			for (Property property : selectedReferenceItems) {
+				if (property instanceof VirtualProperty) {
+					VirtualProperty sProperty = (VirtualProperty) property;
+					selectedItems.add(sProperty.getFullName());
+				}
 				if (property instanceof StructuralUnitProperty) {
 					StructuralUnitProperty sProperty = (StructuralUnitProperty) property;
 					selectedItems.add(sProperty.getStructuralUnit().getName()
 							+ ": " + property.getName()); //$NON-NLS-1$
-				} else {
+				}
+				else {
 					selectedItems.add(property.getName());
 				}
 			}
-
-			//DBL CLICK Listeners
+			
+			// DBL CLICK Listeners
 			selectedItems.addMouseListener(new MouseListener() {
+				
 				@Override
-				public void mouseUp(MouseEvent e) { }
-
+				public void mouseUp(MouseEvent e) {}
+				
 				@Override
-				public void mouseDown(MouseEvent e) { }
-
+				public void mouseDown(MouseEvent e) {}
+				
 				@Override
 				public void mouseDoubleClick(MouseEvent e) {
 					int ind = selectedItems.getSelectionIndex();
 					availbleItems.add(selectedItems.getItem(ind));
 					selectedItems.remove(ind);
 					availableReferenceItems
-					.add(selectedReferenceItems.get(ind));
+							.add(selectedReferenceItems.get(ind));
 					selectedReferenceItems.remove(ind);
-					selectedItems.setSelection(ind);	
+					selectedItems.setSelection(ind);
 				}
 			});
 			availbleItems.addMouseListener(new MouseListener() {
+				
 				@Override
-				public void mouseUp(MouseEvent e) { }
-
+				public void mouseUp(MouseEvent e) {}
+				
 				@Override
-				public void mouseDown(MouseEvent e) { }
-
+				public void mouseDown(MouseEvent e) {}
+				
 				@Override
 				public void mouseDoubleClick(MouseEvent e) {
 					int ind = availbleItems.getSelectionIndex();
 					selectedItems.add(availbleItems.getItem(ind));
 					availbleItems.remove(ind);
 					selectedReferenceItems
-					.add(availableReferenceItems.get(ind));
+							.add(availableReferenceItems.get(ind));
 					availableReferenceItems.remove(ind);
 					availbleItems.setSelection(ind);
 				}
 			});
-
+			
 			Composite orderButtons = new Composite(mainArea, SWT.NONE);
 			orderButtons.setLayout(new GridLayout(1, false));
 			Button up = new Button(orderButtons, SWT.ARROW | SWT.UP);
 			Button down = new Button(orderButtons, SWT.ARROW | SWT.DOWN);
-
+			
 			select.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = availbleItems.getSelectionIndex();
 					selectedItems.add(availbleItems.getItem(ind));
 					availbleItems.remove(ind);
 					selectedReferenceItems
-					.add(availableReferenceItems.get(ind));
+							.add(availableReferenceItems.get(ind));
 					availableReferenceItems.remove(ind);
 					availbleItems.setSelection(ind);
 				}
 			});
-
+			
 			unselect.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = selectedItems.getSelectionIndex();
 					availbleItems.add(selectedItems.getItem(ind));
 					selectedItems.remove(ind);
 					availableReferenceItems
-					.add(selectedReferenceItems.get(ind));
+							.add(selectedReferenceItems.get(ind));
 					selectedReferenceItems.remove(ind);
-					selectedItems.setSelection(ind);					
+					selectedItems.setSelection(ind);
 				}
 			});
-
+			
 			up.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = selectedItems.getSelectionIndex();
 					if (ind > 0) {
 						String value = selectedItems.getItem(ind);
 						selectedItems.remove(ind);
-						selectedItems.add(value, ind -1);
-
+						selectedItems.add(value, ind - 1);
+						
 						Property prop = selectedReferenceItems.get(ind);
 						selectedReferenceItems.remove(ind);
-						selectedReferenceItems.add(ind-1,prop);
-
-						selectedItems.setSelection(ind -1);
+						selectedReferenceItems.add(ind - 1, prop);
+						
+						selectedItems.setSelection(ind - 1);
 					}
 				}
 			});
-
+			
 			down.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = selectedItems.getSelectionIndex();
@@ -317,17 +341,17 @@
 						String value = selectedItems.getItem(ind);
 						selectedItems.remove(ind);
 						selectedItems.add(value, ind + 1);
-
+						
 						Property prop = selectedReferenceItems.get(ind);
 						selectedReferenceItems.remove(ind);
-						selectedReferenceItems.add(ind+1, prop);
-
+						selectedReferenceItems.add(ind + 1, prop);
+						
 						selectedItems.setSelection(ind + 1);
 					}
 				}
 			});
-
+			
 			return mainArea;
 		}
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java	(revision 2946)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java	(revision 2947)
@@ -52,22 +52,24 @@
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnit;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.VirtualProperty;
+
 /**
  * Action to build the reference pattern.
  *
  * @author mdecorde
  */
 public class DefineViewReferencePattern extends Action implements IWorkbenchAction {
-
+	
 	/** The Constant ID. */
 	private static final String ID = "org.txm.rcp.editors.concordances.definereferencepattern"; //$NON-NLS-1$
-
+	
 	/** The window. */
 	private IWorkbenchWindow window;
-
+	
 	/** The concordance editor. */
 	private ConcordanceEditor concordanceEditor;
-
+	
 	/**
 	 * Instantiates a new define reference pattern.
 	 *
@@ -82,60 +84,65 @@
 		setText(TXMUIMessages.referencesAmpdisplayOptions);
 		setToolTipText(TXMUIMessages.referencesDisplayOptions);
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
 	 */
 	@Override
-	public void dispose() { }
-
-	/* (non-Javadoc)
+	public void dispose() {}
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.action.Action#run()
 	 */
 	@Override
 	public void run() {
 		List<StructuralUnit> structuralUnits = null;
-		List<Property> availableReferenceItems = new ArrayList<Property>();
+		List<Property> availableReferenceItems = new ArrayList<>();
 		try {
 			structuralUnits = concordanceEditor.getCorpus().getOrderedStructuralUnits();
 			availableReferenceItems.addAll(concordanceEditor.getCorpus().getOrderedProperties());
-		} catch (Exception e) {
+		}
+		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 		}
-
+		
 		for (StructuralUnit unit : structuralUnits) {
 			availableReferenceItems.addAll(unit.getOrderedProperties());
 		}
-
+		
+		availableReferenceItems.addAll(concordanceEditor.getCorpus().getVirtualProperties());
+		
 		// System.out.println("selected "+concordanceEditor.getSelectedReferences());
 		// System.out.println("before avail"+availableReferenceItems);
 		availableReferenceItems.removeAll(concordanceEditor.getSelectedViewReferences());
-
+		
 		// System.out.println("after avail"+availableReferenceItems);
 		DefineReferencePatternDialog d = null;
 		d = new DefineReferencePatternDialog(window.getShell(),
 				availableReferenceItems, concordanceEditor
-				.getSelectedViewReferences());
-
+						.getSelectedViewReferences());
+		
 		if (d.open() == Window.OK) {
 			concordanceEditor.setRefViewPattern(new ReferencePattern(d
 					.getSelectesdReferenceItems()));
-			//System.out.println(concordanceEditor.getViewReferencePattern());
-
+			// System.out.println(concordanceEditor.getViewReferencePattern());
+			
 		}
 	}
-
+	
 	/**
 	 * The Class DefineReferencePatternDialog.
 	 */
 	private class DefineReferencePatternDialog extends Dialog {
-
+		
 		/** The available reference items. */
 		private List<Property> availableReferenceItems;
-
+		
 		/** The selected reference items. */
 		private List<Property> selectedReferenceItems;
-
+		
 		/**
 		 * Instantiates a new define reference pattern dialog.
 		 *
@@ -147,13 +154,13 @@
 				List<Property> availableReferenceItems,
 				List<Property> selectedReferences) {
 			super(parentShell);
-
+			
 			this.availableReferenceItems = availableReferenceItems;
 			this.selectedReferenceItems = selectedReferences;
 			this.availableReferenceItems.removeAll(selectedReferences);
-			this.setShellStyle(this.getShellStyle() | SWT.RESIZE);	
+			this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
 		}
-
+		
 		/**
 		 * Gets the selectesd reference items.
 		 *
@@ -162,154 +169,172 @@
 		public List<Property> getSelectesdReferenceItems() {
 			return selectedReferenceItems;
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
 		 */
 		@Override
 		protected void configureShell(Shell shell) {
 			super.configureShell(shell);
 			shell.setText(TXMUIMessages.referencesDisplayOptions);
-
+			
 			shell.setSize(400, 500);
 			shell.setLocation(shell.getParent().getLocation());
 		}
-
-		/* (non-Javadoc)
+		
+		/*
+		 * (non-Javadoc)
 		 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 		 */
 		@Override
 		protected Control createDialogArea(Composite parent) {
-
+			
 			Composite mainArea = new Composite(parent, SWT.NONE);
 			mainArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
 					true, true));
 			mainArea.setLayout(new GridLayout(4, false));
-
+			
 			final org.eclipse.swt.widgets.List availbleItems = new org.eclipse.swt.widgets.List(
 					mainArea, SWT.BORDER | SWT.V_SCROLL);
 			for (Property property : availableReferenceItems) {
-				if (property instanceof StructuralUnitProperty) {
+				if (property instanceof VirtualProperty) {
+					VirtualProperty sProperty = (VirtualProperty) property;
+					availbleItems.add(sProperty.getFullName());
+				}
+				else if (property instanceof StructuralUnitProperty) {
 					StructuralUnitProperty sProperty = (StructuralUnitProperty) property;
 					availbleItems.add(sProperty.getStructuralUnit().getName()
 							+ ": " + property.getName()); //$NON-NLS-1$
-				} else {
+				}
+				else {
 					availbleItems.add(property.getName());
 				}
 			}
-
+			
 			GridData gridData = new GridData(GridData.FILL, GridData.FILL,
 					true, true);
-			//Point size = availbleItems.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-			//gridData.widthHint = size.x;
+			// Point size = availbleItems.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+			// gridData.widthHint = size.x;
 			availbleItems.setLayoutData(gridData);
-
+			
 			Composite selectionButtons = new Composite(mainArea, SWT.NONE);
 			selectionButtons.setLayout(new GridLayout(1, false));
 			Button select = new Button(selectionButtons, SWT.ARROW | SWT.RIGHT);
 			Button unselect = new Button(selectionButtons, SWT.ARROW | SWT.LEFT);
-
+			
 			final org.eclipse.swt.widgets.List selectedItems = new org.eclipse.swt.widgets.List(
 					mainArea, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
 			selectedItems.setLayoutData(gridData);
 			for (Property property : selectedReferenceItems) {
-				if (property instanceof StructuralUnitProperty) {
+				if (property instanceof VirtualProperty) {
+					VirtualProperty sProperty = (VirtualProperty) property;
+					selectedItems.add(sProperty.getFullName());
+				}
+				else if (property instanceof StructuralUnitProperty) {
 					StructuralUnitProperty sProperty = (StructuralUnitProperty) property;
 					selectedItems.add(sProperty.getStructuralUnit().getName()
 							+ ": " + property.getName()); //$NON-NLS-1$
-				} else {
+				}
+				else {
 					selectedItems.add(property.getName());
 				}
 			}
-
-			//DBL CLICK Listeners
+			
+			// DBL CLICK Listeners
 			selectedItems.addMouseListener(new MouseListener() {
+				
 				@Override
-				public void mouseUp(MouseEvent e) { }
-
+				public void mouseUp(MouseEvent e) {}
+				
 				@Override
-				public void mouseDown(MouseEvent e) { }
-
+				public void mouseDown(MouseEvent e) {}
+				
 				@Override
 				public void mouseDoubleClick(MouseEvent e) {
 					int ind = selectedItems.getSelectionIndex();
 					availbleItems.add(selectedItems.getItem(ind));
 					selectedItems.remove(ind);
 					availableReferenceItems
-					.add(selectedReferenceItems.get(ind));
+							.add(selectedReferenceItems.get(ind));
 					selectedReferenceItems.remove(ind);
-					selectedItems.setSelection(ind);	
+					selectedItems.setSelection(ind);
 				}
 			});
 			availbleItems.addMouseListener(new MouseListener() {
+				
 				@Override
-				public void mouseUp(MouseEvent e) { }
-
+				public void mouseUp(MouseEvent e) {}
+				
 				@Override
-				public void mouseDown(MouseEvent e) { }
-
+				public void mouseDown(MouseEvent e) {}
+				
 				@Override
 				public void mouseDoubleClick(MouseEvent e) {
 					int ind = availbleItems.getSelectionIndex();
 					selectedItems.add(availbleItems.getItem(ind));
 					availbleItems.remove(ind);
 					selectedReferenceItems
-					.add(availableReferenceItems.get(ind));
+							.add(availableReferenceItems.get(ind));
 					availableReferenceItems.remove(ind);
 					availbleItems.setSelection(ind);
 				}
 			});
-
+			
 			Composite orderButtons = new Composite(mainArea, SWT.NONE);
 			orderButtons.setLayout(new GridLayout(1, false));
 			Button up = new Button(orderButtons, SWT.ARROW | SWT.UP);
 			Button down = new Button(orderButtons, SWT.ARROW | SWT.DOWN);
-
+			
 			select.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = availbleItems.getSelectionIndex();
 					selectedItems.add(availbleItems.getItem(ind));
 					availbleItems.remove(ind);
 					selectedReferenceItems
-					.add(availableReferenceItems.get(ind));
+							.add(availableReferenceItems.get(ind));
 					availableReferenceItems.remove(ind);
 					availbleItems.setSelection(ind);
 				}
 			});
-
+			
 			unselect.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = selectedItems.getSelectionIndex();
 					availbleItems.add(selectedItems.getItem(ind));
 					selectedItems.remove(ind);
 					availableReferenceItems
-					.add(selectedReferenceItems.get(ind));
+							.add(selectedReferenceItems.get(ind));
 					selectedReferenceItems.remove(ind);
-					selectedItems.setSelection(ind);					
+					selectedItems.setSelection(ind);
 				}
 			});
-
+			
 			up.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = selectedItems.getSelectionIndex();
 					if (ind > 0) {
 						String value = selectedItems.getItem(ind);
 						selectedItems.remove(ind);
-						selectedItems.add(value, ind -1);
-
+						selectedItems.add(value, ind - 1);
+						
 						Property prop = selectedReferenceItems.get(ind);
 						selectedReferenceItems.remove(ind);
-						selectedReferenceItems.add(ind-1,prop);
-
-						selectedItems.setSelection(ind -1);
+						selectedReferenceItems.add(ind - 1, prop);
+						
+						selectedItems.setSelection(ind - 1);
 					}
 				}
 			});
-
+			
 			down.addSelectionListener(new SelectionAdapter() {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					int ind = selectedItems.getSelectionIndex();
@@ -317,17 +342,17 @@
 						String value = selectedItems.getItem(ind);
 						selectedItems.remove(ind);
 						selectedItems.add(value, ind + 1);
-
+						
 						Property prop = selectedReferenceItems.get(ind);
 						selectedReferenceItems.remove(ind);
-						selectedReferenceItems.add(ind+1, prop);
-
+						selectedReferenceItems.add(ind + 1, prop);
+						
 						selectedItems.setSelection(ind + 1);
 					}
 				}
 			});
-
+			
 			return mainArea;
 		}
 	}
-}
\ No newline at end of file
+}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/MultiplePropertySelectionDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/MultiplePropertySelectionDialog.java	(revision 2946)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/MultiplePropertySelectionDialog.java	(revision 2947)
@@ -46,34 +46,35 @@
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.VirtualProperty;
 
 // TODO: Auto-generated Javadoc
 /**
  * The dialog box called to select the view properties.
  * 
- *  @ author mdecorde
+ * @ author mdecorde
  */
 public class MultiplePropertySelectionDialog<P extends Property> extends Dialog {
-
+	
 	/** The available properties. */
 	final private List<P> availableProperties;
-
+	
 	/** The selected properties. */
 	final private List<P> selectedProperties;
-
+	
 	/** The maxprops. */
 	int maxprops = -1;
-
+	
 	/** The available properties view. */
 	org.eclipse.swt.widgets.List availablePropertiesView;
-
+	
 	/** The selected properties view. */
 	org.eclipse.swt.widgets.List selectedPropertiesView;
-
+	
 	private ArrayList<P> cancelSelectedProperties;
-
+	
 	private ArrayList<P> cancelAvailableProperties;
-
+	
 	/**
 	 * Instantiates a new view property selection dialog.
 	 *
@@ -86,7 +87,7 @@
 			List<P> selectedProperties) {
 		this(parentShell.getShell(), availableProperties, selectedProperties);
 	}
-
+	
 	/**
 	 * Instantiates a new view property selection dialog.
 	 *
@@ -99,7 +100,7 @@
 			List<P> selectedProperties) {
 		this(shell, availableProperties, selectedProperties, -1);
 	}
-
+	
 	/**
 	 * Instantiates a new view property selection dialog.
 	 *
@@ -112,16 +113,16 @@
 			List<P> availableProperties,
 			List<P> selectedProperties, int maxprops) {
 		super(shell);
-
+		
 		this.availableProperties = availableProperties;
 		this.selectedProperties = selectedProperties;
-		this.cancelAvailableProperties = new ArrayList<P>(availableProperties);
-		this.cancelSelectedProperties = new ArrayList<P>(selectedProperties);
+		this.cancelAvailableProperties = new ArrayList<>(availableProperties);
+		this.cancelSelectedProperties = new ArrayList<>(selectedProperties);
 		
 		this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
 		this.maxprops = maxprops;
 	}
-
+	
 	/**
 	 * Gets the selected properties.
 	 *
@@ -130,8 +131,9 @@
 	public List<P> getSelectedProperties() {
 		return selectedProperties;
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
 	 */
 	@Override
@@ -140,8 +142,9 @@
 		newShell.setText(TXMUIMessages.common_displayOptions);
 		newShell.setMinimumSize(300, 200);
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 	 */
 	@Override
@@ -149,40 +152,42 @@
 		// parent.setLayout(new FormLayout());
 		Composite mainArea = new Composite(parent, SWT.NONE);
 		mainArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
+		
 		// 4 columns
 		GridLayout layout = new GridLayout(4, false);
 		mainArea.setLayout(layout);
-
+		
 		availablePropertiesView = new org.eclipse.swt.widgets.List(mainArea, SWT.BORDER | SWT.V_SCROLL);
 		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
 		availablePropertiesView.setLayoutData(gridData);
-
+		
 		Composite selectionButtons = new Composite(mainArea, SWT.NONE);
 		selectionButtons.setLayout(new GridLayout(1, false));
 		Button select = new Button(selectionButtons, SWT.ARROW | SWT.RIGHT);
 		Button unselect = new Button(selectionButtons, SWT.ARROW | SWT.LEFT);
-
+		
 		selectedPropertiesView = new org.eclipse.swt.widgets.List(mainArea, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
 		gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
 		selectedPropertiesView.setLayoutData(gridData);
-
+		
 		Composite orderButtons = new Composite(mainArea, SWT.NONE);
 		orderButtons.setLayout(new GridLayout(1, false));
 		Button up = new Button(orderButtons, SWT.ARROW | SWT.UP);
 		Button down = new Button(orderButtons, SWT.ARROW | SWT.DOWN);
-
+		
 		select.addSelectionListener(new SelectionAdapter() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int index = availablePropertiesView.getSelectionIndex();
 				if (maxprops == 1) {
 					selectedProperties.add(availableProperties.get(index));
 					availableProperties.remove(index);
-
+					
 					availableProperties.add(selectedProperties.get(0));
 					selectedProperties.remove(0);
-				} else {
+				}
+				else {
 					if (maxprops > 0) {
 						if (selectedProperties.size() >= maxprops)
 							return;
@@ -196,94 +201,100 @@
 				availablePropertiesView.setSelection(index);
 			}
 		});
-
+		
 		unselect.addSelectionListener(new SelectionAdapter() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				deselectProperties();
 			}
 		});
-
+		
 		up.addSelectionListener(new SelectionAdapter() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int index = selectedPropertiesView.getSelectionIndex();
 				if (index > 0) {
 					P selectedP = selectedProperties.get(index);
 					P upperP = selectedProperties.get(index - 1);
-
+					
 					selectedProperties.set(index, upperP);
 					selectedProperties.set(index - 1, selectedP);
-
+					
 					reload();
 					selectedPropertiesView.setSelection(index - 1);
 				}
 			}
 		});
-
+		
 		down.addSelectionListener(new SelectionAdapter() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				int index = selectedPropertiesView.getSelectionIndex();
 				if (index < selectedProperties.size() - 1 && index >= 0) {
 					P selectedP = selectedProperties.get(index);
 					P bellowP = selectedProperties.get(index + 1);
-
+					
 					selectedProperties.set(index, bellowP);
 					selectedProperties.set(index + 1, selectedP);
-
+					
 					reload();
 					selectedPropertiesView.setSelection(index + 1);
 				}
 			}
 		});
-
+		
 		availablePropertiesView.addMouseListener(new MouseAdapter() {
+			
 			@Override
 			public void mouseDoubleClick(MouseEvent e) {
-
-				if ( maxprops == 1) {
+				
+				if (maxprops == 1) {
 					int index = availablePropertiesView.getSelectionIndex();
-					//System.out.println("dl click, maxprops="+maxprops+" idx="+index);
+					// System.out.println("dl click, maxprops="+maxprops+" idx="+index);
 					selectedProperties.add(availableProperties.get(index));
 					availableProperties.remove(index);
-
+					
 					availableProperties.add(selectedProperties.get(0));
 					selectedProperties.remove(0);
-
+					
 					reload();
-
-				} else {
+					
+				}
+				else {
 					int index = availablePropertiesView.getSelectionIndex();
 					if (index >= 0) {
 						selectedProperties.add(availableProperties.get(index));
 						availableProperties.remove(index);
-
+						
 						reload();
 						availablePropertiesView.setSelection(index);
 					}
 				}
 			}
 		});
-
+		
 		selectedPropertiesView.addMouseListener(new MouseAdapter() {
+			
 			@Override
 			public void mouseDoubleClick(MouseEvent e) {
 				deselectProperties();
 			}
 		});
-
+		
 		reload();
 		return mainArea;
 	}
-
+	
 	private void deselectProperties() {
 		if (selectedProperties.size() > 1) {
 			int index = selectedPropertiesView.getSelectionIndex();
-
+			
 			availableProperties.add(selectedProperties.get(index));
 			selectedProperties.remove(index);
-
+			
 			reload();
 			selectedPropertiesView.setSelection(index);
 		}
@@ -299,29 +310,33 @@
 		}
 		availablePropertiesView.removeAll();
 		for (Property property : availableProperties) {
-			//if (!property.getName().equals("id")) //$NON-NLS-1$
-			if (property instanceof StructuralUnitProperty) {
-				availablePropertiesView.add(((StructuralUnitProperty)property).getFullName());
+			// if (!property.getName().equals("id")) //$NON-NLS-1$
+			if (property instanceof VirtualProperty) {
+				availablePropertiesView.add(((VirtualProperty) property).getFullName());
 			}
+			else if (property instanceof StructuralUnitProperty) {
+				availablePropertiesView.add(((StructuralUnitProperty) property).getFullName());
+			}
 			else {
 				availablePropertiesView.add(property.getName());
 			}
 		}
 		selectedPropertiesView.removeAll();
 		for (Property property : selectedProperties) {
-			//if (!property.getName().equals("id")) //$NON-NLS-1$
+			// if (!property.getName().equals("id")) //$NON-NLS-1$
 			if (property instanceof StructuralUnitProperty) {
-				selectedPropertiesView.add(((StructuralUnitProperty)property).getFullName());
+				selectedPropertiesView.add(((StructuralUnitProperty) property).getFullName());
 			}
 			else {
 				selectedPropertiesView.add(property.getName());
 			}
 		}
-
+		
 		availablePropertiesView.getParent().layout();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
 	 */
 	@Override
@@ -330,8 +345,9 @@
 			super.okPressed();
 		}
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
 	 */
 	@Override
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/SinglePropertySelectionDialog.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/SinglePropertySelectionDialog.java	(revision 2946)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/dialog/SinglePropertySelectionDialog.java	(revision 2947)
@@ -46,6 +46,7 @@
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
+import org.txm.searchengine.cqp.corpus.VirtualProperty;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -196,7 +197,10 @@
 		availablePropertiesView.removeAll();
 		for (Property property : allProperties) {
 			// if (!property.getName().equals("id")) //$NON-NLS-1$
-			if (property instanceof StructuralUnitProperty) {
+			if (property instanceof VirtualProperty) {
+				availablePropertiesView.add(((VirtualProperty) property).getFullName());
+			}
+			else if (property instanceof StructuralUnitProperty) {
 				availablePropertiesView.add(((StructuralUnitProperty) property).getFullName());
 			}
 			else {
Index: tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/handlers/___ReferencerToConc.java
===================================================================
--- tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/handlers/___ReferencerToConc.java	(revision 2946)
+++ tmp/org.txm.referencer.rcp/src/org/txm/referencer/rcp/handlers/___ReferencerToConc.java	(revision 2947)
@@ -54,22 +54,23 @@
  */
 @Deprecated
 public class ___ReferencerToConc extends AbstractHandler {
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
 	 */
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		IStructuredSelection selection = (IStructuredSelection) HandlerUtil
-		.getActiveWorkbenchWindow(event).getActivePage().getSelection();
-
+				.getActiveWorkbenchWindow(event).getActivePage().getSelection();
+		
 		ReferencerEditor refeditor = (ReferencerEditor) HandlerUtil
-		.getActiveWorkbenchWindow(event).getActivePage()
-		.getActivePart();
-
+				.getActiveWorkbenchWindow(event).getActivePage()
+				.getActivePart();
+		
 		return link(refeditor, selection);
 	}
-
+	
 	/**
 	 * Link.
 	 *
@@ -77,33 +78,35 @@
 	 * @param iSelection the selection
 	 * @return the object
 	 */
-	public static Object link(ReferencerEditor refeditor, ISelection iSelection)
-	{
+	public static Object link(ReferencerEditor refeditor, ISelection iSelection) {
 		IStructuredSelection selection = (IStructuredSelection) iSelection;
 		String query = getQuery(refeditor.getReferencer(), selection);
-		if (query.length() == 0)
+		if (query.length() == 0) {
 			return null;
+		}
 		CQPCorpus corpus = refeditor.getCorpus();
 		Concordance concordance = new Concordance(corpus);
 		
 		ReferencePattern rp = new ReferencePattern();
-		for (Property p : refeditor.getReferencer().getPattern())
+		for (Property p : refeditor.getReferencer().getPattern()) {
 			rp.addProperty(p);
+		}
 		
 		concordance.setParameters(new CQLQuery(query), null, null, null, null, null, null, rp, rp, null, null);
 		TXMResultEditorInput editorInput = new TXMResultEditorInput(concordance);
-
+		
 		IWorkbenchPage page = refeditor.getEditorSite().getWorkbenchWindow().getActivePage();
 		try {
 			ConcordanceEditor conceditor = (ConcordanceEditor) page.openEditor(editorInput,
-					ConcordanceEditor.class.getName()); //$NON-NLS-1$
-		} catch (PartInitException e) {
-			System.err.println("Error: "+e.getLocalizedMessage());
+					ConcordanceEditor.class.getName());
 		}
-
+		catch (PartInitException e) {
+			System.err.println("Error: " + e.getLocalizedMessage());
+		}
+		
 		return null;
 	}
-
+	
 	/**
 	 * Gets the query.
 	 *
@@ -112,17 +115,16 @@
 	 */
 	private static String getQuery(Referencer referencer, IStructuredSelection selection) {
 		String query = ""; //$NON-NLS-1$
-
+		
 		Line fline = (Line) selection.getFirstElement();
 		int nbToken = 1;
-
+		
 		List<Line> lines = selection.toList();
-
+		
 		Property prop = referencer.getProperty();
-		for (int t = 0; t < nbToken; t++) 
-		{
-			query += "["+prop + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
-
+		for (int t = 0; t < nbToken; t++) {
+			query += "[" + prop + "=\""; //$NON-NLS-1$ //$NON-NLS-2$
+			
 			for (Line line : lines) {
 				String s = line.getPropValue();
 				s = CQLQuery.addBackSlash(s);
