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 2274)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 2275)
@@ -141,192 +141,204 @@
  * @author mdecorde.
  */
 public class ConcordanceEditor extends TXMEditor<Concordance> {
-
+	
 	public static final String ID = ConcordanceEditor.class.getName();
-
-	String locale = Locale.getDefault().getLanguage();//RCPPreferences.getInstance().getString(RCPPreferences.CONFIG_LOCALE);
-
+	
+	String locale = Locale.getDefault().getLanguage();// RCPPreferences.getInstance().getString(RCPPreferences.CONFIG_LOCALE);
+	
 	private static final String BACKTOTEXT_COMMAND_ID = "org.txm.rcp.extensionpoint.backtotext"; //$NON-NLS-1$
-
+	
 	/** The lineids. */
 	List<String> lineids;
-
+	
 	/** The standard comparators. */
 	private List<LineComparator> standardComparators;
-
+	
 	/** The user defined comparators. */
 	private List<LineComparator> userDefinedComparators;
-
+	
 	/** The complexsorter. */
 	ComplexSortSelector complexsorter;
+	
 	org.eclipse.swt.widgets.Text cqlSeparator;
-
+	
 	private Concordance concordance;
-
+	
 	/** The standard comparator class name. */
 	private LineComparator[] standardComparatorClassName = {
 			new NullComparator(), new LexicographicKeywordComparator(),
 			new LexicographicLeftContextComparator(),
 			new LexicographicRightContextComparator(),
 			new PropertiesReferenceComparator() };
-
-	//	/** The n line per page. */
-	//	private int concordance.getNLinePerPage();
+	
+	// /** The n line per page. */
+	// private int concordance.getNLinePerPage();
 	//
-	//	/** The top line. */
-	//	private int topLine;
+	// /** The top line. */
+	// private int topLine;
 	//
-	//	/** The bottom line. */
-	//	private int bottomLine;
-
+	// /** The bottom line. */
+	// private int bottomLine;
+	
 	/** The current comparator. */
 	protected LineComparator currentComparator;
-
-	//	/** The left context size. */
-	//	private int leftContextSize;
+	
+	// /** The left context size. */
+	// private int leftContextSize;
 	//
-	//	/** The right context size. */
-	//	private int rightContextSize;
-
+	// /** The right context size. */
+	// private int rightContextSize;
+	
 	/** The mouseposition. */
 	private Point mouseposition;
-
+	
 	/** The line table viewer. */
 	protected TableViewer viewerRight, viewerLeft;
-
+	
 	/** The reference column. */
 	private TableColumn referenceColumn;
-
+	
 	/** The first column. */
 	private TableColumn firstColumn; // due to a restriction on some platforms
 	// (actually, MS Windows), the first
 	// column is always left aligned. The
 	// work around is to have a 0 width
 	// first column
+	
 	/** The left context column. */
 	private TableColumn leftContextColumn;
+	
 	/** The keyword column. */
 	private TableColumn keywordColumn;
+	
 	/** The right context column. */
 	private TableColumn rightContextColumn;
-
-	//	/** The view properties label. */
-	//	private Label viewPropertiesLabel;
-
+	
+	// /** The view properties label. */
+	// private Label viewPropertiesLabel;
+	
 	/** The set sort property action. */
 	private Action setSortPropertyAction;
-
+	
 	/** The set context size action. */
 	private Action setContextSizeAction;
-
+	
 	/** The set line number action. */
 	private Action setLineNumberAction;
-
+	
 	/** The define view reference pattern action. */
 	protected Action defineViewReferencePatternAction;
-
+	
 	/** The define sort reference pattern action. */
-	protected Action defineSortReferencePatternAction;	
-
+	protected Action defineSortReferencePatternAction;
+	
 	/** The set view property action. */
 	protected Action setViewPropertyAction;
-
+	
 	/** The attached browser editor. */
 	protected TXMBrowser attachedBrowserEditor;
-
+	
 	/** The progresslistener. */
 	protected ProgressListener progresslistener;
-
+	
 	/** The textid. */
 	protected String textid;
-
+	
 	/** The opened page. */
 	Page openedPage;
-
+	
 	/** The query area. */
 	private Composite queryArea;
-
+	
 	/** The navigation area. */
 	private NavigationWidget navigationWidget;
-
-
-	/** The hide btn: hides the form
-	 * TODO: remove the button when the TXMEditorToolbar is fully functionnal. */
+	
+	
+	/**
+	 * The hide btn: hides the form
+	 * TODO: remove the button when the TXMEditorToolbar is fully functionnal.
+	 */
 	private Button deleteLineButton;
-
+	
 	/** The query size. */
 	protected Point querySize;
-
-
+	
 	private Sash sash;
-
+	
 	private Listener tableResizeListener;
-
+	
 	private Table leftTable;
-
+	
 	private Table rightTable;
-
+	
 	private ScrollBar vBarLeft;
-
+	
 	private ScrollBar vBarRight;
-
+	
 	private Label queryLabel;
-
+	
 	private Composite navigationArea;
-
-
+	
+	
 	/** The query widget. */
-	@Parameter(key=ConcordancePreferences.QUERY)
+	@Parameter(key = ConcordancePreferences.QUERY)
 	protected AssistedChoiceQueryWidget queryWidget;
-
-	@Parameter(key=ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES)
+	
+	@Parameter(key = ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES)
 	private PropertiesSelector<WordProperty> leftSortProperties;
-	@Parameter(key=ConcordancePreferences.ANALYSIS_REFERENCE_PATTERN)
+	
+	@Parameter(key = ConcordancePreferences.ANALYSIS_REFERENCE_PATTERN)
 	private PropertiesSelector<Property> refSortProperties;
-	@Parameter(key=ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES)
+	
+	@Parameter(key = ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES)
 	private PropertiesSelector<WordProperty> keywordSortProperties;
-	@Parameter(key=ConcordancePreferences.RIGHT_VIEW_PROPERTIES)
+	
+	@Parameter(key = ConcordancePreferences.RIGHT_VIEW_PROPERTIES)
 	private PropertiesSelector<WordProperty> rightViewProperties;
-	@Parameter(key=ConcordancePreferences.KEYWORD_VIEW_PROPERTIES)
+	
+	@Parameter(key = ConcordancePreferences.KEYWORD_VIEW_PROPERTIES)
 	private PropertiesSelector<WordProperty> keywordViewProperties;
-	@Parameter(key=ConcordancePreferences.LEFT_VIEW_PROPERTIES)
+	
+	@Parameter(key = ConcordancePreferences.LEFT_VIEW_PROPERTIES)
 	private PropertiesSelector<WordProperty> leftViewProperties;
-	@Parameter(key=ConcordancePreferences.VIEW_REFERENCE_PATTERN)
+	
+	@Parameter(key = ConcordancePreferences.VIEW_REFERENCE_PATTERN)
 	private PropertiesSelector<Property> refViewProperties;
-	@Parameter(key=ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES)
+	
+	@Parameter(key = ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES)
 	private PropertiesSelector<WordProperty> rightSortProperties;
-	@Parameter(key=ConcordancePreferences.LEFT_CONTEXT_SIZE)
+	
+	@Parameter(key = ConcordancePreferences.LEFT_CONTEXT_SIZE)
 	private Spinner leftSizeSpinner;
-	@Parameter(key=ConcordancePreferences.RIGHT_CONTEXT_SIZE)
+	
+	@Parameter(key = ConcordancePreferences.RIGHT_CONTEXT_SIZE)
 	private Spinner rightSizeSpinner;
-
-	//	private PropertiesSelector<Property> propsArea;
-
-
-
-
-
+	
+	// private PropertiesSelector<Property> propsArea;
+	
+	
+	
+	
+	
 	@Override
 	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+		
 		super.init(site, input);
-
-		if (!(this.result instanceof Concordance)) {
-			throw new PartInitException(ConcordanceUIMessages.bind(ConcordanceUIMessages.canNotOpenConcordanceEditorWithP0, result));
-		}
-		this.concordance = (Concordance)this.result;
-
+		
+		if (!(this.result instanceof Concordance)) { throw new PartInitException(ConcordanceUIMessages.bind(ConcordanceUIMessages.canNotOpenConcordanceEditorWithP0, result)); }
+		this.concordance = (Concordance) this.result;
+		
 		this.standardComparators = new ArrayList<LineComparator>();
 		this.userDefinedComparators = new ArrayList<LineComparator>();
 		this.setStandardComparators();
 		concordance.setNLinePerPage(ConcordancePreferences.getInstance().getInt(ConcordancePreferences.N_LINES_PER_PAGE));
 	}
-
-
+	
 	@Override
 	public void _createPartControl() {
-
+		
 		Composite controlArea = getExtendedParametersGroup();
-
+		
 		try {
 			composeControlArea(controlArea);
 			Composite d = new Composite(getResultArea(), SWT.NONE);
@@ -336,26 +348,30 @@
 			if (complexsorter != null) {
 				complexsorter.setComparators(this);
 			}
-		} catch(Exception e) {
+		}
+		catch (Exception e) {
 			System.out.println(ConcordanceUIMessages.bind(ConcordanceUIMessages.errorWhileBuildingInterfaceColonP0, e.getLocalizedMessage()));
 			Log.printStackTrace(e);
 		}
 	}
-
+	
 	/**
 	 * Compose display area.
 	 *
 	 * @param displayArea the display area
 	 */
 	private void composeDisplayArea(final Composite displayArea) throws Exception {
-		//		tableLayout = new TableColumnLayout();
+		
+		// tableLayout = new TableColumnLayout();
 		displayArea.setLayout(new FormLayout());
-
+		
 		viewerLeft = new TableViewer(displayArea, SWT.MULTI | SWT.BORDER | SWT.VIRTUAL);
 		
 		viewerLeft.setLabelProvider(new LineLabelProvider(this) {
+			
 			@Override
 			public String getColumnText(Object element, int columnIndex) {
+				
 				Line line = (Line) element;
 				return line.getViewRef().toString();
 			}
@@ -363,97 +379,107 @@
 		viewerLeft.setContentProvider(new ConcordancesProvider());
 		viewerLeft.getTable().setLinesVisible(true);
 		viewerLeft.getTable().setHeaderVisible(true);
-
-		//		firstColumn = new TableColumn(viewer2.getTable(), SWT.LEFT);
-		//		firstColumn.setWidth(10);
-
-		referenceColumn = new TableColumn(viewerLeft.getTable(), SWT.LEFT|SWT.H_SCROLL);
+		
+		// firstColumn = new TableColumn(viewer2.getTable(), SWT.LEFT);
+		// firstColumn.setWidth(10);
+		
+		referenceColumn = new TableColumn(viewerLeft.getTable(), SWT.LEFT | SWT.H_SCROLL);
 		refreshReferenceColumnTitle();
 		referenceColumn.setToolTipText(ConcordanceUIMessages.reference);
 		referenceColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingReferenceColumn);
 				LineComparator comparator = new PropertiesReferenceComparator();
 				if (viewerLeft.getTable().getSortColumn() != referenceColumn) {
 					viewerLeft.getTable().setSortColumn(null);
 					viewerLeft.getTable().setSortColumn(referenceColumn);
 					viewerLeft.getTable().setSortDirection(SWT.UP);
-				} else if (viewerLeft.getTable().getSortDirection() == SWT.UP) {
+				}
+				else if (viewerLeft.getTable().getSortDirection() == SWT.UP) {
 					viewerLeft.getTable().setSortDirection(SWT.DOWN);
 					comparator = new ReverseComparator(comparator);
-				} else {
+				}
+				else {
 					viewerLeft.getTable().setSortDirection(SWT.UP);
 				}
 				comparator.initialize(concordance.getCorpus());
 				currentComparator = comparator;
-				complexsorter.setKey(4);//set ref key
+				complexsorter.setKey(4);// set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
 		referenceColumn.setWidth(100);
-
+		
 		sash = new Sash(displayArea, SWT.VERTICAL);
 		sash.addSelectionListener(new SelectionAdapter() {
+			
 			public void widgetSelected(SelectionEvent event) {
+				
 				((FormData) sash.getLayoutData()).left = new FormAttachment(0, event.x);
 				sash.getParent().layout();
 			}
 		});
 		viewerRight = new TableViewer(displayArea, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER
-				//				| SWT.VIRTUAL
+				// | SWT.VIRTUAL
 				);
-
-		//viewer.setLabelProvider(new LineLabelProvider(this));
+		
+		// viewer.setLabelProvider(new LineLabelProvider(this));
 		viewerRight.setContentProvider(new ConcordancesProvider());
 		viewerRight.getTable().setLinesVisible(true);
 		viewerRight.getTable().setHeaderVisible(true);
-
+		
 		String f = concordance.getCorpus().getFont();
 		if (f != null && f.length() > 0) {
 			Font old = viewerRight.getTable().getFont();
 			FontData fD = old.getFontData()[0];
-			Font font = new Font(Display.getCurrent(), f, fD.getHeight(), fD.getStyle()); 
+			Font font = new Font(Display.getCurrent(), f, fD.getHeight(), fD.getStyle());
 			viewerRight.getTable().setFont(font);
 			viewerLeft.getTable().setFont(font);
 		}
-
+		
 		tableResizeListener = new Listener() {
+			
 			@Override
 			public void handleEvent(Event event) {
+				
 				ScrollBar bar = viewerRight.getTable().getHorizontalBar();
-				float l=leftContextColumn.getWidth();
-				float k=keywordColumn.getWidth();
-				float r=rightContextColumn.getWidth();
-				float t=viewerRight.getTable().getClientArea().width;//the width of the visible part of the table; l+k+r>=t
-				float x=l+k/2-t/2; //the abcisse the visible rectangle must have for the keyword column to be centered
-				float M=bar.getMaximum();
-				float T=bar.getThumb();
-				bar.setSelection(Math.round(x*(M-T)/(l+k+r-t)));//this is how x translate in terms of bar selection
+				float l = leftContextColumn.getWidth();
+				float k = keywordColumn.getWidth();
+				float r = rightContextColumn.getWidth();
+				float t = viewerRight.getTable().getClientArea().width;// the width of the visible part of the table; l+k+r>=t
+				float x = l + k / 2 - t / 2; // the abcisse the visible rectangle must have for the keyword column to be centered
+				float M = bar.getMaximum();
+				float T = bar.getThumb();
+				bar.setSelection(Math.round(x * (M - T) / (l + k + r - t)));// this is how x translate in terms of bar selection
 			}
 		};
-
+		
 		// try to center on keyword column
 		viewerRight.getTable().addListener(SWT.Resize, tableResizeListener);
-
-		//TODO: to enable line deletion, Concordance code must updated -> replace with key binding
+		
+		// TODO: to enable line deletion, Concordance code must updated -> replace with key binding
 		KeyListener kldelete = new KeyListener() {
+			
 			@Override
-			public void keyReleased(KeyEvent e) {	}
+			public void keyReleased(KeyEvent e) {}
+			
 			@Override
 			public void keyPressed(KeyEvent e) {
-				if (e.keyCode != SWT.DEL ) { return; }
+				
+				if (e.keyCode != SWT.DEL) { return; }
 				DeleteLines.deleteConcordanceLines(ConcordanceEditor.this);
 			}
 		};
 		viewerRight.getTable().addKeyListener(kldelete);
 		viewerLeft.getTable().addKeyListener(kldelete);
-
+		
 		TableKeyListener tlistener = new TableKeyListener(viewerLeft, viewerRight);
 		viewerRight.getTable().addKeyListener(tlistener);
 		viewerLeft.getTable().addKeyListener(tlistener);
@@ -461,59 +487,70 @@
 		firstColumn = new TableColumn(viewerRight.getTable(), SWT.LEFT);
 		firstColumn.setWidth(0);
 		firstColumn.setResizable(false);
-
+		
 		TableViewerColumn leftColumnViewer = new TableViewerColumn(viewerRight, SWT.RIGHT);
 		leftContextColumn = leftColumnViewer.getColumn();
 		leftContextColumn.setText(ConcordanceUIMessages.leftContext);
 		leftContextColumn.setToolTipText(ConcordanceUIMessages.leftContext);
 		leftContextColumn.setAlignment(SWT.RIGHT);
 		leftColumnViewer.setLabelProvider(new ColumnLabelProvider() {
+			
 			@Override
 			public String getText(Object element) {
+				
 				Line line = (Line) element;
 				return line.leftContextToString();
 			}
 		});
+		
 		leftContextColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingLeftContextColumn);
 				LineComparator comparator = new LexicographicLeftContextComparator();
 				if (viewerRight.getTable().getSortColumn() != leftContextColumn) {
 					viewerRight.getTable().setSortColumn(leftContextColumn);
 					viewerRight.getTable().setSortDirection(SWT.UP);
-				} else if (viewerRight.getTable().getSortDirection() == SWT.UP) {
+				}
+				else if (viewerRight.getTable().getSortDirection() == SWT.UP) {
 					viewerRight.getTable().setSortDirection(SWT.DOWN);
 					comparator = new ReverseComparator(comparator);
-				} else
+				}
+				else
 					viewerRight.getTable().setSortDirection(SWT.UP);
 				comparator.initialize(concordance.getCorpus());
 				currentComparator = comparator;
-				complexsorter.setKey(2);//set ref key
+				complexsorter.setKey(2);// set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		TableViewerColumn keywordColumnViewer = new TableViewerColumn(viewerRight, SWT.CENTER);
 		keywordColumn = keywordColumnViewer.getColumn();
 		keywordColumn.setText(ConcordanceUIMessages.keyword);
 		keywordColumn.setToolTipText(ConcordanceUIMessages.keyword);
 		keywordColumn.setAlignment(SWT.CENTER);
 		keywordColumnViewer.setLabelProvider(new ColumnLabelProvider() {
+			
 			@Override
 			public String getText(Object element) {
+				
 				Line line = (Line) element;
 				return line.keywordToString();
 			}
 		});
+		
 		keywordColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingKeywordColumn);
 				LineComparator comparator = new LexicographicKeywordComparator();
 				if (viewerRight.getTable().getSortColumn() != keywordColumn) {
@@ -529,35 +566,37 @@
 				}
 				comparator.initialize(concordance.getCorpus());
 				currentComparator = comparator;
-				complexsorter.setKey(1);//set ref key
+				complexsorter.setKey(1);// set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
-
+		
 		TableViewerColumn rightContextColumnViewer = new TableViewerColumn(viewerRight, SWT.LEFT);
 		rightContextColumn = rightContextColumnViewer.getColumn();
 		rightContextColumn.setText(ConcordanceUIMessages.rightContext);
 		rightContextColumn.setToolTipText(ConcordanceUIMessages.rightContext);
 		rightContextColumn.setAlignment(SWT.LEFT);
 		rightContextColumnViewer.setLabelProvider(new ColumnLabelProvider() {
+			
 			@Override
 			public String getText(Object element) {
+				
 				Line line = (Line) element;
 				return line.rightContextToString();
 			}
 		});
 		rightContextColumn.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingRightContextColumn);
 				LineComparator comparator = new LexicographicRightContextComparator();
-
+				
 				if (viewerRight.getTable().getSortColumn() != rightContextColumn) {
 					viewerRight.getTable().setSortColumn(rightContextColumn);
 				}
@@ -570,48 +609,50 @@
 				}
 				comparator.initialize(concordance.getCorpus());
 				currentComparator = comparator;
-				complexsorter.setKey(3); //set ref key
+				complexsorter.setKey(3); // set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
-		//		firstColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
-		//		firstColumn.setWidth(0);
-		//		firstColumn.setResizable(false);
-
+		
+		// firstColumn = new TableColumn(viewer.getTable(), SWT.LEFT);
+		// firstColumn.setWidth(0);
+		// firstColumn.setResizable(false);
+		
 		leftContextColumn.setWidth(200);
 		keywordColumn.setWidth(100);
 		rightContextColumn.setWidth(200);
-
-		//resetColumnWidths(); // set column widths
-
-
-		//		// And now, a sweet piece of code :)
-		//		// When the window is resized, the scrollbar is adjusted so that the
-		//		// keywords remain centered
-		//		viewer.getTable().addListener(SWT.Resize, new Listener() {
-		//			@Override
-		//			public void handleEvent(Event event) {
-		//				ScrollBar bar = viewer.getTable().getHorizontalBar();
-		//				//float l = leftContextColumn.getWidth();
-		//				//float k = keywordColumn.getWidth();
-		//				rightContextColumn.getWidth();
-		//				//float t = lineTableViewer.getTable().getClientArea().width;
-		//				bar.getMaximum();
-		//				bar.getThumb();
-		//			}
-		//		});
-
+		
+		// resetColumnWidths(); // set column widths
+		
+		
+		// // And now, a sweet piece of code :)
+		// // When the window is resized, the scrollbar is adjusted so that the
+		// // keywords remain centered
+		// viewer.getTable().addListener(SWT.Resize, new Listener() {
+		// @Override
+		// public void handleEvent(Event event) {
+		// ScrollBar bar = viewer.getTable().getHorizontalBar();
+		// //float l = leftContextColumn.getWidth();
+		// //float k = keywordColumn.getWidth();
+		// rightContextColumn.getWidth();
+		// //float t = lineTableViewer.getTable().getClientArea().width;
+		// bar.getMaximum();
+		// bar.getThumb();
+		// }
+		// });
+		
 		// back to text mouse listener
 		MouseListener ms = new MouseListener() {
+			
 			int c = 0;
+			
 			@Override
 			public synchronized void mouseDoubleClick(MouseEvent e) {
+				
 				if (e.count == 2 && c == 0) {
 					c++;
 					
@@ -621,22 +662,25 @@
 					c--;
 				}
 			}
-
+			
 			@Override
-			public void mouseDown(MouseEvent e) { }
+			public void mouseDown(MouseEvent e) {}
+			
 			@Override
-			public void mouseUp(MouseEvent e) {	}
+			public void mouseUp(MouseEvent e) {}
 		};
 		viewerRight.getTable().addMouseListener(ms);
 		viewerLeft.getTable().addMouseListener(ms);
-
+		
 		// On Windows, the selection is gray if the table does not have focus.
 		// To make both tables appear in focus, draw the selection background
 		// here.
 		// This part only works on version 3.2 or later.
 		Listener eraseListener = new Listener() {
+			
 			@Override
 			public void handleEvent(Event event) {
+				
 				event.detail &= ~SWT.HOT;
 				if ((event.detail & SWT.SELECTED) != 0) {
 					GC gc = event.gc;
@@ -650,99 +694,117 @@
 				}
 			}
 		};
-
+		
 		// Listeners to avoid 0 width columns
 		referenceColumn.addControlListener(new ConcordanceColumnSizeControlListener(referenceColumn));
 		leftContextColumn.addControlListener(new ConcordanceColumnSizeControlListener(leftContextColumn));
 		keywordColumn.addControlListener(new ConcordanceColumnSizeControlListener(keywordColumn));
 		rightContextColumn.addControlListener(new ConcordanceColumnSizeControlListener(rightContextColumn));
-
+		
 		viewerRight.getTable().addListener(SWT.EraseItem, eraseListener);
-
+		
 		leftTable = viewerLeft.getTable();
 		rightTable = viewerRight.getTable();
 		viewerLeft.getTable().addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				rightTable.deselectAll();
 				rightTable.select(leftTable.getSelectionIndices());
 			}
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
+		
 		vBarLeft = viewerLeft.getTable().getVerticalBar();
 		vBarLeft.addListener(SWT.Selection, new Listener() {
+			
 			@Override
 			public void handleEvent(Event event) {
+				
 				if (Util.isLinux()) {
 					vBarRight.setSelection(vBarLeft.getSelection());
-				} else {
+				}
+				else {
 					viewerRight.getTable().setTopIndex(viewerLeft.getTable().getTopIndex());
 				}
 			}
 		});
+		
 		viewerRight.getTable().addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				leftTable.deselectAll();
 				leftTable.select(rightTable.getSelectionIndices());
 			}
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
+		
 		vBarRight = viewerRight.getTable().getVerticalBar();
 		vBarRight.addListener(SWT.Selection, new Listener() {
+			
 			@Override
 			public void handleEvent(Event event) {
+				
 				if (Util.isLinux()) {
 					vBarLeft.setSelection(vBarRight.getSelection());
-				} else {
-					viewerLeft.getTable().setTopIndex(viewerRight.getTable().getTopIndex());					
 				}
+				else {
+					viewerLeft.getTable().setTopIndex(viewerRight.getTable().getTopIndex());
+				}
 			}
 		});
-
+		
 		// set Layout datas
 		FormData data = new FormData();
-		data.top = new FormAttachment(0); 
-		data.bottom = new FormAttachment(100); 
+		data.top = new FormAttachment(0);
+		data.bottom = new FormAttachment(100);
 		data.left = new FormAttachment(0);
-		data.right = new FormAttachment(sash,0);
+		data.right = new FormAttachment(sash, 0);
 		viewerLeft.getTable().setLayoutData(data);
-
+		
 		FormData data2 = new FormData();
-		data2.top = new FormAttachment(0, 0); 
-		data2.bottom = new FormAttachment(100, 0); 
+		data2.top = new FormAttachment(0, 0);
+		data2.bottom = new FormAttachment(100, 0);
 		data2.left = new FormAttachment(10);
 		sash.setLayoutData(data2);
-
+		
 		FormData data3 = new FormData();
-		data3.top = new FormAttachment(0); 
-		data3.bottom = new FormAttachment(100); 
-		data3.left = new FormAttachment(sash,0);
+		data3.top = new FormAttachment(0);
+		data3.bottom = new FormAttachment(100);
+		data3.left = new FormAttachment(sash, 0);
 		data3.right = new FormAttachment(100);
 		viewerRight.getTable().setLayoutData(data3);
-
+		
 		createContextMenu();
 	}
-
+	
 	/**
 	 * Sort.
 	 */
 	public void sort() {
+		
 		if (concordance != null && currentComparator != null) {
-
-			//System.out.println("concordance sort props: "+concordance.getLeftCAnalysisProperty()+", "+concordance.getKeywordAnalysisProperty()+", "+concordance.getRightCAnalysisProperty());
+			
+			// System.out.println("concordance sort props: "+concordance.getLeftCAnalysisProperty()+", "+concordance.getKeywordAnalysisProperty()+", "+concordance.getRightCAnalysisProperty());
 			concordance.resetLines();
-
+			
 			try {
 				Log.fine(NLS.bind(ConcordanceUIMessages.sortingWithP0, currentComparator.getName()));
 				if (currentComparator instanceof CompositeComparator) {
 					Log.fine(((CompositeComparator) currentComparator).getComparators().toString());
 				}
 				JobHandler jobhandler = new JobHandler("Sorting...") { //$NON-NLS-1$
+					
 					@Override
 					protected IStatus run(IProgressMonitor monitor) {
+						
 						this.runInit(monitor);
 						JobsTimer.start();
 						try {
@@ -752,42 +814,50 @@
 							concordance.setTopIndex(0);
 							concordance.setCurrentMonitor(null);
 							syncExec(new Runnable() {
+								
 								@Override
 								public void run() {
+									
 									StatusLine.setMessage(TXMUIMessages.sortDone);
 									try {
 										refresh(true);
-									} catch (Exception e1) {
+									}
+									catch (Exception e1) {
 										// TODO Auto-generated catch block
 										e1.printStackTrace();
 									}
 								}
 							});
-
-						} catch (ThreadDeath td) {
+							
+						}
+						catch (ThreadDeath td) {
 							return Status.CANCEL_STATUS;
-						} catch (Exception e) {
+						}
+						catch (Exception e) {
 							System.err.println(NLS.bind(ConcordanceUIMessages.anErrorOccurredWhileRetrievingTheConcordanceLinesColonP0, e));
 							org.txm.utils.logger.Log.printStackTrace(e);
-						} catch (Error e) {
-							System.err.println(ConcordanceUIMessages.bind(ConcordanceUIMessages.fatalErrorColonP0,e));
+						}
+						catch (Error e) {
+							System.err.println(ConcordanceUIMessages.bind(ConcordanceUIMessages.fatalErrorColonP0, e));
 							e.printStackTrace();
-						} finally {
+						}
+						finally {
 							monitor.done();
 							JobsTimer.stopAndPrint();
 						}
 						return Status.OK_STATUS;
 					}
 				};
-
+				
 				jobhandler.startJob();
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				System.err.println(NLS.bind(ConcordanceUIMessages.anErrorOccurredWhileRetrievingTheConcordanceLinesColonP0, e));
 				org.txm.utils.logger.Log.printStackTrace(e);
 			}
 		}
 	}
-
+	
 	/**
 	 * Lazy loads the concordance lines range and fills the display area.
 	 *
@@ -795,24 +865,24 @@
 	 * @param to the to
 	 */
 	public void fillDisplayArea(boolean update) {
-		if (viewerRight == null) {
-			return;
-		}
-
+		
+		if (viewerRight == null) { return; }
+		
 		int from = concordance.getTopIndex();
 		from = Math.max(from, 0);
-
+		
 		int to = from + concordance.getNLinePerPage();
 		to = Math.min(to, concordance.getNLines()) - 1;
-
+		
 		viewerRight.getControl().setRedraw(false);
 		viewerLeft.getControl().setRedraw(false);
-
+		
 		List<Line> lines = null;
 		if (concordance.getNLines() > 0) {
 			try {
 				lines = concordance.getLines(from, to);
-			} catch (Exception e) {
+			}
+			catch (Exception e) {
 				System.err.println(NLS.bind(ConcordanceUIMessages.anErrorOccurredWhileRetrievingTheConcordanceLinesColonP0, e));
 				org.txm.utils.logger.Log.printStackTrace(e);
 			}
@@ -820,24 +890,24 @@
 		else {
 			lines = new ArrayList<Line>();
 		}
-
+		
 		viewerRight.setInput(lines);
 		viewerLeft.setInput(lines);
-
-		navigationWidget.setInfoLineText("" + (from+1), " - " + (to+1) + " / " + concordance.getNLines()); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-3$
-
+		
+		navigationWidget.setInfoLineText("" + (from + 1), " - " + (to + 1) + " / " + concordance.getNLines()); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-3$
+		
 		navigationWidget.setPreviousEnabled(concordance.getTopIndex() > 0);
 		navigationWidget.setFirstEnabled(concordance.getTopIndex() > 0);
 		navigationWidget.setNextEnabled((concordance.getTopIndex() + concordance.getNLinePerPage()) < concordance.getNLines() - 1);
 		navigationWidget.setLastEnabled((concordance.getTopIndex() + concordance.getNLinePerPage()) < concordance.getNLines() - 1);
 		navigationWidget.layout();
 		navigationWidget.getParent().layout();
-
+		
 		refreshReferenceColumnTitle();
 		viewerRight.getControl().setRedraw(true);
 		viewerLeft.getControl().setRedraw(true);
 	}
-
+	
 	/**
 	 * Get the Composite that contains the query and sort forms
 	 * 
@@ -846,9 +916,10 @@
 	 * @return
 	 */
 	public Composite getQueryArea() {
+		
 		return queryArea;
 	}
-
+	
 	/**
 	 * Get the Composite that contains the navigation buttons
 	 * 
@@ -857,137 +928,141 @@
 	 * @return
 	 */
 	public Composite getNavigationArea() {
+		
 		return queryArea;
 	}
-
+	
 	/**
 	 * Compose control area.
 	 *
 	 * @param controlArea the control area
 	 */
 	private void composeControlArea(final Composite controlArea) {
-
-
+		
 		// Modified computing listeners to manage multi lines query widgets
 		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this) {
+			
 			@Override
 			public void keyPressed(KeyEvent e) {
+				
 				if (queryWidget.getQuery() == null) return;
 				if (!queryWidget.getQuery().getSearchEngine().hasMultiLineQueries()) super.keyPressed(e);
 			}
 		};
-
+		
 		GridLayout controlLayout = new GridLayout(1, false);
 		controlLayout.verticalSpacing = 0;
 		controlLayout.marginWidth = 0;
 		controlLayout.marginHeight = 0;
 		controlArea.setLayout(controlLayout);
-
+		
 		// Query Area: query itself + view properties
 		queryArea = new Composite(controlArea, SWT.NONE);
 		queryArea.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
 		queryArea.setLayout(new GridLayout(4, false));
-
+		
 		////////////////////////////////
-		//composeAnnotationArea(controlArea);
+		// composeAnnotationArea(controlArea);
 		//////////////////////////////////
-
+		
 		navigationArea = new Composite(controlArea, SWT.NONE);
 		navigationArea.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
-		GridLayout navigationLayout = new GridLayout(7, false); 
+		GridLayout navigationLayout = new GridLayout(7, false);
 		navigationLayout.verticalSpacing = 0;
 		navigationLayout.marginWidth = 0;
 		navigationLayout.marginHeight = 0;
 		navigationArea.setLayout(navigationLayout);
 		///////////////////////////
 		// | Query: [ (v)] [Search] |
-
+		
 		// Query:
 		getMainParametersComposite().getLayout().numColumns = 2;
 		// make
 		getMainParametersComposite().setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-
+		
 		queryLabel = new Label(getMainParametersComposite(), SWT.NONE);
 		queryLabel.setText(TXMUIMessages.ampQuery);
 		queryLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-
+		
 		// [ (v)]
-		queryWidget = new AssistedChoiceQueryWidget(this.getMainParametersComposite(), SWT.DROP_DOWN|SWT.MULTI| SWT.WRAP | SWT.V_SCROLL, concordance.getCorpus());
+		queryWidget = new AssistedChoiceQueryWidget(this.getMainParametersComposite(), SWT.DROP_DOWN | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL, concordance.getCorpus());
 		queryWidget.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
 		queryWidget.addKeyListener(computeKeyListener);
 		queryWidget.getQueryWidget().addModifyListener(computeKeyListener);
-
+		
 		// FIXME: SJ: for computing when changing the query from history combo box
 		// FIXME: SJ: commented because it doesn't work, the computing is launched as soon as we click on the arrow of the combo box
-		//queryWidget.getQueryWidget().addSelectionListener(new ComputeSelectionListener(this));
-
+		// queryWidget.getQueryWidget().addSelectionListener(new ComputeSelectionListener(this));
+		
 		// hide the parameters panel
-		//getTopToolbar().setVisible(TXMEditor.COMPUTING_PARAMETERS_GROUP_ID, false); // the settings are not necessary to compute the concordance
-
+		// getTopToolbar().setVisible(TXMEditor.COMPUTING_PARAMETERS_GROUP_ID, false); // the settings are not necessary to compute the concordance
+		
 		// | Properties: word/pos [Edit] |
-		//		propsArea = new PropertiesSelector<Property>(queryArea, SWT.NONE);
-		//		propsArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
-		//		propsArea.setLayout(new GridLayout(3, false));
-		//		this.propsArea.setProperties(concordance.getAvailableKeywordViewProperties(), concordance.getKeywordViewProperties());
-		//		propsArea.addValueChangeListener(new Listener() {
-		//			@Override
-		//			public void handleEvent(Event event) {
-		//				concordance.setKeywordViewProperties(propsArea.getSelectedProperties());
-		//				refreshViewProperties();
-		//			}
-		//		});
-
+		// propsArea = new PropertiesSelector<Property>(queryArea, SWT.NONE);
+		// propsArea.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
+		// propsArea.setLayout(new GridLayout(3, false));
+		// this.propsArea.setProperties(concordance.getAvailableKeywordViewProperties(), concordance.getKeywordViewProperties());
+		// propsArea.addValueChangeListener(new Listener() {
+		// @Override
+		// public void handleEvent(Event event) {
+		// concordance.setKeywordViewProperties(propsArea.getSelectedProperties());
+		// refreshViewProperties();
+		// }
+		// });
+		
 		// [Search]
-		//		Button go = new Button(queryArea, SWT.PUSH);
-		//		go.setText(TXMUIMessages.SEARCH);
+		// Button go = new Button(queryArea, SWT.PUSH);
+		// go.setText(TXMUIMessages.SEARCH);
 		//
-		//		Font f = go.getFont();
-		//		FontData defaultFont = f.getFontData()[0];
-		//		defaultFont.setStyle(SWT.BOLD);
-		//		Font newf = new Font(go.getDisplay(), defaultFont);
-		//		go.setFont(newf);
+		// Font f = go.getFont();
+		// FontData defaultFont = f.getFontData()[0];
+		// defaultFont.setStyle(SWT.BOLD);
+		// Font newf = new Font(go.getDisplay(), defaultFont);
+		// go.setFont(newf);
 		//
-		//		go.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
-		//		go.addSelectionListener(new ComputeSelectionListener(this));
-
+		// go.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+		// go.addSelectionListener(new ComputeSelectionListener(this));
+		
 		// Complex sort chooser (full line)
 		complexsorter = new ComplexSortSelector(queryArea, SWT.NONE);
 		complexsorter.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, true, 4, 1));
-
+		
 		// properties widget like in the portal version
 		GLComposite propertiesPanel = new GLComposite(queryArea, SWT.BORDER, ConcordanceUIMessages.propertiesPanel);
 		propertiesPanel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, true, 4, 1));
 		propertiesPanel.getLayout().numColumns = 5;
 		propertiesPanel.getLayout().makeColumnsEqualWidth = false;
-
+		
 		try {
 			Label l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.editor_21);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, false, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.references);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, true, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true, false));
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.left);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, true, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true, false));
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.keyword);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, true, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true, false));
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.right);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, true, false));
-
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, true, false));
+			
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.view);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, false, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			refViewProperties = new PropertiesSelector<Property>(propertiesPanel, SWT.NONE);
 			refViewProperties.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			refViewProperties.setTitle(ConcordanceUIMessages.editor_21);
 			refViewProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			refViewProperties.setProperties(ReferencePattern.getPossibleValues(getCorpus()));
 			refViewProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setRefViewPattern(new ReferencePattern(refViewProperties.getSelectedProperties()));
 					super.widgetSelected(e);
 				}
@@ -998,8 +1073,10 @@
 			leftViewProperties.setProperties(getCorpus().getOrderedProperties());
 			leftViewProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			leftViewProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setLeftViewProperties(leftViewProperties.getSelectedProperties());
 					super.widgetSelected(e);
 				}
@@ -1010,8 +1087,10 @@
 			keywordViewProperties.setProperties(getCorpus().getOrderedProperties());
 			keywordViewProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			keywordViewProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setKeywordViewProperties(keywordViewProperties.getSelectedProperties());
 					super.widgetSelected(e);
 				}
@@ -1022,24 +1101,28 @@
 			rightViewProperties.setProperties(getCorpus().getOrderedProperties());
 			rightViewProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			rightViewProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setRightViewProperties(rightViewProperties.getSelectedProperties());
 					super.widgetSelected(e);
 				}
 			});
-
+			
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.sort);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, false, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			refSortProperties = new PropertiesSelector<Property>(propertiesPanel, SWT.NONE);
 			refSortProperties.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			refSortProperties.setTitle(ConcordanceUIMessages.editor_21);
 			refSortProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			refSortProperties.setProperties(ReferencePattern.getPossibleValues(getCorpus()));
 			refSortProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setRefAnalysePattern(new ReferencePattern(refSortProperties.getSelectedProperties()));
 					super.widgetSelected(e);
 				}
@@ -1050,8 +1133,10 @@
 			leftSortProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			leftSortProperties.setProperties(getCorpus().getOrderedProperties());
 			leftSortProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setLeftAnalysisProperties(leftSortProperties.getSelectedProperties());
 					super.widgetSelected(e);
 				}
@@ -1062,8 +1147,10 @@
 			keywordSortProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			keywordSortProperties.setProperties(getCorpus().getOrderedProperties());
 			keywordSortProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setKeywordAnalysisProperties(keywordSortProperties.getSelectedProperties());
 					super.widgetSelected(e);
 				}
@@ -1074,113 +1161,131 @@
 			rightSortProperties.setButtonText(ConcordanceUIMessages.editor_19);
 			rightSortProperties.setProperties(getCorpus().getOrderedProperties());
 			rightSortProperties.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setRightAnalysisProperties(rightSortProperties.getSelectedProperties());
 					super.widgetSelected(e);
 				}
 			});
-
+			
 			l = new Label(propertiesPanel, SWT.NONE);
 			l.setText(ConcordanceUIMessages.size);
-			l.setLayoutData(new GridData(GridData.CENTER,GridData.CENTER, false, false));
+			l.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			new Label(propertiesPanel, SWT.NONE);
 			leftSizeSpinner = new Spinner(propertiesPanel, SWT.BORDER);
 			leftSizeSpinner.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			leftSizeSpinner.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setLeftContextSize(leftSizeSpinner.getSelection());
 					super.widgetSelected(e);
 				}
 			});
 			leftSizeSpinner.addKeyListener(new KeyListener() {
+				
 				@Override
 				public void keyReleased(KeyEvent e) {
+					
 					if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
 						concordance.setLeftContextSize(leftSizeSpinner.getSelection());
 						ConcordanceEditor.this.compute(true);
 					}
 				}
+				
 				@Override
-				public void keyPressed(KeyEvent e) { }
+				public void keyPressed(KeyEvent e) {}
 			});
 			new Label(propertiesPanel, SWT.NONE);
 			rightSizeSpinner = new Spinner(propertiesPanel, SWT.BORDER);
 			rightSizeSpinner.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 			rightSizeSpinner.addSelectionListener(new ComputeSelectionListener(this) {
+				
 				@Override
 				public void widgetSelected(SelectionEvent e) {
+					
 					concordance.setRightContextSize(rightSizeSpinner.getSelection());
 					super.widgetSelected(e);
 				}
 			});
 			rightSizeSpinner.addKeyListener(new KeyListener() {
+				
 				@Override
 				public void keyReleased(KeyEvent e) {
+					
 					if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
 						concordance.setRightContextSize(rightSizeSpinner.getSelection());
 						ConcordanceEditor.this.compute(true);
 					}
 				}
+				
 				@Override
-				public void keyPressed(KeyEvent e) { }
+				public void keyPressed(KeyEvent e) {}
 			});
-		} catch (Exception e1) {
+		}
+		catch (Exception e1) {
 			// TODO Auto-generated catch block
 			e1.printStackTrace();
 		}
-
+		
 		// Delete line button
 		deleteLineButton = new Button(navigationArea, SWT.PUSH);
 		deleteLineButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
 		deleteLineButton.setToolTipText(ConcordanceUIMessages.deleteSelectedLines);
 		deleteLineButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_DELETE));
 		deleteLineButton.addSelectionListener(new SelectionListener() {
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				DeleteLines.deleteConcordanceLines(ConcordanceEditor.this);
 			}
-
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) { }
+			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-
+		
 		// Navigation Area: infoLine and buttons
 		GLComposite navigationAreaComposite = getBottomToolbar().installGLComposite(ConcordanceUIMessages.navigation, 1, false);
 		navigationAreaComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-
+		
 		navigationWidget = new NavigationWidget(navigationAreaComposite, SWT.NONE);
 		navigationWidget.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
-
+		
 		// | [|<] [<] infos [>] [>|] |
 		// [|<]
 		navigationWidget.addFirstListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent arg0) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent arg0) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent arg0) {
+				
 				concordance.setTopIndex(0);
 				try {
 					refresh(false);
 					viewerRight.getTable().setTopIndex(0);
-				} catch (Exception e1) {
+				}
+				catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
 		});
-
+		
 		// [<]
 		navigationWidget.addPreviousListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				int top = concordance.getTopIndex() - concordance.getNLinePerPage();
 				if (top < 0)
 					top = 0;
@@ -1188,79 +1293,86 @@
 				try {
 					refresh(false);
 					viewerRight.getTable().setTopIndex(0);
-				} catch (Exception e1) {
+				}
+				catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
 		});
-
+		
 		// [>]
 		navigationWidget.addNextListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				concordance.setTopIndex(concordance.getTopIndex() + concordance.getNLinePerPage());
 				try {
 					refresh(false);
 					viewerRight.getTable().setTopIndex(0);
-				} catch (Exception e1) {
+				}
+				catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
 		});
-
+		
 		// [>|]
 		navigationWidget.addLastListener(new SelectionListener() {
+			
 			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {
-			}
-
+			public void widgetDefaultSelected(SelectionEvent e) {}
+			
 			@Override
 			public void widgetSelected(SelectionEvent e) {
+				
 				int top = (concordance.getNLines() / concordance.getNLinePerPage()) * concordance.getNLinePerPage();
 				// FIXME: SJ: became useless?
-				//int bottom = top + concordance.getNLinePerPage() -1;
+				// int bottom = top + concordance.getNLinePerPage() -1;
 				concordance.setTopIndex(top);
 				try {
 					refresh(false);
 					viewerRight.getTable().setTopIndex(0);
-				} catch (Exception e1) {
+				}
+				catch (Exception e1) {
 					// TODO Auto-generated catch block
 					e1.printStackTrace();
 				}
 			}
 		});
-
+		
 		queryArea.layout();
 	}
-
+	
 	/**
 	 * refresh
+	 * 
 	 * @param top
 	 * @param bottom
 	 */
 	public void updateEditorFromResult(boolean update) {
+		
 		StatusLine.setMessage(ConcordanceUIMessages.startComputingConcordance);
-
+		
 		try {
 			QueriesView.refresh();
-
+			
 			this.fillDisplayArea(update);
 			
 			boolean b = concordance.getQueryResultParameter() == null;
 			this.queryWidget.setEnabled(b); // disable the widget if a QueryResult was provided
 			
 			this.queryWidget.memorize();
-
+			
 			if (update) {
 				resetColumnWidths();
 			}
-
+			
 			JobsTimer.stopAndPrint();
 		}
 		catch (Exception e1) {
@@ -1275,112 +1387,123 @@
 			}
 		}
 	}
-
+	
 	/**
 	 * Sets the line per page.
 	 *
 	 * @param nb the new line per page
 	 */
 	public void setLinePerPage(int nb) {
+		
 		concordance.setNLinePerPage(nb);
 	}
-
+	
 	/**
 	 * Gets the line per page.
 	 *
 	 * @return the line per page
 	 */
 	public int getLinePerPage() {
+		
 		return concordance.getNLinePerPage();
 	}
-
-	//	/**
-	//	 * Update view properties label.
-	//	 */
-	//	void updateViewPropertiesLabel() {
-	//		String str = StringUtils.join(concordance.getKeywordViewProperties(), "_");
-	//		viewPropertiesLabel.setText(str);
-	//		viewPropertiesLabel.getParent().layout();
-	//		viewPropertiesLabel.update();
-	//		queryArea.layout();
-	//	}
-
-	/* (non-Javadoc)
+	
+	// /**
+	// * Update view properties label.
+	// */
+	// void updateViewPropertiesLabel() {
+	// String str = StringUtils.join(concordance.getKeywordViewProperties(), "_");
+	// viewPropertiesLabel.setText(str);
+	// viewPropertiesLabel.getParent().layout();
+	// viewPropertiesLabel.update();
+	// queryArea.layout();
+	// }
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.part.EditorPart#getTitleToolTip()
 	 */
 	@Override
 	public String getTitleToolTip() {
+		
 		return concordance.getDetails();
 	}
-
+	
 	/**
 	 * Gets the reference pattern.
 	 *
 	 * @return the reference pattern
 	 */
 	ReferencePattern getViewReferencePattern() {
+		
 		return concordance.getRefViewPattern();
 	}
-
+	
 	/**
 	 * Gets the reference pattern.
 	 *
 	 * @return the reference pattern
 	 */
 	ReferencePattern getSortReferencePattern() {
+		
 		return concordance.getRefAnalysePattern();
 	}
-
+	
 	/**
 	 * Sets the left sort properties.
 	 *
 	 * @param list the new left sort properties
 	 */
 	public void setLeftSortProperties(List<WordProperty> list) {
+		
 		concordance.setLeftAnalysisProperties(list);
 	}
-
+	
 	/**
 	 * Sets the keyword sort properties.
 	 *
 	 * @param list the new keyword sort property
 	 */
 	public void setKeywordSortProperties(List<WordProperty> list) {
+		
 		concordance.setAnalysisProperty(list);
 		sort();
 	}
-
+	
 	/**
 	 * Sets the right sort properties.
 	 *
 	 * @param list the new right sort properties
 	 */
 	public void setRightSortProperties(List<WordProperty> list) {
+		
 		concordance.setAnalysisProperty(list);
 		sort();
 	}
-
+	
 	/**
 	 * Sets the view reference pattern.
 	 *
 	 * @param referencePattern the new reference pattern
 	 */
 	public void setRefViewPattern(ReferencePattern referencePattern) {
+		
 		concordance.setRefViewPattern(referencePattern);
 		sort();
 		this.resetLeftTableColumnWidths();
 	}
-
+	
 	/**
 	 * Sets the sort reference pattern.
 	 *
 	 * @param referencePattern the new reference pattern
 	 */
 	public void setRefSortPattern(ReferencePattern referencePattern) {
+		
 		concordance.setRefAnalysePattern(referencePattern);
 		sort();
 	}
-
+	
 	/**
 	 * Sets the context size.
 	 *
@@ -1388,39 +1511,45 @@
 	 * @param rightContextSize the right context size
 	 */
 	public void setContextSize(int leftContextSize, int rightContextSize) {
+		
 		concordance.setLeftContextSize(leftContextSize);
 		concordance.setRightContextSize(rightContextSize);
 		fillDisplayArea(false); // we return to the previously
-		resetRightTableColumnWidths();
+		resetColumnWidths();
 	}
