Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2008-04-23 00:16:46 +0000
committerSusan Franklin2008-04-23 00:16:46 +0000
commit60bbe13e118a1c2e4d4f58a2c2408f7541c377ad (patch)
tree9adc8f1f0a18636ffba8470297b8057588f1753c /bundles/org.eclipse.equinox.p2.ui.admin
parentbf53f5ac4463d53e292e5df90415c48bc325aa0c (diff)
downloadrt.equinox.p2-60bbe13e118a1c2e4d4f58a2c2408f7541c377ad.tar.gz
rt.equinox.p2-60bbe13e118a1c2e4d4f58a2c2408f7541c377ad.tar.xz
rt.equinox.p2-60bbe13e118a1c2e4d4f58a2c2408f7541c377ad.zip
Bug 224999 - [ui] support importing old style update site bookmarks into p2 update manager
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminQueryProvider.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java6
4 files changed, 17 insertions, 18 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
index 927c25e6b..a678bdd57 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ArtifactRepositoriesView.java
@@ -61,8 +61,8 @@ public class ArtifactRepositoriesView extends RepositoriesView {
protected ProvisioningOperation getRemoveOperation(Object[] elements) {
ArrayList urls = new ArrayList();
for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof RepositoryElement)
- urls.add(((RepositoryElement) elements[i]).getLocation());
+ if (elements[i] instanceof IRepositoryElement)
+ urls.add(((IRepositoryElement) elements[i]).getLocation());
}
return new RemoveArtifactRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URL[]) urls.toArray(new URL[urls.size()]));
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
index ef567b112..50b361d2f 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/MetadataRepositoriesView.java
@@ -83,8 +83,8 @@ public class MetadataRepositoriesView extends RepositoriesView {
protected ProvisioningOperation getRemoveOperation(Object[] elements) {
ArrayList urls = new ArrayList();
for (int i = 0; i < elements.length; i++) {
- if (elements[i] instanceof RepositoryElement)
- urls.add(((RepositoryElement) elements[i]).getLocation());
+ if (elements[i] instanceof IRepositoryElement)
+ urls.add(((IRepositoryElement) elements[i]).getLocation());
}
return new RemoveMetadataRepositoryOperation(ProvAdminUIMessages.ArtifactRepositoriesView_RemoveRepositoryOperationLabel, (URL[]) urls.toArray(new URL[urls.size()]));
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminQueryProvider.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminQueryProvider.java
index 7d8ba8042..97c5b28b7 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminQueryProvider.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminQueryProvider.java
@@ -97,10 +97,10 @@ public class ProvAdminQueryProvider implements IQueryProvider {
}
if (element instanceof MetadataRepositories) {
MetadataRepositories metaRepos = (MetadataRepositories) element;
- if (metaRepos.getMetadataRepositories() != null)
- queryable = new QueryableMetadataRepositoryManager(((MetadataRepositories) element).getMetadataRepositories());
- else
- queryable = new QueryableMetadataRepositoryManager(IMetadataRepositoryManager.REPOSITORIES_NON_SYSTEM);
+ if (metaRepos.getMetadataRepositories() == null)
+ metaRepos.setRepoFlags(IMetadataRepositoryManager.REPOSITORIES_NON_SYSTEM);
+ queryable = new QueryableMetadataRepositoryManager(metaRepos);
+
if (useCategories)
// We are using categories, group into categories first.
return new ElementQueryDescriptor(queryable, categoryQuery, new CategoryElementCollector(this, queryable, queryContext, true));
@@ -177,13 +177,12 @@ public class ProvAdminQueryProvider implements IQueryProvider {
case IQueryProvider.METADATA_REPOS :
if (element instanceof MetadataRepositories) {
MetadataRepositories metaRepos = (MetadataRepositories) element;
- if (metaRepos.getMetadataRepositories() != null)
- queryable = new QueryableMetadataRepositoryManager(((MetadataRepositories) element).getMetadataRepositories());
- else
- queryable = new QueryableMetadataRepositoryManager(hideSystem ? IMetadataRepositoryManager.REPOSITORIES_NON_SYSTEM : IMetadataRepositoryManager.REPOSITORIES_ALL);
- } else
- queryable = new QueryableMetadataRepositoryManager(hideSystem ? IMetadataRepositoryManager.REPOSITORIES_NON_SYSTEM : IMetadataRepositoryManager.REPOSITORIES_ALL);
- return new ElementQueryDescriptor(queryable, null, new MetadataRepositoryElementCollector(this, queryContext));
+ if (metaRepos.getMetadataRepositories() == null)
+ metaRepos.setRepoFlags(hideSystem ? IMetadataRepositoryManager.REPOSITORIES_NON_SYSTEM : IMetadataRepositoryManager.REPOSITORIES_ALL);
+ queryable = new QueryableMetadataRepositoryManager(metaRepos);
+ return new ElementQueryDescriptor(queryable, null, new MetadataRepositoryElementCollector(this, queryContext));
+ }
+ return null;
case IQueryProvider.PROFILES :
queryable = new QueryableProfileRegistry();
return new ElementQueryDescriptor(queryable, new Query() {
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java
index e3348e2e2..ebab434a0 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java
@@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.internal.provisional.p2.ui.*;
-import org.eclipse.equinox.internal.provisional.p2.ui.model.RepositoryElement;
+import org.eclipse.equinox.internal.provisional.p2.ui.model.IRepositoryElement;
import org.eclipse.equinox.internal.provisional.p2.ui.operations.ProvisioningOperation;
import org.eclipse.equinox.internal.provisional.p2.ui.viewers.RepositoryContentProvider;
import org.eclipse.equinox.internal.provisional.p2.ui.viewers.StructuredViewerProvisioningListener;
@@ -62,8 +62,8 @@ abstract class RepositoriesView extends ProvView {
Object[] elements = ((ITreeContentProvider) viewer.getContentProvider()).getElements(getInput());
ArrayList urls = new ArrayList();
for (int i = 0; i < elements.length; i++)
- if (elements[i] instanceof RepositoryElement)
- urls.add(((RepositoryElement) elements[i]).getLocation());
+ if (elements[i] instanceof IRepositoryElement)
+ urls.add(((IRepositoryElement) elements[i]).getLocation());
openAddRepositoryDialog(getShell());
}
}

Back to the top