Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/PreferencesEnum.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/PreferencesEnum.java	(revision 8829)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/PreferencesEnum.java	(revision 8830)
@@ -36,5 +36,6 @@
 
     CHUNK_SIZE("chunk_size"), WIDTH_ORIGINALE("width_original"), HEIGHT_ORIGINAL("height_original"), PASSWORD(
-	    "password"), LOGIN("login"), URL_SITE("url");
+	    "password"), LOGIN("login"), URL_SITE("url"), USE_PROXY("use_proxy"), URL_PROXY("url_proxy"), PORT_PROXY(
+	    "port_proxy"), USER_PROXY("user_proxy"), PASS_PROXY("password_proxy");
 
     protected String label;
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 8829)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java	(revision 8830)
@@ -4,14 +4,22 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+
 import javax.swing.JOptionPane;
+
+import org.apache.commons.httpclient.Credentials;
+import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.lang.StringUtils;
 import org.jdom.Document;
 import org.jdom.JDOMException;
+
 import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
 import fr.mael.jiwigo.transverse.util.Messages;
 import fr.mael.jiwigo.transverse.util.Outil;
-
 
 /**
@@ -46,197 +54,270 @@
 public class SessionManager {
 
-	/**
-	 * Logger
-	 */
-	public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(SessionManager.class);
-	/**
-	 * the entered login
-	 */
-	private String login;
-	/**
-	 * the entered password
-	 */
-	private String motDePasse;
-	/**
-	 * the url of the site
-	 */
-	private String url;
-	/**
-	 * the http client
-	 */
-	private HttpClient client;
-
-
-	/**
-	 * Constructor
-	 * @param login the login
-	 * @param motDePasse the password
-	 * @param url the url of the site
-	 */
-	public SessionManager(String login, String motDePasse, String url) {
-		this.login = login;
-		this.motDePasse = motDePasse;
-		this.url = url + "/ws.php";
-		client = new HttpClient();
-		//Using of a Linux user agent. cause... it's better 8)
-		client.getParams().setParameter("http.useragent",
-				"Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1");
-	}
-
-
-	/**
-	 * Connection method
-	 * @return true if successful
-	 */
-	public boolean processLogin() {
-		Document doc;
-		try {
-			doc = executerReturnDocument(MethodsEnum.LOGIN.getLabel(), "username", login, "password", motDePasse);
-			return Outil.checkOk(doc);
-		} catch (Exception e) {
-			LOG.error(Outil.getStackTrace(e));
-		}
-		return false;
-
-	}
-
-
-	/**
-	 * Executes a method on the webservice and returns the result as a string
-	 * @param methode the method to execute
-	 * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
-	 * @return the result
-	 * @throws UnsupportedEncodingException 
-	 */
-	public String executerReturnString(String methode, String... parametres) throws UnsupportedEncodingException {
-		if (parametres.length % 2 != 0 && !(parametres == null)) {
-			try {
-				throw new Exception("Le nombre de parametres doit etre pair");
-			} catch (Exception e) {
-				LOG.error(Outil.getStackTrace(e));
-				return null;
-			}
-		}
-		PostMethod method = new PostMethod(url);
-		method.addParameter("method", methode);
-		for (int i = 0; i < parametres.length; i += 2) {
-			method.addParameter(parametres[i], parametres[i + 1]);
-
-		}
-		//begin bug:0001833
-		method.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
-		//end
-
-		try {
-			client.executeMethod(method);
-			InputStream streamResponse = method.getResponseBodyAsStream();
-			//	    System.out.println(Outil.readInputStreamAsString(streamResponse));
-			//	    String toReturn = method.getResponseBodyAsString();
-			String toReturn = Outil.readInputStreamAsString(streamResponse);
-			LOG.debug(toReturn);
-			return toReturn;
-		} catch (HttpException e) {
-			// TODO Auto-generated catch block
-			LOG.error(Outil.getStackTrace(e));
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			LOG.error(Outil.getStackTrace(e));
-		} catch (IllegalArgumentException e) {
-			LOG.error(Outil.getStackTrace(e));
-			JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_connexionError"),
-					Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
-		} finally {
-			method.releaseConnection();
-		}
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(SessionManager.class);
+    /**
+     * the entered login
+     */
+    private String login;
+    /**
+     * the entered password
+     */
+    private String motDePasse;
+    /**
+     * the url of the site
+     */
+    private String url;
+    /**
+     * the http client
+     */
+    private HttpClient client;
+
+    /**
+     * defines if the user uses a proxy
+     */
+    private boolean usesProxy;
+
+    /**
+     * url of the proxy
+     */
+    private String urlProxy;
+
+    /**
+     * port of the proxy
+     */
+    private int portProxy;
+
+    /**
+     * login for the proxy
+     */
+    private String loginProxy;
+
+    /**
+     * pass for the proxy
+     */
+    private String passProxy;
+
+    /**
+     * true : an error was found for the proxy
+     */
+    private boolean erreurProxy;
+
+    /**
+     * Constructor
+     * @param login the login
+     * @param motDePasse the password
+     * @param url the url of the site
+     */
+    public SessionManager(String login, String motDePasse, String url) {
+	this.login = login;
+	this.motDePasse = motDePasse;
+	this.url = url + "/ws.php";
+	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
+	client = new HttpClient(connectionManager);
+	//Using of a Linux user agent. cause... it's better 8)
+	client.getParams().setParameter("http.useragent",
+		"Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1");
+
+    }
+
+    /**
+     * Connection method
+     * @return true if successful
+     */
+    public boolean processLogin() {
+	Document doc;
+	//configures the proxy
+	if (usesProxy) {
+	    HostConfiguration config = client.getHostConfiguration();
+	    config.setProxy(urlProxy, portProxy);
+	    if (!StringUtils.isEmpty(loginProxy) && !StringUtils.isEmpty(passProxy)) {
+		Credentials credentials = new UsernamePasswordCredentials(loginProxy, passProxy);
+		AuthScope authScope = new AuthScope(urlProxy, portProxy);
+		client.getState().setProxyCredentials(authScope, credentials);
+	    }
+	}
+	try {
+	    doc = executerReturnDocument(MethodsEnum.LOGIN.getLabel(), "username", login, "password", motDePasse);
+	    return Outil.checkOk(doc);
+	} catch (Exception e) {
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return false;
+    }
+
+    /**
+     * Executes a method on the webservice and returns the result as a string
+     * @param methode the method to execute
+     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
+     * @return the result
+     * @throws UnsupportedEncodingException 
+     */
+    public String executerReturnString(String methode, String... parametres) throws UnsupportedEncodingException {
+	if (parametres.length % 2 != 0 && !(parametres == null)) {
+	    try {
+		throw new Exception("Le nombre de parametres doit etre pair");
+	    } catch (Exception e) {
+		LOG.error(Outil.getStackTrace(e));
 		return null;
-
-	}
-
-
-	/**
-	 * Executes a method on the webservice and returns the result as a Dom document
-	 * @param methode the method to execute
-	 * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
-	 * @return the result
-	 * @throws IOException 
-	 */
-	public Document executerReturnDocument(String methode, String... parametres) throws IOException {
-		try {
-			return Outil.stringToDocument(executerReturnString(methode, parametres));
-		} catch (JDOMException e) {
-			// TODO Auto-generated catch block
-			LOG.error(Outil.getStackTrace(e));
-		}
-		return null;
-
-	}
-
-
-	/**
-	 * Executes a method on the webservice and returns the result as a Dom document
-	 * @param methode the method to execute
-	 * @return the result
-	 */
-	public Document executerReturnDocument(String methode) {
-		try {
-			return Outil.stringToDocument(executerReturnString(methode));
-		} catch (JDOMException e) {
-			// TODO Auto-generated catch block
-			LOG.error(Outil.getStackTrace(e));
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			LOG.error(Outil.getStackTrace(e));
-		}
-		return null;
-
-	}
-
-
-	/**
-	 * @return the login
-	 */
-	public String getLogin() {
-		return login;
-	}
-
-
-	/**
-	 * @param login the login to set
-	 */
-	public void setLogin(String login) {
-		this.login = login;
-	}
-
-
-	/**
-	 * @return the motDePasse
-	 */
-	public String getMotDePasse() {
-		return motDePasse;
-	}
-
-
-	/**
-	 * @param motDePasse the motDePasse to set
-	 */
-	public void setMotDePasse(String motDePasse) {
-		this.motDePasse = motDePasse;
-	}
-
-
-	/**
-	 * @return the url
-	 */
-	public String getUrl() {
-		return url;
-	}
-
-
-	/**
-	 * @param url the url to set
-	 */
-	public void setUrl(String url) {
-		this.url = url;
-	}
+	    }
+	}
+	PostMethod method = new PostMethod(url);
+	method.addParameter("method", methode);
+	for (int i = 0; i < parametres.length; i += 2) {
+	    method.addParameter(parametres[i], parametres[i + 1]);
+
+	}
+	//begin bug:0001833
+	method.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+	//end
+
+	try {
+	    client.executeMethod(method);
+	    InputStream streamResponse = method.getResponseBodyAsStream();
+	    //	    System.out.println(Outil.readInputStreamAsString(streamResponse));
+	    //	    String toReturn = method.getResponseBodyAsString();
+	    String toReturn = Outil.readInputStreamAsString(streamResponse);
+	    LOG.debug(toReturn);
+	    return toReturn;
+	} catch (HttpException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	} catch (IOException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	} catch (IllegalArgumentException e) {
+	    LOG.error(Outil.getStackTrace(e));
+	    JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_connexionError"), Messages
+		    .getMessage("error"), JOptionPane.ERROR_MESSAGE);
+	} finally {
+	    method.releaseConnection();
+	}
+	return null;
+
+    }
+
+    /**
+     * Executes a method on the webservice and returns the result as a Dom document
+     * @param methode the method to execute
+     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
+     * @return the result
+     * @throws IOException 
+     */
+    public Document executerReturnDocument(String methode, String... parametres) throws IOException {
+	try {
+	    return Outil.stringToDocument(executerReturnString(methode, parametres));
+	} catch (JDOMException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return null;
+
+    }
+
+    /**
+     * Executes a method on the webservice and returns the result as a Dom document
+     * @param methode the method to execute
+     * @return the result
+     */
+    public Document executerReturnDocument(String methode) {
+	try {
+	    return Outil.stringToDocument(executerReturnString(methode));
+	} catch (JDOMException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	} catch (IOException e) {
+	    // TODO Auto-generated catch block
+	    LOG.error(Outil.getStackTrace(e));
+	}
+	return null;
+
+    }
+
+    /**
+     * @return the login
+     */
+    public String getLogin() {
+	return login;
+    }
+
+    /**
+     * @param login the login to set
+     */
+    public void setLogin(String login) {
+	this.login = login;
+    }
+
+    /**
+     * @return the motDePasse
+     */
+    public String getMotDePasse() {
+	return motDePasse;
+    }
+
+    /**
+     * @param motDePasse the motDePasse to set
+     */
+    public void setMotDePasse(String motDePasse) {
+	this.motDePasse = motDePasse;
+    }
+
+    /**
+     * @return the url
+     */
+    public String getUrl() {
+	return url;
+    }
+
+    /**
+     * @param url the url to set
+     */
+    public void setUrl(String url) {
+	this.url = url;
+    }
+
+    /**
+     * @param usesProxy the usesProxy to set
+     */
+    public void setUsesProxy(boolean usesProxy) {
+	this.usesProxy = usesProxy;
+    }
+
+    /**
+     * @param urlProxy the urlProxy to set
+     */
+    public void setUrlProxy(String urlProxy) {
+	this.urlProxy = urlProxy;
+    }
+
+    /**
+     * @param portProxy the portProxy to set
+     */
+    public void setPortProxy(int portProxy) {
+	this.portProxy = portProxy;
+    }
+
+    /**
+     * @param loginProxy the loginProxy to set
+     */
+    public void setLoginProxy(String loginProxy) {
+	this.loginProxy = loginProxy;
+    }
+
+    /**
+     * @param passProxy the passProxy to set
+     */
+    public void setPassProxy(String passProxy) {
+	this.passProxy = passProxy;
+    }
+
+    /**
+     * @return the erreurProxy
+     */
+    public boolean isErreurProxy() {
+	return erreurProxy;
+    }
 
 }
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/preferences/PreferencesManagement.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/preferences/PreferencesManagement.java	(revision 8829)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/preferences/PreferencesManagement.java	(revision 8830)
@@ -6,5 +6,7 @@
 
 import org.jdom.Document;
