Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2008-02-20 23:30:44 +0000
committerSusan Franklin2008-02-20 23:30:44 +0000
commit90202be67d5663e21cbd9e4c8cdcce38322adc6d (patch)
tree8ec3dde0dbc44451e44ee62f9eafdcab28bdd702 /bundles/org.eclipse.equinox.p2.ui.admin
parentdbb6c95ad0561abcac5a85f307ee6e33233dd0be (diff)
downloadrt.equinox.p2-90202be67d5663e21cbd9e4c8cdcce38322adc6d.tar.gz
rt.equinox.p2-90202be67d5663e21cbd9e4c8cdcce38322adc6d.tar.xz
rt.equinox.p2-90202be67d5663e21cbd9e4c8cdcce38322adc6d.zip
Bug 212461 - [prov] [ui] - admin UI creates duplicate category nodes after adding a repo from end user UI
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/ProfilesView.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RepositoriesView.java8
3 files changed, 25 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
index e6bab4271..af4eab8cc 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
@@ -103,7 +103,13 @@ public class ProfilesView extends ProvView {
protected void addListeners() {
super.addListeners();
- listener = new StructuredViewerProvisioningListener(viewer, StructuredViewerProvisioningListener.PROV_EVENT_IU | StructuredViewerProvisioningListener.PROV_EVENT_PROFILE, ProvAdminUIActivator.getDefault().getQueryProvider());
+ listener = new StructuredViewerProvisioningListener(viewer, StructuredViewerProvisioningListener.PROV_EVENT_IU | StructuredViewerProvisioningListener.PROV_EVENT_PROFILE, ProvAdminUIActivator.getDefault().getQueryProvider()) {
+ protected void refreshAll() {
+ // The content provider maintains the same deferred content manager
+ // unless input changes, so a viewer.refresh() is not enough.
+ ProfilesView.this.refreshAll();
+ }
+ };
ProvUI.addProvisioningListener(listener);
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java
index 2c0054001..8cb78d53d 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvView.java
@@ -122,8 +122,7 @@ abstract class ProvView extends ViewPart {
undoRedoGroup = new UndoRedoActionGroup(getSite(), ProvUI.getProvisioningUndoContext(), true);
refreshAction = new Action(ProvAdminUIMessages.ProvView_RefreshCommandLabel) {
public void run() {
- refreshUnderlyingModel();
- viewer.refresh();
+ refreshAll();
}
};
refreshAction.setToolTipText(ProvAdminUIMessages.ProvView_RefreshCommandTooltip);
@@ -155,9 +154,7 @@ abstract class ProvView extends ViewPart {
public void propertyChange(PropertyChangeEvent event) {
if (getVisualProperties().contains(event.getProperty())) {
- // Refresh all model content. The SDK query provider will provide an updated
- // query for content based on these pref changes.
- viewer.refresh();
+ ProvView.this.refreshAll();
}
}
@@ -224,4 +221,13 @@ abstract class ProvView extends ViewPart {
list.add(PreferenceConstants.PREF_SHOW_GROUPS_ONLY);
return list;
}
+
+ final void refreshAll() {
+ // Refresh the underlying elements
+ refreshUnderlyingModel();
+ // We then reset the input to ensure that anything the content providers
+ // are caching gets reset also. The net effect is that everything
+ // will get queried again.
+ viewer.setInput(getInput());
+ }
}
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 76232bc34..4756f537d 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
@@ -82,7 +82,13 @@ abstract class RepositoriesView extends ProvView {
protected void addListeners() {
super.addListeners();
- listener = new StructuredViewerProvisioningListener(viewer, StructuredViewerProvisioningListener.PROV_EVENT_REPOSITORY, ProvAdminUIActivator.getDefault().getQueryProvider());
+ listener = new StructuredViewerProvisioningListener(viewer, StructuredViewerProvisioningListener.PROV_EVENT_REPOSITORY, ProvAdminUIActivator.getDefault().getQueryProvider()) {
+ protected void refreshAll() {
+ // The content provider maintains the same deferred content manager
+ // unless input changes, so a viewer.refresh() is not enough.
+ RepositoriesView.this.refreshAll();
+ }
+ };
ProvUI.addProvisioningListener(listener);
}

Back to the top