mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
[291224] - Updated use of Viewer*RM vs. *RM to account for the conversion to CountingRequestMonitor.
This commit is contained in:
parent
ad94b7f3a9
commit
9485e0e1f7
2 changed files with 34 additions and 35 deletions
|
@ -50,6 +50,7 @@ import org.eclipse.cdt.dsf.debug.ui.viewmodel.numberformat.FormattedValueVMUtil;
|
|||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.numberformat.IFormattedValueVMContext;
|
||||
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
|
||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||
import org.eclipse.cdt.dsf.ui.concurrent.ViewerCountingRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.ui.concurrent.ViewerDataRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.ui.viewmodel.VMDelta;
|
||||
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
|
||||
|
@ -890,7 +891,7 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
|||
|
||||
// Create the MultiRequestMonitor to handle completion of the set of getModelData() calls.
|
||||
|
||||
final CountingRequestMonitor crm = new CountingRequestMonitor(dsfExecutor, null) {
|
||||
final CountingRequestMonitor crm = new ViewerCountingRequestMonitor(dsfExecutor, update) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
// Now that all the calls to getModelData() are complete, we create an
|
||||
|
@ -905,7 +906,6 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
|||
IExpressionDMContext[] expressionDMCs = new IExpressionDMContext[localsDMData.size()];
|
||||
|
||||
int i = 0;
|
||||
|
||||
for (IVariableDMData localDMData : localsDMData) {
|
||||
expressionDMCs[i++] = expressionService.createExpression(frameDmc, localDMData.getName());
|
||||
}
|
||||
|
@ -927,9 +927,9 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
|||
|
||||
for (IVariableDMContext localDMC : localsDMCs) {
|
||||
DataRequestMonitor<IVariableDMData> rm =
|
||||
new ViewerDataRequestMonitor<IVariableDMData>(dsfExecutor, update) {
|
||||
new DataRequestMonitor<IVariableDMData>(dsfExecutor, crm) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
public void handleSuccess() {
|
||||
localsDMData.add(getData());
|
||||
crm.done();
|
||||
}
|
||||
|
|
|
@ -189,22 +189,23 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider
|
|||
// Optimization: there is only one child node, just pass on the child count to it.
|
||||
getVMProvider().updateNode(childNodes[0], update);
|
||||
} else {
|
||||
getChildrenCountsForNode(update, node, new ViewerDataRequestMonitor<Integer[]>(getVMProvider()
|
||||
.getExecutor(), update) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
int numChildren = 0;
|
||||
for (Integer count : getData()) {
|
||||
numChildren += count.intValue();
|
||||
getChildrenCountsForNode(
|
||||
update, node,
|
||||
new ViewerDataRequestMonitor<Integer[]>(getVMProvider().getExecutor(), update) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
int numChildren = 0;
|
||||
for (Integer count : getData()) {
|
||||
numChildren += count.intValue();
|
||||
}
|
||||
update.setChildCount(numChildren);
|
||||
} else {
|
||||
update.setChildCount(0);
|
||||
}
|
||||
update.setChildCount(numChildren);
|
||||
} else {
|
||||
update.setChildCount(0);
|
||||
update.done();
|
||||
}
|
||||
update.done();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
update.done();
|
||||
|
@ -226,18 +227,19 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider
|
|||
// Optimization: there is only one child node, pass the updates to it.
|
||||
getVMProvider().updateNode(childNodes[0], update);
|
||||
} else {
|
||||
getChildrenCountsForNode(update, node, new ViewerDataRequestMonitor<Integer[]>(getVMProvider()
|
||||
.getExecutor(), update) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!isSuccess()) {
|
||||
update.done();
|
||||
return;
|
||||
}
|
||||
getChildrenCountsForNode(
|
||||
update, node,
|
||||
new ViewerDataRequestMonitor<Integer[]>(getVMProvider().getExecutor(), update) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!isSuccess()) {
|
||||
update.done();
|
||||
return;
|
||||
}
|
||||
|
||||
updateChildrenWithCounts(update, node, getData());
|
||||
}
|
||||
});
|
||||
updateChildrenWithCounts(update, node, getData());
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// Stale update. Just ignore.
|
||||
|
@ -275,13 +277,10 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider
|
|||
final int nodeIndex = i;
|
||||
getVMProvider().updateNode(
|
||||
childNodes[i],
|
||||
new VMChildrenCountUpdate(update, new ViewerDataRequestMonitor<Integer>(
|
||||
getVMProvider().getExecutor(), update) {
|
||||
new VMChildrenCountUpdate(update, new DataRequestMonitor<Integer>(getVMProvider().getExecutor(), crm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
counts[nodeIndex] = getData();
|
||||
}
|
||||
protected void handleSuccess() {
|
||||
counts[nodeIndex] = getData();
|
||||
crm.done();
|
||||
}
|
||||
}));
|
||||
|
|
Loading…
Add table
Reference in a new issue