Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java	(revision 3983)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java	(revision 3984)
@@ -94,6 +94,7 @@
 		};
 		
 		getMainParametersComposite().getLayout().numColumns = 4;
+		getMainParametersComposite().getLayout().horizontalSpacing = 2;
 		
 		nameLabel = new Label(getMainParametersComposite(), SWT.NONE);
 		nameLabel.setText(TXMUIMessages.name);
Index: TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/PartitionEditor.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/PartitionEditor.java	(revision 3983)
+++ TXM/trunk/bundles/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/PartitionEditor.java	(revision 3984)
@@ -10,7 +10,9 @@
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.viewers.ViewerSorter;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyEvent;
@@ -27,9 +29,12 @@
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.Parameter;
+import org.txm.core.results.TXMResult;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.rcp.editors.listeners.ComputeKeyListener;
@@ -41,8 +46,10 @@
 import org.txm.rcp.swt.widget.structures.SimplePartitionPanel;
 import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.Part;
 import org.txm.searchengine.cqp.corpus.Partition;
+import org.txm.searchengine.cqp.corpus.Subcorpus;
 import org.txm.utils.logger.Log;
 
 public class PartitionEditor extends TXMEditor<Partition> {
@@ -64,6 +71,7 @@
 	private Button updateQueryFromAssistance;
 	private Composite assistantPanel;
 	
+	@SuppressWarnings("deprecation")
 	@Override
 	public void _createPartControl() throws Exception {
 		
@@ -72,6 +80,7 @@
 		ComputeKeyListener computeKeyListener = new ComputeKeyListener(this);
 		
 		getMainParametersComposite().getLayout().numColumns = 7;
+		getMainParametersComposite().getLayout().horizontalSpacing = 2;
 		
 		Label l = new Label(getMainParametersComposite(), SWT.NONE);
 		l.setText(TXMUIMessages.name);
@@ -297,6 +306,8 @@
 		
 		// RESULT AREA
 		
+		this.getResultArea().getLayout().verticalSpacing = 2;
+		
 		GLComposite buttons = new GLComposite(this.getResultArea(), SWT.NONE, "buttons");
 		buttons.getLayout().numColumns = 10;
 		buttons.getLayout().horizontalSpacing = 2;
@@ -312,7 +323,6 @@
 					p.delete();
 				}
 				
-				partsViewer.setInput(getResult());
 				try {
 					updateEditorFromResult(false);
 				} catch (Exception e1) {
@@ -335,6 +345,34 @@
 		partsViewer.getTable().setHeaderVisible(true);
 		partsViewer.getTable().setLinesVisible(true);
 		
+		partsViewer.setSorter(new ViewerSorter() {
+					
+			@Override
+			public int compare(Viewer viewer, Object e1, Object e2) {
+				Part p1 = (Part)e1;
+				Part p2 = (Part)e2;
+				int s = 0;
+				if (partsViewer.getTable().getSortColumn() == nameColumn.getColumn()) {
+					s = p1.getName().compareTo(p2.getName());
+				} else if (partsViewer.getTable().getSortColumn() == queryColumn.getColumn()) {
+					s = p1.getQuery().getQueryString().compareTo(p2.getQuery().getQueryString());
+				} else if (partsViewer.getTable().getSortColumn() == sizeColumn.getColumn()) {
+					try {
+						s = p1.getSize() - p2.getSize();
+					}
+					catch (CqiClientException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				}
+				
+				if (partsViewer.getTable().getSortDirection() == SWT.DOWN) s = -s;
+				
+				return s;
+			}
+		});
+		
+		
 		partsViewer.getTable().addKeyListener(new KeyListener() {
 			
 			@Override
@@ -349,7 +387,6 @@
 						}
 					}
 					
-					partsViewer.setInput(getResult());
 					try {
 						updateEditorFromResult(false);
 					} catch (Exception e1) {
@@ -408,6 +445,31 @@
 			}
 		});
 		
+		SelectionListener colSelection = new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				
+				TableColumn col = (TableColumn) e.widget;
+				Table table = partsViewer.getTable();
+				if (table.getSortColumn() == col) {
+					if (table.getSortDirection() == SWT.DOWN) {
+						table.setSortDirection(SWT.UP);
+					} else {
+						table.setSortDirection(SWT.DOWN);
+					}
+				} else {
+					table.setSortDirection(SWT.DOWN);
+				}
+				
+				table.setSortColumn(col);
+				partsViewer.refresh();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		};
+		
 		queryColumn = new TableViewerColumn(partsViewer, SWT.NONE);
 		queryColumn.getColumn().setText("Query");
 		queryColumn.getColumn().pack();
@@ -448,7 +510,26 @@
 			}
 		});
 		
+		TableViewerColumn tmpColumn = new TableViewerColumn(partsViewer, SWT.NONE);
+		tmpColumn.getColumn().setText("");
+		tmpColumn.getColumn().pack();
+		tmpColumn.setLabelProvider(new CellLabelProvider() {
+			
+			private String EMPTY = "";
+
+			@Override
+			public void update(ViewerCell cell) {
+				cell.setText(EMPTY);
+			}
+		});
+
+		nameColumn.getColumn().addSelectionListener(colSelection);
+		queryColumn.getColumn().addSelectionListener(colSelection);
+		sizeColumn.getColumn().addSelectionListener(colSelection);
+		
 		partsViewer.setInput(getResult());
+		
+		TXMEditor.packColumns(this.partsViewer);
 	}
 	
 	/**
@@ -539,6 +620,9 @@
 	
 	@Override
 	public void updateEditorFromResult(boolean update) throws Exception {
+		
 		partsViewer.setInput(getResult());
+		
+		TXMEditor.packColumns(this.partsViewer);
 	}
 }
