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 48c003bd639..836145a61df 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 @@ -1125,8 +1125,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // We are caching the result of this update. Copy the properties from the update // to the cached properties map. if (entry.fProperties == null) { - entry.fProperties = new HashMap(getData().size() + 1 * 4/3); - entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, entry.fDirty); + entry.fProperties = new HashMap((getData().size() + 3) * 4/3); + if (update.getProperties().contains(PROP_CACHE_ENTRY_DIRTY)) { + entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, entry.fDirty); + } } properties = entry.fProperties; properties.putAll(getData()); @@ -1151,11 +1153,20 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // return valid data to the client. In case the update was canceled // we can also return valid data to the client even if the client // is likely to ignore it since the cost of doing so is relatively low. - properties = new HashMap(getData().size() + 1 * 4/3); - properties.put(PROP_CACHE_ENTRY_DIRTY, Boolean.TRUE); + properties = new HashMap((getData().size() + 3) * 4/3); + if (update.getProperties().contains(PROP_CACHE_ENTRY_DIRTY)) { + properties.put(PROP_CACHE_ENTRY_DIRTY, Boolean.TRUE); + } properties.putAll(getData()); } + if (update.getProperties().contains(PROP_UPDATE_POLICY_ID)) { + properties.put(PROP_UPDATE_POLICY_ID, getActiveUpdatePolicy().getID()); + } + + // Save the update status result in the properties as well, it will be + // written to the client update when client updates are completed from + // cache. properties.put(PROP_UPDATE_STATUS, getStatus()); // If there is archive data available, calculate the requested changed value properties. diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICachingVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICachingVMProvider.java index 5806e368619..75599a27b8a 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICachingVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICachingVMProvider.java @@ -46,7 +46,16 @@ public interface ICachingVMProvider extends IVMProvider, IElementPropertiesProvi * @since 2.0 */ public static final String PROP_CACHE_ENTRY_DIRTY = "cache_entry_dirty"; //$NON-NLS-1$ - + + /** + * Property name for the current update policy in view. + * + * @see org.eclipse.cdt.dsf.ui.viewmodel.properties.IElementPropertiesProvider + * + * @since 2.1 + */ + public static final String PROP_UPDATE_POLICY_ID = "update_policy_id"; //$NON-NLS-1$ + /** * Returns the update policies that the given provider supports. */ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelBackground.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelBackground.java index fbcba617db9..6caca36695c 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelBackground.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelBackground.java @@ -27,6 +27,8 @@ public class StaleDataLabelBackground extends LabelBackground { public StaleDataLabelBackground() { super(null); + setPropertyNames( + new String[] { ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY, ICachingVMProvider.PROP_UPDATE_POLICY_ID }); } @Override @@ -37,6 +39,9 @@ public class StaleDataLabelBackground extends LabelBackground { @Override public boolean isEnabled(IStatus status, java.util.Map properties) { - return Boolean.TRUE.equals(properties.get(ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY)); + return + Boolean.TRUE.equals(properties.get(ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY)) && + !AutomaticUpdatePolicy.AUTOMATIC_UPDATE_POLICY_ID.equals( + properties.get(ICachingVMProvider.PROP_UPDATE_POLICY_ID)); } } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelForeground.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelForeground.java index 74626c75790..6f1637917bb 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelForeground.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelForeground.java @@ -27,6 +27,8 @@ public class StaleDataLabelForeground extends LabelForeground { public StaleDataLabelForeground() { super(null); + setPropertyNames( + new String[] { ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY, ICachingVMProvider.PROP_UPDATE_POLICY_ID }); } @Override @@ -37,6 +39,9 @@ public class StaleDataLabelForeground extends LabelForeground { @Override public boolean isEnabled(IStatus status, java.util.Map properties) { - return Boolean.TRUE.equals(properties.get(ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY)); + return + Boolean.TRUE.equals(properties.get(ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY)) && + !AutomaticUpdatePolicy.AUTOMATIC_UPDATE_POLICY_ID.equals( + properties.get(ICachingVMProvider.PROP_UPDATE_POLICY_ID)); } }