Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelaskavaia2016-07-05 09:22:05 -0400
committerPascal Rapicault2016-10-03 22:00:54 -0400
commitd61e55d60ea278e0649584e636338aae57fe48b0 (patch)
tree1dd71f47ecc102031b88123fa304a93884243a68
parentaeb345776d36877dd5026e9152d5217e17fdfea9 (diff)
downloadrt.equinox.p2-d61e55d60ea278e0649584e636338aae57fe48b0.tar.gz
rt.equinox.p2-d61e55d60ea278e0649584e636338aae57fe48b0.tar.xz
rt.equinox.p2-d61e55d60ea278e0649584e636338aae57fe48b0.zip
Bug 495726: MetadataRepositoryElementWrapper ignores parent contextI20161004-0800
If have content set for MetadataRepositories and children of it is MetedataRepository, because of this wrapper context is not passed around, for example if I say I don't want filters, it will only apply to root and not individual repos which does not make any sense Change-Id: I8a89d9366f9cd7575f36c85c66e025b782d6019a Signed-off-by: elaskavaia <elaskavaia.cdt@gmail.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/MetadataRepositoryElementWrapper.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/MetadataRepositoryElementWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/MetadataRepositoryElementWrapper.java
index 70487fcf8..67f3207d8 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/MetadataRepositoryElementWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/MetadataRepositoryElementWrapper.java
@@ -16,6 +16,7 @@ import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.model.*;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.ui.ProvisioningUI;
/**
* ElementWrapper that accepts the matched repo URLs and
@@ -47,13 +48,16 @@ public class MetadataRepositoryElementWrapper extends QueriedElementWrapper {
*/
protected Object wrap(Object item) {
// Assume the item is enabled
- boolean enabled = true;
+
// if the parent is a queried element then use its provisioning UI to find out about enablement
if (parent instanceof QueriedElement) {
- ProvisioningSession session = ((QueriedElement) parent).getProvisioningUI().getSession();
- enabled = ProvUI.getMetadataRepositoryManager(session).isEnabled((URI) item);
- }
- return super.wrap(new MetadataRepositoryElement(parent, (URI) item, enabled));
+ QueriedElement qe = (QueriedElement) parent;
+ ProvisioningUI provisioningUI = qe.getProvisioningUI();
+ ProvisioningSession session = provisioningUI.getSession();
+ boolean enabled = ProvUI.getMetadataRepositoryManager(session).isEnabled((URI) item);
+ return super.wrap(new MetadataRepositoryElement(parent, qe.getQueryContext(), provisioningUI, (URI) item, enabled));
+ }
+ return super.wrap(new MetadataRepositoryElement(parent, (URI) item, true));
}
}

Back to the top