Search in sources :

Example 6 with MutableTreeNode

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());
    });
}
Also used : CPUSnapshotNode(com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode) Date(java.util.Date) MutableTreeNode(javax.swing.tree.MutableTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode)

Example 7 with MutableTreeNode

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;
        }
    }
}
Also used : MutableTreeNode(javax.swing.tree.MutableTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode)

Example 8 with MutableTreeNode

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();
        }
    }
}
Also used : TreeNode(javax.swing.tree.TreeNode) MutableTreeNode(javax.swing.tree.MutableTreeNode)

Example 9 with MutableTreeNode

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++);
    }
}
Also used : FrameInfo(com.jetbrains.actionscript.profiler.sampler.FrameInfo) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) CallInfo(com.jetbrains.actionscript.profiler.vo.CallInfo) MutableTreeNode(javax.swing.tree.MutableTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode)

Example 10 with MutableTreeNode

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);
    }
}
Also used : MutableTreeNode(javax.swing.tree.MutableTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode)

Aggregations

MutableTreeNode (javax.swing.tree.MutableTreeNode)13 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)9 TreeNode (javax.swing.tree.TreeNode)3 Nullable (org.jetbrains.annotations.Nullable)2 Module (com.intellij.openapi.module.Module)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiDirectory (com.intellij.psi.PsiDirectory)1 PsiFile (com.intellij.psi.PsiFile)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 RefactoringElementListener (com.intellij.refactoring.listeners.RefactoringElementListener)1 RefactoringElementListenerProvider (com.intellij.refactoring.listeners.RefactoringElementListenerProvider)1 ListTreeTableModelOnColumns (com.intellij.ui.treeStructure.treetable.ListTreeTableModelOnColumns)1 TreeTableTree (com.intellij.ui.treeStructure.treetable.TreeTableTree)1 IncorrectOperationException (com.intellij.util.IncorrectOperationException)1 ColumnInfo (com.intellij.util.ui.ColumnInfo)1 FrameInfo (com.jetbrains.actionscript.profiler.sampler.FrameInfo)1 CPUSnapshotNode (com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode)1 CallInfo (com.jetbrains.actionscript.profiler.vo.CallInfo)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1