1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

[291425] - [update policy][variables] When stepping fast view flickers in stale data color.

This commit is contained in:
Pawel Piech 2009-10-05 20:59:53 +00:00
parent 1353648eff
commit 9805f1bdd9
4 changed files with 37 additions and 7 deletions

View file

@ -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<String, Object>(getData().size() + 1 * 4/3);
entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, entry.fDirty);
entry.fProperties = new HashMap<String, Object>((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<String, Object>(getData().size() + 1 * 4/3);
properties.put(PROP_CACHE_ENTRY_DIRTY, Boolean.TRUE);
properties = new HashMap<String, Object>((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.

View file

@ -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.
*/

View file

@ -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<String,Object> 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));
}
}

View file

@ -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<String,Object> 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));
}
}