use of javax.swing.tree.MutableTreeNode in project intellij-plugins by JetBrains.
the class ActionScriptProfileControlPanel method doCPUSnapshot.
private void doCPUSnapshot() {
final CPUSnapshotNode newNode = new CPUSnapshotNode(runConfigurationName, module, new Date(), profilerDataConsumer.getProfileData().getCallTree());
ApplicationManager.getApplication().invokeLater(() -> {
final MutableTreeNode root = (MutableTreeNode) treeModel.getRoot();
treeModel.insertNodeInto(newNode, root, root.getChildCount());
});
}
use of javax.swing.tree.MutableTreeNode in project intellij-plugins by JetBrains.
the class LiveModelController method filterByScope.
private void filterByScope(SortableListTreeTableModel model) {
final MutableTreeNode root = (MutableTreeNode) model.getRoot();
int i = 0;
Iterator<SizeInfoNode> iterator = filteredClasses.iterator();
while (iterator.hasNext()) {
final SizeInfoNode node = iterator.next();
if (scope == null || ResolveUtil.containsInScope(node.getQName(), scope)) {
root.insert(node, root.getChildCount());
iterator.remove();
++i;
}
}
while (i < root.getChildCount()) {
final SizeInfoNode child = (SizeInfoNode) root.getChildAt(i);
if (scope != null && !ResolveUtil.containsInScope(child.getQName(), scope)) {
root.remove(i);
filteredClasses.add(child);
} else {
++i;
}
}
}
use of javax.swing.tree.MutableTreeNode in project intellij-community by JetBrains.
the class RefElementNode method checkHasDescriptorUnder.
private void checkHasDescriptorUnder(MutableTreeNode newChild) {
if (myHasDescriptorsUnder)
return;
if (newChild instanceof ProblemDescriptionNode || newChild instanceof RefElementNode && ((RefElementNode) newChild).hasDescriptorsUnder()) {
myHasDescriptorsUnder = true;
TreeNode parent = getParent();
while (parent instanceof RefElementNode) {
((RefElementNode) parent).myHasDescriptorsUnder = true;
parent = parent.getParent();
}
}
}
use of javax.swing.tree.MutableTreeNode in project intellij-plugins by JetBrains.
the class CPUSnapshotView method fillTreeModelRoot.
private <T extends Sample> void fillTreeModelRoot(TreeNode node, CallTree callTree, final Map<FrameInfo, Long> countMap, final Map<FrameInfo, Long> selfCountMap, boolean backTrace, FrameInfo[] frames) {
final MutableTreeNode root = (MutableTreeNode) node;
List<FrameInfo> traces = scopeMatcher.fun(new ArrayList<>(countMap.keySet()));
GlobalSearchScope scope = getCurrentScope();
int index = 0;
for (final FrameInfo s : traces) {
root.insert(new MergedCallNode<T>(new CallInfo(s, countMap.get(s), selfCountMap.get(s)), callTree, frames, backTrace, scope), index++);
}
}
use of javax.swing.tree.MutableTreeNode in project intellij-plugins by JetBrains.
the class LiveModelController method removeUselessNodes.
private static void removeUselessNodes(MutableTreeNode root) {
for (int i = 0; i < root.getChildCount(); ++i) {
MutableTreeNode child = (MutableTreeNode) root.getChildAt(i);
if (child instanceof SizeInfoNode) {
if (((SizeInfoNode) child).getCount() <= 0) {
root.remove(child);
continue;
}
}
removeUselessNodes(child);
}
}
Aggregations