From 08e22395dafe88dbdb57db544d20a4025c5795c1 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Tue, 6 Oct 2009 15:24:19 +0000 Subject: [PATCH] [291425] Additional fix to update active policy ID for cache hits. --- .../update/AbstractCachingVMProvider.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index 836145a61df..aea4ff6a4c6 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -419,6 +419,14 @@ public class AbstractCachingVMProvider extends AbstractVMProvider public void setActiveUpdatePolicy(IVMUpdatePolicy updatePolicy) { getPresentationContext().setProperty(SELECTED_UPDATE_MODE, updatePolicy.getID()); + + // Repaint the view to allow elements using the PROP_UPDATE_POLICY_ID + // property to repaint themselves. + for (final IVMModelProxy proxyStrategy : getActiveModelProxies()) { + if (!proxyStrategy.isDisposed()) { + proxyStrategy.fireModelChanged(new ModelDelta(proxyStrategy.getRootElement(), IModelDelta.CONTENT)); + } + } } public void refresh() { @@ -1099,6 +1107,9 @@ public class AbstractCachingVMProvider extends AbstractVMProvider if (DEBUG_CACHE && (DEBUG_PRESENTATION_ID == null || getPresentationContext().getId().equals(DEBUG_PRESENTATION_ID))) { DsfUIPlugin.debug("cacheHitProperties(node = " + node + ", update = " + update + ", " + entry.fProperties + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } + if (entry.fProperties.containsKey(PROP_UPDATE_POLICY_ID)) { + entry.fProperties.put(PROP_UPDATE_POLICY_ID, getActiveUpdatePolicy().getID()); + } update.setAllProperties(entry.fProperties); update.setStatus((IStatus)entry.fProperties.get(PROP_UPDATE_STATUS)); update.done(); @@ -1108,6 +1119,9 @@ public class AbstractCachingVMProvider extends AbstractVMProvider if (DEBUG_CACHE && (DEBUG_PRESENTATION_ID == null || getPresentationContext().getId().equals(DEBUG_PRESENTATION_ID))) { DsfUIPlugin.debug("cacheHitPropertiesPartialStaleData(node = " + node + ", update = " + update + ", " + entry.fProperties + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } + if (entry.fProperties.containsKey(PROP_UPDATE_POLICY_ID)) { + entry.fProperties.put(PROP_UPDATE_POLICY_ID, getActiveUpdatePolicy().getID()); + } update.setAllProperties(entry.fProperties); update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_STATE, "Cache contains partial stale data for this request.", null)); //$NON-NLS-1$ update.done();