-
+	
 	/**
 	 * Creates the context menu.
 	 */
 	private void createContextMenu() {
+		
 		createActions();
-
+		
 		// store the mouse position
 		viewerRight.getTable().addMouseListener(new MouseAdapter() {
+			
 			@Override
 			public void mouseDown(MouseEvent arg0) {
-
-				if (arg0.button == 3)
+				
+				if (arg0.button == 3) {
 					mouseposition = new Point(arg0.x, arg0.y);
-				//				System.out.println("arg.x="+arg0.x);
-				//				System.out.println("arg.y="+arg0.y);
-				//				System.out.println("hbar: "+lineTableViewer.getTable().getHorizontalBar().getSelection());
-				//				System.out.println("vbar: "+lineTableViewer.getTable().getVerticalBar().getSelection());
-				//				System.out.println("Col: "+getPointedColumn());
+				}
+				// System.out.println("arg.x="+arg0.x);
+				// System.out.println("arg.y="+arg0.y);
+				// System.out.println("hbar: "+lineTableViewer.getTable().getHorizontalBar().getSelection());
+				// System.out.println("vbar: "+lineTableViewer.getTable().getVerticalBar().getSelection());
+				// System.out.println("Col: "+getPointedColumn());
 			}
 		});
-
-		MenuManager menuManager = new MenuManager(); //$NON-NLS-1$
+		
+		MenuManager menuManager = new MenuManager(); // $NON-NLS-1$
 		Menu menu = menuManager.createContextMenu(viewerRight.getTable());
 		menuManager.setRemoveAllWhenShown(true);
 		menuManager.addMenuListener(new IMenuListener() {
+			
 			@Override
 			public void menuAboutToShow(IMenuManager manager) {
+				
 				IWorkbenchPartSite site = ConcordanceEditor.this.getSite();
 				site.getPage().activate(ConcordanceEditor.this);
 				manager.add(setViewPropertyAction);
@@ -1432,13 +1561,15 @@
 			}
 		});
 		viewerRight.getTable().setMenu(menu);
-
-		MenuManager menuManagerLeft = new MenuManager(); //$NON-NLS-1$
+		
+		MenuManager menuManagerLeft = new MenuManager(); // $NON-NLS-1$
 		Menu menuLeft = menuManagerLeft.createContextMenu(viewerLeft.getTable());
 		menuManagerLeft.setRemoveAllWhenShown(true);
 		menuManagerLeft.addMenuListener(new IMenuListener() {
+			
 			@Override
 			public void menuAboutToShow(IMenuManager manager) {
+				
 				IWorkbenchPartSite site = ConcordanceEditor.this.getSite();
 				site.getPage().activate(ConcordanceEditor.this);
 				manager.add(defineViewReferencePatternAction);
@@ -1446,58 +1577,60 @@
 			}
 		});
 		viewerLeft.getTable().setMenu(menuLeft);
-
-		//viewer.getTable().setMenu(menuManager.createContextMenu(viewer.getTable()));
-		//register the right menu to the editor site
+		
+		// viewer.getTable().setMenu(menuManager.createContextMenu(viewer.getTable()));
+		// register the right menu to the editor site
 		getSite().registerContextMenu(menuManager, viewerRight);
 		getSite().setSelectionProvider(viewerRight);
 	}
-
+	
 	/**
 	 * Gets the mouse position.
 	 *
 	 * @return the mouse position
 	 */
 	private Point getMousePosition() {
+		
 		return this.mouseposition;
 	}
-
+	
 	/**
 	 * return the column under the mouse pointer.
 	 * TODO this method wont work if columns are added before the keyword column
+	 * 
 	 * @return the pointed column
 	 */
 	public int getPointedColumn() {
+		
 		Point p = getMousePosition();
 		if (p == null) return 0;
-
+		
 		int x = p.x; // + lineTableViewer.getTable().get;
 		int sumWidthColumn = 0;
-
+		
 		sumWidthColumn += this.leftContextColumn.getWidth();
 		if (x < sumWidthColumn)
 			return 1;
-
+		
 		sumWidthColumn += this.keywordColumn.getWidth();
 		if (x < sumWidthColumn)
 			return 2;
-
-		//		sumWidthColumn += this.rightContextColumn.getWidth();
-		//		if (x < sumWidthColumn)
+		
+		// sumWidthColumn += this.rightContextColumn.getWidth();
+		// if (x < sumWidthColumn)
 		return 3; // last column
-
-		//		return 0;
 	}
