Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 3977)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java	(revision 3978)
@@ -27,37 +27,19 @@
 //
 package org.txm.rcp.actions;
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
 import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.TabFolder;
 import org.eclipse.swt.widgets.TabItem;
@@ -65,17 +47,13 @@
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.swt.widget.PartitionComposer;
-import org.txm.rcp.swt.widget.QueryWidget;
-import org.txm.searchengine.cqp.CQPSearchEngine;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+import org.txm.rcp.swt.widget.structures.AdvancedPartitionPanel;
+import org.txm.rcp.swt.widget.structures.CrossedPartitionPanel;
+import org.txm.rcp.swt.widget.structures.SimplePartitionPanel;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
 import org.txm.searchengine.cqp.corpus.Partition;
-import org.txm.searchengine.cqp.corpus.StructuralUnit;
-import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
-import org.txm.utils.io.IOUtils;
 import org.txm.utils.logger.Log;
 
-// TODO: Auto-generated Javadoc
 /**
  * Allow the user to choose between 3 mode to create a Partition Simple : choose
  * a structural unit and a property Assisted : choose a structural unit and a
@@ -86,61 +64,26 @@
  */
 public class CreatePartitionDialog extends Dialog {
 	
-	// For the "simple" tab
-	/** The selected structural unit. */
-	private StructuralUnit selectedStructuralUnit;
-	
-	/** The selected structural unit property. */
-	private StructuralUnitProperty selectedStructuralUnitProperty;
-	
 	/** The corpus. */
 	private CQPCorpus corpus;
 	
-	// for the "advanced" tab
-	/** The queries. */
-	private List<QueryWidget> queries = new ArrayList<>();
-	
-	/** The part names. */
-	private List<Text> partNames = new ArrayList<>();
-	
-	/** The queries string. */
-	List<String> queriesString = new ArrayList<>();
-	
-	/** The is simple selected. */
-	private boolean isSimpleSelected = true;
-	
-	/** The is assisted selected. */
-	private boolean isAssistedSelected = false;
-	
-	/** The is advanced selected. */
-	private boolean isAdvancedSelected = false;
-	
-	/** The name. */
-	private String name;
-	
 	/** The name text. */
 	private Text nameText;
 	
-	/** The composite for assisted. */
-	private PartitionComposer compositeForAssisted;
-	
-	/** The structural units combo. */
-	private Combo structuralUnitsCombo;
-	
-	/** The structural units final. */
-	private List<StructuralUnit> structuralUnitsFinal;
-	
-	/** The property combo. */
-	private Combo propertyCombo;
-	
 	/** The partition. */
 	private Partition partition;
 	
-	/** The composite for advanced. */
-	private Composite compositeForAdvanced;
+	private SimplePartitionPanel simplePanel;
+	private PartitionComposer compositeForAssisted;
+	private CrossedPartitionPanel crossedPanel;
+	private AdvancedPartitionPanel advancedPartitionPanel;
 	
-	/** The scroll composite. */
-	private ScrolledComposite scrollComposite;
+	private TabItem selectedTab;
+
+	private TabItem simpleTab;
+	private TabItem assistedTab;
+	private TabItem crossedTab;
+	private TabItem advancedTab;
 	
 	/**
 	 * Instantiates a new creates the partition dialog.
@@ -153,7 +96,6 @@
 		super(parentShell);
 		this.corpus = corpus;
 		this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
-		
 	}
 	
 	/*
@@ -187,8 +129,7 @@
 		defaultFont.setStyle(SWT.BOLD);
 		Font newf = new Font(Display.getCurrent(), defaultFont);
 		nameLabel.setText(TXMUIMessages.ampNameColon);
-		nameLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-				false, false));
+		nameLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
 		nameLabel.setFont(newf);
 		
 		nameText = new Text(c, SWT.BORDER);
@@ -202,203 +143,31 @@
 		// First tab
 		// --------------------------------------------------------
 		
-		TabItem simpleTab = new TabItem(tabFolder, SWT.NONE);
-		
+		simpleTab = new TabItem(tabFolder, SWT.NONE);
 		simpleTab.setText(TXMUIMessages.simple);
+		simplePanel = new SimplePartitionPanel(tabFolder, SWT.NONE, corpus);
+		simpleTab.setControl(simplePanel);
 		
-		Composite composite = new Composite(tabFolder, SWT.NONE);
-		simpleTab.setControl(composite);
-		
-		GridLayout layout = new GridLayout(2, false);
-		composite.setLayout(layout);
-		
-		// StructuralUnit
-		// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		
-		Label structureLabel = new Label(composite, SWT.NONE);
-		structureLabel.setText(TXMUIMessages.ampStructureColon);
-		structureLabel.setLayoutData(new GridData(GridData.END,
-				GridData.CENTER, false, false));
-		
-		structuralUnitsCombo = new Combo(composite, SWT.READ_ONLY);
-		structuralUnitsCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-				true, false));
-		
-		List<StructuralUnit> structuralUnits = null;
-		try {
-			structuralUnits = corpus.getOrderedStructuralUnits();
-		}
-		catch (CqiClientException e) {
-			Log.severe(TXMCoreMessages.bind(TXMCoreMessages.error_errorP0, Log.toString(e)));
-			return null;
-		}
-		structuralUnitsFinal = new ArrayList<>();
-		for (StructuralUnit unit : structuralUnits) {
-			if (unit.getName().equals("txmcorpus")) continue; // ignore txmcorpus structure //$NON-NLS-1$
-			
-			if (unit.getOrderedProperties() != null
-					&& unit.getOrderedProperties().size() != 0) {
-				/*
-				 * if ((unit.getName().equals("text") &&
-				 * unit.getProperties().size() > 3)) //$NON-NLS-1$ {
-				 * structuralUnitsCombo.add(unit.getName());
-				 * structuralUnitsFinal.add(unit); } else
-				 * if (!unit.getName().equals("text")) //$NON-NLS-1$ {
-				 */
-				structuralUnitsCombo.add(unit.getName());
-				structuralUnitsFinal.add(unit);
-				// }
-			}
-		}
-		
-		if (structuralUnitsCombo.getItemCount() == 0) {
-			this.getButton(IDialogConstants.OK_ID).setEnabled(false);
-		}
-		else {
-			structuralUnitsCombo.select(0);
-			String[] items = structuralUnitsCombo.getItems();
-			for (int i = 0; i < items.length; i++) {
-				if (items[i].equals("text")) //$NON-NLS-1$
-				{
-					structuralUnitsCombo.select(i);
-					break;
-				}
-			}
-			selectedStructuralUnit = structuralUnitsFinal.get(0);
-		}
-		// combo.setSize (200, 200);
-		
-		// StructuralUnitProperty
-		// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		
-		Label propertyLabel = new Label(composite, SWT.NONE);
-		propertyLabel.setText(TXMUIMessages.ampPropertyColon);
-		propertyLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER,
-				false, false));
-		
-		propertyCombo = new Combo(composite, SWT.READ_ONLY);
-		propertyCombo.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-				true, false));
-		// combo.setSize (200, 200);
-		structuralUnitsCombo.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-			
-			@Override
-			public void widgetSelected(SelectionEvent event) {
-				
-				reloadProperties();
-			}
-		});
-		
-		for (StructuralUnitProperty property : structuralUnitsFinal.get(0).getOrderedProperties()) {
-			if (!(structuralUnitsFinal.get(0).getName().equals("text") &&  //$NON-NLS-1$
-					(property.getName().equals("project") || property.getName().equals("base")))) //$NON-NLS-1$ //$NON-NLS-2$
-				propertyCombo.add(property.getName());
-		}
-		propertyCombo.select(0);
-		selectedStructuralUnitProperty = selectedStructuralUnit.getOrderedProperties()
-				.get(0);
-		
-		propertyCombo.addSelectionListener(new SelectionListener() {
-			
-			@Override
-			public void widgetDefaultSelected(SelectionEvent e) {}
-			
-			@Override
-			public void widgetSelected(SelectionEvent event) {
-				
-				selectedStructuralUnitProperty = selectedStructuralUnit
-						.getOrderedProperties().get(propertyCombo.getSelectionIndex());
-			}
-		});
-		
-		reloadProperties();
-		
 		// Second Tab : assisted mode
