From 3f0952d28ba9b54b92ffb04ac34590e0dace4102 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Tue, 8 May 2007 21:46:40 +0000 Subject: [PATCH] Fixed update problem in Debug view and expression view (bug 186041). --- .../AbstractExpressionLayoutNode.java | 2 +- .../dsf/ui/viewmodel/AbstractVMProvider.java | 46 ++++++++++++------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/viewmodel/expression/AbstractExpressionLayoutNode.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/viewmodel/expression/AbstractExpressionLayoutNode.java index ffacf21203f..6f686cc0b8e 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/viewmodel/expression/AbstractExpressionLayoutNode.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/viewmodel/expression/AbstractExpressionLayoutNode.java @@ -89,7 +89,7 @@ public abstract class AbstractExpressionLayoutNode extends Ab protected void getElementForExpressionPart(final IChildrenUpdate update, final String expressionPartText, final DataRequestMonitor rm) { updateElements(new VMElementsUpdate( update, -1, -1, - new DataRequestMonitor>(getSession().getExecutor(), rm) { + new DataRequestMonitor>(getExecutor(), rm) { @Override protected void handleOK() { if (getData().size() == 0) { diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java index d8ade10a314..2372de3e1e3 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java @@ -161,34 +161,46 @@ abstract public class AbstractVMProvider implements IVMProvider if (node.getChildLayoutNodes().length == 0) { for (IHasChildrenUpdate update : updates) { update.setHasChilren(false); + update.done(); } return; } + // Create a matrix of element updates: + // The first dimension "i" is the list of children updates that came from the viewer. + // For each of these updates, there are "j" number of elment updates corresponding + // to the number of child layout nodes in this node. + // Each children update from the viewer is complete when all the child layout nodes + // fill in their elements update. + // Once the matrix is constructed, the child layout nodes are given the list of updates + // equal to the updates requested by the viewer. VMHasElementsUpdate[][] elementsUpdates = new VMHasElementsUpdate[node.getChildLayoutNodes().length][updates.length]; for (int i = 0; i < updates.length; i ++) { final IHasChildrenUpdate update = updates[i]; + + final MultiRequestMonitor> hasChildrenMultiRequestMon = + new MultiRequestMonitor>(getExecutor(), null) { + @Override + protected void handleCompleted() { + // Status is OK, only if all request monitors are OK. + if (getStatus().isOK()) { + boolean isContainer = false; + for (DataRequestMonitor hasElementsDone : getRequestMonitors()) { + isContainer |= hasElementsDone.getStatus().isOK() && + hasElementsDone.getData().booleanValue(); + } + update.setHasChilren(isContainer); + } else { + update.setStatus(getStatus()); + } + update.done(); + } + }; + for (int j = 0; j < node.getChildLayoutNodes().length; j++) { - final MultiRequestMonitor> hasChildrenMultiRequestMon = - new MultiRequestMonitor>(getExecutor(), null) { - @Override - protected void handleCompleted() { - // Status is OK, only if all request monitors are OK. - if (getStatus().isOK()) { - boolean isContainer = false; - for (DataRequestMonitor hasElementsDone : getRequestMonitors()) { - isContainer |= hasElementsDone.getStatus().isOK() && - hasElementsDone.getData().booleanValue(); - } - update.setHasChilren(isContainer); - update.done(); - } - } - }; - elementsUpdates[j][i] = new VMHasElementsUpdate( update, hasChildrenMultiRequestMon.add(