-
+	
 	/**
 	 * Creates the actions.
 	 */
 	private void createActions() {
+		
 		setSortPropertyAction = new SortPropertySelection(getSite()
 				.getWorkbenchWindow(), this, this.viewerRight);
 		setContextSizeAction = new SetContextSize(getSite()
 				.getWorkbenchWindow(), this);
-		//resetColumnWidths = new ResetColumnWidths(getSite().getWorkbenchWindow(), this);
+		// resetColumnWidths = new ResetColumnWidths(getSite().getWorkbenchWindow(), this);
 		setLineNumberAction = new SetLineNumber(getSite().getWorkbenchWindow(),
 				this);
 		defineViewReferencePatternAction = new DefineViewReferencePattern(getSite()
@@ -1507,34 +1640,37 @@
 		setViewPropertyAction = new ViewPropertySelection(getSite()
 				.getWorkbenchWindow(), this, this.viewerRight);
 	}
-
+	
 	/**
 	 * Gets the concordance.
 	 *
 	 * @return the concordance
 	 */
 	public Concordance getConcordance() {
+		
 		return concordance;
 	}
-
+	
 	/**
 	 * Gets the available sort properties.
 	 *
 	 * @return the available sort properties
 	 */
 	public List<WordProperty> getAvailableSortProperties() {
+		
 		return concordance.getAvailableKeywordSortProperties();
 	}
-
+	
 	/**
 	 * Gets the user defined comparators.
 	 *
 	 * @return the user defined comparators
 	 */
 	public List<LineComparator> getUserDefinedComparators() {
+		
 		return userDefinedComparators;
 	}
-
+	
 	/**
 	 * Sets the user defined comparators.
 	 *
@@ -1542,498 +1678,521 @@
 	 */
 	public void setUserDefinedComparators(
 			List<LineComparator> userDefinedComparators) {
+		
 		this.userDefinedComparators = userDefinedComparators;
 	}
-
+	
 	/**
 	 * Sets the current comparator.
 	 *
 	 * @param comparator the new current comparator
 	 */
 	public void setCurrentComparator(LineComparator comparator) {
+		
 		this.currentComparator = comparator;
 	}
-
+	
 	/**
 	 * Gets the standard comparators.
 	 *
 	 * @return the standard comparators
 	 */
 	public List<LineComparator> getStandardComparators() {
+		
 		return standardComparators;
 	}
-
+	
 	/**
 	 * Gets the top line.
 	 *
 	 * @return the top line
 	 */
 	public int getTopLine() {
+		
 		return concordance.getTopIndex();
 	}
-
+	
 	/**
 	 * Gets the bottom line.
 	 *
 	 * @return the bottom line
 	 */
 	public int getBottomLine() {
+		
 		return concordance.getTopIndex() + concordance.getNLinePerPage() - 1;
 	}
-
+	
 	/**
 	 * Gets the left context size.
 	 *
 	 * @return the left context size
 	 */
 	public int getLeftContextSize() {
+		
 		return concordance.getLeftContextSize();
 	}
-
+	
 	/**
 	 * Gets the right context size.
 	 *
 	 * @return the right context size
 	 */
 	public int getRightContextSize() {
+		
 		return concordance.getRightContextSize();
 	}
-
+	
 	/**
 	 * Gets the corpus.
 	 *
 	 * @return the corpus
 	 */
 	public CQPCorpus getCorpus() {
+		
 		return concordance.getCorpus();
 	}
-
-	/* (non-Javadoc)
+	
+	/*
+	 * (non-Javadoc)
 	 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
 	 */
 	@Override
 	public void setFocus() {
+		
 		if (this.queryWidget == null) return;
 		this.queryWidget.setFocus();
 	}
-
+	
 	/**
 	 * refresh column display accordingly to the views properties.
 	 */
 	private void refreshViewProperties() {
+		
 		concordance.resetLines();
 		sort();
 	}
-
+	
 	/**
 	 * Refresh sort properties.
 	 */
 	private void refreshSortProperties() {
+		
 		concordance.resetLines();
 		sort();
 	}
-
+	
 	/**
 	 * Sets the left c view properties.
 	 *
 	 * @param selectedViewProperties the new left c view properties
 	 */
 	public void setLeftViewProperties(List<WordProperty> selectedViewProperties) {
+		
 		concordance.setLeftViewProperties(selectedViewProperties);
 		refreshViewProperties();
 	}
-
+	
 	/**
 	 * Sets the right c view properties.
 	 *
 	 * @param selectedViewProperties the new right c view properties
 	 */
 	public void setRightViewProperties(List<WordProperty> selectedViewProperties) {
+		
 		concordance.setRightViewProperties(selectedViewProperties);
 		refreshViewProperties();
 	}
-
+	
 	/**
 	 * Sets the keyword view properties.
 	 *
 	 * @param selectedViewProperties the new keyword view properties
 	 */
 	public void setKeywordViewProperties(List<WordProperty> selectedViewProperties) {
+		
 		concordance.setKeywordViewProperties(selectedViewProperties);
 		refreshViewProperties();
-		//		updateViewPropertiesLabel();
+		// updateViewPropertiesLabel();
 	}
-
+	
 	/**
 	 * Refresh reference column title.
 	 */
-	public void refreshReferenceColumnTitle()
-	{
+	public void refreshReferenceColumnTitle() {
+		
 		referenceColumn.setText(concordance.getRefViewPattern().getTitle());
 	}
-
+	
 	/**
 	 * Gets the selected left c view properties.
 	 *
 	 * @return the selected left c view properties
 	 */
 	public List<WordProperty> getSelectedLeftViewProperties() {
+		
 		return concordance.getLeftViewProperties();
 	}
-
+	
 	/**
 	 * Gets the selected keyword view properties.
 	 *
 	 * @return the selected keyword view properties
 	 */
 	public List<WordProperty> getSelectedKeywordViewProperties() {
+		
 		return concordance.getKeywordViewProperties();
 	}
-
+	
 	/**
 	 * Gets the selected right c view properties.
 	 *
 	 * @return the selected right c view properties
 	 */
 	public List<WordProperty> getSelectedRightViewProperties() {
+		
 		return concordance.getRightViewProperties();
 	}
-
+	
 	/**
 	 * Gets the selected left c sort properties.
 	 *
 	 * @return the selected left c sort properties
 	 */
 	public List<WordProperty> getSelectedLeftSortProperties() {
+		
 		return concordance.getLeftAnalysisProperties();
 	}
-
+	
 	/**
 	 * Gets the selected keyword sort properties.
 	 *
 	 * @return the selected keyword sort properties
 	 */
 	public List<WordProperty> getSelectedKeywordSortProperties() {
+		
 		return concordance.getKeywordAnalysisProperties();
 	}
-
+	
 	/**
 	 * Gets the selected right c sort properties.
 	 *
 	 * @return the selected right c sort properties
 	 */
 	public List<WordProperty> getSelectedRightSortProperties() {
+		
 		return concordance.getRightAnalysisProperties();
 	}
-
+	
 	/**
 	 * Gets the available left c view properties.
 	 *
 	 * @return the available left c view properties
 	 */
 	public List<WordProperty> getAvailableLeftViewProperties() {
+		
 		return concordance.getAvailableLeftViewProperties();
 	}
-
+	
 	/**
 	 * Gets the available keyword view properties.
 	 *
 	 * @return the available keyword view properties
 	 */
 	public List<WordProperty> getAvailableKeywordViewProperties() {
+		
 		return concordance.getAvailableKeywordViewProperties();
 	}
-
+	
 	/**
 	 * Gets the available right c view properties.
 	 *
 	 * @return the available right c view properties
 	 */
 	public List<WordProperty> getAvailableRightViewProperties() {
+		
 		return concordance.getAvailableRightViewProperties();
 	}
-
+	
 	/**
 	 * Gets the available left sort properties.
 	 *
 	 * @return the available left sort properties
 	 */
 	public List<WordProperty> getAvailableLeftSortProperties() {
+		
 		return concordance.getAvailableLeftSortProperties();
 	}
-
+	
 	/**
 	 * Gets the available keyword sort properties.
 	 *
 	 * @return the available keyword sort properties
 	 */
 	public List<WordProperty> getAvailableKeywordSortProperties() {
+		
 		return concordance.getAvailableKeywordSortProperties();
 	}
-
+	
 	/**
 	 * Gets the available right sort properties.
 	 *
 	 * @return the available right sort properties
 	 */
 	public List<WordProperty> getAvailableRightSortProperties() {
+		
 		return concordance.getAvailableRightSortProperties();
 	}
-
+	
 	/**
 	 * Gets the selected references.
 	 *
 	 * @return the selected references
 	 */
 	public List<Property> getSelectedViewReferences() {
+		
 		return concordance.getRefViewPattern().getProperties();
 	}
-
+	
 	/**
 	 * Gets the selected references.
 	 *
 	 * @return the selected references
 	 */
 	public List<Property> getSelectedSortReferences() {
+		
 		return concordance.getRefAnalysePattern().getProperties();
 	}
-
+	
 	/**
 	 * Gets the line table viewer.
 	 *
 	 * @return the line table viewer
 	 */
 	public TableViewer getLineTableViewer() {
+		
 		return viewerRight;
 	}
-
+	
 	/**
 	 * Reset sorted column.
 	 *
 	 * @param col the col
 	 */
 	public void resetSortedColumn(int col) {
-		switch(col) {
-		case 1://keyword
-			viewerRight.getTable().setSortColumn(this.keywordColumn);
-			viewerRight.getTable().setSortDirection(SWT.DOWN);
-			break;
-		case 2://left
-			viewerRight.getTable().setSortColumn(this.leftContextColumn);
-			viewerRight.getTable().setSortDirection(SWT.DOWN);
-			break;
-		case 3://right
-			viewerRight.getTable().setSortColumn(this.rightContextColumn);
-			viewerRight.getTable().setSortDirection(SWT.DOWN);
-			break;
-		case 4://references
-			viewerRight.getTable().setSortColumn(this.referenceColumn);
-			viewerRight.getTable().setSortDirection(SWT.DOWN);
-			break;
-		default:
-			viewerRight.getTable().setSortColumn(null);
-			viewerRight.getTable().setSortDirection(SWT.NONE);
+		
+		switch (col) {
+			case 1:// keyword
+				viewerRight.getTable().setSortColumn(this.keywordColumn);
+				viewerRight.getTable().setSortDirection(SWT.DOWN);
+				break;
+			case 2:// left
+				viewerRight.getTable().setSortColumn(this.leftContextColumn);
+				viewerRight.getTable().setSortDirection(SWT.DOWN);
+				break;
+			case 3:// right
+				viewerRight.getTable().setSortColumn(this.rightContextColumn);
+				viewerRight.getTable().setSortDirection(SWT.DOWN);
+				break;
+			case 4:// references
+				viewerRight.getTable().setSortColumn(this.referenceColumn);
+				viewerRight.getTable().setSortDirection(SWT.DOWN);
+				break;
+			default:
+				viewerRight.getTable().setSortColumn(null);
+				viewerRight.getTable().setSortDirection(SWT.NONE);
 		}
-
+		
 	}
-
+	
 	/*
-	/**
+	 * /**
 	 * Back to text.
-
-	@SuppressWarnings("restriction") //$NON-NLS-1$
-	public void backToText() {
-		try {
-			StructuredSelection select = (StructuredSelection) viewer.getSelection();
-			if (select == null) return;
-			Line line = (Line) select.getFirstElement();
-			if (line == null) return;
-
-			StructuralUnit textS = null;
-			textid = ""; //$NON-NLS-1$
-			String baseid = ""; //$NON-NLS-1$
-
-			String projectid = ""; //$NON-NLS-1$
-			try {
-				textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$
-				Property textP = textS.getProperty("id"); //$NON-NLS-1$
-				textid = line.getMatch().getValueForProperty(textP);// get text via text struc property id
-				// Log.info("Corpus' base ("+baseid+") : "+corpus.getParent());
-			} catch (Exception e2) {
-				System.out.println(Messages.ConcordancesEditor_8);
-				org.txm.utils.logger.Log.printStackTrace(e2);
-				return;
-			}
-
-			Log.info(Messages.ConcordancesEditor_20);
-
-			final List<String> wordids = concordance.getKeywordsId(
-					textid, getTopLine(), getBottomLine() + 1);
-
-			lineids = null;
-			try {
-				lineids = line.getMatch().getValuesForProperty(
-						corpus.getProperty("id")); //$NON-NLS-1$
-			} catch (Exception e1) {
-				org.txm.utils.logger.Log.printStackTrace(e1);
-				return;
-			}
-			Log.info(NLS.bind(Messages.ConcordancesEditor_26, 
-					new Object[]{projectid, baseid, textid}));
-
-			Text text = corpus.getMainCorpus().getText(textid);
-			if (text == null) {
-				System.out.println(NLS.bind(Messages.ConcordancesEditor_27, textid));
-				StatusLine.setMessage(NLS.bind(Messages.ConcordancesEditor_27, textid));
-				Log.severe(NLS.bind(Messages.ConcordancesEditor_27, textid));
-				return;
-			}
-
-			Edition edition = text.getEdition(corpus.getMainCorpus().getDefaultEdition()); 
-			if (edition == null) {
-				System.out.println(Messages.ConcordancesEditor_30);
-				StatusLine.setMessage(Messages.ConcordancesEditor_30);
-				Log.severe(Messages.ConcordancesEditor_30);
-				return;
-			}
-
-			String line_wordid = lineids.get(0);
-			if (line_wordid == null) {
-				System.out.println(Messages.ConcordancesEditor_9+edition+Messages.ConcordancesEditor_10);
-				return;				
-			}
-			openedPage = edition.getPageForWordId(line_wordid);
-			if (openedPage != null) {
-				// System.out.println(page.getFile());
-				if (attachedBrowserEditor == null || attachedBrowserEditor.isDisposed()) {
-					attachedBrowserEditor = OpenBrowser.openEdition(openedPage.getFile().getAbsolutePath(), openedPage.getFile().getName());
-					if (attachedBrowserEditor != null) {
-						attachedBrowserEditor.setEdition(edition);
-					} else {
-						System.out.println("Fail to create Edition editor.");
-						return;
-					}
-				}
-
-				if (attachedBrowserEditor != null) {
-					attachedBrowserEditor.showPage(openedPage);
-					attachedBrowserEditor.setWordsIds(wordids, lineids);
-
-					IWorkbenchPage attachedPage = attachedBrowserEditor.getEditorSite().getPage();
-					attachedPage.activate(attachedBrowserEditor);
-				}
-			} else
-				System.out.println(NLS.bind(Messages.ConcordancesEditor_29, wordids.get(0)));
-		} catch (Exception err) {
-			Log.severe(NLS.bind(Messages.ConcordancesEditor_46, err));
-			Log.printStackTrace(err);
-		}
-	}
+	 * @SuppressWarnings("restriction") //$NON-NLS-1$
+	 * public void backToText() {
+	 * try {
+	 * StructuredSelection select = (StructuredSelection) viewer.getSelection();
+	 * if (select == null) return;
+	 * Line line = (Line) select.getFirstElement();
+	 * if (line == null) return;
+	 * StructuralUnit textS = null;
+	 * textid = ""; //$NON-NLS-1$
+	 * String baseid = ""; //$NON-NLS-1$
+	 * String projectid = ""; //$NON-NLS-1$
+	 * try {
+	 * textS = corpus.getStructuralUnit("text"); //$NON-NLS-1$
+	 * Property textP = textS.getProperty("id"); //$NON-NLS-1$
+	 * textid = line.getMatch().getValueForProperty(textP);// get text via text struc property id
+	 * // Log.info("Corpus' base ("+baseid+") : "+corpus.getParent());
+	 * } catch (Exception e2) {
+	 * System.out.println(Messages.ConcordancesEditor_8);
+	 * org.txm.utils.logger.Log.printStackTrace(e2);
+	 * return;
+	 * }
+	 * Log.info(Messages.ConcordancesEditor_20);
+	 * final List<String> wordids = concordance.getKeywordsId(
+	 * textid, getTopLine(), getBottomLine() + 1);
+	 * lineids = null;
+	 * try {
+	 * lineids = line.getMatch().getValuesForProperty(
+	 * corpus.getProperty("id")); //$NON-NLS-1$
+	 * } catch (Exception e1) {
+	 * org.txm.utils.logger.Log.printStackTrace(e1);
+	 * return;
+	 * }
+	 * Log.info(NLS.bind(Messages.ConcordancesEditor_26,
+	 * new Object[]{projectid, baseid, textid}));
+	 * Text text = corpus.getMainCorpus().getText(textid);
+	 * if (text == null) {
+	 * System.out.println(NLS.bind(Messages.ConcordancesEditor_27, textid));
+	 * StatusLine.setMessage(NLS.bind(Messages.ConcordancesEditor_27, textid));
+	 * Log.severe(NLS.bind(Messages.ConcordancesEditor_27, textid));
+	 * return;
+	 * }
+	 * Edition edition = text.getEdition(corpus.getMainCorpus().getDefaultEdition());
+	 * if (edition == null) {
+	 * System.out.println(Messages.ConcordancesEditor_30);
+	 * StatusLine.setMessage(Messages.ConcordancesEditor_30);
+	 * Log.severe(Messages.ConcordancesEditor_30);
+	 * return;
+	 * }
+	 * String line_wordid = lineids.get(0);
+	 * if (line_wordid == null) {
+	 * System.out.println(Messages.ConcordancesEditor_9+edition+Messages.ConcordancesEditor_10);
+	 * return;
+	 * }
+	 * openedPage = edition.getPageForWordId(line_wordid);
+	 * if (openedPage != null) {
+	 * // System.out.println(page.getFile());
+	 * if (attachedBrowserEditor == null || attachedBrowserEditor.isDisposed()) {
+	 * attachedBrowserEditor = OpenBrowser.openEdition(openedPage.getFile().getAbsolutePath(), openedPage.getFile().getName());
+	 * if (attachedBrowserEditor != null) {
+	 * attachedBrowserEditor.setEdition(edition);
+	 * } else {
+	 * System.out.println("Fail to create Edition editor.");
+	 * return;
+	 * }
+	 * }
+	 * if (attachedBrowserEditor != null) {
+	 * attachedBrowserEditor.showPage(openedPage);
+	 * attachedBrowserEditor.setWordsIds(wordids, lineids);
+	 * IWorkbenchPage attachedPage = attachedBrowserEditor.getEditorSite().getPage();
+	 * attachedPage.activate(attachedBrowserEditor);
+	 * }
+	 * } else
+	 * System.out.println(NLS.bind(Messages.ConcordancesEditor_29, wordids.get(0)));
+	 * } catch (Exception err) {
+	 * Log.severe(NLS.bind(Messages.ConcordancesEditor_46, err));
+	 * Log.printStackTrace(err);
+	 * }
+	 * }
 	 */
-
+	
 	/**
 	 * Gets the current comparator used for sorting lines.
+	 * 
 	 * @return the currentComparator
 	 */
 	public LineComparator getCurrentComparator() {
+		
 		return currentComparator;
 	}
-
+	
 	/**
 	 * Gets the number of pages.
+	 * 
 	 * @return
 	 */
-	public int getPagesCount()	{
-		return (int) Math.ceil(((double)this.concordance.getNLines() / concordance.getNLinePerPage()));
+	public int getPagesCount() {
+		
+		return (int) Math.ceil(((double) this.concordance.getNLines() / concordance.getNLinePerPage()));
 	}
-
+	
 	public void setQuery(String query) {
+		
 		queryWidget.setText(query);
 	}
-
-
+	
 	/**
 	 * Open the edition for the selected line.
 	 * The command used to show the edition is an EditionBackToText Extension
 	 */
 	public boolean backToText() {
-
+		
 		StructuredSelection select = (StructuredSelection) viewerRight.getSelection();
 		if (select == null) return false;
-
+		
 		Line line = (Line) select.getFirstElement();
 		if (line == null) return false;
-
+		
 		try {
 			IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(BACKTOTEXT_COMMAND_ID);
 			for (IConfigurationElement e : config) {
 				Object o = e.createExecutableExtension("class"); // //$NON-NLS-1$
-				if (o instanceof BackToTextCommand) {
-					return ((BackToTextCommand) o).backToText(this, line.getMatch());
-				}
+				if (o instanceof BackToTextCommand) { return ((BackToTextCommand) o).backToText(this, line.getMatch()); }
 			}
-		} catch (CoreException e1) {
+		}
+		catch (CoreException e1) {
 			e1.printStackTrace();
 		}
-
+		
 		return false;
-
-		//		try {
-		//			StructuredSelection select = (StructuredSelection) viewer.getSelection();
-		//			if (select == null) return;
-		//			Line line = (Line) select.getFirstElement();
-		//			if (line == null) return;
-		//			org.txm.rcp.synoptic.commands.BackToText.backToText(line);
-		//		} catch(Exception err) {
-		//			System.out.println("Error while calling backtotext: "+err);
-		//			Log.printStackTrace(err);
-		//		}
+		
+		// try {
+		// StructuredSelection select = (StructuredSelection) viewer.getSelection();
+		// if (select == null) return;
+		// Line line = (Line) select.getFirstElement();
+		// if (line == null) return;
+		// org.txm.rcp.synoptic.commands.BackToText.backToText(line);
+		// } catch(Exception err) {
+		// System.out.println("Error while calling backtotext: "+err);
+		// Log.printStackTrace(err);
+		// }
 	}
-
+	
 	public void resetLeftTableColumnWidths() {
-
+		
 		int refMax = referenceColumn.getText().length();
 		for (TableItem item : viewerLeft.getTable().getItems()) {
 			if (refMax < item.getText(0).length()) refMax = item.getText(0).length();
 		}
-
-		//System.out.println("Size="+queryLabel.getSize().x +" label="+queryLabel.getText()+" l size"+ queryLabel.getText().length());
-		float W = 1f+(float)(queryLabel.getSize().x / (float)queryLabel.getText().length());
-		//System.out.println("W= "+W+" Maxs "+refMax+ " " +leftMax+" " +keywordMax+" "+rightMax);
-
-		((FormData) sash.getLayoutData()).left = new FormAttachment(0, 25+(int) (refMax*W));
-		referenceColumn.setWidth(2*(int) (refMax*W));
+		
+		// System.out.println("Size="+queryLabel.getSize().x +" label="+queryLabel.getText()+" l size"+ queryLabel.getText().length());
+		float W = 1f + (float) (queryLabel.getSize().x / (float) queryLabel.getText().length());
+		// System.out.println("W= "+W+" Maxs "+refMax+ " " +leftMax+" " +keywordMax+" "+rightMax);
+		
+		((FormData) sash.getLayoutData()).left = new FormAttachment(0, 25 + (int) (refMax * W));
+		referenceColumn.setWidth(2 * (int) (refMax * W));
 		getResultArea().layout(true, true);
 	}
-
+	
 	/*
 	 * 
 	 */
 	public void resetRightTableColumnWidths() {
-
-		float W = 1f+(float)(queryLabel.getSize().x / (float)queryLabel.getText().length());
-
+		
+		float W = 1f + (float) (queryLabel.getSize().x / (float) queryLabel.getText().length());
+		
 		TableColumn[] columns = viewerRight.getTable().getColumns();
-		for (int i = 0 ; i < columns.length ; i++) {
+		for (int i = 0; i < columns.length; i++) {
 			TableColumn column = columns[i];
 			if (column.getWidth() == 0) continue; // skip closed columns
-
+			
 			int max = column.getText().length();
 			if (max == 0) continue; // skip no-title columns
-
+			
 			int n = 0;
 			for (TableItem item : viewerRight.getTable().getItems()) {
 				if (max < item.getText(i).length()) max = item.getText(i).length();
 				if (n++ > 100) break; // stop testing after 100 lines
 			}
-
-			column.setWidth(15+(int) (max*W));
+			
+			column.setWidth(15 + (int) (max * W));
 		}
-
+		
 		viewerRight.getTable().layout(true, true);
 		tableResizeListener.handleEvent(null); // center on keyword column
 	}
-
+	
 	/**
 	 * Computes the column widths using the max length of each column (title+lines)
 	 * 
@@ -2042,16 +2201,17 @@
 	 * The characters width is estimated using the queryLabel length
 	 */
 	public void resetColumnWidths() {
+		
 		resetLeftTableColumnWidths();
 		resetRightTableColumnWidths();
 	}
-
-
+	
 	public Composite getExtensionButtonComposite() {
+		
 		// TODO Auto-generated method stub
 		return null;
 	}
-
+	
 	/**
 	 * ControlerListener to maintain the width of a TableColumn superior to 5
 	 * 
@@ -2059,43 +2219,48 @@
 	 *
 	 */
 	public static class ConcordanceColumnSizeControlListener implements ControlListener {
+		
 		private TableColumn column;
-
+		
 		public ConcordanceColumnSizeControlListener(TableColumn column) {
+			
 			this.column = column;
 		}
-
+		
 		@Override
-		public void controlMoved(ControlEvent e) { }
-
+		public void controlMoved(ControlEvent e) {}
+		
 		@Override
 		public void controlResized(ControlEvent e) {
-			if (column != null && !column.isDisposed() &&column.getWidth() < 5) {
+			
+			if (column != null && !column.isDisposed() && column.getWidth() < 5) {
 				column.setWidth(5);
 			}
 		}
 	}
-
+	
 	public String getLocale() {
+		
 		return locale;
 	}
-
+	
 	@Override
 	public void updateResultFromEditor() {
 		// TODO
 	}
-
-
+	
 	/**
 	 * Sets the standard comparators.
 	 */
 	private void setStandardComparators() {
-		for (int i = 0; i < standardComparatorClassName.length; i++)
+		
+		for (int i = 0; i < standardComparatorClassName.length; i++) {
 			standardComparators.add(standardComparatorClassName[i]);
+		}
 	}
-
-
+	
 	public boolean isDisposed() {
+		
 		return viewerLeft.getTable().isDisposed();
 	}
-}
\ No newline at end of file
+}