-		TabItem assistedTab = new TabItem(tabFolder, SWT.NONE);
-		
+		assistedTab = new TabItem(tabFolder, SWT.NONE);
 		assistedTab.setText(TXMUIMessages.assisted);
-		
 		compositeForAssisted = new PartitionComposer(tabFolder, SWT.NONE, this.corpus);
 		assistedTab.setControl(compositeForAssisted);
 		
-		// Third tab: avanced mode
-		// --------------------------------------------------------
+		// Second Tab : crossed mode
+		crossedTab = new TabItem(tabFolder, SWT.NONE);
+		crossedTab.setText("Crossed");
+		crossedPanel = new CrossedPartitionPanel(tabFolder, SWT.NONE, this.corpus);
+		crossedTab.setControl(crossedPanel);
 		
-		TabItem advancedTab = new TabItem(tabFolder, SWT.NONE);
+		// Last tab: advanced mode
+		advancedTab = new TabItem(tabFolder, SWT.NONE);
 		advancedTab.setText(TXMUIMessages.advanced);
+		advancedPartitionPanel = new AdvancedPartitionPanel(tabFolder, SWT.NONE, this.corpus);
+		advancedTab.setControl(advancedPartitionPanel);
 		
-		Composite advanceContainer = new Composite(tabFolder, SWT.NONE);
-		GridLayout advanceLayout = new GridLayout(2, false);
-		advanceContainer.setLayout(advanceLayout);
-		advancedTab.setControl(advanceContainer);
+		selectedTab = simpleTab;
 		
-		scrollComposite = new ScrolledComposite(advanceContainer, SWT.V_SCROLL | SWT.BORDER);
-		scrollComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
-		
-		Button plusButton = new Button(advanceContainer, SWT.NONE);
-		plusButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER, GridData.FILL, false, false));
-		plusButton.setText("+"); //$NON-NLS-1$
-		plusButton.addListener(SWT.Selection, new Listener() {
-			
-			@Override
-			public void handleEvent(Event event) {
-				
-				addQueryField();
-			}
-		});
-		
-		// TODO enable when specified
-		// Button importButton = new Button(advanceContainer, SWT.NONE);
-		// importButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER,
-		// GridData.FILL, false, false));
-		// importButton.setText("Import from properties file..."); //$NON-NLS-1$
-		// importButton.addListener(SWT.Selection, new Listener() {
-		// @Override
-		// public void handleEvent(Event event) {
-		// FileDialog d = new FileDialog(event.display.getActiveShell());
-		// d.setFilterExtensions(new String[] {"*.properties"});
-		// d.setText("Select a properties file containing CQL queries");
-		// String path = d.open();
-		// if (path != null) {
-		// Properties props = new Properties();
-		// try {
-		// props.load(IOUtils.getReader(new File(path)));
-		// for (Object key : props.keySet()) {
-		// String value = props.getProperty(key.toString());
-		// QueryWidget qw = addQueryField(key.toString().substring(0, Math.min(20, key.toString().length())), value);
-		// }
-		// } catch (Exception e) {
-		// // TODO Auto-generated catch block
-		// e.printStackTrace();
-		// }
-		// }
-		//
-		// }
-		// });
-		
-		compositeForAdvanced = new Composite(scrollComposite, SWT.NONE);
-		GridLayout layoutForAdvanced = new GridLayout(3, false);
-		compositeForAdvanced.setLayout(layoutForAdvanced);
-		
-		scrollComposite.setContent(compositeForAdvanced);
-		scrollComposite.setExpandVertical(true);
-		scrollComposite.setExpandHorizontal(true);
-		scrollComposite.addControlListener(new ControlAdapter() {
-			
-			@Override
-			public void controlResized(ControlEvent e) {
-				
-				Rectangle r = scrollComposite.getClientArea();
-				scrollComposite.setMinSize(compositeForAdvanced.computeSize(
-						r.width, SWT.DEFAULT));
-			}
-		});
-		
-		createAdvancedQueryField();
-		
 		// check the state of the OK button according to the change of tab
 		// --------------------------------
 		
@@ -410,156 +179,13 @@
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				
-				// record the tab currently in use
-				if (tabFolder.getSelectionIndex() == 0) {
-					isSimpleSelected = true;
-					isAssistedSelected = false;
-					isAdvancedSelected = false;
-				}
-				else if (tabFolder.getSelectionIndex() == 1) {
-					isSimpleSelected = false;
-					isAssistedSelected = true;
-					isAdvancedSelected = false;
-				}
-				else {
-					isSimpleSelected = false;
-					isAssistedSelected = false;
-					isAdvancedSelected = true;
-				}
+				selectedTab = tabFolder.getSelection()[0];
 			}
 		});
 		
 		return tabFolder;
 	}
