Index: src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java	(copie de travail)
@@ -7,19 +7,20 @@
 package org.apache.ivyde.eclipse.cpcontainer;
 
 import java.io.File;
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 import org.apache.ivy.core.module.descriptor.Configuration;
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
 import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.ui.preferences.IvyPreferencePage;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
@@ -27,16 +28,19 @@
 import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
 import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension;
 import org.eclipse.jdt.ui.wizards.NewElementWizardPage;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.FocusAdapter;
 import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Image;
@@ -44,13 +48,18 @@
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
 import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.dialogs.PreferencesUtil;
 import org.eclipse.ui.model.WorkbenchContentProvider;
 import org.eclipse.ui.model.WorkbenchLabelProvider;
 import org.eclipse.ui.views.navigator.ResourceSorter;
@@ -58,114 +67,146 @@
 public class IvydeContainerPage extends NewElementWizardPage implements IClasspathContainerPage,
         IClasspathContainerPageExtension {
 
-    private IJavaProject _project;
+    IJavaProject project;
 
-    private IClasspathEntry _entry;
+    Text ivyFilePathText;
 
-    private Text _ivyFilePathText;
+    CheckboxTableViewer confTableViewer;
 
-    private CheckboxTableViewer _confTableViewer;
+    Text settingsText;
 
+    Text acceptedTypesText;
+
+    Text sourcesTypesText;
+
+    Text sourcesSuffixesText;
+
+    Text javadocTypesText;
+
+    Text javadocSuffixesText;
+
+    Button doRetrieveButton;
+
+    Text retrievePatternText;
+
+    Button alphaOrderCheck;
+
+    Button projectSpecificButton;
+
+    Button browse;
+
+    Link generalSettingsLink;
+
+    Composite configComposite;
+
+    private IvyClasspathContainerConfiguration conf;
+
+    /**
+     * Constructor
+     *
+     */
     public IvydeContainerPage() {
         super("IvyDE Container");
     }
 
-    public boolean isPageComplete() {
-        return true;
+    void checkCompleted() {
+        String error;
+        if (ivyFilePathText.getText().length() == 0) {
+            error = "Choose a valid ivy file";
+        } else if (confTableViewer.getCheckedElements().length == 0) {
+            error = "Choose at least one configuration";
+        } else {
+            error = null;
+        }
+        setErrorMessage(error);
+        setPageComplete(error == null);
     }
 
     public boolean finish() {
-        if (_ivyFilePathText.getText().length() > 0 && getConfigurationsText().length() > 0) {
-            return true;
-        }
-        MessageDialog.openWarning(_ivyFilePathText.getShell(), "Missing information",
-            "Please select a valid file and choose at least one configuration");
-        return false;
+        return true;
     }
 
     public IClasspathEntry getSelection() {
-        return createEntry();
+        conf.ivyXmlPath = ivyFilePathText.getText();
+        conf.confs = getConfigurations();
+        if (projectSpecificButton.getSelection()) {
+            conf.ivySettingsPath = settingsText.getText();
+            conf.acceptedTypes = IvyClasspathUtil.split(acceptedTypesText.getText());
+            conf.sourceTypes = IvyClasspathUtil.split(sourcesTypesText.getText());
+            conf.javadocTypes = IvyClasspathUtil.split(javadocTypesText.getText());
+            conf.sourceSuffixes = IvyClasspathUtil.split(sourcesSuffixesText.getText());
+            conf.javadocSuffixes = IvyClasspathUtil.split(javadocSuffixesText.getText());
+            conf.doRetrieve = doRetrieveButton.getSelection();
+            conf.retreivePattern = retrievePatternText.getText();
+            conf.alphaOrder = alphaOrderCheck.getSelection();
+        }
+        return JavaCore.newContainerEntry(conf.getPath());
     }
 
     public void setSelection(IClasspathEntry entry) {
-        _entry = entry != null ? entry : createDefaultEntry();
+        if (entry == null) {
+            conf = new IvyClasspathContainerConfiguration("ivy.xml", Arrays
+                    .asList(new String[] {"*"}));
+        } else {
+            conf = new IvyClasspathContainerConfiguration(entry.getPath());
+        }
     }
 
-    private IClasspathEntry createEntry() {
-        IClasspathEntry entry = JavaCore.newContainerEntry(new Path(
-                IvyClasspathContainer.IVY_CLASSPATH_CONTAINER_ID)
-                .append(_ivyFilePathText.getText()).append(getConfigurationsText()));
-        return entry;
-    }
-
-    private String getConfigurationsText() {
-        Object[] confs = _confTableViewer.getCheckedElements();
-        int tot = _confTableViewer.getTable().getItemCount();
-        if (confs != null && confs.length == tot) {
-            return "*";
+    private List getConfigurations() {
+        Object[] confs = confTableViewer.getCheckedElements();
+        int total = confTableViewer.getTable().getItemCount();
+        if (confs.length == total) {
+            return Arrays.asList(new String[] {"*"});
         }
-        String text = "";
+        List confList = new ArrayList();
         for (int i = 0; i < confs.length; i++) {
-            Configuration conf = (Configuration) confs[i];
-            text += conf.getName() + (i < confs.length ? "," : "");
+            Configuration c = (Configuration) confs[i];
+            confList.add(c.getName());
         }
-        return text;
+        return confList;
     }
 
-    private IClasspathEntry createDefaultEntry() {
-        IClasspathEntry entry = JavaCore.newContainerEntry(new Path(
-                IvyClasspathContainer.IVY_CLASSPATH_CONTAINER_ID).append("ivy.xml/*"));
-        return entry;
-    }
-
     public void createControl(Composite parent) {
         setTitle("IvyDE Managed Libraries");
         setDescription("Choose ivy file and its configurations.");
-        Composite control = new Composite(parent, 0);
-        GridLayout layout = new GridLayout(2, false);
-        control.setLayout(layout);
-        GridData data = new GridData(GridData.FILL);
-        data.grabExcessHorizontalSpace = true;
-        control.setLayoutData(data);
 
-        addMainSection(control);
-        setControl(control);
-    }
+        TabFolder tabs = new TabFolder(parent, SWT.BORDER);
+        tabs.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 
-    private Composite createDefaultComposite(Composite parent) {
-        Composite composite = new Composite(parent, SWT.NULL);
-        GridLayout layout = new GridLayout();
-        layout.numColumns = 3;
-        composite.setLayout(layout);
+        TabItem mainTab = new TabItem(tabs, SWT.NONE);
+        mainTab.setText("Main");
+        mainTab.setControl(createMainTab(tabs));
 
-        GridData data = new GridData();
-        data.grabExcessHorizontalSpace = true;
-        data.grabExcessVerticalSpace = true;
-        data.verticalAlignment = GridData.FILL;
-        data.horizontalAlignment = GridData.FILL;
-        composite.setLayoutData(data);
+        TabItem advancedTab = new TabItem(tabs, SWT.NONE);
+        advancedTab.setText("Advanced");
+        advancedTab.setControl(createAdvancedTab(tabs));
 
-        return composite;
+        setControl(tabs);
+
+        loadFromConf();
     }
 
-    private void addMainSection(Composite parent) {
-        Composite composite = createDefaultComposite(parent);
+    private Control createMainTab(Composite parent) {
+        Composite composite = new Composite(parent, SWT.NONE);
+        composite.setLayout(new GridLayout(3, false));
+        composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 
         // Label for ivy file field
         Label pathLabel = new Label(composite, SWT.NONE);
         pathLabel.setText("Ivy File");
 
-        _ivyFilePathText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _ivyFilePathText.setText(IvyClasspathContainer.getIvyFilePath(_entry.getPath()));
-        _ivyFilePathText.addFocusListener(new FocusAdapter() {
+        ivyFilePathText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+        ivyFilePathText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+        ivyFilePathText.addFocusListener(new FocusAdapter() {
             public void focusLost(FocusEvent e) {
                 refreshConfigurationTable();
             }
         });
-        GridData gridData = new GridData();
-        gridData.horizontalAlignment = GridData.FILL;
-        gridData.grabExcessHorizontalSpace = true;
-        _ivyFilePathText.setLayoutData(gridData);
+        ivyFilePathText.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                checkCompleted();
+            }
+        });
 
         Button btn = new Button(composite, SWT.NONE);
         btn.setText("Browse");
@@ -176,7 +217,7 @@
                         new WorkbenchContentProvider());
                 dialog.setValidator(new ISelectionStatusValidator() {
                     private final IStatus errorStatus = new Status(IStatus.ERROR, IvyPlugin.ID, 0,
-                            "", null); //$NON-NLS-1$
+                            "", null);
 
                     public IStatus validate(Object[] selection) {
                         if (selection.length == 0) {
@@ -194,14 +235,14 @@
                 });
                 dialog.setTitle("choose ivy file");
                 dialog.setMessage("choose the ivy file to use to resolve dependencies");
-                dialog.setInput(_project.getProject());
+                dialog.setInput(project.getProject());
                 dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
 
                 if (dialog.open() == Window.OK) {
                     Object[] elements = dialog.getResult();
                     if (elements.length > 0 && elements[0] instanceof IFile) {
                         IPath p = ((IFile) elements[0]).getProjectRelativePath();
-                        _ivyFilePathText.setText(p.toString());
+                        ivyFilePathText.setText(p.toString());
                         refreshConfigurationTable();
                     }
                 }
@@ -211,23 +252,21 @@
         // Label for ivy configurations field
         Label confLabel = new Label(composite, SWT.NONE);
         confLabel.setText("Configurations");
-        gridData = new GridData();
-        gridData.verticalAlignment = GridData.BEGINNING;
-        confLabel.setLayoutData(gridData);
+
         // table for configuration selection
-        _confTableViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.H_SCROLL
+        confTableViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER | SWT.H_SCROLL
                 | SWT.V_SCROLL);
-        _confTableViewer.getTable().setHeaderVisible(true);
-        TableColumn col1 = new TableColumn(_confTableViewer.getTable(), SWT.NONE);
+        confTableViewer.getTable().setHeaderVisible(true);
+        TableColumn col1 = new TableColumn(confTableViewer.getTable(), SWT.NONE);
         col1.setText("Name");
         col1.setWidth(100);
-        TableColumn col2 = new TableColumn(_confTableViewer.getTable(), SWT.NONE);
+        TableColumn col2 = new TableColumn(confTableViewer.getTable(), SWT.NONE);
         col2.setText("Description");
         col2.setWidth(300);
-        _confTableViewer.setColumnProperties(new String[] {"Name", "Description"});
-        _confTableViewer.getTable().setLayoutData(
+        confTableViewer.setColumnProperties(new String[] {"Name", "Description"});
+        confTableViewer.getTable().setLayoutData(
             new GridData(GridData.FILL, GridData.FILL, true, true));
-        _confTableViewer.setContentProvider(new IStructuredContentProvider() {
+        confTableViewer.setContentProvider(new IStructuredContentProvider() {
             public Object[] getElements(Object inputElement) {
                 if (inputElement != null && !"".equals(inputElement)) {
                     return getConfigurations((String) inputElement);
@@ -236,118 +275,307 @@
             }
 
             public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+                // nothing to do
             }
 
             public void dispose() {
+                // nothing to do
             }
         });
-        _confTableViewer.setLabelProvider(new ConfigurationLabelProvider());
-        _confTableViewer.setInput(_ivyFilePathText.getText());
-        initTableSelection(_ivyFilePathText.getText());
+        confTableViewer.setLabelProvider(new ConfigurationLabelProvider());
+        confTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+            public void selectionChanged(SelectionChangedEvent event) {
+                checkCompleted();
+            }
+        });
 
         // refresh
         Button refreshConf = new Button(composite, SWT.NONE);
-        gridData = new GridData();
-        gridData.verticalAlignment = GridData.BEGINNING;
-        refreshConf.setLayoutData(gridData);
         refreshConf.setText("Refresh");
         refreshConf.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
-                _confTableViewer.setInput(_ivyFilePathText.getText());
+                confTableViewer.setInput(ivyFilePathText.getText());
             }
         });
-        Composite spacer = new Composite(composite, SWT.NONE);
+
+        // some spacer
+        new Composite(composite, SWT.NONE);
+
         Link select = new Link(composite, SWT.PUSH);
-        gridData = new GridData();
-        gridData.verticalAlignment = GridData.BEGINNING;
-        select.setLayoutData(gridData);
         select.setText("<A>All</A>/<A>None</A>");
         select.addSelectionListener(new SelectionAdapter() {
             public void widgetSelected(SelectionEvent e) {
                 if (e.text.equals("All")) {
-                    ;
-                    _confTableViewer.setCheckedElements(getConfigurations(_ivyFilePathText
-                            .getText()));
+                    confTableViewer
+                            .setCheckedElements(getConfigurations(ivyFilePathText.getText()));
                 } else {
-                    _confTableViewer.setCheckedElements(new Configuration[0]);
+                    confTableViewer.setCheckedElements(new Configuration[0]);
                 }
             }
         });
+
+        return composite;
     }
 
+    private Control createAdvancedTab(Composite parent) {
+        Composite composite = new Composite(parent, SWT.NONE);
+        composite.setLayout(new GridLayout());
+        composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+
+        Composite headerComposite = new Composite(composite, SWT.NONE);
+        headerComposite.setLayout(new GridLayout(2, false));
+        headerComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+        projectSpecificButton = new Button(headerComposite, SWT.CHECK);
+        projectSpecificButton.setText("Enable project specific settings");
+        projectSpecificButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                updateFieldsStatus();
+            }
+        });
+
+        generalSettingsLink = new Link(headerComposite, SWT.NONE);
+        generalSettingsLink.setFont(composite.getFont());
+        generalSettingsLink.setText("<A>Configure Workspace Settings...</A>");
+        generalSettingsLink.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                PreferencesUtil.createPreferenceDialogOn(getShell(),
+                    IvyPreferencePage.PEREFERENCE_PAGE_ID, null, null);
+            }
+        });
+        generalSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
+
+        Label horizontalLine = new Label(headerComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
+        horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+
+        configComposite = new Composite(composite, SWT.NONE);
+        configComposite.setLayout(new GridLayout(3, false));
+        configComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+        Label label = new Label(configComposite, SWT.NONE);
+        label.setText("Ivy settings path:");
+
+        settingsText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        settingsText
+                .setToolTipText("The url where your ivysettings file can be found. \nUse 'default' to reference the default ivy settings. \nRelative paths are handled relative to the project. Example: 'file://./ivysettings.xml'.");
+        settingsText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+        browse = new Button(configComposite, SWT.NONE);
+        browse.setText("Browse");
+        browse.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                File f = getFile(new File("/"));
+                if (f != null) {
+                    try {
+                        settingsText.setText(f.toURL().toExternalForm());
+                    } catch (MalformedURLException ex) {
+                        // this cannot happend
+                    }
+                }
+            }
+        });
+
+        label = new Label(configComposite, SWT.NONE);
+        label.setText("Accepted types:");
+
+        acceptedTypesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        acceptedTypesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2,
+                1));
+        acceptedTypesText
+                .setToolTipText("Comma separated list of artifact types to use in IvyDE Managed Dependencies Library.\nExample: jar, zip");
+
+        label = new Label(configComposite, SWT.NONE);
+        label.setText("Sources types:");
+
+        sourcesTypesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        sourcesTypesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false,
+                2, 1));
+        sourcesTypesText
+                .setToolTipText("Comma separated list of artifact types to be used as sources.\nExample: source, src");
+
+        label = new Label(configComposite, SWT.NONE);
+        label.setText("Sources suffixes:");
+
+        sourcesSuffixesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        sourcesSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
+                2, 1));
+        sourcesSuffixesText
+                .setToolTipText("Comma separated list of suffixes to match sources to artifacts.\nExample: -source, -src");
+
+        label = new Label(configComposite, SWT.NONE);
+        label.setText("Javadoc types:");
+
+        javadocTypesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        javadocTypesText
+                .setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+        javadocTypesText
+                .setToolTipText("Comma separated list of artifact types to be used as javadoc.\nExample: javadoc.");
+
+        label = new Label(configComposite, SWT.NONE);
+        label.setText("Javadoc suffixes:");
+
+        javadocSuffixesText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        javadocSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
+                2, 1));
+        javadocSuffixesText
+                .setToolTipText("Comma separated list of suffixes to match javadocs to artifacts.\nExample: -javadoc, -doc");
+
+        doRetrieveButton = new Button(configComposite, SWT.CHECK);
+        doRetrieveButton.setText("Do retrieve after resolve");
+        doRetrieveButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false, 3,
+                1));
+
+        label = new Label(configComposite, SWT.NONE);
+        label.setText("Retrive pattern:");
+
+        retrievePatternText = new Text(configComposite, SWT.SINGLE | SWT.BORDER);
+        retrievePatternText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false,
+                2, 1));
+        retrievePatternText.setEnabled(doRetrieveButton.getSelection());
+        retrievePatternText
+                .setToolTipText("Example: lib/[conf]/[artifact].[ext]\nTo copy artifacts in folder named lib without revision by folder named like configurations");
+
+        doRetrieveButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                retrievePatternText.setEnabled(doRetrieveButton.getSelection());
+            }
+        });
+
+        alphaOrderCheck = new Button(configComposite, SWT.CHECK);
+        alphaOrderCheck.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+        alphaOrderCheck.setText("Order alphabetically the classpath entries");
+        alphaOrderCheck.setToolTipText(
+            "Order alphabetically the artifacts in the classpath container");
+
+        return composite;
+    }
+
+    private void loadFromConf() {
+        ivyFilePathText.setText(conf.ivyXmlPath);
+
+        confTableViewer.setInput(conf.ivyXmlPath);
+        initTableSelection(conf.ivyXmlPath, conf.confs);
+
+        if (conf.isProjectSpecific()) {
+            projectSpecificButton.setSelection(true);
+            settingsText.setText(conf.ivySettingsPath);
+            acceptedTypesText.setText(IvyClasspathUtil.concat(conf.acceptedTypes));
+            sourcesTypesText.setText(IvyClasspathUtil.concat(conf.sourceTypes));
+            sourcesSuffixesText.setText(IvyClasspathUtil.concat(conf.sourceSuffixes));
+            javadocTypesText.setText(IvyClasspathUtil.concat(conf.javadocTypes));
+            javadocSuffixesText.setText(IvyClasspathUtil.concat(conf.javadocSuffixes));
+            doRetrieveButton.setSelection(conf.doRetrieve);
+            retrievePatternText.setText(conf.retreivePattern);
+            alphaOrderCheck.setSelection(conf.alphaOrder);
+        } else {
+            projectSpecificButton.setSelection(false);
+            settingsText.setText("");
+            acceptedTypesText.setText("jar");
+            sourcesTypesText.setText("source,src");
+            sourcesSuffixesText.setText("-source,-sources,-src");
+            javadocTypesText.setText("javadoc");
+            javadocSuffixesText.setText("-javadoc,-javadocs,-doc,-docs");
+            doRetrieveButton.setSelection(false);
+            retrievePatternText.setText("lib/[conf]/[artifact].[ext]");
+            alphaOrderCheck.setSelection(false);
+        }
+
+        updateFieldsStatus();
+    }
+
+    void updateFieldsStatus() {
+        boolean projectSpecific = projectSpecificButton.getSelection();
+        generalSettingsLink.setEnabled(!projectSpecific);
+        configComposite.setEnabled(projectSpecific);
+        settingsText.setEnabled(projectSpecific);
+        acceptedTypesText.setEnabled(projectSpecific);
+        sourcesTypesText.setEnabled(projectSpecific);
+        sourcesSuffixesText.setEnabled(projectSpecific);
+        javadocTypesText.setEnabled(projectSpecific);
+        javadocSuffixesText.setEnabled(projectSpecific);
+        doRetrieveButton.setEnabled(projectSpecific);
+        retrievePatternText.setEnabled(doRetrieveButton.getSelection() && projectSpecific);
+        alphaOrderCheck.setEnabled(projectSpecific);
+    }
+
+    File getFile(File startingDirectory) {
+        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+        if (startingDirectory != null) {
+            dialog.setFileName(startingDirectory.getPath());
+        }
+        dialog.setFilterExtensions(new String[] {"*.xml", "*"});
+        String file = dialog.open();
+        if (file != null) {
+            file = file.trim();
+            if (file.length() > 0) {
+                return new File(file);
+            }
+        }
+        return null;
+    }
+
     /**
      * @param ivyFile
      */
