From 9500d9b90a24a8ba3f6c43001c47261fe48644b2 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Wed, 23 Sep 2009 04:32:37 +0000 Subject: [PATCH] Documentation enhancement --- .../dsf/ui/viewmodel/AbstractVMProvider.java | 6 +++++ .../DefaultVMContentProviderStrategy.java | 26 +++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java index 0cfb65dc229..f1c77db46b1 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java @@ -516,6 +516,12 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene * processing of the update. For example the AbstractCachingVMProvider * overrides this method to optionally return the results for an update from * a cache. + * + * [node] represents the type of the child element, not of the parent. In + * other words, the update requests are asking if one or more model elements + * of a particular type (thread, e.g.) have children. But [node] does not + * represent that type. It represents the type of the potential children + * (frame, e.g.) */ public void updateNode(final IVMNode node, IHasChildrenUpdate[] updates) { IHasChildrenUpdate[] updateProxies = new IHasChildrenUpdate[updates.length]; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java index 2d162305efc..26caa2d9dd1 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java @@ -104,6 +104,14 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider } } + /** + * @param node + * the type of element (thread, variable, frame, e.g,) that's in + * the update requests. All the given requests contain the same + * type of element. + * @param updates + * the has-children requests + */ private void updateNode(IVMNode node, final IHasChildrenUpdate[] updates) { final IVMNode[] childNodes = getVMProvider().getChildVMNodes(node); if (childNodes.length == 0) { @@ -119,17 +127,13 @@ public class DefaultVMContentProviderStrategy implements IElementContentProvider getVMProvider().updateNode(childNodes[0], updates); } else { // 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 nodes in this node. - // Each children update from the viewer is complete when all the child - // nodes - // fill in their elements update. - // Once the matrix is constructed, the child nodes are given the list of - // updates - // equal to the updates requested by the viewer. + // 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 element updates corresponding to the number of child nodes in + // this node. Each children update from the viewer is complete when + // all the child nodes fill in their elements update. Once the + // matrix is constructed, the child nodes are given the list of + // updates equal to the updates requested by the viewer. VMHasChildrenUpdate[][] elementsUpdates = new VMHasChildrenUpdate[childNodes.length][updates.length]; for (int i = 0; i < updates.length; i++) { final IHasChildrenUpdate update = updates[i];