-	
-	/**
-	 * Reload properties.
-	 */
-	private void reloadProperties() {
 		
-		List<StructuralUnitProperty> properties = null;
-		selectedStructuralUnit = structuralUnitsFinal.get(structuralUnitsCombo
-				.getSelectionIndex());
-		
-		properties = selectedStructuralUnit.getOrderedProperties();
-		propertyCombo.removeAll();
-		for (StructuralUnitProperty property : properties) {
-			/*
-			 * if (!(selectedStructuralUnit.getName().equals("text") &&
-			 * //$NON-NLS-1$ (property.getName().equals("id") || //$NON-NLS-1$
-			 * property.getName().equals("base") || //$NON-NLS-1$
-			 * property.getName().equals("project")))) //$NON-NLS-1$
-			 */
-			if (selectedStructuralUnit.getName().equals("text") && //$NON-NLS-1$
-					(property.getName().equals("project") || property.getName().equals("base"))) continue; // ignore technical properties //$NON-NLS-1$ //$NON-NLS-2$
-			propertyCombo.add(property.getName());
-		}
-		if (propertyCombo.getItemCount() > 0) {
-			propertyCombo.select(0);
-			String[] items = propertyCombo.getItems();
-			for (int i = 0; i < items.length; i++)
-				if (items[i].equals("id")) //$NON-NLS-1$
-				{
-					propertyCombo.select(i);
-					break;
-				}
-			selectedStructuralUnitProperty = selectedStructuralUnit
-					.getOrderedProperties().get(0);
-			// this.getButton(IDialogConstants.OK_ID).setEnabled(true);
-		}
-	}
-	
-	/**
-	 * Return true if no query is currently given in the "advanced" tab (ie if
-	 * all Text field opened are empty).
-	 *
-	 * @return true, if successful
-	 */
-	private boolean noquery() {
-		
-		for (QueryWidget query : queries) {
-			if (query.getText().length() == 0)
-				return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * Creates the advanced query field.
-	 *
-	 */
-	private void createAdvancedQueryField() {
-		
-		addQueryField();
-		Rectangle r = scrollComposite.getClientArea();
-		scrollComposite.setMinSize(compositeForAdvanced.computeSize(r.width,
-				SWT.DEFAULT));
-	}
-	
-	/**
-	 * Adds the query field.
-	 *
-	 */
-	private QueryWidget addQueryField() {
-		
-		return addQueryField(null, null);
-	}
-	
-	/**
-	 * Adds the query field.
-	 *
-	 * @param name the query name
-	 * @param value the query
-	 */
-	private QueryWidget addQueryField(String name, String value) {
-		
-		final Text advancedPartLabel = new Text(compositeForAdvanced, SWT.BORDER);
-		advancedPartLabel.setText(TXMUIMessages.part
-				+ (partNames.size() + 1));
-		advancedPartLabel.setLayoutData(new GridData(GridData.FILL,
-				GridData.CENTER, false, false));
-		if (name != null && name.length() > 0) {
-			advancedPartLabel.setText(name);
-		}
-		partNames.add(advancedPartLabel);
-		
-		final QueryWidget queryText;
-		queryText = new QueryWidget(compositeForAdvanced, SWT.DROP_DOWN, corpus.getProject(), CQPSearchEngine.getEngine());
-		queryText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-		GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, false);
-		// gridData.widthHint = convertHeightInCharsToPixels(20);
-		queryText.setLayoutData(gridData);
-		queries.add(queryText);
-		if (value != null) {
-			queryText.setText(value);
-		}
-		final Button minusButton = new Button(compositeForAdvanced, SWT.NONE);
-		minusButton.setText("-"); //$NON-NLS-1$
-		// minusButton.setData(queryText);
-		minusButton.addListener(SWT.Selection, new Listener() {
-			
-			@Override
-			public void handleEvent(Event event) {
-				
-				queries.remove(queryText);
-				partNames.remove(advancedPartLabel);
-				advancedPartLabel.dispose();
-				queryText.dispose();
-				minusButton.dispose();
-				compositeForAdvanced.layout(true);
-			}
-		});
-		Rectangle r = scrollComposite.getClientArea();
-		scrollComposite.setMinSize(compositeForAdvanced.computeSize(r.width,
-				SWT.DEFAULT));
-		scrollComposite.update();
-		scrollComposite.layout();
-		compositeForAdvanced.update();
-		compositeForAdvanced.layout();
-		
-		return queryText;
-	}
-	
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.jface.dialogs.Dialog#okPressed()
@@ -567,78 +193,18 @@
 	@Override
 	protected void okPressed() {
 		
-		if (isAdvancedSelected() && noquery()) {
+		if (selectedTab == advancedTab && advancedPartitionPanel.isQueriesSet()) {
 			MessageDialog.openError(getShell(),
 					TXMUIMessages.invalidQuery,
 					TXMUIMessages.queriesCannotBeLeftEmpty);
 			return;
 		}
 		
-		/*
-		 * if (isAssistedSelected) {
-		 * if (compositeForAssisted.hasUnassigned()) {
-		 * System.out.println(Messages.CreatePartitionDialog_11);
-		 * return;
-		 * }
-		 * }
-		 */
-		
-		for (QueryWidget query : queries) {
-			queriesString.add(query.getQueryString());
-			query.memorize();
-		}
 		partition = createPartition();
 		super.okPressed();
 	}
-	
-	/**
-	 * Tell if the user is using the "advanced" tab.
-	 *
-	 * @return true, if is advanced selected
-	 */
-	public boolean isAdvancedSelected() {
 		
-		return isAdvancedSelected;
-	}
-	
 	/**
-	 * Gets the structural unit.
-	 *
-	 * @return the structural unit
-	 */
-	public StructuralUnit getStructuralUnit() {
-		
-		if (isAdvancedSelected())
-			throw new IllegalStateException(TXMUIMessages.cannotAskForTheSimpleTabWhenTheUserHasSelectedTheAdvancedTab);
-		return selectedStructuralUnit;
-	}
-	
-	/**
-	 * Gets the structural unit property.
-	 *
-	 * @return the structural unit property
-	 */
-	public StructuralUnitProperty getStructuralUnitProperty() {
-		
-		if (isAdvancedSelected())
-			throw new IllegalStateException(TXMUIMessages.cannotAskForTheSimpleTabWhenTheUserHasSelectedTheAdvancedTab);
-		return selectedStructuralUnitProperty;
-	}
-	
-	/**
-	 * Gets the queries.
-	 *
-	 * @return the queries
-	 */
-	public List<String> getQueries() {
-		
-		if (!isAdvancedSelected())
-			throw new IllegalStateException(TXMUIMessages.cannotAskForTheSimpleTabWhenTheUserHasSelectedTheAdvancedTab);
-		return queriesString;
-	}
-	
-	
-	/**
 	 * Creates the partition.
 	 *
 	 * @return the partition
@@ -649,28 +215,11 @@
 		
 		String name = nameText.getText();
 		
-		// Simple mode
-		if (isSimpleSelected) {
+		if (selectedTab == simpleTab) { // Simple mode
 			
-			StructuralUnit structuralUnit = this.structuralUnitsFinal.get(this.structuralUnitsCombo.getSelectionIndex());
-			StructuralUnitProperty property = structuralUnit.getProperty(this.propertyCombo.getText());
-			try {
-				
-				// auto-naming if needed
-				if (name.isEmpty()) {
-					name = property.asFullNameString();
-				}
-				
-				partition = new Partition(corpus);
-				partition.setParameters(name, property, null);
-			}
-			catch (Exception e) {
-				org.txm.utils.logger.Log.printStackTrace(e);
-				return null;
-			}
+			partition = simplePanel.createPartition(name);
 		}
-		// Assisted mode
-		else if (isAssistedSelected) {
+		else if (selectedTab == assistedTab) { // Assisted mode
 			
 			// auto-naming if needed
 			if (name.isEmpty()) {
@@ -680,24 +229,14 @@
 			
 			partition = this.compositeForAssisted.createPartition(name);
 		}
-		// Advanced mode
-		else if (isAdvancedSelected) {
-			try {
-				
-				// auto-naming if needed
-				if (name.isEmpty()) {
-					name = "partition" + (this.corpus.getPartitions().size() + 1); //$NON-NLS-1$
-					Log.info(TXMCoreMessages.bind(TXMUIMessages.noPartitionNameWasSpecifiedTheNameIsP0, name));
-				}
-				
-				partition = new Partition(this.corpus);
-				partition.setParameters(name, this.getQueries(), this.getAdvancePartNames());
-			}
-			catch (Exception e) {
-				org.txm.utils.logger.Log.printStackTrace(e);
-				return null;
-			}
+		else if (selectedTab == crossedTab) { // Advanced mode
+			
+			partition = crossedPanel.createPartition(name);
 		}
+		else if (selectedTab == advancedTab) { // Advanced mode
+			
+			partition = advancedPartitionPanel.createPartition(name);
+		}
 		
 		// Error
 		if (partition == null) {
@@ -709,24 +248,6 @@
 	}
 	
 	/**
-	 * Gets the advance part names.
-	 *
-	 * @return the advance part names
-	 */
-	private List<String> getAdvancePartNames() {
-		
-		ArrayList<String> values = new ArrayList<>();
-		int count = 0;
-		for (Text t : partNames) {
-			String name = t.getText().trim();
-			if (name.length() == 0)
-				name = TXMUIMessages.part + count++;
-			values.add(name);
-		}
-		return values;
-	}
-	
-	/**
 	 * Gets the partition.
 	 *
 	 * @return the partition
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java	(revision 3977)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/PartitionComposer.java	(revision 3978)
@@ -456,23 +456,15 @@
 			this.setLayout(new GridLayout(4, false));
 			
 			Label titleLabel = new Label(this, SWT.NONE);
-			titleLabel.setLayoutData(new GridData(GridData.FILL,
-					GridData.CENTER, false, false, 1, 1));
+			titleLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false, 1, 1));
 			titleLabel.setText(TXMUIMessages.titleColon);
-			Font f = titleLabel.getFont();
-			FontData defaultFont = f.getFontData()[0];
-			defaultFont.setStyle(SWT.BOLD);
-			Font newf = new Font(Display.getCurrent(), defaultFont);
-			titleLabel.setFont(newf);
 			
 			title = new Text(this, SWT.BORDER);
-			title.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-					true, false, 2, 1));
+			title.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
 			
 			Button delete = new Button(this, SWT.PUSH);
 			delete.setImage(IImageKeys.getImage(IImageKeys.ACTION_DELETE));
-			delete.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-					false, false, 1, 1));
+			delete.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 1, 1));
 			delete.addSelectionListener(new SelectionListener() {
 				
 				@Override
@@ -480,8 +472,9 @@
 					
 					PartItem p = selfP;
 					
-					for (String s : p.getColumns())
+					for (String s : p.getColumns()) {
 						self.add(s);
+					}
 					parts.remove(selfP);
 					p.dispose();
 					
@@ -493,8 +486,7 @@
 				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
 			Button add = new Button(this, SWT.PUSH);
-			add.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
-					false, 2, 1));
+			add.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
 			add.setText(TXMUIMessages.assign);
 			add.addSelectionListener(new SelectionListener() {
 				
@@ -502,12 +494,14 @@
 				public void widgetSelected(SelectionEvent e) {
 					
 					// System.out.println(Messages.bind(Messages.PartitionComposer_10, composer.getSelection()));
-					for (String s : composer.getSelection())
+					for (String s : composer.getSelection()) {
 						columns.add(s);
+					}
 					composer.remove(composer.getSelection());
 					layout(true);
-					if (composer.availableList.getItemCount() > 0)
+					if (composer.availableList.getItemCount() > 0) {
 						composer.availableList.select(0);
+					}
 					composer.layout(true);
 					updateDisplay();
 				}
@@ -517,8 +511,7 @@
 			});
 			
 			Button rmv = new Button(this, SWT.PUSH);
-			rmv.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true,
-					false, 2, 1));
+			rmv.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
 			rmv.setText(TXMUIMessages.remove);
 			rmv.addSelectionListener(new SelectionListener() {
 				
@@ -543,10 +536,8 @@
 				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
 			
-			columns = new org.eclipse.swt.widgets.List(this, SWT.MULTI
-					| SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL);
-			columns.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
-					true, true, 4, 1));
+			columns = new org.eclipse.swt.widgets.List(this, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL);
+			columns.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 4, 1));
 			columns.setSize(200, 300);
 		}
 		
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SuperListViewer.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SuperListViewer.java	(revision 3977)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/structures/SuperListViewer.java	(revision 3978)
@@ -5,16 +5,15 @@
 
 import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.ListViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTargetAdapter;
 import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.DropTargetListener;
 import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
@@ -63,8 +62,6 @@
 		selectByListButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
 		selectByListButton.addSelectionListener(new SelectionListener() {
 			
-			
-
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				
@@ -139,6 +136,10 @@
 		});
 	}
 	
+	public void setLabelProvider(IBaseLabelProvider labelProvider) {
+		valueCombo.setLabelProvider(labelProvider);
+	}
+	
 	public void selectAll() {
 		valueCombo.getList().selectAll();
 	}
