private static final String LOC = ".loc";
private static final String TIMESTAMP = ".timestamp";
public List<IRepositoryModel> loadRepositories()
{
IPreferenceStore prefs = SigilCore.getDefault().getPreferenceStore();
ArrayList<IRepositoryModel> repositories = new ArrayList<IRepositoryModel>();
for (IRepositoryType type : loadRepositoryTypes())
{
String typeID = type.getId();
if (type.isDynamic())
{
String instances = prefs.getString(REPOSITORY + typeID + INSTANCES);
if (instances.trim().length() > 0)
{
for (String instance : instances.split(","))
{
String key = REPOSITORY + typeID + "." + instance;
repositories.add(loadRepository(instance, key, type, prefs));
}
}
}
else
{
String key = REPOSITORY + typeID;
repositories.add(loadRepository(typeID, key, type, prefs));
}
}
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());