felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r990188 - in /felix/trunk/sigil: common/core/src/org/apache/felix/sigil/common/config/ eclipse/core/ eclipse/core/src/org/apache/felix/sigil/eclipse/ eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/ eclipse/core/src/o...
Date Fri, 27 Aug 2010 16:13:58 GMT
Author: dsavage
Date: Fri Aug 27 16:13:57 2010
New Revision: 990188

URL: http://svn.apache.org/viewvc?rev=990188&view=rev
Log:
further work on FELIX-1355, also tidied up repository preferences as part of FELIX-1649

Added:
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryPreferences.java
      - copied, changed from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/preferences/
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/preferences/SigilPreferencesInitializer.java
      - copied, changed from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryConfig.java
      - copied, changed from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/EclipseRepositoryConfig.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/IRepositoryMap.java
      - copied, changed from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/IRepositoryMap.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryPreferences.java
      - copied, changed from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryConfiguration.java
Removed:
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/EclipseRepositoryConfig.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/IRepositoryMap.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryConfiguration.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositorySet.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/RepositorySet.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetDialog.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositorySetsView.java
Modified:
    felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java
    felix/trunk/sigil/eclipse/core/plugin.xml
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/SigilCore.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilModelRoot.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilProject.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/GlobalRepositoryManager.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/SigilRepositoryManager.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryManager.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/RepositoryMap.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/ProjectResourceListener.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/SigilProjectManager.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/ISigilProjectModel.java
    felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
    felix/trunk/sigil/eclipse/runtime/src/org/apache/felix/sigil/eclipse/runtime/OSGiLauncher.java
    felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/SigilSearch.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/actions/RefreshRepositoryAction.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/handlers/project/RefreshSigilClasspathCommandHandler.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/RepositoryViewPart.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/resolution/BundleResolverView.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ExportedPackageFinder.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ModelLabelProvider.java
    felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ResourcesDialogHelper.java
    felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java

Modified: felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java (original)
+++ felix/trunk/sigil/common/core/src/org/apache/felix/sigil/common/config/BldProject.java Fri Aug 27 16:13:57 2010
@@ -30,7 +30,6 @@ import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.URI;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -664,6 +663,11 @@ public class BldProject implements IBldP
 
         Properties repo = config.getProps(null, name);
 
+        if ( repo.isEmpty() ) {
+            // XXX getProps returns and empty props vs null if not found?
+            return null;
+        }
+        
         for (Object k : repo.keySet())
         {
             String key = (String) k;

Modified: felix/trunk/sigil/eclipse/core/plugin.xml
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/plugin.xml?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/plugin.xml (original)
+++ felix/trunk/sigil/eclipse/core/plugin.xml Fri Aug 27 16:13:57 2010
@@ -65,7 +65,7 @@
    <extension
          point="org.eclipse.core.runtime.preferences">
       <initializer
-            class="org.apache.felix.sigil.eclipse.preferences.SigilPreferencesInitializer">
+            class="org.apache.felix.sigil.eclipse.internal.preferences.SigilPreferencesInitializer">
       </initializer>
    </extension>
    <extension

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/SigilCore.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/SigilCore.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/SigilCore.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/SigilCore.java Fri Aug 27 16:13:57 2010
@@ -44,14 +44,14 @@ import org.apache.felix.sigil.eclipse.in
 import org.apache.felix.sigil.eclipse.internal.install.OSGiInstallManager;
 import org.apache.felix.sigil.eclipse.internal.model.project.SigilModelRoot;
 import org.apache.felix.sigil.eclipse.internal.model.project.SigilProject;
-import org.apache.felix.sigil.eclipse.internal.model.repository.RepositoryConfiguration;
+import org.apache.felix.sigil.eclipse.internal.model.repository.RepositoryPreferences;
 import org.apache.felix.sigil.eclipse.internal.repository.eclipse.GlobalRepositoryManager;
 import org.apache.felix.sigil.eclipse.internal.repository.manager.RepositoryMap;
 import org.apache.felix.sigil.eclipse.internal.resources.ProjectResourceListener;
 import org.apache.felix.sigil.eclipse.internal.resources.SigilProjectManager;
 import org.apache.felix.sigil.eclipse.model.project.ISigilModelRoot;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositoryConfiguration;
+import org.apache.felix.sigil.eclipse.model.repository.IRepositoryPreferences;
 import org.apache.felix.sigil.eclipse.model.util.JavaHelper;
 import org.eclipse.core.resources.ICommand;
 import org.eclipse.core.resources.IProject;
@@ -145,7 +145,7 @@ public class SigilCore extends AbstractU
     private ServiceTracker descriptorTracker;
     private ServiceTracker registryTracker;
     private ServiceTracker serializerTracker;
-    private static IRepositoryConfiguration repositoryConfig;
+    private static IRepositoryPreferences repositoryPrefs;
     private static SigilProjectManager projectManager;
     private static OSGiInstallManager installs;
     private static ISigilModelRoot modelRoot;
@@ -270,7 +270,7 @@ public class SigilCore extends AbstractU
 
         modelRoot = new SigilModelRoot();
 
-        repositoryConfig = new RepositoryConfiguration();
+        repositoryPrefs = new RepositoryPreferences();
 
         installs = new OSGiInstallManager();
 
@@ -428,23 +428,24 @@ public class SigilCore extends AbstractU
         if ( model == null ) return globalRepositoryManager;
         try
         {
-            return model.getRepositoryManager(repositoryMap);
+            return projectManager.getRepositoryManager(model, repositoryMap);
         }
         catch (CoreException e)
         {
-            warn("Failed to build repository manager for " + model, e);
+            SigilCore.error("Failed to read repository config", e);
             return globalRepositoryManager;
-        }
+        }        
     }
 
-    public static IRepositoryConfiguration getRepositoryConfiguration()
+    public static IRepositoryPreferences getRepositoryPreferences()
     {
-        return repositoryConfig;
+        return repositoryPrefs;
     }
 
     public static void rebuildAllBundleDependencies(IProgressMonitor monitor)
     {
         Collection<ISigilProjectModel> projects = getRoot().getProjects();
+        
         if (!projects.isEmpty())
         {
             SubMonitor progress = SubMonitor.convert(monitor, projects.size() * 20);
@@ -480,7 +481,7 @@ public class SigilCore extends AbstractU
     {
         try
         {
-            dependent.resetClasspath(progress.newChild(10));
+            dependent.resetClasspath(progress.newChild(10), false);
             dependent.getProject().build(IncrementalProjectBuilder.FULL_BUILD,
                 progress.newChild(10));
         }

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilModelRoot.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilModelRoot.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilModelRoot.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilModelRoot.java Fri Aug 27 16:13:57 2010
@@ -93,7 +93,7 @@ public class SigilModelRoot implements I
                         else if (element instanceof ILibraryImport)
                         {
                             ILibraryImport l = (ILibraryImport) element;
-                            ILibrary lib = SigilCore.getRepositoryManager(sigil).resolveLibrary(
+                            ILibrary lib = sigil.getRepositoryManager().resolveLibrary(
                                 l);
 
                             if (lib != null)

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilProject.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilProject.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilProject.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/SigilProject.java Fri Aug 27 16:13:57 2010
@@ -51,9 +51,7 @@ import org.apache.felix.sigil.common.rep
 import org.apache.felix.sigil.common.repository.ResolutionException;
 import org.apache.felix.sigil.eclipse.PathUtil;
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.eclipse.internal.repository.manager.EclipseRepositoryManager;
 import org.apache.felix.sigil.eclipse.job.ThreadProgressMonitor;
-import org.apache.felix.sigil.eclipse.model.project.IRepositoryMap;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.apache.felix.sigil.eclipse.model.util.JavaHelper;
 import org.apache.felix.sigil.eclipse.progress.ProgressAdapter;
@@ -178,7 +176,7 @@ public class SigilProject extends Abstra
     {
         SubMonitor progress = SubMonitor.convert(monitor, 100);
 
-        IRepositoryManager manager = SigilCore.getRepositoryManager(this);
+        IRepositoryManager manager = getRepositoryManager();
         ResolutionConfig config = new ResolutionConfig(ResolutionConfig.INCLUDE_OPTIONAL
             | ResolutionConfig.IGNORE_ERRORS);
 
@@ -444,8 +442,12 @@ public class SigilProject extends Abstra
         return "SigilProject[" + getSymbolicName() + ":" + getVersion() + "]";
     }
 
-    public void resetClasspath(IProgressMonitor monitor) throws CoreException
+    public void resetClasspath(IProgressMonitor monitor, boolean forceResolve) throws CoreException
     {
+        if (forceResolve) {
+            processRequirementsChanges(monitor);
+        }
+        
         Path containerPath = new Path(SigilCore.CLASSPATH_CONTAINER_PATH);
         IJavaProject java = getJavaModel();
         ClasspathContainerInitializer init = JavaCore.getClasspathContainerInitializer(SigilCore.CLASSPATH_CONTAINER_PATH);
@@ -493,7 +495,7 @@ public class SigilProject extends Abstra
                     IRequiredBundle rb = (IRequiredBundle) element;
                     try
                     {
-                        IRepositoryManager manager = SigilCore.getRepositoryManager(SigilProject.this);
+                        IRepositoryManager manager = SigilProject.this.getRepositoryManager();
                         ResolutionConfig config = new ResolutionConfig(
                             ResolutionConfig.IGNORE_ERRORS);
                         IResolution res = manager.getBundleResolver().resolve(rb, config,
@@ -683,12 +685,6 @@ public class SigilProject extends Abstra
         }
     }
     
-    public IRepositoryManager getRepositoryManager(IRepositoryMap repositoryMap) throws CoreException {
-        IRepositoryConfig config = getRepositoryConfig();
-        config = new EclipseRepositoryConfig(config);
-        return new EclipseRepositoryManager(config, repositoryMap);
-    }
-    
     public boolean isInBundleClasspath(IPackageFragment root) throws JavaModelException
     {
         if (getBundle().getClasspathEntrys().isEmpty())
@@ -712,4 +708,12 @@ public class SigilProject extends Abstra
             return getBundle().getClasspathEntrys().contains(enc.trim());
         }
     }
+
+    /* (non-Javadoc)
+     * @see org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel#getRepositoryManager()
+     */
+    public IRepositoryManager getRepositoryManager()
+    {
+        return SigilCore.getRepositoryManager(this);
+    }
 }

Copied: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryPreferences.java (from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java)
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryPreferences.java?p2=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryPreferences.java&p1=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java&r1=989695&r2=990188&rev=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryConfiguration.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/repository/RepositoryPreferences.java Fri Aug 27 16:13:57 2010
@@ -23,6 +23,8 @@ import java.io.File;
 import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.List;
@@ -30,11 +32,9 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositoryConfiguration;
+import org.apache.felix.sigil.eclipse.model.repository.IRepositoryPreferences;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositorySet;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryType;
-import org.apache.felix.sigil.eclipse.model.repository.RepositorySet;
 import org.apache.felix.sigil.eclipse.preferences.PrefsUtils;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
@@ -48,19 +48,21 @@ import org.eclipse.jface.preference.Pref
 import org.eclipse.swt.graphics.Image;
 import org.osgi.framework.Bundle;
 
-public class RepositoryConfiguration implements IRepositoryConfiguration
+public class RepositoryPreferences implements IRepositoryPreferences
 {
 
     private static final String REPOSITORY = "repository.";
-    private static final String REPOSITORY_SET = REPOSITORY + "set.";
-    private static final String REPOSITORY_SETS = REPOSITORY + "sets";
-    private static final String REPOSITORY_TIMESTAMP = REPOSITORY + "timestamp";
+    private static final String REPOSITORY_ORDER = REPOSITORY + "order";
     private static final String INSTANCES = ".instances";
     private static final String NAME = ".name";
     private static final String LOC = ".loc";
     private static final String TIMESTAMP = ".timestamp";
 
-    public static final String REPOSITORY_DEFAULT_SET = REPOSITORY + "default.set";
+    private static final HashMap<String, String> migrationTable = new HashMap<String, String>();
+    
+    static {
+        migrationTable.put("org.apache.felix.sigil.core.file", "filesystem");
+    }
 
     public List<IRepositoryModel> loadRepositories()
     {
@@ -91,6 +93,27 @@ public class RepositoryConfiguration imp
             }
 
         }
+        
+        final List<String> order = PrefsUtils.stringToList(prefs.getString(REPOSITORY_ORDER));
+        
+        Collections.sort(repositories, new Comparator<IRepositoryModel>() {
+            public int compare(IRepositoryModel o1, IRepositoryModel o2)
+            {
+                int i1 = order.indexOf(o1.getId());
+                int i2 = order.indexOf(o2.getId());
+                
+                if ( i1 < i2 ) {
+                    return -1;
+                }
+                else if ( i1 > i2 ) {
+                    return 1;
+                }
+                else {
+                    return 0;
+                }
+            }
+            
+        });
 
         return repositories;
     }
@@ -118,9 +141,23 @@ public class RepositoryConfiguration imp
         saveRepositoryPreferences(repositories, mapped);
         createNewEntries(mapped, prefs);
         deleteOldEntries(repositories, prefs);
-        // time stamp is used as a signal to the manager
-        // to update its view of the stored repositories
-        timeStamp(prefs);
+        // do this last as it is a signal to preferences
+        // listeners to read repo config
+        setRepositoryOrder(repositories, prefs);
+    }
+
+    /**
+     * @param repositories
+     * @param prefs
+     */
+    private void setRepositoryOrder(List<IRepositoryModel> repositories,
+        IPreferenceStore prefs)
+    {        
+        ArrayList<String> ids = new ArrayList<String>();
+        for(IRepositoryModel model : repositories) {
+            ids.add(model.getId());
+        }
+        prefs.setValue(REPOSITORY_ORDER, PrefsUtils.listToString(ids));
     }
 
     public List<RepositoryType> loadRepositoryTypes()
@@ -139,7 +176,7 @@ public class RepositoryConfiguration imp
                 String type = c.getAttribute("type");
                 boolean dynamic = Boolean.valueOf(c.getAttribute("dynamic"));
                 String icon = c.getAttribute("icon");
-                String provider = c.getAttribute("alias");
+                String provider = c.getAttribute("alias");                
                 Image image = (icon == null || icon.trim().length() == 0) ? null
                     : loadImage(e, icon);
                 repositories.add(new RepositoryType(id, provider, type, dynamic, image));
@@ -159,117 +196,6 @@ public class RepositoryConfiguration imp
         return element;
     }
 
-    public IRepositorySet getDefaultRepositorySet()
-    {
-        ArrayList<IRepositoryModel> reps = new ArrayList<IRepositoryModel>();
-        for (String s : PrefsUtils.stringToArray(getPreferences().getString(
-            REPOSITORY_DEFAULT_SET)))
-        {
-            IRepositoryModel rep = findRepository(s);
-            if (rep == null)
-            {
-                SigilCore.error("Missing repository for " + s);
-            }
-            else
-            {
-                reps.add(rep);
-            }
-        }
-        return new RepositorySet(reps);
-    }
-
-    public IRepositorySet getRepositorySet(String name)
-    {
-        String key = REPOSITORY_SET + name;
-        if (getPreferences().contains(key))
-        {
-            ArrayList<IRepositoryModel> reps = new ArrayList<IRepositoryModel>();
-            for (String s : PrefsUtils.stringToArray(getPreferences().getString(key)))
-            {
-                IRepositoryModel rep = findRepository(s);
-                if (rep == null)
-                {
-                    throw new IllegalStateException("Missing repository for " + s);
-                }
-                reps.add(rep);
-            }
-            return new RepositorySet(reps);
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    public Map<String, IRepositorySet> loadRepositorySets()
-    {
-        IPreferenceStore store = getPreferences();
-
-        HashMap<String, IRepositorySet> sets = new HashMap<String, IRepositorySet>();
-
-        for (String name : PrefsUtils.stringToArray(store.getString(REPOSITORY_SETS)))
-        {
-            String key = REPOSITORY_SET + name;
-            ArrayList<IRepositoryModel> reps = new ArrayList<IRepositoryModel>();
-            for (String s : PrefsUtils.stringToArray(getPreferences().getString(key)))
-            {
-                reps.add(findRepository(s));
-            }
-            sets.put(name, new RepositorySet(reps));
-        }
-
-        return sets;
-    }
-
-    public void saveRepositorySets(Map<String, IRepositorySet> sets)
-    {
-        IPreferenceStore store = getPreferences();
-
-        ArrayList<String> names = new ArrayList<String>();
-
-        for (Map.Entry<String, IRepositorySet> set : sets.entrySet())
-        {
-            String name = set.getKey();
-            String key = REPOSITORY_SET + name;
-            ArrayList<String> ids = new ArrayList<String>();
-            for (IRepositoryModel m : set.getValue().getRepositories())
-            {
-                ids.add(m.getId());
-            }
-            store.setValue(key, PrefsUtils.listToString(ids));
-            names.add(name);
-        }
-
-        for (String name : PrefsUtils.stringToArray(store.getString(REPOSITORY_SETS)))
-        {
-            if (!names.contains(name))
-            {
-                String key = REPOSITORY_SET + name;
-                store.setToDefault(key);
-            }
-        }
-
-        store.setValue(REPOSITORY_SETS, PrefsUtils.listToString(names));
-        timeStamp(store);
-    }
-
-    public void setDefaultRepositorySet(IRepositorySet defaultSet)
-    {
-        ArrayList<String> ids = new ArrayList<String>();
-        for (IRepositoryModel m : defaultSet.getRepositories())
-        {
-            ids.add(m.getId());
-        }
-        IPreferenceStore prefs = getPreferences();
-        prefs.setValue(REPOSITORY_DEFAULT_SET, PrefsUtils.listToString(ids));
-        timeStamp(prefs);
-    }
-
-    private void timeStamp(IPreferenceStore prefs)
-    {
-        prefs.setValue(REPOSITORY_TIMESTAMP, System.currentTimeMillis());
-    }
-
     private IPreferenceStore getPreferences()
     {
         return SigilCore.getDefault().getPreferenceStore();

Copied: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/preferences/SigilPreferencesInitializer.java (from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java)
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/preferences/SigilPreferencesInitializer.java?p2=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/preferences/SigilPreferencesInitializer.java&p1=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java&r1=989695&r2=990188&rev=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/preferences/SigilPreferencesInitializer.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/preferences/SigilPreferencesInitializer.java Fri Aug 27 16:13:57 2010
@@ -17,11 +17,12 @@
  * under the License.
  */
 
-package org.apache.felix.sigil.eclipse.preferences;
+package org.apache.felix.sigil.eclipse.internal.preferences;
 
 import org.apache.felix.sigil.common.osgi.VersionRangeBoundingRule;
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.eclipse.internal.model.repository.RepositoryConfiguration;
+import org.apache.felix.sigil.eclipse.preferences.PrefsUtils;
+import org.apache.felix.sigil.eclipse.preferences.PromptablePreference;
 import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
 import org.eclipse.jface.preference.IPreferenceStore;
 
@@ -35,7 +36,15 @@ public class SigilPreferencesInitializer
     public void initializeDefaultPreferences()
     {
         IPreferenceStore store = SigilCore.getDefault().getPreferenceStore();
+        setUpDefaults(store);
+        migrateOldPreferences(store);
+    }
 
+    /**
+     * @param store
+     */
+    private void setUpDefaults(IPreferenceStore store)
+    {
         store.setDefault(SigilCore.OSGI_INSTALL_CHECK_PREFERENCE, true);
 
         store.setDefault(SigilCore.DEFAULT_VERSION_LOWER_BOUND,
@@ -54,7 +63,14 @@ public class SigilPreferencesInitializer
         store.setDefault(SigilCore.PREFERENCES_REBUILD_PROJECTS,
             PromptablePreference.Prompt.name());
 
-        store.setDefault(RepositoryConfiguration.REPOSITORY_DEFAULT_SET,
+        store.setDefault("repository.order",
             "org.apache.felix.sigil.core.workspaceprovider");
     }
+    
+    /**
+     * @param store
+     */
+    private void migrateOldPreferences(IPreferenceStore store)
+    {
+    }
 }

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/GlobalRepositoryManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/GlobalRepositoryManager.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/GlobalRepositoryManager.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/GlobalRepositoryManager.java Fri Aug 27 16:13:57 2010
@@ -19,27 +19,17 @@
 
 package org.apache.felix.sigil.eclipse.internal.repository.eclipse;
 
-import java.util.List;
-
 import org.apache.felix.sigil.common.repository.IRepositoryManager;
-import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.internal.repository.eclipse.SigilRepositoryManager;
 import org.apache.felix.sigil.eclipse.internal.repository.manager.RepositoryMap;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel;
 
 public class GlobalRepositoryManager extends SigilRepositoryManager implements IRepositoryManager
 {
 
     public GlobalRepositoryManager(RepositoryMap map)
     {
-        super(null, map);
+        super(map);
     }
 
-    @Override
-    protected IRepositoryModel[] findRepositories()
-    {
-        List<IRepositoryModel> repos = SigilCore.getRepositoryConfiguration().loadRepositories();
-        return repos.toArray(new IRepositoryModel[repos.size()]);
-    }
 
 }

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/SigilRepositoryManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/SigilRepositoryManager.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/SigilRepositoryManager.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/eclipse/SigilRepositoryManager.java Fri Aug 27 16:13:57 2010
@@ -24,6 +24,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Properties;
 
 import org.apache.felix.sigil.common.repository.AbstractRepositoryManager;
@@ -33,9 +34,8 @@ import org.apache.felix.sigil.common.rep
 import org.apache.felix.sigil.common.repository.RepositoryException;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.internal.repository.manager.RepositoryMap;
-import org.apache.felix.sigil.eclipse.model.project.IRepositoryMap.RepositoryCache;
+import org.apache.felix.sigil.eclipse.internal.repository.manager.IRepositoryMap.RepositoryCache;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositorySet;
 import org.apache.felix.sigil.eclipse.model.repository.IRepositoryType;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
@@ -50,13 +50,10 @@ import org.eclipse.jface.util.PropertyCh
 public class SigilRepositoryManager extends AbstractRepositoryManager implements IRepositoryManager, IPropertyChangeListener
 {
 
-    private final String repositorySet;
-
     private RepositoryMap cachedRepositories;
 
-    public SigilRepositoryManager(String repositorySet, RepositoryMap cachedRepositories)
+    public SigilRepositoryManager(RepositoryMap cachedRepositories)
     {
-        this.repositorySet = repositorySet;
         this.cachedRepositories = cachedRepositories;
     }
 
@@ -84,7 +81,7 @@ public class SigilRepositoryManager exte
         ArrayList<IBundleRepository> repos = new ArrayList<IBundleRepository>();
         HashSet<String> ids = new HashSet<String>();
 
-        IRepositoryModel[] models = findRepositories();
+        List<IRepositoryModel> models = findRepositories();
         for (IRepositoryModel repo : models)
         {
             try
@@ -141,26 +138,9 @@ public class SigilRepositoryManager exte
         return null;
     }
 
-    protected IRepositoryModel[] findRepositories()
+    protected List<IRepositoryModel> findRepositories()
     {
-        if (repositorySet == null)
-        {
-            return SigilCore.getRepositoryConfiguration().getDefaultRepositorySet().getRepositories();
-        }
-        else
-        {
-            IRepositorySet set = SigilCore.getRepositoryConfiguration().getRepositorySet(
-                repositorySet);
-            if (set == null)
-            {
-                SigilCore.error("Unknown repository set " + repositorySet);
-                return SigilCore.getRepositoryConfiguration().getDefaultRepositorySet().getRepositories();
-            }
-            else
-            {
-                return set.getRepositories();
-            }
-        }
+        return SigilCore.getRepositoryPreferences().loadRepositories();
     }
 
     private IBundleRepository loadRepository(String id, Properties pref,

Copied: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryConfig.java (from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/EclipseRepositoryConfig.java)
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryConfig.java?p2=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryConfig.java&p1=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/EclipseRepositoryConfig.java&r1=989695&r2=990188&rev=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/model/project/EclipseRepositoryConfig.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryConfig.java Fri Aug 27 16:13:57 2010
@@ -17,16 +17,14 @@
  * under the License.
  */
 
-package org.apache.felix.sigil.eclipse.internal.model.project;
+package org.apache.felix.sigil.eclipse.internal.repository.manager;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 
 import org.apache.felix.sigil.common.config.IRepositoryConfig;
@@ -52,8 +50,8 @@ public class EclipseRepositoryConfig imp
      */
     public List<String> getAllRepositories()
     {
-        ArrayList<String> list = new ArrayList<String>(readRepositories().keySet());
-        list.addAll(projectConfig.getAllRepositories());
+        ArrayList<String> list = new ArrayList<String>(projectConfig.getAllRepositories());
+        list.addAll(readRepositoryNames());
         return list;
     }
 
@@ -63,8 +61,8 @@ public class EclipseRepositoryConfig imp
     public Properties getRepositoryConfig(String name)
     {
         Properties props = projectConfig.getRepositoryConfig(name);
-        if ( props.isEmpty() ) {
-            props = readRepositories().get(name);
+        if ( props == null ) {
+            props = readRepositoryConfig(name);
         }
         return props;
     }
@@ -76,7 +74,7 @@ public class EclipseRepositoryConfig imp
     {
         URI def = projectConfig.getRepositoryDefinition(name);
         if ( def == null ) {
-            if ( readRepositories().containsKey(name) ) {
+            if ( readRepositoryNames().contains(name) ) {
                 def = URI.create("sigil:eclipse:preferences");
             }
         }
@@ -91,29 +89,48 @@ public class EclipseRepositoryConfig imp
         return projectConfig.getRepositoryPath();
     }
 
-    private Map<String, Properties> readRepositories() {
-        HashMap<String, Properties> repos = new HashMap<String, Properties>();
+    /**
+     * @return
+     */
+    private static List<String> readRepositoryNames()
+    {
+        List<IRepositoryModel> models = findRepositories();
+        ArrayList<String> repos = new ArrayList<String>(models.size());
+        for (IRepositoryModel repo : models)
+        {
+            String id = repo.getId();
+            repos.add(id);
+        }
+        
+        return repos;
+    }
+
+    private static Properties readRepositoryConfig(String name) {
         IPreferenceStore prefs = SigilCore.getDefault().getPreferenceStore();
 
-        IRepositoryModel[] models = findRepositories();
-        for (IRepositoryModel repo : models)
+        for (IRepositoryModel repo : findRepositories())
         {
             try
             {
                 String id = repo.getId();
-                Properties pref = null;
-                if (repo.getType().isDynamic())
-                {
-                    String instance = "repository." + repo.getType().getId() + "." + id;
-                    String loc = prefs.getString(instance + ".loc");
-                    pref = loadPreferences(loc);
+                if ( name.equals(id) ) {
+                    Properties pref = null;
+                    if (repo.getType().isDynamic())
+                    {
+                        String instance = "repository." + repo.getType().getId() + "." + id;
+                        String loc = prefs.getString(instance + ".loc");
+                        pref = loadPreferences(loc);                     
+                    }
+                    else
+                    {
+                        pref = new Properties();
+                    }
+                    
+                    if (!pref.containsKey(IRepositoryConfig.REPOSITORY_PROVIDER)) {
+                        pref.put(IRepositoryConfig.REPOSITORY_PROVIDER, repo.getType().getProvider());
+                    }
+                    return pref;
                 }
-                else
-                {
-                    pref = new Properties();
-                }
-                
-                repos.put(id, pref);
             }
             catch (IOException e)
             {
@@ -121,15 +138,16 @@ public class EclipseRepositoryConfig imp
             }
         }
         
-        return repos;
+        // ok not found
+        return null;
     }
     
-    private IRepositoryModel[] findRepositories()
+    private static final List<IRepositoryModel> findRepositories()
     {
-        return SigilCore.getRepositoryConfiguration().getDefaultRepositorySet().getRepositories();
+        return SigilCore.getRepositoryPreferences().loadRepositories();
     }
     
-    private Properties loadPreferences(String loc) throws FileNotFoundException,
+    private static final Properties loadPreferences(String loc) throws FileNotFoundException,
     IOException
     {
         FileInputStream in = null;

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryManager.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryManager.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/EclipseRepositoryManager.java Fri Aug 27 16:13:57 2010
@@ -31,14 +31,16 @@ import org.apache.felix.sigil.common.rep
 import org.apache.felix.sigil.common.repository.IRepositoryProvider;
 import org.apache.felix.sigil.common.repository.RepositoryException;
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.eclipse.model.project.IRepositoryMap;
-import org.apache.felix.sigil.eclipse.model.project.IRepositoryMap.RepositoryCache;
+import org.apache.felix.sigil.eclipse.internal.repository.manager.IRepositoryMap.RepositoryCache;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
 
 /**
  * @author dave
  *
  */
-public class EclipseRepositoryManager extends AbstractRepositoryManager
+public class EclipseRepositoryManager extends AbstractRepositoryManager implements IPropertyChangeListener
 {
     private final IRepositoryConfig config;
     private final IRepositoryMap repositoryMap;
@@ -49,9 +51,25 @@ public class EclipseRepositoryManager ex
      */
     public EclipseRepositoryManager(IRepositoryConfig config, IRepositoryMap repositoryMap)
     {
-        this.config = config;
+        this.config = new EclipseRepositoryConfig(config);
         this.repositoryMap = repositoryMap;
     }
+    
+    @Override
+    public void initialise()
+    {
+        super.initialise();
+        SigilCore.getDefault().getPreferenceStore().addPropertyChangeListener(this);
+    }
+
+    public void destroy()
+    {
+        IPreferenceStore prefs = SigilCore.getDefault().getPreferenceStore();
+        if (prefs != null)
+        {
+            prefs.removePropertyChangeListener(this);
+        }
+    }    
 
     /* (non-Javadoc)
      * @see org.apache.felix.sigil.common.repository.AbstractRepositoryManager#loadRepositories()
@@ -91,12 +109,14 @@ public class EclipseRepositoryManager ex
             }
             else {
                 Properties props = config.getRepositoryConfig(name);
-                String uid = config.getRepositoryDefinition(name).toString() + name;
-                IBundleRepository repo = buildRepository(uid, name, props);
-                
-                if ( repo != null ) {
-                    list.add(repo);
-                }                
+                if (props != null) {
+                    String uid = config.getRepositoryDefinition(name).toString() + '#' + name;
+                    IBundleRepository repo = buildRepository(uid, name, props);
+                    
+                    if ( repo != null ) {
+                        list.add(repo);
+                    }
+                }
             }
         }
     }
@@ -122,6 +142,8 @@ public class EclipseRepositoryManager ex
                 SigilCore.log(msg);
             else
                 SigilCore.warn(msg);
+            
+            return null;
         }
 
         try
@@ -169,5 +191,16 @@ public class EclipseRepositoryManager ex
             throw new RepositoryException("Failed to build repositories", e);
         }
     }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+     */
+    public void propertyChange(PropertyChangeEvent event)
+    {
+        if (event.getProperty().equals("repository.order"))
+        {
+            loadRepositories();
+        }
+    }
     
 }

Copied: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/IRepositoryMap.java (from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/IRepositoryMap.java)
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/IRepositoryMap.java?p2=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/IRepositoryMap.java&p1=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/IRepositoryMap.java&r1=989695&r2=990188&rev=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/IRepositoryMap.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/IRepositoryMap.java Fri Aug 27 16:13:57 2010
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.felix.sigil.eclipse.model.project;
+package org.apache.felix.sigil.eclipse.internal.repository.manager;
 
 import java.util.Properties;
 

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/RepositoryMap.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/RepositoryMap.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/RepositoryMap.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/repository/manager/RepositoryMap.java Fri Aug 27 16:13:57 2010
@@ -23,7 +23,6 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 
-import org.apache.felix.sigil.eclipse.model.project.IRepositoryMap;
 
 public class RepositoryMap implements IRepositoryMap
 {

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/ProjectResourceListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/ProjectResourceListener.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/ProjectResourceListener.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/ProjectResourceListener.java Fri Aug 27 16:13:57 2010
@@ -35,11 +35,6 @@ import org.eclipse.core.resources.IResou
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 
-//import org.eclipse.core.runtime.IProgressMonitor;
-//import org.eclipse.core.runtime.IStatus;
-//import org.eclipse.core.runtime.Status;
-//import org.eclipse.core.runtime.jobs.Job;
-
 public class ProjectResourceListener implements IResourceChangeListener
 {
     public static final int EVENT_MASKS = IResourceChangeEvent.PRE_DELETE

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/SigilProjectManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/SigilProjectManager.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/SigilProjectManager.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/internal/resources/SigilProjectManager.java Fri Aug 27 16:13:57 2010
@@ -20,20 +20,26 @@ package org.apache.felix.sigil.eclipse.i
 
 import java.util.HashMap;
 
+import org.apache.felix.sigil.common.config.IRepositoryConfig;
+import org.apache.felix.sigil.common.repository.IRepositoryManager;
 import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.internal.model.project.SigilProject;
+import org.apache.felix.sigil.eclipse.internal.repository.manager.EclipseRepositoryManager;
+import org.apache.felix.sigil.eclipse.internal.repository.manager.IRepositoryMap;
+import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 
 public class SigilProjectManager
 {
-    private static HashMap<IProject, SigilProject> projects = new HashMap<IProject, SigilProject>();
+    private static HashMap<IProject, ISigilProjectModel> projects = new HashMap<IProject, ISigilProjectModel>();
+    private static HashMap<ISigilProjectModel, EclipseRepositoryManager> repositoryManagers = new HashMap<ISigilProjectModel, EclipseRepositoryManager>();
 
-    public SigilProject getSigilProject(IProject project) throws CoreException
+    public ISigilProjectModel getSigilProject(IProject project) throws CoreException
     {
         if (project.hasNature(SigilCore.NATURE_ID))
         {
-            SigilProject p = null;
+            ISigilProjectModel p = null;
             synchronized (projects)
             {
                 p = projects.get(project);
@@ -54,9 +60,35 @@ public class SigilProjectManager
 
     public void flushSigilProject(IProject project)
     {
-        synchronized (project)
+        synchronized (projects)
         {
-            projects.remove(project);
+            ISigilProjectModel model = projects.remove(project);
+            if ( model != null ) {
+                EclipseRepositoryManager manager = repositoryManagers.remove(model);
+                manager.destroy();           
+            }            
+        }
+    }
+
+    /**
+     * @param model
+     * @param repositoryMap 
+     * @throws CoreException 
+     */
+    public IRepositoryManager getRepositoryManager(ISigilProjectModel model, IRepositoryMap repositoryMap) throws CoreException
+    {
+        synchronized( projects ) {
+            EclipseRepositoryManager manager = repositoryManagers.get(model);
+            
+            if ( manager == null ) {
+                IRepositoryConfig config = model.getRepositoryConfig();
+                
+                manager = new EclipseRepositoryManager(config, repositoryMap);
+                
+                repositoryManagers.put(model, manager);
+            }
+            
+            return manager;
         }
     }
 }

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/ISigilProjectModel.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/ISigilProjectModel.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/ISigilProjectModel.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/project/ISigilProjectModel.java Fri Aug 27 16:13:57 2010
@@ -95,7 +95,7 @@ public interface ISigilProjectModel exte
      */
     IJavaProject getJavaModel();
 
-    void resetClasspath(IProgressMonitor monitor) throws CoreException;
+    void resetClasspath(IProgressMonitor monitor, boolean forceResolve) throws CoreException;
 
     IPath findBundleLocation() throws CoreException;
 
@@ -121,9 +121,8 @@ public interface ISigilProjectModel exte
         throws CoreException;
 
     /**
-     * @param repositoryMap 
      * @return
      * @throws CoreException 
      */
-    IRepositoryManager getRepositoryManager(IRepositoryMap repositoryMap) throws CoreException;
+    IRepositoryManager getRepositoryManager();
 }

Copied: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryPreferences.java (from r989695, felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryConfiguration.java)
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryPreferences.java?p2=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryPreferences.java&p1=felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryConfiguration.java&r1=989695&r2=990188&rev=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryConfiguration.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/repository/IRepositoryPreferences.java Fri Aug 27 16:13:57 2010
@@ -20,14 +20,12 @@
 package org.apache.felix.sigil.eclipse.model.repository;
 
 import java.util.List;
-import java.util.Map;
 
 import org.apache.felix.sigil.eclipse.internal.model.repository.RepositoryType;
 import org.eclipse.core.runtime.CoreException;
 
-public interface IRepositoryConfiguration
+public interface IRepositoryPreferences
 {
-
     List<IRepositoryModel> loadRepositories();
 
     IRepositoryModel findRepository(String id);
@@ -37,14 +35,4 @@ public interface IRepositoryConfiguratio
     List<RepositoryType> loadRepositoryTypes();
 
     IRepositoryModel newRepositoryElement(IRepositoryType type);
-
-    IRepositorySet getDefaultRepositorySet();
-
-    void setDefaultRepositorySet(IRepositorySet defaultSet);
-
-    IRepositorySet getRepositorySet(String name);
-
-    Map<String, IRepositorySet> loadRepositorySets();
-
-    void saveRepositorySets(Map<String, IRepositorySet> sets);
 }
\ No newline at end of file

Modified: felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java (original)
+++ felix/trunk/sigil/eclipse/core/src/org/apache/felix/sigil/eclipse/model/util/JavaHelper.java Fri Aug 27 16:13:57 2010
@@ -168,7 +168,7 @@ public class JavaHelper
     {
         final LinkedList<IPackageExport> results = new LinkedList<IPackageExport>();
 
-        SigilCore.getRepositoryManager(project).visit(new IModelWalker()
+        project.getRepositoryManager().visit(new IModelWalker()
         {
             public boolean visit(IModelElement element)
             {
@@ -312,7 +312,7 @@ public class JavaHelper
                 else if (element instanceof IRequiredBundle)
                 {
                     IRequiredBundle rb = (IRequiredBundle) element;
-                    IRepositoryManager manager = SigilCore.getRepositoryManager(project);
+                    IRepositoryManager manager = project.getRepositoryManager();
                     ResolutionConfig config = new ResolutionConfig(
                         ResolutionConfig.INCLUDE_OPTIONAL
                             | ResolutionConfig.IGNORE_ERRORS);
@@ -366,7 +366,7 @@ public class JavaHelper
         IResolution resolution;
         try
         {
-            resolution = SigilCore.getRepositoryManager(sigil).getBundleResolver().resolve(
+            resolution = sigil.getRepositoryManager().getBundleResolver().resolve(
                 sigil, config, new ResolutionMonitorAdapter(monitor));
         }
         catch (ResolutionException e)

Modified: felix/trunk/sigil/eclipse/runtime/src/org/apache/felix/sigil/eclipse/runtime/OSGiLauncher.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/runtime/src/org/apache/felix/sigil/eclipse/runtime/OSGiLauncher.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/runtime/src/org/apache/felix/sigil/eclipse/runtime/OSGiLauncher.java (original)
+++ felix/trunk/sigil/eclipse/runtime/src/org/apache/felix/sigil/eclipse/runtime/OSGiLauncher.java Fri Aug 27 16:13:57 2010
@@ -89,7 +89,7 @@ public class OSGiLauncher extends Abstra
         try
         {
             // TODO need to figure out a sensible repository manager for launch configs
-            IRepositoryManager manager = SigilCore.getRepositoryManager(null);
+            IRepositoryManager manager = SigilCore.getGlobalRepositoryManager();
             client.apply(form.resolve(new RuntimeBundleResolver(manager, config)));
         }
         catch (Exception e)

Modified: felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/SigilSearch.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/SigilSearch.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/SigilSearch.java (original)
+++ felix/trunk/sigil/eclipse/search/src/org/apache/felix/sigil/search/SigilSearch.java Fri Aug 27 16:13:57 2010
@@ -125,12 +125,12 @@ public class SigilSearch extends Abstrac
             if (index == null)
             {
                 index = new Index();
-                for (IBundleRepository rep : SigilCore.getRepositoryManager(sigil).getRepositories())
+                for (IBundleRepository rep : sigil.getRepositoryManager().getRepositories())
                 {
                     index(index, rep);
                 }
 
-                SigilCore.getRepositoryManager(sigil).addRepositoryChangeListener(
+                sigil.getRepositoryManager().addRepositoryChangeListener(
                     new IRepositoryChangeListener()
                     {
                         public void repositoryChanged(RepositoryChangeEvent event)

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/actions/RefreshRepositoryAction.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/actions/RefreshRepositoryAction.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/actions/RefreshRepositoryAction.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/actions/RefreshRepositoryAction.java Fri Aug 27 16:13:57 2010
@@ -72,7 +72,7 @@ public class RefreshRepositoryAction ext
                     SubMonitor sub = SubMonitor.convert(monitor, projects.size() * 10);
                     for (ISigilProjectModel p : projects)
                     {
-                        p.resetClasspath(sub.newChild(10));
+                        p.resetClasspath(sub.newChild(10), false);
                     }
                 }
             }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/handlers/project/RefreshSigilClasspathCommandHandler.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/handlers/project/RefreshSigilClasspathCommandHandler.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/handlers/project/RefreshSigilClasspathCommandHandler.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/handlers/project/RefreshSigilClasspathCommandHandler.java Fri Aug 27 16:13:57 2010
@@ -53,7 +53,7 @@ public class RefreshSigilClasspathComman
                         throws CoreException, InvocationTargetException,
                         InterruptedException
                     {
-                        model.resetClasspath(monitor);
+                        model.resetClasspath(monitor, true);
                     }
                 };
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesPreferencePage.java Fri Aug 27 16:13:57 2010
@@ -20,9 +20,7 @@
 package org.apache.felix.sigil.eclipse.ui.internal.preferences.repository;
 
 import org.apache.felix.sigil.eclipse.SigilCore;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositoryConfiguration;
-import org.apache.felix.sigil.eclipse.model.repository.IRepositorySet;
-import org.apache.felix.sigil.eclipse.model.repository.RepositorySet;
+import org.apache.felix.sigil.eclipse.model.repository.IRepositoryPreferences;
 import org.apache.felix.sigil.eclipse.ui.internal.preferences.ProjectDependentPreferencesPage;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -41,7 +39,6 @@ public class RepositoriesPreferencePage 
 
     private boolean changed;
     private RepositoriesView viewPage;
-    private RepositorySetsView setPage;
 
     public RepositoriesPreferencePage()
     {
@@ -70,7 +67,6 @@ public class RepositoriesPreferencePage 
     private Control initContents(Composite parent)
     {
         viewPage = new RepositoriesView(this);
-        setPage = new RepositorySetsView(this);
 
         Composite control = new Composite(parent, SWT.NONE);
 
@@ -80,10 +76,6 @@ public class RepositoriesPreferencePage 
         view.setText("Repositories");
         view.setControl(viewPage.createContents(folder));
 
-        TabItem sets = new TabItem(folder, SWT.NONE);
-        sets.setText("Sets");
-        sets.setControl(setPage.createContents(folder));
-
         control.setLayout(new GridLayout(1, true));
         folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
 
@@ -101,12 +93,8 @@ public class RepositoriesPreferencePage 
     {
         try
         {
-            IRepositoryConfiguration config = SigilCore.getRepositoryConfiguration();
+            IRepositoryPreferences config = SigilCore.getRepositoryPreferences();
             config.saveRepositories(viewPage.getRepositories());
-            config.saveRepositorySets(setPage.getSets());
-            IRepositorySet defaultSet = new RepositorySet(
-                setPage.getDefaultRepositories());
-            config.setDefaultRepositorySet(defaultSet);
 
             setErrorMessage(null);
             getApplyButton().setEnabled(false);

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoriesView.java Fri Aug 27 16:13:57 2010
@@ -34,6 +34,7 @@ import org.eclipse.jface.viewers.ISelect
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.window.Window;
 import org.eclipse.jface.wizard.WizardDialog;
@@ -98,11 +99,11 @@ public class RepositoriesView
 
         // Layout
         composite.setLayout(new GridLayout(2, false));
-        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 6));
+        table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 7));
 
         createButtons(composite, repositoryView);
 
-        repositories = SigilCore.getRepositoryConfiguration().loadRepositories();
+        repositories = SigilCore.getRepositoryPreferences().loadRepositories();
         repositoryView.setInput(repositories);
 
         return composite;
@@ -114,10 +115,18 @@ public class RepositoriesView
         add.setText("Add...");
         add.setEnabled(true);
 
+        final Button upBtn = new Button(composite, SWT.PUSH);
+        upBtn.setText("Up");
+        upBtn.setEnabled(false);
+
+        final Button downBtn = new Button(composite, SWT.PUSH);
+        downBtn.setText("Down");
+        downBtn.setEnabled(false);
+        
         final Button edit = new Button(composite, SWT.PUSH);
         edit.setText("Edit...");
         edit.setEnabled(false);
-
+        
         final Button remove = new Button(composite, SWT.PUSH);
         remove.setText("Remove");
         remove.setEnabled(false);
@@ -125,7 +134,7 @@ public class RepositoriesView
         final Button refresh = new Button(composite, SWT.PUSH);
         refresh.setText("Refresh");
         refresh.setEnabled(false);
-
+                
         // Listeners
         add.addSelectionListener(new SelectionAdapter()
         {
@@ -162,6 +171,24 @@ public class RepositoriesView
             }
         });
 
+        upBtn.addSelectionListener(new SelectionAdapter()
+        {
+            @Override
+            public void widgetSelected(SelectionEvent e)
+            {
+                up();
+            }
+        });
+        
+        downBtn.addSelectionListener(new SelectionAdapter()
+        {
+            @Override
+            public void widgetSelected(SelectionEvent e)
+            {
+                down();
+            }
+        });
+        
         repositoryView.addSelectionChangedListener(new ISelectionChangedListener()
         {
             public void selectionChanged(SelectionChangedEvent event)
@@ -175,9 +202,13 @@ public class RepositoriesView
 
                     checkEditEnabled(edit, sel);
                     checkRemoveEnabled(remove, sel);
+                    upBtn.setEnabled(sel.size() == 1);
+                    downBtn.setEnabled(sel.size() == 1);
                 }
                 else
                 {
+                    upBtn.setEnabled(false);
+                    downBtn.setEnabled(false);
                     refresh.setEnabled(false);
                     edit.setEnabled(false);
                     remove.setEnabled(false);
@@ -185,10 +216,37 @@ public class RepositoriesView
             }
         });
 
+        // layout
         add.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        upBtn.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+        downBtn.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
         edit.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
         remove.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
     }
+    
+    private void up()
+    {
+        IRepositoryModel model = (IRepositoryModel) ((StructuredSelection) repositoryView.getSelection()).getFirstElement();
+        int i = repositories.indexOf(model);
+        if (i > 0)
+        {
+            repositories.remove(i);
+            repositories.add(i - 1, model);
+            repositoryView.refresh();
+        }
+    }
+
+    private void down()
+    {
+        IRepositoryModel model = (IRepositoryModel) ((StructuredSelection) repositoryView.getSelection()).getFirstElement();
+        int i = repositories.indexOf(model);
+        if (i < repositories.size() - 1)
+        {
+            repositories.remove(i);
+            repositories.add(i + 1, model);
+            repositoryView.refresh();
+        }
+    }    
 
     @SuppressWarnings("unchecked")
     private void checkRemoveEnabled(Button button, IStructuredSelection sel)

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/preferences/repository/RepositoryTypeSelectionPage.java Fri Aug 27 16:13:57 2010
@@ -102,7 +102,7 @@ public class RepositoryTypeSelectionPage
                 {
                     IStructuredSelection sel = (IStructuredSelection) event.getSelection();
                     IRepositoryType type = (IRepositoryType) sel.getFirstElement();
-                    repositoryElement = SigilCore.getRepositoryConfiguration().newRepositoryElement(
+                    repositoryElement = SigilCore.getRepositoryPreferences().newRepositoryElement(
                         type);
                     selectWizardNode(new RepositoryWizardNode(repositoryElement));
                 }
@@ -110,7 +110,7 @@ public class RepositoryTypeSelectionPage
         });
 
         ArrayList<IRepositoryType> descriptors = new ArrayList<IRepositoryType>(
-            SigilCore.getRepositoryConfiguration().loadRepositoryTypes());
+            SigilCore.getRepositoryPreferences().loadRepositoryTypes());
 
         for (Iterator<IRepositoryType> i = descriptors.iterator(); i.hasNext();)
         {

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/RepositoryViewPart.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/RepositoryViewPart.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/RepositoryViewPart.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/RepositoryViewPart.java Fri Aug 27 16:13:57 2010
@@ -112,7 +112,7 @@ public class RepositoryViewPart extends 
         public RepositoryAction(IBundleRepository rep)
         {
             this.rep = rep;
-            this.model = SigilCore.getRepositoryConfiguration().findRepository(
+            this.model = SigilCore.getRepositoryPreferences().findRepository(
                 rep.getId());
         }
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/resolution/BundleResolverView.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/resolution/BundleResolverView.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/resolution/BundleResolverView.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/internal/views/resolution/BundleResolverView.java Fri Aug 27 16:13:57 2010
@@ -259,7 +259,7 @@ public class BundleResolverView extends 
         };
 
         ISigilProjectModel project = findProject(element);
-        IRepositoryManager repository = SigilCore.getRepositoryManager(project);
+        IRepositoryManager repository = project.getRepositoryManager();
 
         int options = ResolutionConfig.IGNORE_ERRORS;
 

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ExportedPackageFinder.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ExportedPackageFinder.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ExportedPackageFinder.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ExportedPackageFinder.java Fri Aug 27 16:13:57 2010
@@ -25,7 +25,6 @@ import java.util.List;
 import org.apache.felix.sigil.common.model.IModelElement;
 import org.apache.felix.sigil.common.model.IModelWalker;
 import org.apache.felix.sigil.common.model.osgi.IPackageExport;
-import org.apache.felix.sigil.eclipse.SigilCore;
 import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -66,7 +65,7 @@ public class ExportedPackageFinder imple
                 return !monitor.isCanceled();
             }
         };
-        SigilCore.getRepositoryManager(sigil).visit(walker);
+        sigil.getRepositoryManager().visit(walker);
         if (exports.size() > 0)
         {
             accumulator.addElements(exports);

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ModelLabelProvider.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ModelLabelProvider.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ModelLabelProvider.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ModelLabelProvider.java Fri Aug 27 16:13:57 2010
@@ -93,7 +93,7 @@ public class ModelLabelProvider extends 
         if (element instanceof IBundleRepository)
         {
             IBundleRepository rep = (IBundleRepository) element;
-            IRepositoryModel config = SigilCore.getRepositoryConfiguration().findRepository(
+            IRepositoryModel config = SigilCore.getRepositoryPreferences().findRepository(
                 rep.getId());
             return config.getType().getIcon();
         }
@@ -168,7 +168,7 @@ public class ModelLabelProvider extends 
         if (element instanceof IBundleRepository)
         {
             IBundleRepository rep = (IBundleRepository) element;
-            IRepositoryModel config = SigilCore.getRepositoryConfiguration().findRepository(
+            IRepositoryModel config = SigilCore.getRepositoryPreferences().findRepository(
                 rep.getId());
             return config.getName();
         }

Modified: felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ResourcesDialogHelper.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ResourcesDialogHelper.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ResourcesDialogHelper.java (original)
+++ felix/trunk/sigil/eclipse/ui/src/org/apache/felix/sigil/eclipse/ui/util/ResourcesDialogHelper.java Fri Aug 27 16:13:57 2010
@@ -347,7 +347,7 @@ public class ResourcesDialogHelper
                         return !monitor.isCanceled();
                     }
                 };
-                SigilCore.getRepositoryManager(sigil).visit(walker);
+                sigil.getRepositoryManager().visit(walker);
                 if (!bundles.isEmpty())
                 {
                     dialog.addElements(bundles);

Modified: felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java?rev=990188&r1=990187&r2=990188&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java (original)
+++ felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/BldRepositoryManager.java Fri Aug 27 16:13:57 2010
@@ -91,11 +91,13 @@ public class BldRepositoryManager extend
             }
             else {
                 Properties props = config.getRepositoryConfig(name);
-                IBundleRepository repo = buildRepository(name, props);
-                
-                if ( repo != null ) {
-                    list.add(repo);
-                }                
+                if (props != null) {
+                    IBundleRepository repo = buildRepository(name, props);
+                    
+                    if ( repo != null ) {
+                        list.add(repo);
+                    }
+                }
             }
         }
     }



Mime
View raw message