+import org.jdom.Element;
 import org.jdom.input.SAXBuilder;
+import org.jdom.output.XMLOutputter;
 
 import fr.mael.jiwigo.transverse.util.Outil;
@@ -73,6 +75,10 @@
 	    xml.append("	<login></login>\n");
 	    xml.append("	<url></url>\n");
+	    xml.append("	<use_proxy>false</use_proxy>\n");
+	    xml.append("	<url_proxy></url_proxy>\n");
+	    xml.append("	<port_proxy></port_proxy>\n");
+	    xml.append("	<user_proxy></user_proxy>\n");
+	    xml.append("	<password_proxy></password_proxy>\n");
 	    xml.append("</config>");
-
 	    FileWriter out = new FileWriter(outFile);
 	    out.write(xml.toString());
@@ -106,8 +112,16 @@
 	try {
 	    Document document = sxb.build(new File(getConfigFilePath()));
-	    document.getRootElement().getChild(key).setText(text);
-	    FileWriter out = new FileWriter(getConfigFilePath());
-	    out.write(Outil.documentToString(document));
-	    out.close();
+	    try {
+		document.getRootElement().getChild(key).setText(text);
+	    } catch (NullPointerException e) {
+		Element element = new Element(key);
+		element.addContent(text);
+		document.getRootElement().addContent(element);
+	    }
+	    XMLOutputter out = new XMLOutputter();
+	    FileWriter writer = new FileWriter(getConfigFilePath());
+	    out.output(document, writer);
+	    writer.flush();
+	    writer.close();
 	} catch (Exception e) {
 	    LOG.error(Outil.getStackTrace(e));
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ConnexionDialog.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ConnexionDialog.java	(revision 8829)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ConnexionDialog.java	(revision 8830)
@@ -1,5 +1,7 @@
 package fr.mael.jiwigo.ui;
 
+import java.awt.BorderLayout;
 import java.awt.Dimension;
+import java.awt.FlowLayout;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
@@ -16,4 +18,5 @@
 import java.util.Arrays;
 import java.util.Locale;
+
 import javax.swing.AbstractListModel;
 import javax.swing.ComboBoxModel;
@@ -24,6 +27,8 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 import javax.swing.JPasswordField;
 import javax.swing.JTextField;
+
 import fr.mael.jiwigo.Main;
 import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
@@ -31,5 +36,4 @@
 import fr.mael.jiwigo.transverse.util.Messages;
 import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
-
 
 /**
@@ -64,279 +68,320 @@
 public class ConnexionDialog extends JDialog implements ActionListener, ItemListener, KeyListener, WindowListener {
 
-	/**
-	 * Logger
-	 */
-	public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(ConnexionDialog.class);
-	/**
-	 * field that contains the url
-	 */
-	private JTextField fieldUrl;
-	/**
-	 * field that contains the login
-	 */
-	private JTextField loginField;
-	/**
-	 * field that contains de password
-	 */
-	private JPasswordField passwordField;
-	/**
-	 * label of the url field
-	 */
-	private JLabel labelUrl;
-	/**
-	 * label of the login field
-	 */
-	private JLabel labelLogin;
-	/**
-	 *  label of the password field
-	 */
-	private JLabel labelPass;
-	/**
-	 * ok button for the connection
-	 */
-	private JButton boutonOk;
-
-	/**
-	 * Box that allows to save informations
-	 */
-	private JCheckBox checkBoxRetenir;
-
-	/**
-	 * Combo containing all locales
-	 */
-	private JComboBox comboLocales;
-
-
-	/**
-	 * Constructor 
-	 */
-	public ConnexionDialog() {
-		Locale defautLocale = Messages.usedLocale;
-		labelUrl = new JLabel(Messages.getMessage("connexionDialog_urlSite"));
-		labelLogin = new JLabel(Messages.getMessage("connexionDialog_login"));
-		labelPass = new JLabel(Messages.getMessage("connexionDialog_pass"));
-		comboLocales = new JComboBox();
-		boutonOk = new JButton("Ok");
-		String url = PreferencesManagement.getValue(PreferencesEnum.URL_SITE.getLabel());
-		String login = PreferencesManagement.getValue(PreferencesEnum.LOGIN.getLabel());
-		String pass = PreferencesManagement.getValue(PreferencesEnum.PASSWORD.getLabel());
-		fieldUrl = new JTextField(url);
-		loginField = new JTextField(login);
-		passwordField = new JPasswordField(pass);
-		checkBoxRetenir = new JCheckBox(Messages.getMessage("connexionDialog_sauvegarder"));
-		if (!url.equals("") && !login.equals("") && !pass.equals("")) {
-			checkBoxRetenir.setSelected(true);
+    /**
+     * Logger
+     */
+    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory
+	    .getLog(ConnexionDialog.class);
+    /**
+     * field that contains the url
+     */
+    private JTextField fieldUrl;
+    /**
+     * field that contains the login
+     */
+    private JTextField loginField;
+    /**
+     * field that contains de password
+     */
+    private JPasswordField passwordField;
+    /**
+     * label of the url field
+     */
+    private JLabel labelUrl;
+    /**
+     * label of the login field
+     */
+    private JLabel labelLogin;
+    /**
+     *  label of the password field
+     */
+    private JLabel labelPass;
+    /**
+     * ok button for the connection
+     */
+    private JButton boutonOk;
+
+    /**
+     * Box that allows to save informations
+     */
+    private JCheckBox checkBoxRetenir;
+
+    /**
+     * Combo containing all locales
+     */
+    private JComboBox comboLocales;
+
+    /**
+     * Panel that allows to define a proxy to use
+     */
+    private ProxyPanel proxyPanel;
+
+    /**
+     * Constructor 
+     */
+    public ConnexionDialog() {
+	Locale defautLocale = Messages.usedLocale;
+	labelUrl = new JLabel(Messages.getMessage("connexionDialog_urlSite"));
+	labelLogin = new JLabel(Messages.getMessage("connexionDialog_login"));
+	labelPass = new JLabel(Messages.getMessage("connexionDialog_pass"));
+	proxyPanel = new ProxyPanel(this);
+	comboLocales = new JComboBox();
+	boutonOk = new JButton("Ok");
+	String url = PreferencesManagement.getValue(PreferencesEnum.URL_SITE.getLabel());
+	String login = PreferencesManagement.getValue(PreferencesEnum.LOGIN.getLabel());
+	String pass = PreferencesManagement.getValue(PreferencesEnum.PASSWORD.getLabel());
+
+	fieldUrl = new JTextField(url);
+	loginField = new JTextField(login);
+	passwordField = new JPasswordField(pass);
+	checkBoxRetenir = new JCheckBox(Messages.getMessage("connexionDialog_sauvegarder"));
+	if (!url.equals("") && !login.equals("") && !pass.equals("")) {
+	    checkBoxRetenir.setSelected(true);
+	}
+	JPanel panelInformations = new JPanel(new GridBagLayout());
+	Dimension fieldDimensions = new Dimension(300, 30);
+	fieldUrl.setPreferredSize(fieldDimensions);
+	fieldUrl.addActionListener(this);
+	loginField.setPreferredSize(fieldDimensions);
+	loginField.addActionListener(this);
+	passwordField.setPreferredSize(fieldDimensions);
+	passwordField.addActionListener(this);
+	this.getContentPane().setLayout(new BorderLayout());
+	GridBagConstraints constraints = new GridBagConstraints();
+	constraints.gridx = 0;
+	constraints.gridy = 0;
+	constraints.insets = new Insets(3, 3, 3, 3);
+	panelInformations.add(labelUrl, constraints);
+	constraints.gridx++;
+	panelInformations.add(fieldUrl, constraints);
+	constraints.gridx = 0;
+	constraints.gridy++;
+	panelInformations.add(labelLogin, constraints);
+	constraints.gridx++;
+	panelInformations.add(loginField, constraints);
+	constraints.gridx = 0;
+	constraints.gridy++;
+	panelInformations.add(labelPass, constraints);
+	constraints.gridx++;
+	panelInformations.add(passwordField, constraints);
+	constraints.gridx = 0;
+	constraints.gridy++;
+	panelInformations.add(comboLocales, constraints);
+	constraints.gridx++;
+	panelInformations.add(checkBoxRetenir, constraints);
+	constraints.gridx = 0;
+	constraints.gridy++;//  
+	//	for (Locale locale : SimpleDateFormat.getAvailableLocales()) {
+	//	    comboLocales.addItem(locale.getDisplayName(Locale.ENGLISH));
+	//	}
+	comboLocales.setPreferredSize(new Dimension(130, 25));
+	comboLocales.addItemListener(this);
+	boutonOk.setPreferredSize(new Dimension(80, 30));
+	boutonOk.addActionListener(this);
+	JPanel panelBouton = new JPanel(new FlowLayout(FlowLayout.CENTER));
+	panelBouton.add(boutonOk);
+	localeModel model = new localeModel();
+	comboLocales.setModel(model);
+	model.setSelectedItem(defautLocale.getDisplayLanguage(Locale.ENGLISH));
+	this.getContentPane().add(panelInformations, BorderLayout.NORTH);
+	this.getContentPane().add(proxyPanel, BorderLayout.CENTER);
+	this.getContentPane().add(panelBouton, BorderLayout.SOUTH);
+	this.addWindowListener(this);
+	this.setResizable(false);
+    }
+
+    public void showDialog() {
+	this.pack();
+	this.setLocationRelativeTo(null);
+	this.setVisible(true);
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent paramActionEvent) {
+	//if one field is empty, an error is displayed
+	if (fieldUrl.getText().equals("") || loginField.getText().equals("") || passwordField.getText().equals("")) {
+	    JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_emptyField"), Messages
+		    .getMessage("error"), JOptionPane.ERROR_MESSAGE);
+	} else {
+	    if (!fieldUrl.getText().startsWith("http://")) {
+		fieldUrl.setText("http://" + fieldUrl.getText());
+	    }
+	    //instanciation of the session manager
+	    Main.sessionManager = new SessionManager(loginField.getText(), passwordField.getText(), fieldUrl.getText());
+	    boolean echecProxy = false;
+	    if (proxyPanel.getCheckBox().isSelected()) {
+		int portProxy = 0;
+		try {
+		    portProxy = Integer.valueOf(proxyPanel.getFieldPort().getText());
+		    Main.sessionManager.setPortProxy(portProxy);
+		    Main.sessionManager.setUrlProxy(proxyPanel.getFieldUrl().getText());
+		    Main.sessionManager.setLoginProxy(proxyPanel.getFieldLogin().getText());
+		    Main.sessionManager.setPassProxy(proxyPanel.getFieldPassword().getText());
+		    Main.sessionManager.setUsesProxy(true);
+		} catch (Exception e) {
+		    echecProxy = true;
 		}
-		Dimension fieldDimensions = new Dimension(300, 30);
-		fieldUrl.setPreferredSize(fieldDimensions);
-		fieldUrl.addActionListener(this);
-		loginField.setPreferredSize(fieldDimensions);
-		loginField.addActionListener(this);
-		passwordField.setPreferredSize(fieldDimensions);
-		passwordField.addActionListener(this);
-		this.getContentPane().setLayout(new GridBagLayout());
-		GridBagConstraints constraints = new GridBagConstraints();
-		constraints.gridx = 0;
-		constraints.gridy = 0;
-		constraints.insets = new Insets(3, 3, 3, 3);
-		this.getContentPane().add(labelUrl, constraints);
-		constraints.gridx++;
-		this.getContentPane().add(fieldUrl, constraints);
-		constraints.gridx = 0;
-		constraints.gridy++;
-		this.getContentPane().add(labelLogin, constraints);
-		constraints.gridx++;
-		this.getContentPane().add(loginField, constraints);
-		constraints.gridx = 0;
-		constraints.gridy++;
-		this.getContentPane().add(labelPass, constraints);
-		constraints.gridx++;
-		this.getContentPane().add(passwordField, constraints);
-		constraints.gridx = 0;
-		constraints.gridy++;
-		this.getContentPane().add(comboLocales, constraints);
-		constraints.gridx++;
-		this.getContentPane().add(checkBoxRetenir, constraints);
-		constraints.gridx = 0;
-		constraints.gridy++;//  
-		//	for (Locale locale : SimpleDateFormat.getAvailableLocales()) {
-		//	    comboLocales.addItem(locale.getDisplayName(Locale.ENGLISH));
-		//	}
-		comboLocales.setPreferredSize(new Dimension(130, 25));
-		comboLocales.addItemListener(this);
-		localeModel model = new localeModel();
-		comboLocales.setModel(model);
-		model.setSelectedItem(defautLocale.getDisplayLanguage(Locale.ENGLISH));
-		this.getContentPane().add(boutonOk, constraints);
-		boutonOk.setPreferredSize(new Dimension(80, 30));
-		boutonOk.addActionListener(this);
-		this.addWindowListener(this);
-	}
-
-
-	public void showDialog() {
-		this.pack();
-		this.setLocationRelativeTo(null);
-		this.setVisible(true);
-	}
-
-
-	@Override
-	public void actionPerformed(ActionEvent paramActionEvent) {
-		//if one field is empty, an error is displayed
-		if (fieldUrl.getText().equals("") || loginField.getText().equals("") || passwordField.getText().equals("")) {
-			JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_emptyField"),
-					Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
+
+	    }
+
+	    //save informations...
+	    if (checkBoxRetenir.isSelected()) {
+		PreferencesManagement.setValue(PreferencesEnum.LOGIN.getLabel(), loginField.getText());
+		PreferencesManagement.setValue(PreferencesEnum.PASSWORD.getLabel(), passwordField.getText());
+		PreferencesManagement.setValue(PreferencesEnum.URL_SITE.getLabel(), fieldUrl.getText());
+		PreferencesManagement
+			.setValue(PreferencesEnum.URL_PROXY.getLabel(), proxyPanel.getFieldUrl().getText());
+		PreferencesManagement.setValue(PreferencesEnum.PORT_PROXY.getLabel(), proxyPanel.getFieldPort()
+			.getText());
+		PreferencesManagement.setValue(PreferencesEnum.USER_PROXY.getLabel(), proxyPanel.getFieldLogin()
+			.getText());
+		PreferencesManagement.setValue(PreferencesEnum.PASS_PROXY.getLabel(), proxyPanel.getFieldPassword()
+			.getText());
+		PreferencesManagement.setValue(PreferencesEnum.USE_PROXY.getLabel(), String.valueOf(proxyPanel
+			.getCheckBox().isSelected()));
+	    }
+	    //... or not
+	    else {
+		PreferencesManagement.setValue(PreferencesEnum.LOGIN.getLabel(), "");
+		PreferencesManagement.setValue(PreferencesEnum.PASSWORD.getLabel(), "");
+		PreferencesManagement.setValue(PreferencesEnum.URL_SITE.getLabel(), "");
+		PreferencesManagement
+			.setValue(PreferencesEnum.URL_PROXY.getLabel(), proxyPanel.getFieldUrl().getText());
+		PreferencesManagement.setValue(PreferencesEnum.PORT_PROXY.getLabel(), proxyPanel.getFieldPort()
+			.getText());
+		PreferencesManagement.setValue(PreferencesEnum.USER_PROXY.getLabel(), proxyPanel.getFieldLogin()
+			.getText());
+		PreferencesManagement.setValue(PreferencesEnum.PASS_PROXY.getLabel(), proxyPanel.getFieldPassword()
+			.getText());
+		PreferencesManagement.setValue(PreferencesEnum.USE_PROXY.getLabel(), "false");
+	    }
+	    if (echecProxy) {
+		JOptionPane.showMessageDialog(null, Messages.getMessage("proxyError"), Messages.getMessage("error"),
+			JOptionPane.ERROR_MESSAGE);
+	    } else {
+		if (!Main.sessionManager.processLogin()) {
+		    //if the login fails, an error is displayed
+		    if (!Main.sessionManager.isErreurProxy()) {
+			JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_connexionError"),
+				Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
+		    }
 		} else {
-			if (!fieldUrl.getText().startsWith("http://")) {
-				fieldUrl.setText("http://" + fieldUrl.getText());
-			}
-			//instanciation of the session manager
-			Main.sessionManager = new SessionManager(loginField.getText(), passwordField.getText(), fieldUrl.getText());
-			if (checkBoxRetenir.isSelected()) {
-				PreferencesManagement.setValue(PreferencesEnum.LOGIN.getLabel(), loginField.getText());
-				PreferencesManagement.setValue(PreferencesEnum.PASSWORD.getLabel(), passwordField.getText());
-				PreferencesManagement.setValue(PreferencesEnum.URL_SITE.getLabel(), fieldUrl.getText());
-			} else {
-				PreferencesManagement.setValue(PreferencesEnum.LOGIN.getLabel(), "");
-				PreferencesManagement.setValue(PreferencesEnum.PASSWORD.getLabel(), "");
-				PreferencesManagement.setValue(PreferencesEnum.URL_SITE.getLabel(), "");
-			}
-			if (!Main.sessionManager.processLogin()) {
-				//if the login fails, an error is displayed
-				JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_connexionError"),
-						Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
-			} else {
-				//		Locale.setDefault((Locale) comboLocales.getSelectedItem());
-				Main.showFrame();
-				//hides the dialog
-				this.dispose();
-			}
+		    //		Locale.setDefault((Locale) comboLocales.getSelectedItem());
+		    Main.showFrame();
+		    //hides the dialog
+		    this.dispose();
 		}
-	}
-
-	/**
-	 * @author mael
-	 * Internal class that represents the model of the combobox that allows
-	 * to choose a locale
-	 */
-	class localeModel extends AbstractListModel implements ComboBoxModel {
-
-		Locale[] locales = SimpleDateFormat.getAvailableLocales();
-		//List<Locale> locales = Messages.getAvailableBundles();
-		String[] localesNames;
-
-		String selection = null;
-
-
-		public localeModel() {
-			localesNames = new String[locales.length];
-			int compteur = 0;
-			for (Locale locale : locales) {
-				localesNames[compteur] = locale.getDisplayName(Locale.ENGLISH);
-				compteur++;
-			}
-			Arrays.sort(localesNames);
-		}
-
-
-		public Object getElementAt(int index) {
-			return localesNames[index];
-		}
-
-
-		public int getSize() {
-			return locales.length;
-		}
-
-
-		public void setSelectedItem(Object anItem) {
-			selection = (String) anItem;
-		}
-
-
-		public Object getSelectedItem() {
-			if (selection != null)
-				return selection;
-			else
-				return null;
-		}
-	}
-
-
-	@Override
-	public void itemStateChanged(ItemEvent paramItemEvent) {
-		for (Locale locale : SimpleDateFormat.getAvailableLocales()) {
-			if (locale.getDisplayName(Locale.ENGLISH).equals(paramItemEvent.getItem())) {
-				Messages.usedLocale = locale;
-				dispose();
-				ConnexionDialog dial = new ConnexionDialog();
-				dial.showDialog();
-
-			}
-
-		}
-	}
-
-
-	@Override
-	public void keyPressed(KeyEvent arg0) {
-	}
-
-
-	@Override
-	public void keyReleased(KeyEvent arg0) {
-
-	}
-
-
-	@Override
-	public void keyTyped(KeyEvent arg0) {
-	}
-
-
-	@Override
-	public void windowActivated(WindowEvent e) {
-		// TODO Auto-generated method stub
-
-	}
-
-
-	@Override
-	public void windowClosed(WindowEvent e) {
-	}
-
-
-	@Override
-	public void windowClosing(WindowEvent e) {
-		System.exit(0);
-	}
-
-
-	@Override
-	public void windowDeactivated(WindowEvent e) {
-		// TODO Auto-generated method stub
-
-	}
-
-
-	@Override
-	public void windowDeiconified(WindowEvent e) {
-		// TODO Auto-generated method stub
-
-	}
-
-
-	@Override
-	public void windowIconified(WindowEvent e) {
-		// TODO Auto-generated method stub
-
-	}
-
-
-	@Override
-	public void windowOpened(WindowEvent e) {
-		// TODO Auto-generated method stub
-
-	}
+	    }
+
+	}
+    }
+
+    @Override
+    public void itemStateChanged(ItemEvent paramItemEvent) {
+	for (Locale locale : SimpleDateFormat.getAvailableLocales()) {
+	    if (locale.getDisplayName(Locale.ENGLISH).equals(paramItemEvent.getItem())) {
+		Messages.usedLocale = locale;
+		dispose();
+		ConnexionDialog dial = new ConnexionDialog();
+		dial.showDialog();
+
+	    }
+
+	}
+    }
+
+    @Override
+    public void keyPressed(KeyEvent arg0) {
+    }
+
+    @Override
+    public void keyReleased(KeyEvent arg0) {
+
+    }
+
+    @Override
+    public void keyTyped(KeyEvent arg0) {
+    }
+
+    @Override
+    public void windowActivated(WindowEvent e) {
+	// TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void windowClosed(WindowEvent e) {
+    }
+
+    @Override
+    public void windowClosing(WindowEvent e) {
+	System.exit(0);
+    }
+
+    @Override
+    public void windowDeactivated(WindowEvent e) {
+	// TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void windowDeiconified(WindowEvent e) {
+	// TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void windowIconified(WindowEvent e) {
+	// TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void windowOpened(WindowEvent e) {
+	// TODO Auto-generated method stub
+
+    }
+
+    /**
+     * @author mael
+     * Internal class that represents the model of the combobox that allows
+     * to choose a locale
+     */
+    class localeModel extends AbstractListModel implements ComboBoxModel {
+
+	Locale[] locales = SimpleDateFormat.getAvailableLocales();
+	//List<Locale> locales = Messages.getAvailableBundles();
+	String[] localesNames;
+
+	String selection = null;
+
+	public localeModel() {
+	    localesNames = new String[locales.length];
+	    int compteur = 0;
+	    for (Locale locale : locales) {
+		localesNames[compteur] = locale.getDisplayName(Locale.ENGLISH);
+		compteur++;
+	    }
+	    Arrays.sort(localesNames);
+	}
+
+	public Object getElementAt(int index) {
+	    return localesNames[index];
+	}
+
+	public int getSize() {
+	    return locales.length;
+	}
+
+	public void setSelectedItem(Object anItem) {
+	    selection = (String) anItem;
+	}
+
+	public Object getSelectedItem() {
+	    if (selection != null)
+		return selection;
+	    else
+		return null;
+	}
+    }
 }
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/MyCollapsiblePanel.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/MyCollapsiblePanel.java	(revision 8830)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/MyCollapsiblePanel.java	(revision 8830)
@@ -0,0 +1,110 @@
+package fr.mael.jiwigo.ui;
+
+/* 
+  * $Id: CollapsiblePaneDemo.java 1164 2009-11-03 04:22:00Z kschaefe $ 
+  * 
+  * Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle, 
+  * Santa Clara, California 95054, U.S.A. All rights reserved. 
+  * 
+  * This library is free software; you can redistribute it and/or 
+  * modify it under the terms of the GNU Lesser General Public 
+  * License as published by the Free Software Foundation; either 
+  * version 2.1 of the License, or (at your option) any later version. 
+  *  
+  * This library is distributed in the hope that it will be useful, 
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+  * Lesser General Public License for more details. 
+  *  
+  * You should have received a copy of the GNU Lesser General Public 
+  * License along with this library; if not, write to the Free Software 
+  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
+  */
+
+import java.awt.BorderLayout;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+
+import org.jdesktop.swingx.JXCollapsiblePane;
+
+import fr.mael.jiwigo.ui.browser.BrowserPanel;
+
+/** 
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * @author Karl George Schaefer 
+ */
+@SuppressWarnings("serial")
+public class MyCollapsiblePanel extends JPanel {
+    private JXCollapsiblePane collapsiblePane;
+    private JButton collapsingButton;
+    private BrowserPanel browserFrame = BrowserPanel.getInstance();
+    private JSplitPane splitPane;
+
+    //    /** 
+    //     * main method allows us to run as a standalone demo. 
+    //     */
+    //    public static void main(String[] args) {
+    //	SwingUtilities.invokeLater(new Runnable() {
+    //	    public void run() {
+    //		JFrame frame = new JFrame();
+    //
+    //		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+    //		frame.getContentPane().add(new TEst());
+    //		frame.setPreferredSize(new Dimension(800, 600));
+    //		frame.pack();
+    //		frame.setLocationRelativeTo(null);
+    //		frame.setVisible(true);
+    //	    }
+    //	});
+    //    }
+
+    public MyCollapsiblePanel(JTabbedPane tabbedPane) {
+	setLayout(new BorderLayout());
+	splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+	splitPane.setTopComponent(browserFrame);
+	splitPane.setBottomComponent(tabbedPane);
+	splitPane.setResizeWeight(0.5);
+	add(splitPane, BorderLayout.CENTER);
+
+    }
+
+    @Override
+    public void revalidate() {
+	// TODO Auto-generated method stub
+	super.revalidate();
+
+    }
+
+    //    public void changeSize(Dimension dimension) {
+    //	Dimension dim = new Dimension(dimension.width, dimension.height - 400);
+    //	
+    //    }
+
+}
Index: /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ProxyPanel.java
===================================================================
--- /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ProxyPanel.java	(revision 8830)
+++ /extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ProxyPanel.java	(revision 8830)
@@ -0,0 +1,194 @@
+package fr.mael.jiwigo.ui;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JPasswordField;
+import javax.swing.JTextField;
+
+import fr.mael.jiwigo.transverse.enumeration.PreferencesEnum;
+import fr.mael.jiwigo.transverse.util.Messages;
+import fr.mael.jiwigo.transverse.util.preferences.PreferencesManagement;
+
+/**
+   Copyright (c) 2010, Mael
+   All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of jiwigo nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+   DISCLAIMED. IN NO EVENT SHALL Mael BE LIABLE FOR ANY
+   DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+   
+ * @author mael
+ *
+ */
+public class ProxyPanel extends JPanel {
+
+    private JPanel panel;
+    private HeaderPanel headerPanel_;
+    private JTextField fieldUrl = new JTextField();
+    private JLabel labelUrl = new JLabel();
+    private JTextField fieldPort = new JTextField();
+    private JTextField fieldLogin = new JTextField();
+    private JLabel labelCredentials = new JLabel();
+    private JPasswordField fieldPassword = new JPasswordField();
+    private ConnexionDialog connectionDialog;
+    private JCheckBox checkBox;
+    private boolean useProxy = false;
+
+    public ProxyPanel(ConnexionDialog connexionDialog) {
+	super(new GridBagLayout());
+
+	String urlProxy = PreferencesManagement.getValue(PreferencesEnum.URL_PROXY.getLabel());
+	String portProxy = PreferencesManagement.getValue(PreferencesEnum.PORT_PROXY.getLabel());
+	String loginProxy = PreferencesManagement.getValue(PreferencesEnum.USER_PROXY.getLabel());
+	String passProxy = PreferencesManagement.getValue(PreferencesEnum.PASS_PROXY.getLabel());
+	fieldUrl.setText(urlProxy);
+	fieldPort.setText(portProxy);
+	fieldLogin.setText(loginProxy);
+	fieldPassword.setText(passProxy);
+
+	this.connectionDialog = connexionDialog;
+	labelUrl.setText(Messages.getMessage("proxyPanel_address"));
+	labelCredentials.setText(Messages.getMessage("proxyPanel_credentials"));
+	panel = new JPanel(new GridBagLayout());
+	GridBagConstraints c = new GridBagConstraints();
+	c.gridx = 0;
+	c.gridy = 0;
+	c.insets = new Insets(4, 4, 4, 4);
+	panel.add(labelUrl, c);
+	c.gridx++;
+	fieldUrl.setPreferredSize(new Dimension(150, 30));
+	panel.add(fieldUrl, c);
+	c.gridx++;
+	fieldPort.setPreferredSize(new Dimension(150, 30));
+	panel.add(fieldPort, c);
+
+	c.gridy++;
+	c.gridx = 0;
+	panel.add(labelCredentials, c);
+	c.gridx++;
+	fieldLogin.setPreferredSize(new Dimension(150, 30));
+	panel.add(fieldLogin, c);
+	c.gridx++;
+	fieldPassword.setPreferredSize(new Dimension(150, 30));
+	panel.add(fieldPassword, c);
+
+	GridBagConstraints gbc = new GridBagConstraints();
+	gbc.insets = new Insets(1, 3, 0, 3);
+	gbc.weightx = 1.0;
+	gbc.fill = gbc.HORIZONTAL;
+	gbc.gridwidth = gbc.REMAINDER;
+
+	try {
+	    useProxy = Boolean.valueOf(PreferencesManagement.getValue(PreferencesEnum.USE_PROXY.getLabel()));
+	} catch (Exception e) {
+	    useProxy = false;
+	}
+
+	headerPanel_ = new HeaderPanel(Messages.getMessage("proxyPanel_useProxy"));
+
+	add(headerPanel_, gbc);
+	add(panel, gbc);
+	panel.setVisible(false);
+
+	JLabel padding = new JLabel();
+	gbc.weighty = 1.0;
+	add(padding, gbc);
+	if (useProxy) {
+	    checkBox.setSelected(true);
+	    toggleSelection();
+	}
+
+    }
+
+    public void toggleSelection() {
+
+	panel.setVisible(!panel.isShowing());
+
+	validate();
+
+	headerPanel_.repaint();
+	connectionDialog.pack();
+    }
+
+    /**
+     * @return the fieldUrl
+     */
+    public JTextField getFieldUrl() {
+	return fieldUrl;
+    }
+
+    /**
+     * @return the fieldPort
+     */
+    public JTextField getFieldPort() {
+	return fieldPort;
+    }
+
+    /**
+     * @return the fieldLogin
+     */
+    public JTextField getFieldLogin() {
+	return fieldLogin;
+    }
+
+    /**
+     * @return the fieldPassword
+     */
+    public JPasswordField getFieldPassword() {
+	return fieldPassword;
+    }
+
+    /**
+     * @return the checkBox
+     */
+    public JCheckBox getCheckBox() {
+	return checkBox;
+    }
+
+    private class HeaderPanel extends JPanel implements ItemListener {
+
+	public HeaderPanel(String text) {
+
+	    setPreferredSize(new Dimension(200, 30));
+	    this.setLayout(new FlowLayout(FlowLayout.LEFT));
+	    checkBox = new JCheckBox(text);
+	    checkBox.setSelected(useProxy);
+	    checkBox.addItemListener(this);
+	    this.add(checkBox);
+	}
+
+	@Override
+	public void itemStateChanged(ItemEvent arg0) {
+	    toggleSelection();
+	}
+
+    }
+
+}
