mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 10:15:39 +02:00
[280770] [view model] Stack frame list is not updated on change of stack frame limit preferences
This commit is contained in:
parent
14848d5e34
commit
c6d196e720
1 changed files with 105 additions and 65 deletions
|
@ -336,6 +336,14 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base implementation that handles calling child nodes to build
|
||||||
|
* the model delta. This method delegates to two other methods:
|
||||||
|
* {@link #buildChildDeltasForEventContext(IVMContext[], IVMNode, Object, VMDelta, int, RequestMonitor)}
|
||||||
|
* and {@link #buildChildDeltasForAllContexts(IVMNode, Object, VMDelta, int, RequestMonitor)},
|
||||||
|
* depending on the result of calling{@link IVMNode#getContextsForEvent(VMDelta, Object, DataRequestMonitor)}.
|
||||||
|
* @see IVMNode#buildDelta(Object, ModelDelta, int, RequestMonitor)
|
||||||
|
*/
|
||||||
protected void buildChildDeltas(final IVMNode node, final Object event, final VMDelta parentDelta,
|
protected void buildChildDeltas(final IVMNode node, final Object event, final VMDelta parentDelta,
|
||||||
final int nodeOffset, final RequestMonitor rm)
|
final int nodeOffset, final RequestMonitor rm)
|
||||||
{
|
{
|
||||||
|
@ -345,14 +353,19 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
new DataRequestMonitor<IVMContext[]>(getVMProvider().getExecutor(), rm) {
|
new DataRequestMonitor<IVMContext[]>(getVMProvider().getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleCompleted() {
|
protected void handleCompleted() {
|
||||||
|
if (isSuccess() || getStatus().getCode() == IDsfStatusConstants.NOT_SUPPORTED) {
|
||||||
|
|
||||||
if (isSuccess()) {
|
if (isSuccess()) {
|
||||||
assert getData() != null;
|
assert getData() != null;
|
||||||
buildChildDeltasForEventContext(getData(), node, event, parentDelta, nodeOffset, rm);
|
buildChildDeltasForEventContext(
|
||||||
} else if (getStatus().getCode() == IDsfStatusConstants.NOT_SUPPORTED) {
|
getData(), node, event, parentDelta, nodeOffset, rm);
|
||||||
|
} else {
|
||||||
// The DMC for this node was not found in the event. Call the
|
// The DMC for this node was not found in the event. Call the
|
||||||
// super-class to resort to the default behavior which may add a
|
// super-class to resort to the default behavior which will add a
|
||||||
// delta for every element in this node.
|
// delta for every element in this node.
|
||||||
buildChildDeltasForAllContexts(node, event, parentDelta, nodeOffset, rm);
|
buildChildDeltasForAllContexts(
|
||||||
|
node, event, parentDelta, nodeOffset, rm);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
super.handleCompleted();
|
super.handleCompleted();
|
||||||
}
|
}
|
||||||
|
@ -360,13 +373,19 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base implementation that handles calling child nodes to build
|
||||||
|
* the model delta. This method is called with the context obtained
|
||||||
|
* by calling{@link IVMNode#getContextsForEvent(VMDelta, Object, DataRequestMonitor)}.
|
||||||
|
* @see IVMNode#buildDelta(Object, ModelDelta, int, RequestMonitor)
|
||||||
|
*/
|
||||||
protected void buildChildDeltasForEventContext(final IVMContext[] vmcs, final IVMNode node, final Object event,
|
protected void buildChildDeltasForEventContext(final IVMContext[] vmcs, final IVMNode node, final Object event,
|
||||||
final VMDelta parentDelta, final int nodeOffset, final RequestMonitor requestMonitor)
|
final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm)
|
||||||
{
|
{
|
||||||
final Map<IVMNode,Integer> childNodeDeltas = getChildNodesWithDeltaFlags(node, parentDelta, event);
|
final Map<IVMNode,Integer> childNodesWithDeltaFlags = getChildNodesWithDeltaFlags(node, parentDelta, event);
|
||||||
if (childNodeDeltas.size() == 0) {
|
if (childNodesWithDeltaFlags.size() == 0) {
|
||||||
// There are no child nodes with deltas, just return to parent.
|
// There are no child nodes with deltas, just return to parent.
|
||||||
requestMonitor.done();
|
rm.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,7 +394,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
// VMC.
|
// VMC.
|
||||||
boolean calculateIndex = false;
|
boolean calculateIndex = false;
|
||||||
if (nodeOffset >= 0) {
|
if (nodeOffset >= 0) {
|
||||||
for (int childDelta : childNodeDeltas.values()) {
|
for (int childDelta : childNodesWithDeltaFlags.values()) {
|
||||||
if ( (childDelta & (IModelDelta.SELECT | IModelDelta.EXPAND)) != 0 ) {
|
if ( (childDelta & (IModelDelta.SELECT | IModelDelta.EXPAND)) != 0 ) {
|
||||||
calculateIndex = true;
|
calculateIndex = true;
|
||||||
break;
|
break;
|
||||||
|
@ -390,19 +409,19 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
node,
|
node,
|
||||||
new VMChildrenUpdate(
|
new VMChildrenUpdate(
|
||||||
parentDelta, getVMProvider().getPresentationContext(), -1, -1,
|
parentDelta, getVMProvider().getPresentationContext(), -1, -1,
|
||||||
new DataRequestMonitor<List<Object>>(getVMProvider().getExecutor(), requestMonitor) {
|
new DataRequestMonitor<List<Object>>(getVMProvider().getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
// Check for an empty list of elements. If it's empty then we
|
// Check for an empty list of elements. If it's empty then we
|
||||||
// don't have to call the children nodes, so return here.
|
// don't have to call the children nodes, so return here.
|
||||||
// No need to propagate error, there's no means or need to display it.
|
// No need to propagate error, there's no means or need to display it.
|
||||||
if (getData().isEmpty()) {
|
if (getData().isEmpty()) {
|
||||||
requestMonitor.done();
|
rm.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CountingRequestMonitor countingRm =
|
CountingRequestMonitor countingRm =
|
||||||
new CountingRequestMonitor(getVMProvider().getExecutor(), requestMonitor);
|
new CountingRequestMonitor(getVMProvider().getExecutor(), rm);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (IVMContext vmc : vmcs) {
|
for (IVMContext vmc : vmcs) {
|
||||||
|
@ -424,7 +443,8 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
delta = parentDelta.addNode(vmc, elementIndex, IModelDelta.NO_CHANGE);
|
delta = parentDelta.addNode(vmc, elementIndex, IModelDelta.NO_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
callChildNodesToBuildDelta(node, childNodeDeltas, delta, event, countingRm);
|
callChildNodesToBuildDelta(
|
||||||
|
node, childNodesWithDeltaFlags, delta, event, countingRm);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
countingRm.setDoneCount(count);
|
countingRm.setDoneCount(count);
|
||||||
|
@ -432,7 +452,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
CountingRequestMonitor countingRm =
|
CountingRequestMonitor countingRm =
|
||||||
new CountingRequestMonitor(getVMProvider().getExecutor(), requestMonitor);
|
new CountingRequestMonitor(getVMProvider().getExecutor(), rm);
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (IVMContext vmc : vmcs) {
|
for (IVMContext vmc : vmcs) {
|
||||||
// Optimization: Try to find a delta with a matching element, if found use it.
|
// Optimization: Try to find a delta with a matching element, if found use it.
|
||||||
|
@ -441,7 +461,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
if (delta == null) {
|
if (delta == null) {
|
||||||
delta = parentDelta.addNode(vmc, IModelDelta.NO_CHANGE);
|
delta = parentDelta.addNode(vmc, IModelDelta.NO_CHANGE);
|
||||||
}
|
}
|
||||||
callChildNodesToBuildDelta(node, childNodeDeltas, delta, event, requestMonitor);
|
callChildNodesToBuildDelta(node, childNodesWithDeltaFlags, delta, event, rm);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
countingRm.setDoneCount(count);
|
countingRm.setDoneCount(count);
|
||||||
|
@ -451,20 +471,18 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
/**
|
/**
|
||||||
* Base implementation that handles calling child nodes to build
|
* Base implementation that handles calling child nodes to build
|
||||||
* the model delta. The child nodes are called with all the elements
|
* the model delta. The child nodes are called with all the elements
|
||||||
* in this node, which could be very inefficient. In order to build delta
|
* in this node, which could be very inefficient. This method is only
|
||||||
* only for specific elements in this node, the class extending
|
* called if {@link IVMNode#getContextsForEvent(VMDelta, Object, DataRequestMonitor)}
|
||||||
* <code>AbstractVMNode</code> should override this method.
|
* is not supported by the node for the given element.
|
||||||
* @see IVMNode#buildDelta(Object, ModelDelta, int, RequestMonitor)
|
* @see IVMNode#buildDelta(Object, ModelDelta, int, RequestMonitor)
|
||||||
*/
|
*/
|
||||||
protected void buildChildDeltasForAllContexts(final IVMNode node, final Object event, final VMDelta parentDelta,
|
protected void buildChildDeltasForAllContexts(final IVMNode node, final Object event, final VMDelta parentDelta,
|
||||||
final int nodeOffset, final RequestMonitor requestMonitor)
|
final int nodeOffset, final RequestMonitor rm)
|
||||||
{
|
{
|
||||||
// Find the child nodes that have deltas for the given event.
|
|
||||||
final Map<IVMNode,Integer> childNodesWithDeltaFlags = getChildNodesWithDeltaFlags(node, parentDelta, event);
|
final Map<IVMNode,Integer> childNodesWithDeltaFlags = getChildNodesWithDeltaFlags(node, parentDelta, event);
|
||||||
|
|
||||||
// If no child nodes have deltas we can stop here.
|
|
||||||
if (childNodesWithDeltaFlags.size() == 0) {
|
if (childNodesWithDeltaFlags.size() == 0) {
|
||||||
requestMonitor.done();
|
// There are no child nodes with deltas, just return to parent.
|
||||||
|
rm.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,14 +492,26 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
// delta to handle these flags. Similarly, the index argument is
|
// delta to handle these flags. Similarly, the index argument is
|
||||||
// not necessary either.
|
// not necessary either.
|
||||||
boolean mustGetElements = false;
|
boolean mustGetElements = false;
|
||||||
|
boolean _updateFlagsOnly = true;
|
||||||
for (int childDelta : childNodesWithDeltaFlags.values()) {
|
for (int childDelta : childNodesWithDeltaFlags.values()) {
|
||||||
if ((childDelta & ~IModelDelta.STATE) != 0) {
|
if ((childDelta & ~IModelDelta.STATE) != 0) {
|
||||||
mustGetElements = true;
|
mustGetElements = true;
|
||||||
}
|
}
|
||||||
|
if ((childDelta & ~(IModelDelta.STATE | IModelDelta.CONTENT)) != 0) {
|
||||||
|
_updateFlagsOnly = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
final boolean updateFlagsOnly = _updateFlagsOnly;
|
||||||
|
|
||||||
if (!mustGetElements) {
|
if (!mustGetElements) {
|
||||||
callChildNodesToBuildDelta(node, childNodesWithDeltaFlags, parentDelta, event, requestMonitor);
|
callChildNodesToBuildDelta(
|
||||||
|
node, childNodesWithDeltaFlags, parentDelta, event,
|
||||||
|
new RequestMonitor(getVMProvider().getExecutor(), rm) {
|
||||||
|
@Override
|
||||||
|
protected void handleError() {
|
||||||
|
super.handleError();
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// The given child nodes have deltas potentially for all elements
|
// The given child nodes have deltas potentially for all elements
|
||||||
// from this node. Retrieve all elements and call the child nodes with
|
// from this node. Retrieve all elements and call the child nodes with
|
||||||
|
@ -490,20 +520,26 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
node,
|
node,
|
||||||
new VMChildrenUpdate(
|
new VMChildrenUpdate(
|
||||||
parentDelta, getVMProvider().getPresentationContext(), -1, -1,
|
parentDelta, getVMProvider().getPresentationContext(), -1, -1,
|
||||||
new DataRequestMonitor<List<Object>>(getVMProvider().getExecutor(), requestMonitor) {
|
new DataRequestMonitor<List<Object>>(getVMProvider().getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleCompleted() {
|
||||||
if (fDisposed) return;
|
if (fDisposed) return;
|
||||||
|
|
||||||
// Check for an empty list of elements. If it's empty then we
|
// Check for an empty list of elements. If the list of elements is empty
|
||||||
// don't have to call the children nodes, so return here.
|
// still call the child nodes using the parent delta only. Do this only if
|
||||||
if (getData().size() == 0) {
|
// an optimization was used to build the delta, so that the child node can
|
||||||
requestMonitor.done();
|
// adds the optimized delta flags without the full delta (bug 280770).
|
||||||
|
if (getData() == null || getData().size() == 0) {
|
||||||
|
if (updateFlagsOnly) {
|
||||||
|
callChildNodesToBuildDelta(
|
||||||
|
node, childNodesWithDeltaFlags, parentDelta, event, rm);
|
||||||
|
} else {
|
||||||
|
rm.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
final MultiRequestMonitor<RequestMonitor> elementsDeltasMultiRequestMon =
|
final MultiRequestMonitor<RequestMonitor> elementsDeltasMultiRequestMon =
|
||||||
new MultiRequestMonitor<RequestMonitor>(getVMProvider().getExecutor(), requestMonitor);
|
new MultiRequestMonitor<RequestMonitor>(getVMProvider().getExecutor(), rm);
|
||||||
|
|
||||||
// For each element from this node, create a new delta,
|
// For each element from this node, create a new delta,
|
||||||
// and then call all the child nodes to build their delta.
|
// and then call all the child nodes to build their delta.
|
||||||
|
@ -523,6 +559,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -537,9 +574,11 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
* generated by this node, unless the full delta path is not being calculated
|
* generated by this node, unless the full delta path is not being calculated
|
||||||
* due to an optimization.
|
* due to an optimization.
|
||||||
* @param event The event object that the delta is being built for.
|
* @param event The event object that the delta is being built for.
|
||||||
* @param requestMonitor The result token to invoke when the delta is completed.
|
* @param rm The result token to invoke when the delta is completed.
|
||||||
*/
|
*/
|
||||||
protected void callChildNodesToBuildDelta(final IVMNode node, final Map<IVMNode,Integer> childNodes, final VMDelta delta, final Object event, final RequestMonitor requestMonitor) {
|
protected void callChildNodesToBuildDelta(final IVMNode node, final Map<IVMNode,Integer> childNodes, final VMDelta delta,
|
||||||
|
final Object event, final RequestMonitor rm)
|
||||||
|
{
|
||||||
assert childNodes.size() != 0;
|
assert childNodes.size() != 0;
|
||||||
|
|
||||||
// Check if any of the child nodes are will generate IModelDelta.SELECT or
|
// Check if any of the child nodes are will generate IModelDelta.SELECT or
|
||||||
|
@ -555,10 +594,10 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
|
|
||||||
getChildNodesElementOffsets(
|
getChildNodesElementOffsets(
|
||||||
node, delta, calculateOffsets,
|
node, delta, calculateOffsets,
|
||||||
new DataRequestMonitor<Map<IVMNode, Integer>>(getVMProvider().getExecutor(), requestMonitor) {
|
new DataRequestMonitor<Map<IVMNode, Integer>>(getVMProvider().getExecutor(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
final CountingRequestMonitor multiRm = new CountingRequestMonitor(getVMProvider().getExecutor(), requestMonitor);
|
final CountingRequestMonitor multiRm = new CountingRequestMonitor(getVMProvider().getExecutor(), rm);
|
||||||
int multiRmCount = 0;
|
int multiRmCount = 0;
|
||||||
|
|
||||||
// Set the total count of number of children in the parent delta.
|
// Set the total count of number of children in the parent delta.
|
||||||
|
@ -575,7 +614,8 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
buildChildDeltas(
|
buildChildDeltas(
|
||||||
childNode, event, delta, nodeOffset, new RequestMonitor(getVMProvider().getExecutor(), multiRm));
|
childNode, event, delta, nodeOffset,
|
||||||
|
new RequestMonitor(getVMProvider().getExecutor(), multiRm) );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
multiRmCount++;
|
multiRmCount++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue