From dc2da954144f2f0e28755845dd1e3fd3858afc2c Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 26 Jul 2013 15:40:12 +0200 Subject: [PATCH] Overrides, SmartList --- .../xdebugger/frame/XValueChildrenList.java | 6 ++++-- .../impl/ui/tree/nodes/XValueContainerNode.java | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueChildrenList.java b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueChildrenList.java index 94fec3b690e6..aff088a71ee4 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueChildrenList.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueChildrenList.java @@ -15,6 +15,7 @@ */ package com.intellij.xdebugger.frame; +import com.intellij.util.SmartList; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -27,6 +28,7 @@ import java.util.List; */ public class XValueChildrenList { public static final XValueChildrenList EMPTY = new XValueChildrenList(Collections.emptyList(), Collections.emptyList()); + private final List myNames; private final List myValues; @@ -36,8 +38,8 @@ public class XValueChildrenList { } public XValueChildrenList() { - myNames = new ArrayList(); - myValues = new ArrayList(); + myNames = new SmartList(); + myValues = new SmartList(); } public static XValueChildrenList singleton(String name, @NotNull XValue value) { diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java index 4be1ddc797a0..e8fe7ed2394d 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueContainerNode.java @@ -16,6 +16,7 @@ package com.intellij.xdebugger.impl.ui.tree.nodes; import com.intellij.ui.SimpleTextAttributes; +import com.intellij.util.SmartList; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.SortedList; import com.intellij.xdebugger.frame.*; @@ -65,10 +66,12 @@ public abstract class XValueContainerNode(); } } - List> newChildren = new ArrayList>(); + List> newChildren = new SmartList>(); for (int i = 0; i < children.size(); i++) { XValueNodeImpl node = new XValueNodeImpl(myTree, XValueContainerNode.this, children.getName(i), children.getValue(i)); myValueChildren.add(node); @@ -105,26 +109,31 @@ public abstract class XValueContainerNode children, final boolean last) { - final XValueChildrenList list = new XValueChildrenList(); + final XValueChildrenList list = new XValueChildrenList(children.size()); for (XValue child : children) { list.add(null, child); } addChildren(list, last); } + @Override public void tooManyChildren(final int remaining) { DebuggerUIUtil.invokeLater(new Runnable() { + @Override public void run() { setTemporaryMessageNode(MessageTreeNode.createEllipsisNode(myTree, XValueContainerNode.this, remaining)); } }); } + @Override public boolean isObsolete() { return myObsolete; } + @Override public void clearChildren() { myCachedAllChildren = null; myMessageChildren = null; @@ -133,6 +142,7 @@ public abstract class XValueContainerNode getChildren() { loadChildren(); @@ -200,6 +212,7 @@ public abstract class XValueContainerNode getLoadedChildren() { return myValueChildren;