-    private void initTableSelection(final String ivyFile) {
-        String selectedConfsString = IvyClasspathContainer.getConfigurationsText(_entry.getPath());
-        if ("*".equals(selectedConfsString)) {
-            _confTableViewer.setCheckedElements(getConfigurations(ivyFile));
+    private void initTableSelection(final String ivyFile, List confs) {
+        if ("*".equals(confs.get(0))) {
+            confTableViewer.setCheckedElements(getConfigurations(ivyFile));
         } else {
-            String selectedConf[] = IvyClasspathContainer.getConfigurations(_entry.getPath());
-            if (selectedConf != null) {
-                ModuleDescriptor md = getModuleDescriptor(ivyFile);
-                if (md != null) {
-                    for (int i = 0; i < selectedConf.length; i++) {
-                        String name = selectedConf[i];
-                        Configuration configuration = md.getConfiguration(name);
-                        if (configuration != null) {
-                            _confTableViewer.setChecked(configuration, true);
-                        }
+            ModuleDescriptor md = getModuleDescriptor(ivyFile);
+            if (md != null) {
+                for (int i = 0; i < confs.size(); i++) {
+                    Configuration configuration = md.getConfiguration((String) confs.get(i));
+                    if (configuration != null) {
+                        confTableViewer.setChecked(configuration, true);
                     }
                 }
             }
         }
     }
 
-    public void initialize(IJavaProject project, IClasspathEntry currentEntries[]) {
-        _project = project;
+    public void initialize(IJavaProject p, IClasspathEntry currentEntries[]) {
+        this.project = p;
+        // setSelection(currentEntries[0]);
     }
 
-    /**
-     * 
-     */
-    private void refreshConfigurationTable() {
-        if (_confTableViewer.getInput() == null
-                || !_confTableViewer.getInput().equals(_ivyFilePathText.getText())) {
-            _confTableViewer.setInput(_ivyFilePathText.getText());
+    void refreshConfigurationTable() {
+        if (confTableViewer.getInput() == null
+                || !confTableViewer.getInput().equals(ivyFilePathText.getText())) {
+            confTableViewer.setInput(ivyFilePathText.getText());
         }
     }
 
-    /**
-     * @param ivyfile
-     * @return
-     */
-    private Configuration[] getConfigurations(String ivyfile) {
+    Configuration[] getConfigurations(String ivyfile) {
         try {
             ModuleDescriptor moduleDescriptor = getModuleDescriptor(ivyfile);
             if (moduleDescriptor != null) {
                 return moduleDescriptor.getConfigurations();
             }
         } catch (Exception e) {
+            // TODO handle it or log it
         }
         return new Configuration[0];
     }
 
-    /**
-     * @param ivyfile
-     * @return
-     * @throws MalformedURLException
-     * @throws ParseException
-     * @throws IOException
-     */
     private ModuleDescriptor getModuleDescriptor(String ivyfile) {
         try {
-            IFile file = _project.getProject().getFile(ivyfile);
+            IFile file = project.getProject().getFile(ivyfile);
             URL url = new File(file.getLocation().toOSString()).toURL();
+            String ivySettingsPath;
+            if (projectSpecificButton.getSelection()) {
+                ivySettingsPath = settingsText.getText();
+            } else {
+                ivySettingsPath = IvyPlugin.getPreferenceStoreHelper().getIvySettingsPath();
+            }
             return ModuleDescriptorParserRegistry.getInstance().parseDescriptor(
-                IvyPlugin.getIvy(_project).getSettings(), url, false);
+                IvyPlugin.getIvy(project, ivySettingsPath).getSettings(), url, false);
         } catch (Exception e) {
+            // TODO hanle it or log it
         }
         return null;
     }
 
-    private static class ConfigurationLabelProvider extends LabelProvider implements
-            ITableLabelProvider {
+    static class ConfigurationLabelProvider extends LabelProvider implements ITableLabelProvider {
 
         public Image getColumnImage(Object element, int columnIndex) {
             return null;
Index: src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java	(révision 0)
+++ src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java	(révision 0)
@@ -0,0 +1,206 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.cpcontainer;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.ivyde.eclipse.IvyPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+/**
+ * path:
+ * org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/ivy.xml/conf/ivysetting.xml/acceptedTypes/sourceTypes/javadocTypes/sourceSuffixes/javadocSuffixes/doRetrieve/retreivePattern/order
+ */
+public class IvyClasspathContainerConfiguration {
+
+    String ivyXmlPath;
+
+    List/* <String> */confs = Arrays.asList(new String[] {"default"});
+
+    String ivySettingsPath;
+
+    List/* <String> */acceptedTypes;
+
+    List/* <String> */sourceTypes;
+
+    List/* <String> */javadocTypes;
+
+    List/* <String> */sourceSuffixes;
+
+    List/* <String> */javadocSuffixes;
+
+    boolean doRetrieve;
+
+    String retreivePattern;
+
+    boolean alphaOrder;
+
+    public IvyClasspathContainerConfiguration(String ivyXmlPath, List confs) {
+        this.ivyXmlPath = ivyXmlPath;
+        this.confs = confs;
+    }
+
+    public IvyClasspathContainerConfiguration(IPath path) {
+        ivyXmlPath = IvyClasspathUtil.decodeIPathSegment(path.segment(1));
+        confs = IvyClasspathUtil.split(path.segment(2));
+        if (path.segmentCount() > 3) {
+            ivySettingsPath = IvyClasspathUtil.decodeIPathSegment(path.segment(3));
+            acceptedTypes = IvyClasspathUtil.split(path.segment(4));
+            sourceTypes = IvyClasspathUtil.split(path.segment(5));
+            javadocTypes = IvyClasspathUtil.split(path.segment(6));
+            sourceSuffixes = IvyClasspathUtil.split(path.segment(7));
+            javadocSuffixes = IvyClasspathUtil.split(path.segment(8));
+            doRetrieve = Boolean.valueOf(path.segment(9)).booleanValue();
+            retreivePattern = IvyClasspathUtil.decodeIPathSegment(path.segment(10));
+            alphaOrder = Boolean.valueOf(path.segment(11)).booleanValue();
+        }
+    }
+
+    public IPath getPath() {
+        IPath path = new Path(IvyClasspathContainer.IVY_CLASSPATH_CONTAINER_ID);
+        path = path.append(IvyClasspathUtil.encodeIPathSegment(ivyXmlPath));
+        path = path.append(IvyClasspathUtil.concat(confs));
+        if (ivySettingsPath != null) {
+            path = path.append(IvyClasspathUtil.encodeIPathSegment(ivySettingsPath));
+            path = path.append(IvyClasspathUtil.concat(acceptedTypes));
+            path = path.append(IvyClasspathUtil.concat(sourceTypes));
+            path = path.append(IvyClasspathUtil.concat(javadocTypes));
+            path = path.append(IvyClasspathUtil.concat(sourceSuffixes));
+            path = path.append(IvyClasspathUtil.concat(javadocSuffixes));
+            path = path.append(Boolean.toString(doRetrieve));
+            path = path.append(IvyClasspathUtil.encodeIPathSegment(retreivePattern));
+            path = path.append(Boolean.toString(alphaOrder));
+        }
+        return path;
+    }
+
+    public String getInheritedIvySettingsPath() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getIvySettingsPath();
+        }
+        return ivySettingsPath;
+    }
+
+    public Collection getInheritedAcceptedTypes() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getAcceptedTypes();
+        }
+        return acceptedTypes;
+    }
+
+    public Collection getInheritedSourceTypes() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getSourceTypes();
+        }
+        return sourceTypes;
+    }
+
+    public Collection getInheritedSourceSuffixes() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getSourceSuffixes();
+        }
+        return sourceSuffixes;
+    }
+
+    public Collection getInheritedJavadocTypes() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getJavadocTypes();
+        }
+        return javadocTypes;
+    }
+
+    public Collection getInheritedJavadocSuffixes() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getJavadocSuffixes();
+        }
+        return javadocSuffixes;
+    }
+
+    public boolean getInheritedDoRetrieve() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getDoRetrieve();
+        }
+        return doRetrieve;
+    }
+
+    public String getInheritedRetreivePattern() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().getRetreivePattern();
+        }
+        return retreivePattern;
+    }
+
+    public boolean isInheritedAlphaOrder() {
+        if (ivySettingsPath == null) {
+            return IvyPlugin.getPreferenceStoreHelper().isAlphOrder();
+        }
+        return alphaOrder;
+    }
+
+    public List getAcceptedTypes() {
+        return acceptedTypes;
+    }
+
+    public List getConfs() {
+        return confs;
+    }
+
+    public boolean getDoRetrieve() {
+        return doRetrieve;
+    }
+
+    public String getIvySettingsPath() {
+        return ivySettingsPath;
+    }
+
+    public String getIvyXmlPath() {
+        return ivyXmlPath;
+    }
+
+    public List getJavadocSuffixes() {
+        return javadocSuffixes;
+    }
+
+    public List getJavadocTypes() {
+        return javadocTypes;
+    }
+
+    public boolean isAlphaOrder() {
+        return alphaOrder;
+    }
+
+    public String getRetreivePattern() {
+        return retreivePattern;
+    }
+
+    public List getSourceSuffixes() {
+        return sourceSuffixes;
+    }
+
+    public List getSourceTypes() {
+        return sourceTypes;
+    }
+
+    public boolean isProjectSpecific() {
+        return ivySettingsPath != null;
+    }
+
+}

