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:
parent
1353648eff
commit
9805f1bdd9
4 changed files with 37 additions and 7 deletions
|
@ -1125,8 +1125,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider
|
||||||
// We are caching the result of this update. Copy the properties from the update
|
// We are caching the result of this update. Copy the properties from the update
|
||||||
// to the cached properties map.
|
// to the cached properties map.
|
||||||
if (entry.fProperties == null) {
|
if (entry.fProperties == null) {
|
||||||
entry.fProperties = new HashMap<String, Object>(getData().size() + 1 * 4/3);
|
entry.fProperties = new HashMap<String, Object>((getData().size() + 3) * 4/3);
|
||||||
entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, entry.fDirty);
|
if (update.getProperties().contains(PROP_CACHE_ENTRY_DIRTY)) {
|
||||||
|
entry.fProperties.put(PROP_CACHE_ENTRY_DIRTY, entry.fDirty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
properties = entry.fProperties;
|
properties = entry.fProperties;
|
||||||
properties.putAll(getData());
|
properties.putAll(getData());
|
||||||
|
@ -1151,11 +1153,20 @@ public class AbstractCachingVMProvider extends AbstractVMProvider
|
||||||
// return valid data to the client. In case the update was canceled
|
// 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
|
// 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.
|
// 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 = new HashMap<String, Object>((getData().size() + 3) * 4/3);
|
||||||
properties.put(PROP_CACHE_ENTRY_DIRTY, Boolean.TRUE);
|
if (update.getProperties().contains(PROP_CACHE_ENTRY_DIRTY)) {
|
||||||
|
properties.put(PROP_CACHE_ENTRY_DIRTY, Boolean.TRUE);
|
||||||
|
}
|
||||||
properties.putAll(getData());
|
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());
|
properties.put(PROP_UPDATE_STATUS, getStatus());
|
||||||
|
|
||||||
// If there is archive data available, calculate the requested changed value properties.
|
// If there is archive data available, calculate the requested changed value properties.
|
||||||
|
|
|
@ -46,7 +46,16 @@ public interface ICachingVMProvider extends IVMProvider, IElementPropertiesProvi
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public static final String PROP_CACHE_ENTRY_DIRTY = "cache_entry_dirty"; //$NON-NLS-1$
|
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.
|
* Returns the update policies that the given provider supports.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -27,6 +27,8 @@ public class StaleDataLabelBackground extends LabelBackground {
|
||||||
|
|
||||||
public StaleDataLabelBackground() {
|
public StaleDataLabelBackground() {
|
||||||
super(null);
|
super(null);
|
||||||
|
setPropertyNames(
|
||||||
|
new String[] { ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY, ICachingVMProvider.PROP_UPDATE_POLICY_ID });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,6 +39,9 @@ public class StaleDataLabelBackground extends LabelBackground {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ public class StaleDataLabelForeground extends LabelForeground {
|
||||||
|
|
||||||
public StaleDataLabelForeground() {
|
public StaleDataLabelForeground() {
|
||||||
super(null);
|
super(null);
|
||||||
|
setPropertyNames(
|
||||||
|
new String[] { ICachingVMProvider.PROP_CACHE_ENTRY_DIRTY, ICachingVMProvider.PROP_UPDATE_POLICY_ID });
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,6 +39,9 @@ public class StaleDataLabelForeground extends LabelForeground {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isEnabled(IStatus status, java.util.Map<String,Object> properties) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue