Skip to content

Commit ecc08c2

Browse files
committed
Merge branch 'master' into graal
2 parents ef0491e + 07b9a46 commit ecc08c2

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/model/RootNode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import javax.swing.SortOrder;
3333
import org.graalvm.visualvm.lib.jfluid.heap.Heap;
3434
import org.graalvm.visualvm.heapviewer.HeapContext;
35+
import org.graalvm.visualvm.heapviewer.ui.HeapViewerRenderer;
3536
import org.openide.util.Lookup;
3637

3738
/**
@@ -66,6 +67,9 @@ public abstract class RootNode extends HeapViewerNode {
6667
protected abstract HeapViewerNode[] retrieveChildren(HeapViewerNode node);
6768

6869

70+
public abstract HeapViewerRenderer resolveRenderer(HeapViewerNode node);
71+
72+
6973
// public RootNode() {
7074
// this(NO_NODES);
7175
// }

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/ui/HeapViewerRendererWrapper.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import javax.accessibility.AccessibleContext;
2828
import javax.swing.JComponent;
29-
import org.graalvm.visualvm.heapviewer.model.HeapViewerNode;
3029

3130
/**
3231
*
@@ -38,9 +37,7 @@ public abstract class HeapViewerRendererWrapper implements HeapViewerRenderer {
3837

3938
@Override
4039
public void setValue(Object value, int row) {
41-
HeapViewerNode node = getNode(value);
42-
renderer = getRenderer(node);
43-
renderer.setValue(node, row);
40+
renderer = getRenderer(value, row);
4441
}
4542

4643
@Override
@@ -73,8 +70,7 @@ public AccessibleContext getAccessibleContext() {
7370
return renderer.getAccessibleContext();
7471
}
7572

76-
protected abstract HeapViewerNode getNode(Object value);
7773

78-
protected abstract HeapViewerRenderer getRenderer(HeapViewerNode node);
74+
protected abstract HeapViewerRenderer getRenderer(Object value, int row);
7975

8076
}

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/ui/TreeTableView.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public TreeTableView(String viewID, HeapContext context, HeapViewerActions actio
144144
public void updateChildren(HeapViewerNode node) { if (model != null) model.childrenChanged(root); childrenChanged(); /*if (treeTable != null) treeTable.resetExpandedNodes();*/ }
145145
protected HeapViewerNode[] retrieveChildren(HeapViewerNode node) { return nodesCache.retrieveChildren(node); }
146146
protected HeapViewerNode[] lazilyComputeChildren(Heap heap, String viewID, HeapViewerNodeFilter viewFilter, List<DataType> dataTypes, List<SortOrder> sortOrders, Progress progress) { return TreeTableView.this.computeData(root, heap, viewID, viewFilter, dataTypes, sortOrders, progress); }
147+
public HeapViewerRenderer resolveRenderer(HeapViewerNode node) { return TreeTableView.this.resolveNodeRenderer(node); }
147148
};
148149
currentRoot = root;
149150

@@ -403,9 +404,13 @@ private TreeTableViewRenderer getNodesRenderer() {
403404
return nodesRenderer;
404405
}
405406

406-
public HeapViewerRenderer getNodeRenderer(HeapViewerNode node) {
407+
private HeapViewerRenderer resolveNodeRenderer(HeapViewerNode node) {
407408
TreeTableViewRenderer viewRenderer = getNodesRenderer();
408-
HeapViewerRenderer nodeRenderer = viewRenderer.resolve(node.getClass());
409+
return viewRenderer.resolve(node.getClass());
410+
}
411+
412+
public HeapViewerRenderer getNodeRenderer(HeapViewerNode node) {
413+
HeapViewerRenderer nodeRenderer = resolveNodeRenderer(node);
409414
nodeRenderer.setValue(node, -1);
410415
return nodeRenderer;
411416
}

0 commit comments

Comments
 (0)