Modification de propriétés sur src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
___________________________________________________________________
Nom : svn:keywords
   + Date Revision Author HeadURL Id
Nom : svn:eol-style
   + native

Index: src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java	(copie de travail)
@@ -1,15 +1,38 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package org.apache.ivyde.eclipse.cpcontainer;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.ivy.util.Message;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathContainer;
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
@@ -138,11 +161,85 @@
         IClasspathEntry[] cpe = javaProject.getRawClasspath();
         for (int i = 0; i < cpe.length; i++) {
             IClasspathEntry entry = cpe[i];
-            if (IvyClasspathContainer.isIvyClasspathContainer(entry.getPath())) {
+            if (isIvyClasspathContainer(entry.getPath())) {
                 return (IvyClasspathContainer) JavaCore.getClasspathContainer(entry.getPath(),
                     javaProject);
             }
         }
         return null;
     }
+
+    public static boolean isIvyClasspathContainer(IPath containerPath) {
+        return containerPath.segmentCount() >= 3
+                && IvyClasspathContainer.IVY_CLASSPATH_CONTAINER_ID
+                        .equals(containerPath.segment(0));
+    }
+
+    public static void scheduleResolve(IJavaProject javaProject) {
+        IvyClasspathContainer cp = getIvyClasspathContainer(javaProject);
+        if (cp != null) {
+            cp.scheduleResolve();
+        }
+    }
+
+    public static IvyClasspathContainer getIvyClasspathContainer(IJavaProject javaProject) {
+        try {
+            IClasspathEntry[] entries = javaProject.getRawClasspath();
+            for (int i = 0; i < entries.length; i++) {
+                IClasspathEntry entry = entries[i];
+                if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
+                    IPath path = entry.getPath();
+                    if (isIvyClasspathContainer(path)) {
+                        IClasspathContainer cp = JavaCore.getClasspathContainer(path, javaProject);
+                        if (cp instanceof IvyClasspathContainer) {
+                            return (IvyClasspathContainer) cp;
+                        }
+                    }
+                }
+            }
+        } catch (JavaModelException e) {
+            Message.error(e.getMessage());
+        }
+        return null;
+    }
+
+    public static List split(String str) {
+        String[] terms = str.split(",");
+        List ret = new ArrayList();
+        for (int i = 0; i < terms.length; i++) {
+            String t = terms[i].trim();
+            if (t.length() > 0) {
+                ret.add(t);
+            }
+        }
+        return ret;
+    }
+
+    public static String concat(Collection/* <String> */list) {
+        StringBuffer b = new StringBuffer();
+        Iterator it = list.iterator();
+        while (it.hasNext()) {
+            b.append(it.next());
+            if (it.hasNext()) {
+                b.append(",");
+            }
+        }
+        return b.toString();
+    }
+
+    public static String encodeIPathSegment(String segment) {
+        try {
+            return URLEncoder.encode(segment, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public static String decodeIPathSegment(String segment) {
+        try {
+            return URLDecoder.decode(segment, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }
Index: src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathEntry.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathEntry.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathEntry.java	(copie de travail)
@@ -1,72 +0,0 @@
-package org.apache.ivyde.eclipse.cpcontainer;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IAccessRule;
-import org.eclipse.jdt.core.IClasspathAttribute;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-
-public class IvyClasspathEntry implements IClasspathEntry {
-
-    Path path_;
-
-    IvyClasspathEntry(Path path) {
-        path_ = path;
-    }
-
-    public int getContentKind() {
-        return IPackageFragmentRoot.K_BINARY;
-    }
-
-    public int getEntryKind() {
-        return CPE_LIBRARY;
-    }
-
-    public IPath[] getExclusionPatterns() {
-        return null;
-    }
-
-    public IPath[] getInclusionPatterns() {
-        return null;
-    }
-
-    public IPath getOutputLocation() {
-        return null;
-    }
-
-    public IPath getPath() {
-        return path_;
-    }
-
-    public IClasspathEntry getResolvedEntry() {
-        return this;
-    }
-
-    public IPath getSourceAttachmentPath() {
-        return null;
-    }
-
-    public IPath getSourceAttachmentRootPath() {
-        return null;
-    }
-
-    public boolean isExported() {
-        return false;
-    }
-
-    public boolean combineAccessRules() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public IAccessRule[] getAccessRules() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public IClasspathAttribute[] getExtraAttributes() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-}
Index: src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java	(copie de travail)
@@ -1,3 +1,20 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package org.apache.ivyde.eclipse.cpcontainer;
 
 import java.io.File;
@@ -42,6 +59,7 @@
 import org.apache.ivy.plugins.repository.TransferListener;
 import org.apache.ivy.util.Message;
 import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.ui.preferences.IvyDEPreferenceStoreHelper;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -57,8 +75,6 @@
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.ClasspathEntry;
-import org.eclipse.jdt.internal.core.JavaModelManager;
 import org.eclipse.swt.widgets.Display;
 
 /**
@@ -75,18 +91,15 @@
 
         private IProgressMonitor _dlmonitor;
 
-        private Ivy _ivy;
-
         private boolean _usePreviousResolveIfExist;
 
         private int _workPerArtifact = 100;
 
         private boolean _notify;
 
-        public IvyResolveJob(Ivy ivy, boolean usePreviousResolveIfExist, boolean notify) {
-            super("Resolve " + _javaProject.getProject().getName() + "/" + _ivyXmlPath
+        public IvyResolveJob(boolean usePreviousResolveIfExist, boolean notify) {
+            super("Resolve " + _javaProject.getProject().getName() + "/" + conf.ivyXmlPath
                     + " dependencies");
-            _ivy = ivy;
             _usePreviousResolveIfExist = usePreviousResolveIfExist;
             _notify = notify;
         }
@@ -166,7 +179,7 @@
                     try {
                         ivyURL = _ivyXmlFile.toURL();
                     } catch (MalformedURLException e) {
-                        status[0] = new Status(Status.ERROR, IvyPlugin.ID, Status.ERROR,
+                        status[0] = new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                                 "The path of ivy.xml is not a valid URL", e);
                         return;
                     }
@@ -185,10 +198,10 @@
                         if (_usePreviousResolveIfExist) {
                             md = ModuleDescriptorParserRegistry.getInstance().parseDescriptor(
                                 _ivy.getSettings(), ivyURL, false);
-                            if (_confs.length == 1 && "*".equals(_confs[0])) {
+                            if (conf.confs.size() == 1 && "*".equals(conf.confs.get(0))) {
                                 confs = md.getConfigurationsNames();
                             } else {
-                                confs = _confs;
+                                confs = (String[]) conf.confs.toArray(new String [conf.confs.size()]);
                             }
 
                             all = new LinkedHashSet();
@@ -222,7 +235,7 @@
                                             + md.getModuleRevisionId().getModuleId()
                                             + " doesn't contain enough data: resolving again\n");
                                     ResolveReport r = _ivy.resolve(ivyURL, new ResolveOptions()
-                                            .setConfs(_confs));
+                                            .setConfs((String[]) conf.confs.toArray(new String [conf.confs.size()])));
                                     all.addAll(Arrays.asList(r.getArtifactsReports(null, false)));
                                     confs = r.getConfigurations();
                                     problemMessages.addAll(r.getAllProblemMessages());
@@ -234,7 +247,7 @@
                         } else {
                             Message.info("\n\nIVYDE: calling resolve on " + ivyURL + "\n");
                             ResolveReport report = _ivy.resolve(ivyURL, new ResolveOptions()
-                                    .setConfs(_confs));
+                                    .setConfs((String[]) conf.confs.toArray(new String [conf.confs.size()])));
                             problemMessages = report.getAllProblemMessages();
                             all = new LinkedHashSet(Arrays.asList(report.getArtifactsReports(null,
                                 false)));
@@ -263,7 +276,7 @@
                         String errorMsg = "Error while resolving dependencies for " + _ivyXmlFile
                                 + "\n" + e.getMessage();
                         Message.error(errorMsg);
-                        status[0] = new Status(Status.ERROR, IvyPlugin.ID, Status.ERROR, errorMsg,
+                        status[0] = new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR, errorMsg,
                                 e);
                         return;
                     } finally {
@@ -336,12 +349,13 @@
                     .toArray(new ArtifactDownloadReport[all.size()]);
             Set duplicates = new HashSet();
             for (int i = 0; i < reports.length - 1; i++) {
-                if (IvyPlugin.accept(_javaProject, reports[i].getArtifact())) {
+                if (accept(reports[i].getArtifact())) {
                     ModuleRevisionId mrid1 = reports[i].getArtifact().getModuleRevisionId();
                     for (int j = i + 1; j < reports.length; j++) {
-                        if (IvyPlugin.accept(_javaProject, reports[j].getArtifact())) {
+                        if (accept(reports[j].getArtifact())) {
                             ModuleRevisionId mrid2 = reports[j].getArtifact().getModuleRevisionId();
-                            if (mrid1.getModuleId().equals(mrid2.getModuleId()) && !mrid1.getRevision().equals(mrid2.getRevision())) {
+                            if (mrid1.getModuleId().equals(mrid2.getModuleId())
+                                    && !mrid1.getRevision().equals(mrid2.getRevision())) {
                                 duplicates.add(mrid1.getModuleId());
                                 break;
                             }
@@ -351,14 +365,8 @@
             }
             if (!duplicates.isEmpty()) {
                 StringBuffer buffer = new StringBuffer(
-                        "There are some duplicates entries due to conflicts between the resolved configurations (");
-                for (int i = 0; i < _confs.length; i++) {
-                    buffer.append(_confs[i]);
-                    if (i < _confs.length - 1) {
-                        buffer.append(", ");
-                    }
-                }
-                buffer.append("):\n  - ");
+                        "There are some duplicates entries due to conflicts between the resolved configurations " + conf.confs);
+                buffer.append(":\n  - ");
                 Iterator it = duplicates.iterator();
                 while (it.hasNext()) {
                     buffer.append(it.next());
@@ -371,12 +379,11 @@
         }
 
         private void maybeRetrieve(ModuleDescriptor md, String[] confs) throws IOException {
-            // call retrieve if required
-            if (IvyPlugin.shouldDoRetrieve(_javaProject)) {
-                _monitor.setTaskName("retrieving dependencies in "
-                        + IvyPlugin.getFullRetrievePatternHerited(_javaProject));
-                _ivy.retrieve(md.getModuleRevisionId(), IvyPlugin
-                        .getFullRetrievePatternHerited(_javaProject), new RetrieveOptions()
+            if (conf.getInheritedDoRetrieve()) {
+                String pattern = _javaProject.getProject().getLocation().toPortableString() + "/"
+                        + conf.getInheritedRetreivePattern();
+                _monitor.setTaskName("retrieving dependencies in " + pattern);
+                _ivy.retrieve(md.getModuleRevisionId(), pattern, new RetrieveOptions()
                         .setConfs(confs));
             }
         }
@@ -387,13 +394,13 @@
             for (Iterator iter = all.iterator(); iter.hasNext();) {
                 ArtifactDownloadReport artifact = (ArtifactDownloadReport) iter.next();
                 if (artifact.getLocalFile() != null
-                        && IvyPlugin.accept(_javaProject, artifact.getArtifact())) {
+                        && accept(artifact.getArtifact())) {
                     Path classpathArtifact = new Path(artifact.getLocalFile().getAbsolutePath());
                     Path sourcesArtifact = getSourcesArtifactPath(artifact, all);
                     Path javadocArtifact = getJavadocArtifactPath(artifact, all);
                     paths.add(JavaCore.newLibraryEntry(classpathArtifact, getSourceAttachment(
                         classpathArtifact, sourcesArtifact), getSourceAttachmentRoot(
-                        classpathArtifact, sourcesArtifact), ClasspathEntry.NO_ACCESS_RULES,
+                        classpathArtifact, sourcesArtifact), null,
                         getExtraAttribute(classpathArtifact, javadocArtifact), false));
                 }
             }
@@ -409,13 +416,13 @@
                 ArtifactDownloadReport otherAdr = (ArtifactDownloadReport) iter.next();
                 Artifact a = otherAdr.getArtifact();
                 if (otherAdr.getLocalFile() != null
-                        && IvyPlugin.isSourceArtifactName(_javaProject, artifact.getName(), a.getName())
+                        && isSourceArtifactName(artifact.getName(), a.getName())
                         && a.getId().getRevision().equals(artifact.getId().getRevision())
-                        && IvyPlugin.isSources(_javaProject, a)) {
+                        && isSources(a)) {
                     return new Path(otherAdr.getLocalFile().getAbsolutePath());
                 }
             }
-            if (IvyPlugin.shouldTestNonDeclaredSources(_javaProject)) {
+            if (shouldTestNonDeclaredSources()) {
                 return getMetaArtifactPath(adr, "source", "sources");
             } else {
                 return null;
@@ -429,14 +436,14 @@
                 ArtifactDownloadReport otherAdr = (ArtifactDownloadReport) iter.next();
                 Artifact a = otherAdr.getArtifact();
                 if (otherAdr.getLocalFile() != null
-                        && IvyPlugin.isJavadocArtifactName(_javaProject, artifact.getName(), a.getName())
+                        && isJavadocArtifactName(artifact.getName(), a.getName())
                         && a.getModuleRevisionId().equals(artifact.getModuleRevisionId())
                         && a.getId().equals(artifact.getId())
-                        && IvyPlugin.isJavadoc(_javaProject, a)) {
+                        && isJavadoc(a)) {
                     return new Path(otherAdr.getLocalFile().getAbsolutePath());
                 }
             }
-            if (IvyPlugin.shouldTestNonDeclaredSources(_javaProject)) {
+            if (shouldTestNonDeclaredJavadocs()) {
                 return getMetaArtifactPath(adr, "javadoc", "javadoc");
             } else {
                 return null;
@@ -551,14 +558,14 @@
 
     private File _ivyXmlFile;
 
-    private String _ivyXmlPath;
-
-    private String[] _confs = new String[] {"default"};
-
     private IPath _path;
 
     private IvyResolveJob _job;
 
+    IvyClasspathContainerConfiguration conf;
+
+    Ivy _ivy;
+
     /**
      * Create an Ivy class path container from some predefined classpath entries. The provided class
      * path entries should come from the default "persisted" classpath container. Note that no
@@ -568,7 +575,7 @@
      * @param javaProject
      *            the project of containing this container
      * @param path
-     *            the path the project
+     *            the path the container
      * @param ivyFile
      *            the path to the ivy file
      * @param confs
@@ -576,18 +583,32 @@
      * @param classpathEntries
      *            the entries to start with
      */
-    public IvyClasspathContainer(IJavaProject javaProject, IPath path, String ivyFile,
-            String[] confs, IClasspathEntry[] classpathEntries) {
-        _javaProject = javaProject;
+    public IvyClasspathContainer(IJavaProject javaProject, IPath path, IClasspathEntry[] classpathEntries) {
+        this._javaProject = javaProject;
         _path = path;
-
-        _ivyXmlPath = ivyFile;
-        _ivyXmlFile = resolveFile(ivyFile);
-        _confs = confs;
+        conf = new IvyClasspathContainerConfiguration(path);
+        _ivyXmlFile = resolveFile(conf.ivyXmlPath);
         _classpathEntries = classpathEntries;
-        IvyPlugin.getDefault().register(this);
+        _ivy = IvyPlugin.getIvy(javaProject, conf.ivySettingsPath);
     }
 
+    public IvyClasspathContainer(IvyClasspathContainer cp) {
+        _javaProject = cp._javaProject;
+        _path = cp._path;
+        conf = cp.conf;
+        _ivy = cp._ivy;
+        _ivyXmlFile = cp._ivyXmlFile;
+        _classpathEntries = cp._classpathEntries;
+    }
+
+    public IvyClasspathContainerConfiguration getConf() {
+        return conf;
+    }
+
+    public IFile getIvyFile() {
+        return _javaProject.getProject().getFile(conf.ivyXmlPath);
+    }
+
     private File resolveFile(String path) {
         IFile iFile = _javaProject.getProject().getFile(path);
         return new File(iFile.getLocation().toOSString());
@@ -599,7 +620,7 @@
      * @see org.eclipse.jdt.core.IClasspathContainer#getDescription()
      */
     public String getDescription() {
-        return _ivyXmlPath + " " + Arrays.asList(_confs);
+        return conf.ivyXmlPath + " " + conf.confs;
     }
 
     /*
@@ -647,14 +668,12 @@
     private IvyResolveJob computeClasspathEntries(final boolean usePreviousResolveIfExist,
             boolean notify, boolean isUser) {
         try {
-            Ivy ivy = IvyPlugin.getIvy(_javaProject);
-
             // resolve job already running
             synchronized (this) {
                 if (_job != null) {
                     return _job;
                 }
-                _job = new IvyResolveJob(ivy, usePreviousResolveIfExist, notify);
+                _job = new IvyResolveJob(usePreviousResolveIfExist, notify);
                 _job.setUser(isUser);
                 _job.setRule(RESOLVE_EVENT_RULE);
                 return _job;
@@ -675,16 +694,16 @@
         computeClasspathEntries(false, true, true).run(monitor);
     }
 
-    public void resolve() {
+    public void scheduleResolve() {
         computeClasspathEntries(false, true, true).schedule();
     }
 
-    public void refresh(boolean isUser) {
+    public void scheduleRefresh(boolean isUser) {
         computeClasspathEntries(true, true, isUser).schedule();
     }
 
-    public void refresh() {
-        refresh(true);
+    public void scheduleRefresh() {
+        scheduleRefresh(true);
     }
 
     private void updateClasspathEntries(boolean notify, final IClasspathEntry[] classpathEntries) {
@@ -700,7 +719,7 @@
     private void setClasspathEntries(final IClasspathEntry[] entries, final boolean notify) {
         Display.getDefault().asyncExec(new Runnable() {
             public void run() {
-                if (IvyPlugin.isAlphaOrder(_javaProject)) {
+                if (conf.isInheritedAlphaOrder()) {
                     Arrays.sort(entries, new Comparator() {
                         public int compare(Object o1, Object o2) {
                             return ((IClasspathEntry) o1).getPath().lastSegment().compareTo(((IClasspathEntry) o2).getPath().lastSegment());
@@ -717,105 +736,78 @@
 
     private void notifyUpdateClasspathEntries() {
         try {
-            JavaModelManager manager = JavaModelManager.getJavaModelManager();
-            manager.containerPut(_javaProject, _path, null);
             JavaCore.setClasspathContainer(_path, new IJavaProject[] {_javaProject},
-                new IClasspathContainer[] {IvyClasspathContainer.this}, null);
+                new IClasspathContainer[] {new IvyClasspathContainer(IvyClasspathContainer.this)}, null);
         } catch (JavaModelException e) {
             Message.error(e.getMessage());
         }
     }
 
-    public static String[] getConfigurations(IPath containerPath) {
-        return containerPath.lastSegment().split(",");
+    public URL getReportUrl() {
+        try {
+            URL ivyURL = _ivyXmlFile.toURL();
+            ModuleDescriptor md = ModuleDescriptorParserRegistry.getInstance().parseDescriptor(
+                _ivy.getSettings(), ivyURL, false);
+            String resolveId = ResolveOptions.getDefaultResolveId(md);
+            return _ivy.getResolutionCacheManager().getConfigurationResolveReportInCache(resolveId,
+                md.getConfigurationsNames()[0]).toURL();
+        } catch (Exception ex) {
+            return null;
+        }
     }
 
-    public static String getConfigurationsText(IPath containerPath) {
-        return containerPath.lastSegment();
+    public IJavaProject getProject() {
+        return _javaProject;
     }
 
-    public static String getIvyFilePath(IPath containerPath) {
-        return ((IPath) containerPath.clone()).removeFirstSegments(1).removeLastSegments(1)
-                .toString();
+    public boolean shouldTestNonDeclaredSources() {
+        return true; // TODO: add settings for that
     }
 
-    public static boolean isIvyClasspathContainer(IPath containerPath) {
-        return containerPath.segmentCount() >= 3
-                && IvyClasspathContainer.IVY_CLASSPATH_CONTAINER_ID
-                        .equals(containerPath.segment(0));
+    public boolean shouldTestNonDeclaredJavadocs() {
+        return true; // TODO: add settings for that
     }
 
-    /**
-     * Resolves the classpath container corresponding to the given ivy file, if any.
-     * 
-     * @param file
-     */
-    public static void resolveIfNeeded(IFile file) {
-        IJavaProject javaProject = JavaCore.create(file.getProject());
-        try {
-            IClasspathEntry[] entries = javaProject.getRawClasspath();
-            for (int i = 0; i < entries.length; i++) {
-                IClasspathEntry entry = entries[i];
-                if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
-                    IPath path = entry.getPath();
-                    if (isIvyClasspathContainer(path)
-                            && file.getProjectRelativePath().toString()
-                                    .equals(getIvyFilePath(path))) {
-                        IClasspathContainer cp = JavaCore.getClasspathContainer(path, javaProject);
+    public boolean isJavadocArtifactName(String jar, String javadoc) {
+        return isArtifactName(jar, javadoc, conf.getInheritedJavadocSuffixes());
+    }
 
-                        if (cp instanceof IvyClasspathContainer) {
-                            IvyClasspathContainer c = (IvyClasspathContainer) cp;
-                            c.resolve();
-                        }
-                    }
-                }
-            }
-        } catch (JavaModelException e) {
-            Message.error(e.getMessage());
-        }
+    public boolean isSourceArtifactName(String jar, String source) {
+        return isArtifactName(jar, source, conf.getInheritedSourceSuffixes());
     }
 
-    public static void resolve(IJavaProject javaProject) {
-        try {
-            IClasspathEntry[] entries = javaProject.getRawClasspath();
-            for (int i = 0; i < entries.length; i++) {
-                IClasspathEntry entry = entries[i];
-                if (entry != null && entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
-                    IPath path = entry.getPath();
-                    if (isIvyClasspathContainer(path)) {
-                        IClasspathContainer cp = JavaCore.getClasspathContainer(path, javaProject);
-
-                        if (cp instanceof IvyClasspathContainer) {
-                            IvyClasspathContainer c = (IvyClasspathContainer) cp;
-                            c.resolve();
-                        }
-                    }
-                }
+    private boolean isArtifactName(String jar, String name, Collection/* <String> */suffixes) {
+        if (name.equals(jar)) {
+            return true;
+        }
+        Iterator it = suffixes.iterator();
+        while (it.hasNext()) {
+            if (name.equals(jar + it.next())) {
+                return true;
             }
-        } catch (JavaModelException e) {
-            Message.error(e.getMessage());
         }
+        return false;
     }
 
-    public IFile getIvyFile() {
-        return _javaProject.getProject().getFile(_ivyXmlPath);
+    /**
+     * Check if the artifact is an artifact which can be added to the classpath container
+     * 
+     * @param artifact
+     *            the artifact to check
+     * @return <code>true</code> if the artifact can be added
+     */
+    public boolean accept(Artifact artifact) {
+        return conf.getInheritedAcceptedTypes().contains(artifact.getType())
+                && !conf.getInheritedSourceTypes().contains(artifact.getType())
+                && !conf.getInheritedJavadocTypes().contains(artifact.getType());
     }
 
-    public URL getReportUrl() {
-        try {
-            Ivy ivy = IvyPlugin.getIvy(_javaProject);
-            URL ivyURL = _ivyXmlFile.toURL();
-            ModuleDescriptor md = ModuleDescriptorParserRegistry.getInstance().parseDescriptor(
-                ivy.getSettings(), ivyURL, false);
-            String resolveId = ResolveOptions.getDefaultResolveId(md);
-            return ivy.getResolutionCacheManager().getConfigurationResolveReportInCache(resolveId,
-                md.getConfigurationsNames()[0]).toURL();
-        } catch (Exception ex) {
-            return null;
-        }
+    public boolean isSources(Artifact artifact) {
+        return conf.getInheritedSourceTypes().contains(artifact.getType());
     }
 
-    public IJavaProject getProject() {
-        return _javaProject;
+    public boolean isJavadoc(Artifact artifact) {
+        return conf.getInheritedJavadocTypes().contains(artifact.getType());
     }
+
 }
Index: src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathInitializer.java	(copie de travail)
@@ -1,3 +1,20 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package org.apache.ivyde.eclipse.cpcontainer;
 
 import org.apache.ivy.util.Message;
@@ -26,9 +43,7 @@
      * refresh
      */
     public void initialize(IPath containerPath, IJavaProject project) throws CoreException {
-        if (IvyClasspathContainer.isIvyClasspathContainer(containerPath)) {
-            String ivyFilePath = IvyClasspathContainer.getIvyFilePath(containerPath);
-            String[] confs = IvyClasspathContainer.getConfigurations(containerPath);
+        if (IvyClasspathUtil.isIvyClasspathContainer(containerPath)) {
 
             // try to get an existing one
             IClasspathContainer container = null;
@@ -41,12 +56,12 @@
             }
 
             if (container == null) {
-                container = new IvyClasspathContainer(project, containerPath, ivyFilePath, confs,
+                container = new IvyClasspathContainer(project, containerPath,
                         new IClasspathEntry[0]);
             } else if (!(container instanceof IvyClasspathContainer)) {
                 // this might be the persisted one : reuse the persisted entries
-                container = new IvyClasspathContainer(project, containerPath, ivyFilePath, confs,
-                        container.getClasspathEntries());
+                container = new IvyClasspathContainer(project, containerPath, container
+                        .getClasspathEntries());
             }
 
             try {
@@ -58,7 +73,7 @@
             }
 
             // now refresh the container to be synchronized with the ivy.xml
-            ((IvyClasspathContainer) container).refresh(false);
+            ((IvyClasspathContainer) container).scheduleRefresh(false);
         }
     }
 
@@ -78,7 +93,7 @@
      */
     public void requestClasspathContainerUpdate(IPath containerPath, final IJavaProject project,
             IClasspathContainer containerSuggestion) throws CoreException {
-        if (IvyClasspathContainer.isIvyClasspathContainer(containerPath)) {
+        if (IvyClasspathUtil.isIvyClasspathContainer(containerPath)) {
             IClasspathEntry ice[] = containerSuggestion.getClasspathEntries();
             IPackageFragmentExtraInfo ei = IvyPlugin.getDefault().getPackageFragmentExtraInfo();
             for (int i = 0; i < ice.length; i++) {
@@ -101,7 +116,7 @@
                         return;
                     }
                     if (ivycp != null) {
-                        ivycp.refresh();
+                        ivycp.scheduleRefresh();
                     }
                 }
             });
Index: src/java/org/apache/ivyde/eclipse/IvyPlugin.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/IvyPlugin.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/IvyPlugin.java	(copie de travail)
@@ -1,3 +1,20 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package org.apache.ivyde.eclipse;
 
 import java.io.File;
@@ -2,30 +19,23 @@
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
-import java.util.Set;
 
 import org.apache.ivy.Ivy;
-import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.util.Message;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
 import org.apache.ivyde.eclipse.cpcontainer.fragmentinfo.IPackageFragmentExtraInfo;
 import org.apache.ivyde.eclipse.cpcontainer.fragmentinfo.PreferenceStoreInfo;
 import org.apache.ivyde.eclipse.ui.console.IvyConsole;
+import org.apache.ivyde.eclipse.ui.preferences.IvyDEPreferenceStoreHelper;
 import org.apache.ivyde.eclipse.ui.preferences.PreferenceConstants;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
 import org.eclipse.jdt.core.IJavaModel;
@@ -38,27 +48,21 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.prefs.BackingStoreException;
 
 /**
  * The main plugin class to be used in the desktop.
  */
 public class IvyPlugin extends AbstractUIPlugin {
+
+    /** The ID of IvyDE plugin */
     public static final String ID = "org.apache.ivyde.eclipse";
 
-    public static final String PREF_CONSOLE_DEBUG_COLOR = ID + ".console.color.debug";
-
-    public static final String PREF_CONSOLE_VERBOSE_COLOR = ID + ".console.color.verbose";
-
-    public static final String PREF_CONSOLE_INFO_COLOR = ID + ".console.color.info";
-
-    public static final String PREF_CONSOLE_WARN_COLOR = ID + ".console.color.warn";
-
-    public static final String PREF_CONSOLE_ERROR_COLOR = ID + ".console.color.error";
-
     // The shared instance.
     private static IvyPlugin plugin;
 
@@ -67,6 +71,8 @@
 
     private IvyConsole console;
 
+    private IvyDEPreferenceStoreHelper prefStoreHelper;
+
     private IJavaModel javaModel;
 
     /**
@@ -89,19 +95,25 @@
             // Don't let the console bring down the CVS UI
             log(IStatus.ERROR, "Errors occurred starting the Ivy console", e);
         }
+        javaModel = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
+        prefStoreHelper = new IvyDEPreferenceStoreHelper(getPreferenceStore());
         getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
             public void propertyChange(PropertyChangeEvent event) {
-                if (event.getProperty() == PreferenceConstants.IVYCONF_PATH) {
-                    ivyConfPathChanged();
+                try {
+                    if (event.getProperty() == PreferenceConstants.IVYSETTINGS_PATH
+                            || event.getProperty() == PreferenceConstants.ACCEPTED_TYPES
+                            || event.getProperty() == PreferenceConstants.SOURCES_TYPES
+                            || event.getProperty() == PreferenceConstants.JAVADOC_TYPES) {
+                        prefStoreChanged();
+                    }
+                } catch (JavaModelException e) {
+                    MessageDialog.openError(IvyPlugin.getDefault().getWorkbench()
+                            .getActiveWorkbenchWindow().getShell(),
+                        "Unable to trigger the update the IvyDE classpath containers", e
+                                .getMessage());
                 }
-                if (event.getProperty() == PreferenceConstants.ACCEPTED_TYPES
-                        || event.getProperty() == PreferenceConstants.SOURCES_TYPES
-                        || event.getProperty() == PreferenceConstants.JAVADOC_TYPES) {
-                    typesChanged(event.getProperty());
-                }
             }
         });
-        javaModel = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
         log(IStatus.INFO, "IvyDE plugin started", null);
     }
 
@@ -116,6 +128,16 @@
         // console.shutdown();
     }
 
+    void prefStoreChanged() throws JavaModelException {
+        IJavaProject[] projects = plugin.javaModel.getJavaProjects();
+        for (int i = 0; i < projects.length; i++) {
+            IvyClasspathContainer cp = IvyClasspathUtil.getIvyClasspathContainer(projects[i]);
+            if (cp != null && !cp.getConf().isProjectSpecific()) {
+                IvyClasspathUtil.scheduleResolve(projects[i]);
+            }
+        }
+    }
+
     /**
      * Convenience method for logging statuses to the plugin log
      * 
@@ -139,12 +161,56 @@
 
     /**
      * Returns the shared instance.
+     * 
+     * @return the plugin instance
      */
     public static IvyPlugin getDefault() {
         return plugin;
     }
 
     /**
+     * Returns the active workbench shell
+     * 
+     * @return the active workbench shell
+     */
+    public static Shell getActiveWorkbenchShell() {
+        IWorkbenchWindow workBenchWindow = getActiveWorkbenchWindow();
+        if (workBenchWindow == null) {
+            return null;
+        }
+        return workBenchWindow.getShell();
+    }
+
+    /**
+     * Returns the active workbench page or <code>null</code> if none.
+     * 
+     * @return the active workbench page
+     */
+    public static IWorkbenchPage getActivePage() {
+        IWorkbenchWindow window = getActiveWorkbenchWindow();
+        if (window != null) {
+            return window.getActivePage();
+        }
+        return null;
+    }
+
+    /**
+     * Returns the active workbench window
+     * 
+     * @return the active workbench window
+     */
+    public static IWorkbenchWindow getActiveWorkbenchWindow() {
+        if (getDefault() == null) {
+            return null;
+        }
+        IWorkbench workBench = getDefault().getWorkbench();
+        if (workBench == null) {
+            return null;
+        }
+        return workBench.getActiveWorkbenchWindow();
+    }
+
+    /**
      * Returns the string from the plugin's resource bundle, or 'key' if not found.
      */
     public static String getResourceString(String key) {
@@ -186,424 +252,172 @@
      * @return the image descriptor
      */
     public static ImageDescriptor getImageDescriptor(String path) {
-        return AbstractUIPlugin.imageDescriptorFromPlugin("org.apache.ivyde", path);
+        return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
     }
 
     private static class IvyConfig {
         Ivy ivy;
 
         long configTime = -1;
-
-        public IvyConfig() {
-        }
-
-        public IvyConfig(Ivy ivy) {
-            this.ivy = ivy;
-        }
     }
 
-    private static Map _ivysByProject = new HashMap(); // Map (IJavaProject -> IvyConfig)
+    private Map/* <String, IvyConfig> */ivyBySettings = new HashMap();
 
-    private static Map _ivysByConf = new HashMap(); // Map (configPath -> IvyConfig)
-
-    private static boolean _inChange;
-
-    private static Set _todo = new HashSet();
-
     private PreferenceStoreInfo _packageExtraInfo;
 
-    private Map _containers = new HashMap();
-
-    public static Ivy getIvy(IJavaProject javaProject) {
-        Ivy ivy = refreshIvyConfiguration(javaProject, getIvyconfURL(javaProject));
-        return ivy == null ? new Ivy() : ivy;
+    /**
+     * @return the helper around the plugin preference store
+     */
+    public static IvyDEPreferenceStoreHelper getPreferenceStoreHelper() {
+        return plugin.prefStoreHelper;
     }
 
-    public static void ivyConfPathChanged() {
+    /**
+     * Get the Ivy instance for the specified project and the settings of the configured container
+     * on the project.
+     * 
+     * @param javaProject
+     *            the Java project
+     * @param ivySettingsPath
+     *            the settings to use
+     * @return the configured Ivy instance, <code>null</code> if it failed
+     */
+    // TODO: check that every caller of this function can properly handle a returned null
+    public static synchronized Ivy getIvy(IJavaProject javaProject) {
+        IvyClasspathContainer cp;
         try {
-            IJavaProject[] projects = plugin.javaModel.getJavaProjects();
-            String defaultConfURL = getIvyconfURL();
-            for (int i = 0; i < projects.length; i++) {
-                if (getStrictIvyconfURL(projects[i]) == null) {
-                    resolve(projects[i]);
-                }
-            }
+            cp = IvyClasspathUtil.getIvyClassPathContainer(javaProject);
         } catch (JavaModelException e) {
+            // TODO log and better handle the error
+            return null;
         }
+        if (cp == null) {
+            return null;
+        }
+        return getIvy(javaProject, cp.getConf().getIvySettingsPath());
     }
 
-    public static void typesChanged(String typesCode) {
+    /**
+     * Get the Ivy instance for the specified project and the specified settings
+     * <p>
+     * 
+     * @param javaProject
+     *            the Java project
+     * @param ivySettingsPath
+     *            the settings to use
+     * @return the configured Ivy instance, <code>null</code> if it failed
+     */
+    // TODO: check that every caller of this function can properly handle a returned null
+    public static synchronized Ivy getIvy(IJavaProject javaProject, String ivySettingsPath) {
+        IvyConfig ic;
         try {
-            IJavaProject[] projects = plugin.javaModel.getJavaProjects();
-            String defaultConfURL = getIvyconfURL();
-            for (int i = 0; i < projects.length; i++) {
-                if ("[inherited]".equals(getInheritablePreferenceString(projects[i], typesCode))) {
-                    resolve(projects[i]);
-                }
+            if (ivySettingsPath == null || ivySettingsPath.trim().length() == 0) {
+                // no settings specified, so take the default one
+                return getDefaultIvy();
             }
-        } catch (JavaModelException e) {
-        }
-    }
 
-    private static synchronized Ivy refreshIvyConfiguration(IJavaProject javaProject,
-            String configPath) {
-        try {
-            if (configPath == null || configPath.trim().length() == 0
-                    || "default".equals(configPath)) {
-                return defaultIvyConfigure(javaProject);
-            } else {
-                IvyConfig ic = (IvyConfig) _ivysByProject.get(javaProject);
-                if (ic == null) {
-                    ic = (IvyConfig) _ivysByConf.get(configPath);
-                    if (ic == null) {
-                        ic = new IvyConfig();
-                        _ivysByProject.put(javaProject, ic);
-                        _ivysByConf.put(configPath, ic);
-                    }
-                }
+            ic = (IvyConfig) plugin.ivyBySettings.get(ivySettingsPath);
+            if (ic == null) {
+                ic = new IvyConfig();
+                plugin.ivyBySettings.put(ivySettingsPath, ic);
+            }
 
-                URL url = new URL(configPath);
-                if (url.getProtocol().startsWith("file")) {
-                    File file = new File(url.getPath());
+            // before returning the found ivy, try to refresh it if the settings changed
 
-                    // BEGIN - JIRA: IVYDE-25 by Peter Chanthamynavong
-                    // Getting an Absolute Filename Path from a Relative Filename Path for the
-                    // current project
-                    if (!file.exists()) {
-                        IProject project = javaProject.getProject();
-                        File loc = project.getLocation().toFile();
-                        file = new File(loc, url.getPath());
-                        Message.info("\n\nIVYDE: ivysettings from relative path: "
-                                + file.getAbsolutePath());
-                    }
-                    // END - JIRA: IVYDE-25
+            URL url = new URL(ivySettingsPath);
+            if (url.getProtocol().startsWith("file")) {
+                File file = new File(url.getPath());
 
-                    if (!file.exists()) {
-                        MessageDialog
-                                .openWarning(
-                                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                                    "No ivyConf found",
-                                    configPath
-                                            + " ivyconf cannot be found.\nPlease set your ivy conf url in the preference or in your project properties to be able to use IvyDE");
-                        if (ic.ivy == null) {
-                            ic.ivy = new Ivy();
-                        }
+                // BEGIN - JIRA: IVYDE-25 by Peter Chanthamynavong
+                // Getting an Absolute Filename Path from a Relative Filename Path for the
+                // current project
+                if (!file.exists()) {
+                    IProject project = javaProject.getProject();
+                    File loc = project.getLocation().toFile();
+                    file = new File(loc, url.getPath());
+                    Message.info("\n\nIVYDE: ivysettings from relative path: "
+                            + file.getAbsolutePath());
+                }
+                // END - JIRA: IVYDE-25
+
+                if (!file.exists()) {
+                    MessageDialog
+                            .openWarning(
+                                getActiveWorkbenchShell(),
+                                "No ivyConf found",
+                                ivySettingsPath
+                                        + " ivyconf cannot be found.\nPlease set your ivy conf url in the preference or in your project properties to be able to use IvyDE");
+                    return null;
+                }
+
+                if (file.lastModified() != ic.configTime) {
+                    ic.ivy = new Ivy();
+                    if (ic.configTime == -1) {
+                        Message.info("\n\n");
                     } else {
-                        if (file.lastModified() != ic.configTime) {
-                            ic.ivy = new Ivy();
-                            if (ic.configTime == -1) {
-                                Message.info("\n\n");
-                            } else {
-                                Message
-                                        .info("\n\nIVYDE: ivysettings has changed, configuring ivy again\n");
-                            }
-                            ic.ivy.configure(file);
-                            ic.configTime = file.lastModified();
-                        }
+                        Message.info("\n\nIVYDE: ivysettings has changed, configuring ivy again\n");
                     }
-                } else {
-                    if (ic.ivy == null) {
-                        ic.ivy = new Ivy();
-                        ic.ivy.configure(url);
-                    }
+                    ic.ivy.configure(file);
+                    ic.configTime = file.lastModified();
                 }
-                return ic.ivy;
+
+            } else {
+                // an URL but not a file
+                if (ic.ivy == null) {
+                    ic.ivy = new Ivy();
+                    ic.ivy.configure(url);
+                }
             }
+            return ic.ivy;
         } catch (Exception e) {
-            try {
-                MessageDialog
-                        .openWarning(
-                            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                            "Bad ivyConf found",
-                            "Problem occured while using "
-                                    + configPath
-                                    + " to configure Ivy.\nPlease set your ivy conf url properly in the preference or in the project properties to be able to use IvyDE.\nException message: "
-                                    + e.getMessage());
-            } catch (Exception ex) {
-            }
-            log(IStatus.WARNING, "Problem occured while using " + configPath + " to configure Ivy",
-                e);
-            Message.warn("IVYDE: Problem occured while using " + configPath
+            MessageDialog
+                    .openWarning(
+                        getActiveWorkbenchShell(),
+                        "Bad ivySetting found",
+                        "Problem occured while using "
+                                + ivySettingsPath
+                                + " to configure Ivy.\n"
+                                + "Please set your ivy settings url properly in the preference or in the project properties to be able to use IvyDE.\n"
+                                + "Exception message: " + e.getMessage());
+            log(IStatus.WARNING, "Problem occured while using " + ivySettingsPath
+                    + " to configure Ivy", e);
+            Message.warn("IVYDE: Problem occured while using " + ivySettingsPath
                     + " to configure Ivy. See error log for details");
-            _ivysByProject.remove(javaProject);
-            _ivysByConf.remove(configPath);
-            return new Ivy();
+            plugin.ivyBySettings.remove(ivySettingsPath);
+            return null;
         }
     }
 
-    private static Ivy defaultIvyConfigure(IJavaProject javaProject) {
-        IvyConfig ic = (IvyConfig) _ivysByProject.get(javaProject);
+    private static Ivy getDefaultIvy() {
+        IvyConfig ic = (IvyConfig) plugin.ivyBySettings.get(null);
         if (ic == null) {
-            ic = (IvyConfig) _ivysByConf.get("default");
-        }
-        Ivy ivy = ic == null ? null : ic.ivy;
-        if (ivy == null) {
-            ivy = new Ivy();
+            ic = new IvyConfig();
+            ic.ivy = new Ivy();
             try {
-                ivy.configureDefault();
-                IvyConfig ivyConfig = new IvyConfig(ivy);
-                _ivysByProject.put(javaProject, ivyConfig);
-                _ivysByConf.put("default", ivyConfig);
+                ic.ivy.configureDefault();
+                plugin.ivyBySettings.put(null, ic);
             } catch (Exception ex) {
                 MessageDialog
                         .openWarning(
-                            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+                            getActiveWorkbenchShell(),
                             "Impossible to configure Ivy",
-                            "Problem occured while configuring Ivy with its default settings.\nPlease set an ivy settings url properly in the preference or in the project properties to be able to use IvyDE.\nException message: "
-                                    + ex.getMessage());
+                            "Problem occured while configuring Ivy with its default settings.\n"
+                                    + "Please set an ivy settings url properly in the preference or in the project properties to be able to use IvyDE.\n"
+                                    + "Exception message: " + ex.getMessage());
                 log(IStatus.WARNING,
                     "Problem occured while configuring Ivy with its default settings.", ex);
                 Message
                         .warn("IVYDE: Problem occured while configuring Ivy with its default settings. See error log for details");
+                return null;
             }
         }
-        return ivy;
+        return ic.ivy;
     }
 
-    public static String getIvyconfURL(IJavaProject project) {
-        String ivyconf = getStrictIvyconfURL(project);
-        if (ivyconf == null) {
-            return getIvyconfURL();
-        } else {
-            return ivyconf;
-        }
-    }
-
-    public static String getStrictIvyconfURL(IJavaProject project) {
-        if (project == null) {
-            return null;
-        }
-        String opt = IvyPlugin.getDefault().getProjectPreferences(project).get(
-            PreferenceConstants.IVYCONF_PATH, null);
-        if (opt == null || opt.trim().length() == 0 || "inherited".equals(opt)) {
-            return null;
-        } else {
-            return opt.trim();
-        }
-    }
-
-    public static String getIvyconfURL() {
-        String configPath = IvyPlugin.getDefault().getPreferenceStore().getString(
-            PreferenceConstants.IVYCONF_PATH);
-        if (configPath == null || configPath.trim().length() == 0) {
-            return "default";
-        } else {
-            return configPath.trim();
-        }
-    }
-
-    public static void setIvyconfURL(IJavaProject project, String ivyconfURL) {
-        _ivysByProject.remove(project);
-        if (ivyconfURL == null) {
-            IvyPlugin.getDefault().getProjectPreferences(project).put(
-                PreferenceConstants.IVYCONF_PATH, "inherited");
-        } else {
-            IvyPlugin.getDefault().getProjectPreferences(project).put(
-                PreferenceConstants.IVYCONF_PATH, ivyconfURL);
-        }
-        flushProjectPreferences(project);
-
-        resolve(project);
-    }
-
-    /**
-     * Check if the artifact is an artifact which can be added to the classpath container
-     * 
-     * @param project
-     *            the project containing the ivy container
-     * @param artifact
-     *            the artifact to check
-     * @return <code>true</code> if the artifact can be added
-     */
-    public static boolean accept(IJavaProject project, Artifact artifact) {
-        return getAcceptedTypes(project).contains(artifact.getType())
-                && !getSourcesTypes(project).contains(artifact.getType())
-                && !getJavadocTypes(project).contains(artifact.getType());
-    }
-
-    private static Collection getAcceptedTypes(IJavaProject project) {
-        return getInheritablePreferenceList(project, PreferenceConstants.ACCEPTED_TYPES, "jar");
-    }
-
-    public static String getAcceptedTypesString(IJavaProject project) {
-        return getInheritablePreferenceString(project, PreferenceConstants.ACCEPTED_TYPES);
-    }
-
-    public static void setAcceptedTypes(IJavaProject project, String types) {
-        setInheritablePreferenceString(project, types, PreferenceConstants.ACCEPTED_TYPES);
-    }
-
-    public static boolean isSources(IJavaProject project, Artifact artifact) {
-        return getSourcesTypes(project).contains(artifact.getType());
-    }
-
-    private static Collection getSourcesTypes(IJavaProject project) {
-        return getInheritablePreferenceList(project, PreferenceConstants.SOURCES_TYPES, "source");
-    }
-
-    public static String getSourcesTypesString(IJavaProject project) {
-        return getInheritablePreferenceString(project, PreferenceConstants.SOURCES_TYPES);
-    }
-
-    public static void setSourcesTypes(IJavaProject project, String types) {
-        setInheritablePreferenceString(project, types, PreferenceConstants.SOURCES_TYPES);
-    }
-
-    public static boolean isSourceArtifactName(IJavaProject project, String jar, String source) {
-        if (source.equals(jar)) {
-            return true;
-        }
-        Iterator it = getSourcesSuffixes(project).iterator();
-        while (it.hasNext()) {
-            if (source.equals(jar + it.next())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private static Collection getSourcesSuffixes(IJavaProject project) {
-        return getInheritablePreferenceList(project, PreferenceConstants.SOURCES_SUFFIXES, "-source, -sources, -src");
-    }
-
-    public static String getSourcesSuffixesString(IJavaProject project) {
-        return getInheritablePreferenceString(project, PreferenceConstants.SOURCES_SUFFIXES);
-    }
-
-    public static void setSourcesSuffixes(IJavaProject project, String types) {
-        setInheritablePreferenceString(project, types, PreferenceConstants.SOURCES_SUFFIXES);
-    }
-
-    public static boolean isJavadoc(IJavaProject project, Artifact artifact) {
-        return getJavadocTypes(project).contains(artifact.getType());
-    }
-
-    private static Collection getJavadocTypes(IJavaProject project) {
-        return getInheritablePreferenceList(project, PreferenceConstants.JAVADOC_TYPES, "javadoc");
-    }
-
-    public static String getJavadocTypesString(IJavaProject project) {
-        return getInheritablePreferenceString(project, PreferenceConstants.JAVADOC_TYPES);
-    }
-
-    public static void setJavadocTypes(IJavaProject project, String types) {
-        setInheritablePreferenceString(project, types, PreferenceConstants.JAVADOC_TYPES);
-    }
-
-    public static boolean isJavadocArtifactName(IJavaProject project, String jar, String javadoc) {
-        if (javadoc.equals(jar)) {
-            return true;
-        }
-        Iterator it = getJavadocSuffixes(project).iterator();
-        while (it.hasNext()) {
-            if (javadoc.equals(jar + it.next())) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private static Collection getJavadocSuffixes(IJavaProject project) {
-        return getInheritablePreferenceList(project, PreferenceConstants.JAVADOC_SUFFIXES, "-javadoc, -javadocs, -doc, -docs");
-    }
-
-    public static String getJavadocSuffixesString(IJavaProject project) {
-        return getInheritablePreferenceString(project, PreferenceConstants.JAVADOC_SUFFIXES);
-    }
-
-    public static void setJavadocSuffixes(IJavaProject project, String types) {
-        setInheritablePreferenceString(project, types, PreferenceConstants.JAVADOC_SUFFIXES);
-    }
-
-    private static Collection getInheritablePreferenceList(IJavaProject project, String code, String defaultValues) {
-        String types = getInheritablePreferenceString(project, code);
-
-        if ("[inherited]".equals(types)) {
-            String workspaceTypes = IvyPlugin.getDefault().getPreferenceStore()
-                    .getString(code);
-            if (workspaceTypes == null || workspaceTypes.trim().length() == 0) {
-                types = defaultValues;
-            } else {
-                types = workspaceTypes.trim();
-            }
-        }
-        return split(types);
-    }
-
-    private static String getInheritablePreferenceString(IJavaProject project, String code) {
-        String values = IvyPlugin.getDefault().getProjectPreferences(project).get(code, null);
-        if (values == null || values.trim().length() == 0) {
-            return "[inherited]";
-        }
-        return values.trim();
-    }
-
-    private static void setInheritablePreferenceString(IJavaProject project, String values, String code) {
-        if (values == null || values.trim().length() == 0 || values.trim().startsWith("[inherited]")) {
-            IvyPlugin.getDefault().getProjectPreferences(project).put(code, "[inherited]");
-        } else {
-            IvyPlugin.getDefault().getProjectPreferences(project).put(code, values);
-        }
-        flushProjectPreferences(project);
-        resolve(project);
-    }
-
-    private static Collection split(String str) {
-        String[] t = str.split(",");
-        Collection ret = new ArrayList();
-        for (int i = 0; i < t.length; i++) {
-            if (t[i].trim().length() > 0) {
-                ret.add(t[i].trim());
-            }
-        }
-        return ret;
-    }
-
     public IvyConsole getConsole() {
         return console;
     }
 
-    public static String getRetreivePattern() {
-        if (IvyPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.DO_RETRIEVE)) {
-            String pattern = IvyPlugin.getDefault().getPreferenceStore().getString(
-                PreferenceConstants.RETRIEVE_PATTERN);
-            return pattern == null ? "" : pattern.trim();
-        } else {
-            return "";
-        }
-    }
-
-    public static String getRetreivePattern(IJavaProject project) {
-        String pattern = IvyPlugin.getDefault().getProjectPreferences(project).get(
-            PreferenceConstants.RETRIEVE_PATTERN, null);
-
-        return pattern == null ? "" : pattern.trim();
-    }
-
-    public static void setRetreivePattern(String pattern) {
-        IvyPlugin.getDefault().getPreferenceStore().putValue(PreferenceConstants.RETRIEVE_PATTERN,
-            pattern);
-    }
-
-    public static void setRetreivePattern(IJavaProject project, String pattern) {
-        if (pattern == null || pattern.trim().length() == 0) {
-            pattern = "none";
-        } else if (pattern.startsWith("[inherited]")) {
-            pattern = "[inherited]";
-        }
-        IvyPlugin.getDefault().getProjectPreferences(project).put(
-            PreferenceConstants.RETRIEVE_PATTERN, pattern);
-        flushProjectPreferences(project);
-    }
-
-    private static void flushProjectPreferences(IJavaProject project) {
-        try {
-            IvyPlugin.getDefault().getProjectPreferences(project).flush();
-        } catch (BackingStoreException e) {
-            log(IStatus.WARNING, "impossible to store IvyDE project preferences", e);
-        }
-    }
-
     public IPackageFragmentExtraInfo getPackageFragmentExtraInfo() {
         if (_packageExtraInfo == null) {
             _packageExtraInfo = new PreferenceStoreInfo(getPreferenceStore());
@@ -611,88 +425,4 @@
         return _packageExtraInfo;
     }
 
-    public static String getRetrievePatternHerited(IJavaProject project) {
-        String retreivePattern = getRetreivePattern(project);
-        if ("".equals(retreivePattern) || retreivePattern.startsWith("[inherited]")) {
-            retreivePattern = getRetreivePattern();
-            if (!"".equals(retreivePattern)) {
-                retreivePattern = "[inherited] " + retreivePattern;
-            }
-        } else if ("none".equals(retreivePattern)) {
-            retreivePattern = "";
-        }
-        return retreivePattern.trim();
-    }
-
-    public static String getFullRetrievePatternHerited(IJavaProject project) {
-        String retreivePattern = getRetrievePatternHerited(project);
-        if (!"".equals(retreivePattern)) {
-            if (retreivePattern.startsWith("[inherited] ")) {
-                retreivePattern = retreivePattern.substring("[inherited] ".length());
-            }
-            return project.getProject().getLocation().toPortableString() + "/" + retreivePattern;
-        } else {
-            return "";
-        }
-    }
-
-    public static boolean shouldDoRetrieve(IJavaProject project) {
-        return !"".equals(getRetrievePatternHerited(project));
-    }
-
-    public static boolean isAlphaOrder(IJavaProject javaProject) {
-        return IvyPlugin.getDefault().getProjectPreferences(javaProject).getBoolean(
-            PreferenceConstants.APHABETICAL_ORDER, false);
-    }
-
-    public static void setAlphaOrder(IJavaProject project, boolean alphaOrder) {
-        IvyPlugin.getDefault().getProjectPreferences(project).putBoolean(
-            PreferenceConstants.APHABETICAL_ORDER, alphaOrder);
-    }
-
-    public static boolean shouldTestNonDeclaredSources(IJavaProject project) {
-        return true; // TODO: add settings for that
-    }
-
-    public static boolean shouldTestNonDeclaredJavadocs(IJavaProject project) {
-        return true; // TODO: add settings for that
-    }
-
-    public IEclipsePreferences getProjectPreferences(final IJavaProject project) {
-        IScopeContext projectScope = new ProjectScope(project.getProject());
-        IEclipsePreferences projectNode = projectScope.getNode(ID);
-        return projectNode;
-
-    }
-
-    public static void beginChanges() {
-        _inChange = true;
-    }
-
-    public static void commitChanges() {
-        _inChange = false;
-        for (Iterator iter = _todo.iterator(); iter.hasNext();) {
-            IJavaProject project = (IJavaProject) iter.next();
-            IvyClasspathContainer.resolve(project);
-        }
-    }
-
-    private static void resolve(IJavaProject project) {
-        if (_inChange) {
-            _todo.add(project);
-        } else {
-            IvyClasspathContainer.resolve(project);
-        }
-    }
-
-    public void register(IvyClasspathContainer container) {
-        _containers.put(container.getProject().getProject().getName() + "/" + container.getPath(),
-            container);
-    }
-
-    public Collection getAllContainers() {
-        Message.debug("all known ivy classpath containers are: " + _containers.keySet());
-        return _containers.values();
-    }
-
 }
Index: src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAllAction.java	(copie de travail)
@@ -1,15 +1,22 @@
 package org.apache.ivyde.eclipse.ui.actions;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -31,7 +38,21 @@
     public void run(IAction action) {
         Job resolveAllJob = new Job("Resolve all dependencies") {
             protected IStatus run(IProgressMonitor monitor) {
-                Collection containers = IvyPlugin.getDefault().getAllContainers();
+                IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
+                IJavaProject[] projects;
+                try {
+                    projects = model.getJavaProjects();
+                } catch (JavaModelException e) {
+                    return new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
+                            "Unable to get the list of available java projects", e);
+                }
+                List containers = new ArrayList();
+                for (int i = 0; i < projects.length; i++) {
+                    IvyClasspathContainer cp = IvyClasspathUtil.getIvyClasspathContainer(projects[i]);
+                    if (cp != null) {
+                        containers.add(cp);
+                    }
+                }
                 monitor.beginTask("Resolve all dependencies", containers.size());
                 for (Iterator iter = containers.iterator(); iter.hasNext();) {
                     if (monitor.isCanceled()) {
Index: src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/actions/RefreshAction.java	(copie de travail)
@@ -34,7 +34,7 @@
             return;
         }
         if (cp != null) {
-            cp.refresh();
+            cp.scheduleRefresh();
         }
     }
 
Index: src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/actions/ResolveAction.java	(copie de travail)
@@ -34,7 +34,7 @@
             return;
         }
         if (cp != null) {
-            cp.resolve();
+            cp.scheduleResolve();
         }
     }
 
Index: src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java	(copie de travail)
@@ -1,3 +1,20 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package org.apache.ivyde.eclipse.ui.preferences;
 
 import java.io.File;
@@ -33,6 +50,9 @@
 public class IvyPreferencePage extends FieldEditorPreferencePage implements
         IWorkbenchPreferencePage {
 
+    /** the ID of the preference page */
+    public static final String PEREFERENCE_PAGE_ID = "org.apache.ivyde.eclipse.ui.preferences.IvyPreferencePage";
+
     private StringFieldEditor _pattern;
 
     public IvyPreferencePage() {
@@ -62,7 +82,8 @@
         spacer.setText("Runtime option");
         spacer = new Label(fieldParent, SWT.SEPARATOR | SWT.HORIZONTAL);
         spacer.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));
-        addField(new FileFieldEditor(PreferenceConstants.IVYCONF_PATH, "&IvyConf URL:", fieldParent) {
+        addField(new FileFieldEditor(PreferenceConstants.IVYSETTINGS_PATH, "&Ivy settings URL:",
+                fieldParent) {
             /* Opens the file chooser dialog and returns the selected file as an url. */
             protected String changePressed() {
                 String f = super.changePressed();
@@ -87,8 +108,8 @@
         Label explanation = new Label(fieldParent, SWT.NONE);
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
                 1));
-        explanation
-                .setText("The url where your ivyconf file can be found. \nUse default to reference the default ivy configuration.");
+        explanation.setText("The url where your ivyconf file can be found. \n"
+                + "Use default to reference the default ivy configuration.");
         new Label(fieldParent, SWT.NONE).setLayoutData(new GridData(GridData.FILL,
                 GridData.BEGINNING, false, false, 3, 1)); // space
 
@@ -116,7 +137,8 @@
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
                 1));
         explanation
-                .setText("Pattern example: lib/[conf]/[artifact].[ext]\nTo copy artifacts in folder named lib without revision by folder named like configurations");
+                .setText("Pattern example: lib/[conf]/[artifact].[ext]\n"
+                        + "To copy artifacts in folder named lib without revision by folder named like configurations");
         new Label(fieldParent, SWT.NONE).setLayoutData(new GridData(GridData.FILL,
                 GridData.BEGINNING, false, false, 3, 1)); // space
 
@@ -128,7 +150,8 @@
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
                 1));
         explanation
-                .setText("Comma separated list of artifact types to use in IvyDE Managed Dependencies Library\nExample: jar, zip");
+                .setText("Comma separated list of artifact types to use in IvyDE Managed Dependencies Library\n"
+                        + "Example: jar, zip");
 
         addField(new StringFieldEditor(PreferenceConstants.SOURCES_TYPES, "Sources types",
                 fieldParent));
@@ -137,18 +160,18 @@
         explanation = new Label(fieldParent, SWT.NONE);
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
                 1));
-        explanation
-                .setText("Comma separated list of artifact types to be used as sources. \nExample: source, src");
+        explanation.setText("Comma separated list of artifact types to be used as sources. \n"
+                + "Example: source, src");
 
         addField(new StringFieldEditor(PreferenceConstants.SOURCES_SUFFIXES, "Sources suffixes",
-            fieldParent));
+                fieldParent));
 
         new Label(fieldParent, SWT.NONE); // space
         explanation = new Label(fieldParent, SWT.NONE);
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
-            1));
-        explanation
-            .setText("Comma separated list of suffixes to match sources and artifacts. \nExample: -source, -src");
+                1));
+        explanation.setText("Comma separated list of suffixes to match sources and artifacts. \n"
+                + "Example: -source, -src");
 
         addField(new StringFieldEditor(PreferenceConstants.JAVADOC_TYPES, "Javadoc types",
                 fieldParent));
@@ -157,18 +180,18 @@
         explanation = new Label(fieldParent, SWT.NONE);
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
                 1));
-        explanation
-                .setText("Comma separated list of artifact types to be used as javadoc. \nExample: javadoc");
+        explanation.setText("Comma separated list of artifact types to be used as javadoc. \n"
+                + "Example: javadoc");
 
         addField(new StringFieldEditor(PreferenceConstants.JAVADOC_SUFFIXES, "Javadoc suffixes",
-            fieldParent));
+                fieldParent));
 
         new Label(fieldParent, SWT.NONE); // space
         explanation = new Label(fieldParent, SWT.NONE);
         explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,
-            1));
-        explanation
-            .setText("Comma separated list of suffixes to match javadocs and artifacts. \nExample: -javadoc, -doc");
+                1));
+        explanation.setText("Comma separated list of suffixes to match javadocs and artifacts. \n"
+                + "Example: -javadoc, -doc");
 
         spacer = new Label(fieldParent, SWT.NONE);
         spacerData = new GridData();
Index: src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java	(copie de travail)
@@ -5,7 +5,7 @@
  */
 public class PreferenceConstants {
 
-    public static final String IVYCONF_PATH = "ivy_conf_path";
+    public static final String IVYSETTINGS_PATH = "ivy_conf_path";
 
     public static final String ORGANISATION = "ivy_org";
 
@@ -31,6 +31,6 @@
 
     public static final String RETRIEVE_PATTERN = "retreive.pattern";
 
-    public static final String APHABETICAL_ORDER = "order.alphabetical";
+    public static final String ALPHABETICAL_ORDER = "order.alphabetical";
 
 }
Index: src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java	(révision 0)
+++ src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java	(révision 0)
@@ -0,0 +1,92 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.ui.preferences;
+
+import java.util.List;
+
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class IvyDEPreferenceStoreHelper {
+
+    private final IPreferenceStore prefStore;
+
+    public IvyDEPreferenceStoreHelper(IPreferenceStore prefStore) {
+        this.prefStore = prefStore;
+        setDefault();
+    }
+
+    public void setDefault() {
+        prefStore.setDefault(PreferenceConstants.IVYSETTINGS_PATH, "");
+        prefStore.setDefault(PreferenceConstants.ORGANISATION, "");
+        prefStore.setDefault(PreferenceConstants.ORGANISATION_URL, "");
+        prefStore.setDefault(PreferenceConstants.ACCEPTED_TYPES, "jar");
+        prefStore.setDefault(PreferenceConstants.SOURCES_TYPES, "source");
+        prefStore.setDefault(PreferenceConstants.JAVADOC_TYPES, "javadoc");
+        prefStore.setDefault(PreferenceConstants.SOURCES_SUFFIXES, "-source,-sources,-src");
+        prefStore.setDefault(PreferenceConstants.JAVADOC_SUFFIXES, "-javadoc,-javadocs,-doc,-docs");
+        prefStore.setDefault(PreferenceConstants.DO_RETRIEVE, false);
+        prefStore.setDefault(PreferenceConstants.RETRIEVE_PATTERN, "lib/[conf]/[artifact].[ext]");
+        prefStore.setDefault(PreferenceConstants.ALPHABETICAL_ORDER, false);
+    }
+
+    public String getIvyOrg() {
+        return prefStore.getString(PreferenceConstants.ORGANISATION);
+    }
+
+    public String getIvyOrgUrl() {
+        return prefStore.getString(PreferenceConstants.ORGANISATION_URL);
+    }
+
+    public String getIvySettingsPath() {
+        return prefStore.getString(PreferenceConstants.IVYSETTINGS_PATH);
+    }
+
+    public List getAcceptedTypes() {
+        return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.ACCEPTED_TYPES));
+    }
+
+    public List getSourceTypes() {
+        return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.SOURCES_TYPES));
+    }
+
+    public List getJavadocTypes() {
+        return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.JAVADOC_TYPES));
+    }
+
+    public List getSourceSuffixes() {
+        return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.SOURCES_SUFFIXES));
+    }
+
+    public List getJavadocSuffixes() {
+        return IvyClasspathUtil.split(prefStore.getString(PreferenceConstants.JAVADOC_SUFFIXES));
+    }
+
+    public boolean getDoRetrieve() {
+        return prefStore.getBoolean(PreferenceConstants.DO_RETRIEVE);
+    }
+
+    public String getRetreivePattern() {
+        return prefStore.getString(PreferenceConstants.RETRIEVE_PATTERN);
+    }
+
+    public boolean isAlphOrder() {
+        return prefStore.getBoolean(PreferenceConstants.ALPHABETICAL_ORDER);
+    }
+
+}

Modification de propriétés sur src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
___________________________________________________________________
Nom : svn:keywords
   + Date Revision Author HeadURL Id
Nom : svn:eol-style
   + native

Index: src/java/org/apache/ivyde/eclipse/ui/console/IvyConsole.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/console/IvyConsole.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/console/IvyConsole.java	(copie de travail)
@@ -28,6 +28,17 @@
  * implementation
  */
 public class IvyConsole extends MessageConsole implements MessageLogger {
+
+    public static final String PREF_CONSOLE_DEBUG_COLOR = IvyPlugin.ID + ".console.color.debug";
+
+    public static final String PREF_CONSOLE_VERBOSE_COLOR = IvyPlugin.ID + ".console.color.verbose";
+
+    public static final String PREF_CONSOLE_INFO_COLOR = IvyPlugin.ID + ".console.color.info";
+
+    public static final String PREF_CONSOLE_WARN_COLOR = IvyPlugin.ID + ".console.color.warn";
+
+    public static final String PREF_CONSOLE_ERROR_COLOR = IvyPlugin.ID + ".console.color.error";
+
     private MessageConsoleStream[] streams = new MessageConsoleStream[5];
 
     private ConsoleDocument document;
@@ -118,15 +129,15 @@
                 // install colors
                 Color color;
 
-                color = createColor(Display.getDefault(), IvyPlugin.PREF_CONSOLE_DEBUG_COLOR);
+                color = createColor(Display.getDefault(), PREF_CONSOLE_DEBUG_COLOR);
                 streams[Message.MSG_DEBUG].setColor(color);
-                color = createColor(Display.getDefault(), IvyPlugin.PREF_CONSOLE_VERBOSE_COLOR);
+                color = createColor(Display.getDefault(), PREF_CONSOLE_VERBOSE_COLOR);
                 streams[Message.MSG_VERBOSE].setColor(color);
-                color = createColor(Display.getDefault(), IvyPlugin.PREF_CONSOLE_INFO_COLOR);
+                color = createColor(Display.getDefault(), PREF_CONSOLE_INFO_COLOR);
                 streams[Message.MSG_INFO].setColor(color);
-                color = createColor(Display.getDefault(), IvyPlugin.PREF_CONSOLE_WARN_COLOR);
+                color = createColor(Display.getDefault(), PREF_CONSOLE_WARN_COLOR);
                 streams[Message.MSG_WARN].setColor(color);
-                color = createColor(Display.getDefault(), IvyPlugin.PREF_CONSOLE_ERROR_COLOR);
+                color = createColor(Display.getDefault(), PREF_CONSOLE_ERROR_COLOR);
                 streams[Message.MSG_ERR].setColor(color);
 
                 initialized = true;
@@ -168,13 +179,13 @@
         RGB rgb = PreferenceConverter.getColor(IvyPlugin.getDefault().getPreferenceStore(),
             preference);
         if (rgb == PreferenceConverter.COLOR_DEFAULT_DEFAULT) {
-            if (IvyPlugin.PREF_CONSOLE_DEBUG_COLOR.equals(preference)) {
+            if (PREF_CONSOLE_DEBUG_COLOR.equals(preference)) {
                 rgb = new RGB(180, 180, 255);
-            } else if (IvyPlugin.PREF_CONSOLE_VERBOSE_COLOR.equals(preference)) {
+            } else if (PREF_CONSOLE_VERBOSE_COLOR.equals(preference)) {
                 rgb = new RGB(50, 150, 50);
-            } else if (IvyPlugin.PREF_CONSOLE_WARN_COLOR.equals(preference)) {
+            } else if (PREF_CONSOLE_WARN_COLOR.equals(preference)) {
                 rgb = new RGB(255, 80, 20);
-            } else if (IvyPlugin.PREF_CONSOLE_ERROR_COLOR.equals(preference)) {
+            } else if (PREF_CONSOLE_ERROR_COLOR.equals(preference)) {
                 rgb = new RGB(255, 0, 0);
             }
         }
Index: src/java/org/apache/ivyde/eclipse/ui/editors/IvyEditor.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/editors/IvyEditor.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/editors/IvyEditor.java	(copie de travail)
@@ -1,6 +1,24 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
 package org.apache.ivyde.eclipse.ui.editors;
 
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
 import org.apache.ivyde.eclipse.ui.core.IvyFileEditorInput;
 import org.apache.ivyde.eclipse.ui.editors.pages.OverviewFormPage;
 import org.apache.ivyde.eclipse.ui.editors.xml.XMLEditor;
@@ -11,6 +29,8 @@
 import org.eclipse.core.resources.IResourceChangeListener;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
@@ -113,7 +133,11 @@
     public void doSave(IProgressMonitor monitor) {
         xmlEditor.doSave(monitor);
         IFile file = ((IvyFileEditorInput) getEditorInput()).getFile();
-        IvyClasspathContainer.resolveIfNeeded(file);
+        IJavaProject project = JavaCore.create(file.getProject());
+        IvyClasspathContainer cp = IvyClasspathUtil.getIvyClasspathContainer(project);
+        if (cp.getConf().getIvyXmlPath().equals(file.getProjectRelativePath().toString())) {
+            cp.scheduleResolve();
+        }
     }
 
     /**
Index: src/java/org/apache/ivyde/eclipse/ui/properties/IvyProjectPropertyPage.java
===================================================================
--- src/java/org/apache/ivyde/eclipse/ui/properties/IvyProjectPropertyPage.java	(révision 620011)
+++ src/java/org/apache/ivyde/eclipse/ui/properties/IvyProjectPropertyPage.java	(copie de travail)
@@ -1,337 +0,0 @@
-package org.apache.ivyde.eclipse.ui.properties;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import org.apache.ivyde.eclipse.IvyPlugin;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class IvyProjectPropertyPage extends PropertyPage {
-
-    private static final String PATH_TITLE = "Ivy settings url:";
-
-    private static final String ACCEPTED_TYPES_TITLE = "Accepted types:";
-
-    private static final String SOURCES_TYPES_TITLE = "Sources types:";
-
-    private static final String SOURCES_SUFFIXES_TITLE = "Sources suffixes:";
-
-    private static final String JAVADOC_TYPES_TITLE = "Javadoc types:";
-
-    private static final String JAVADOC_SUFFIXES_TITLE = "Javadoc suffixes:";
-
-    private Text _pathValueText;
-
-    private Button _retreiveB;
-
-    private Text _patternT;
-
-    private Text _acceptedTypesText;
-
-    private Text _sourcesTypesText;
-
-    private Text _javadocTypesText;
-
-    private Text _sourcesSuffixesText;
-
-    private Text _javadocSuffixesText;
-
-    private Button _alphaOrder;
-    
-    public IvyProjectPropertyPage() {
-        super();
-    }
-
-    private void addMainSection(Composite parent) {
-        Composite composite = createDefaultComposite(parent);
-
-        // Label for path field
-        Label pathLabel = new Label(composite, SWT.NONE);
-        pathLabel.setText(PATH_TITLE);
-
-        _pathValueText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        String ivyconfURL = IvyPlugin.getStrictIvyconfURL(getJavaProject());
-        if (ivyconfURL == null) {
-            ivyconfURL = getDefaultIvyconfURLForDisplay();
-        }
-        _pathValueText.setText(ivyconfURL);
-        _pathValueText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false,
-                2, 1));
-
-        Button btn = new Button(composite, SWT.NONE);
-        btn.setText("Browse");
-        btn.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(SelectionEvent e) {
-                File f = getFile(new File("/"));
-                if (f != null) {
-                    try {
-                        _pathValueText.setText(f.toURL().toExternalForm());
-                    } catch (MalformedURLException e1) {
-                    }
-                }
-            }
-        });
-
-        new Label(composite, SWT.NONE); // space
-        Label explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation
-                .setText("The url where your ivysettings file can be found. \nUse 'default' to reference the default ivy settings. \nUse '[inherited]' to use your general eclipse setting.\nRelative paths are handled relative to the project. Example: 'file://./ivysettings.xml'.");
-        new Label(composite, SWT.NONE).setLayoutData(new GridData(GridData.FILL,
-                GridData.BEGINNING, false, false, 4, 1)); // space
-
-        Label acceptedTypesLabel = new Label(composite, SWT.NONE);
-        acceptedTypesLabel.setText(ACCEPTED_TYPES_TITLE);
-
-        _acceptedTypesText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _acceptedTypesText.setText(IvyPlugin.getAcceptedTypesString(getJavaProject()));
-        _acceptedTypesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true,
-                false, 3, 1));
-
-        new Label(composite, SWT.NONE); // space
-        explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation
-                .setText("Comma separated list of artifact types to use in IvyDE Managed Dependencies Library.\nExample: jar, zip\nUse [inherited] to use your general eclise setting.");
-
-        Label sourcesTypesLabel = new Label(composite, SWT.NONE);
-        sourcesTypesLabel.setText(SOURCES_TYPES_TITLE);
-
-        _sourcesTypesText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _sourcesTypesText.setText(IvyPlugin.getSourcesTypesString(getJavaProject()));
-        _sourcesTypesText
-                .setToolTipText("Example: source, src\nUse [inherited] to use your general eclise setting.");
-        _sourcesTypesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true,
-                false, 3, 1));
-
-        new Label(composite, SWT.NONE); // space
-        explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation.setText("Comma separated list of artifact types to be used as sources.");
-
-        Label sourcesSuffixesLabel = new Label(composite, SWT.NONE);
-        sourcesSuffixesLabel.setText(SOURCES_SUFFIXES_TITLE);
-
-        _sourcesSuffixesText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _sourcesSuffixesText.setText(IvyPlugin.getSourcesSuffixesString(getJavaProject()));
-        _sourcesSuffixesText
-                .setToolTipText("Example: -source, -src\nUse [inherited] to use your general eclise setting.");
-        _sourcesSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true,
-                false, 3, 1));
-
-        new Label(composite, SWT.NONE); // space
-        explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation.setText("Comma separated list of suffixes to match sources to artifacts.");
-
-        Label javadocTypesLabel = new Label(composite, SWT.NONE);
-        javadocTypesLabel.setText(JAVADOC_TYPES_TITLE);
-
-        _javadocTypesText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _javadocTypesText.setText(IvyPlugin.getJavadocTypesString(getJavaProject()));
-        _javadocTypesText
-                .setToolTipText("Example: javadoc\nUse [inherited] to use your general eclise setting.");
-        _javadocTypesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true,
-                false, 3, 1));
-
-        new Label(composite, SWT.NONE); // space
-        explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation.setText("Comma separated list of artifact types to be used as javadoc.");
-
-        Label javadocSuffixesLabel = new Label(composite, SWT.NONE);
-        javadocSuffixesLabel.setText(JAVADOC_TYPES_TITLE);
-
-        _javadocSuffixesText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _javadocSuffixesText.setText(IvyPlugin.getJavadocSuffixesString(getJavaProject()));
-        _javadocSuffixesText
-                .setToolTipText("Example: -javadoc, -doc\nUse [inherited] to use your general eclise setting.");
-        _javadocSuffixesText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true,
-                false, 3, 1));
-
-        new Label(composite, SWT.NONE); // space
-        explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation.setText("Comma separated list of suffixes to match javadocs to artifacts.");
-
-        new Label(composite, SWT.NONE).setLayoutData(new GridData(GridData.FILL,
-                GridData.BEGINNING, false, false, 4, 1)); // space
-
-        _retreiveB = new Button(composite, SWT.CHECK);
-        _retreiveB.setText("Do retrieve after resolve");
-        _retreiveB
-                .setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 4, 1));
-
-        new Label(composite, SWT.NONE).setText("Pattern:");
-        _patternT = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        _patternT.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false, 3, 1));
-        _retreiveB.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(SelectionEvent e) {
-                _patternT.setEnabled(_retreiveB.getSelection());
-            }
-        });
-        _retreiveB.setSelection(IvyPlugin.shouldDoRetrieve(getJavaProject()));
-        _patternT.setEnabled(_retreiveB.getSelection());
-        _patternT.setText(IvyPlugin.getRetrievePatternHerited(getJavaProject()));
-
-        new Label(composite, SWT.NONE); // space
-        explanation = new Label(composite, SWT.NONE);
-        explanation.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 3,
-                1));
-        explanation
-                .setText("Example: lib/[conf]/[artifact].[ext]\nTo copy artifacts in folder named lib without revision by folder named like configurations\nUse [inherited] to use your general eclipse setting.");
-
-        new Label(composite, SWT.NONE).setLayoutData(new GridData(GridData.FILL,
-                GridData.BEGINNING, false, false, 4, 1)); // space
-
-        _alphaOrder = new Button(composite, SWT.CHECK);
-        _alphaOrder.setText("Order alphabetically the artifacts in the classpath container");
-        _alphaOrder
-                .setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 4, 1));
-        _alphaOrder.setSelection(IvyPlugin.isAlphaOrder(getJavaProject()));
-
-        new Label(composite, SWT.NONE).setLayoutData(new GridData(GridData.FILL,
-                GridData.BEGINNING, false, false, 4, 1)); // space
-    }
-
-    /**
-     * Try to get a JavaProject from the getElement() result. Throws a IllegalStateException if it
-     * can't succeed.
-     * 
-     * @return
-     */
-    private IJavaProject getJavaProject() {
-        IAdaptable adaptable = getElement();
-        IJavaProject project = null;
-        if (adaptable instanceof IJavaProject) {
-            project = (IJavaProject) adaptable;
-        } else if (adaptable instanceof IProject) {
-            project = JavaCore.create((IProject) adaptable);
-        } else {
-            throw new IllegalStateException("Attempting a IProject element ! Not "
-                    + adaptable.getClass().getName() + " element");
-        }
-        return project;
-    }
-
-    /**
-     * Helper to open the file chooser dialog.
-     * 
-     * @param startingDirectory
-     *            the directory to open the dialog on.
-     * @return File The File the user selected or <code>null</code> if they do not.
-     */
-    private File getFile(File startingDirectory) {
-
-        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
-        if (startingDirectory != null)
-            dialog.setFileName(startingDirectory.getPath());
-        dialog.setFilterExtensions(new String[] {"*.xml", "*"});
-        String file = dialog.open();
-        if (file != null) {
-            file = file.trim();
-            if (file.length() > 0)
-                return new File(file);
-        }
-
-        return null;
-    }
-
-    /**
-     * @see PreferencePage#createContents(Composite)
-     */
-    protected Control createContents(Composite parent) {
-        Composite composite = new Composite(parent, SWT.NONE);
-        GridLayout layout = new GridLayout(1, false);
-        composite.setLayout(layout);
-        GridData data = new GridData(GridData.FILL);
-        data.grabExcessHorizontalSpace = true;
-        composite.setLayoutData(data);
-
-        addMainSection(composite);
-        return composite;
-    }
-
-    private Composite createDefaultComposite(Composite parent) {
-        Composite composite = new Composite(parent, SWT.NULL);
-        GridLayout layout = new GridLayout();
-        layout.numColumns = 4;
-        composite.setLayout(layout);
-
-        GridData data = new GridData();
-        data.grabExcessHorizontalSpace = true;
-        data.verticalAlignment = GridData.FILL;
-        data.horizontalAlignment = GridData.FILL;
-        composite.setLayoutData(data);
-
-        return composite;
-    }
-
-    protected void performDefaults() {
-        _pathValueText.setText(getDefaultIvyconfURLForDisplay());
-        _retreiveB.setSelection(false);
-        _alphaOrder.setSelection(false);
-        _patternT.setText("");
-        _acceptedTypesText.setText("[inherited]");
-        _sourcesTypesText.setText("[inherited]");
-        _sourcesSuffixesText.setText("[inherited]");
-        _javadocTypesText.setText("[inherited]");
-        _javadocSuffixesText.setText("[inherited]");
-    }
-
-    private String getDefaultIvyconfURLForDisplay() {
-        return "[inherited] " + IvyPlugin.getIvyconfURL();
-    }
-
-    public boolean performOk() {
-        IvyPlugin.beginChanges();
-        try {
-            // store the value in the owner text field
-            String text = _pathValueText.getText();
-            if (text.startsWith("[inherited] ") || text.trim().length() == 0) {
-                text = null;
-            }
-            IvyPlugin.setIvyconfURL(getJavaProject(), text);
-
-            // retreive per project
-            if (_retreiveB.getSelection()) {
-                IvyPlugin.setRetreivePattern(getJavaProject(), _patternT.getText());
-            } else {
-                IvyPlugin.setRetreivePattern(getJavaProject(), "");
-            }
-
-            IvyPlugin.setAlphaOrder(getJavaProject(), _alphaOrder.getSelection());
-            IvyPlugin.setAcceptedTypes(getJavaProject(), _acceptedTypesText.getText());
-            IvyPlugin.setSourcesTypes(getJavaProject(), _sourcesTypesText.getText());
-            IvyPlugin.setSourcesSuffixes(getJavaProject(), _sourcesSuffixesText.getText());
-            IvyPlugin.setJavadocTypes(getJavaProject(), _javadocTypesText.getText());
-            IvyPlugin.setJavadocSuffixes(getJavaProject(), _javadocSuffixesText.getText());
-            return true;
-        } finally {
-            IvyPlugin.commitChanges();
-        }
-    }
-
-}
Index: plugin.xml
===================================================================
--- plugin.xml	(révision 620011)
+++ plugin.xml	(copie de travail)
@@ -113,31 +113,6 @@
       </initializer>
    </extension>
    
-   <extension
-         point="org.eclipse.ui.propertyPages">
-      <page
-            objectClass="org.eclipse.core.resources.IProject"
-            class="org.apache.ivyde.eclipse.ui.properties.IvyProjectPropertyPage"
-            id="org.apache.ivyde.eclipse.properties.ivyProjectPropertyPage"
-            name="Ivy">
-         <filter
-               name="nature"
-               value="org.eclipse.jdt.core.javanature">
-         </filter>
-         <keywordReference id="org.eclipse.jdt.ui.buildpath"/>
-      </page>
-      <page
-            objectClass="org.eclipse.jdt.core.IJavaProject"
-            class="org.apache.ivyde.eclipse.ui.properties.IvyProjectPropertyPage"
-            id="org.apache.ivyde.eclipse.properties.ivyProjectPropertyPage"
-            name="Ivy">
-         <filter
-               name="nature"
-               value="org.eclipse.jdt.core.javanature">
-         </filter>
-         <keywordReference id="org.eclipse.jdt.ui.buildpath"/>
-      </page>
-   </extension>
    
 	<extension 
 	   point="org.eclipse.ui.views">
Index: META-INF/MANIFEST.MF
===================================================================
--- META-INF/MANIFEST.MF	(révision 620011)
+++ META-INF/MANIFEST.MF	(copie de travail)
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: IvyDE Eclipse Plug-in
 Bundle-SymbolicName: org.apache.ivyde.eclipse; singleton:=true
-Bundle-Version: 1.3.0.20071219120000
+Bundle-Version: 1.3.0.20080114120000
 Bundle-ClassPath: ivyde-eclipse.jar
 Bundle-Activator: org.apache.ivyde.eclipse.IvyPlugin
 Bundle-Vendor: Apache Software Foundation
@@ -20,7 +20,6 @@
  org.apache.ivyde.eclipse.ui.editors.pages,
  org.apache.ivyde.eclipse.ui.editors.xml,
  org.apache.ivyde.eclipse.ui.preferences,
- org.apache.ivyde.eclipse.ui.properties,
  org.apache.ivyde.eclipse.ui.search,
  org.apache.ivyde.eclipse.ui.views,
  org.apache.ivyde.eclipse.ui.wizards
