Search in sources :

Example 1 with CPUSnapshotNode

use of com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode 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 2 with CPUSnapshotNode

use of com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode in project intellij-plugins by JetBrains.

the class ActionScriptProfileControlPanel method setupComponents.

private void setupComponents() {
    EditSourceOnDoubleClickHandler.install(snapshotTree);
    PopupHandler.installPopupHandler(snapshotTree, PROFILER_SNAPSHOT_GROUP_ID, ActionPlaces.UNKNOWN);
    snapshotTree.setCellRenderer(new ColoredTreeCellRenderer() {

        @Override
        public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            setIcon(value instanceof CPUSnapshotNode ? FlexProfilerIcons.SnapshotCPU : FlexProfilerIcons.LiveObjects);
            if (value.toString() != null) {
                append(value.toString());
            }
        }
    });
}
Also used : CPUSnapshotNode(com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode) ColoredTreeCellRenderer(com.intellij.ui.ColoredTreeCellRenderer)

Aggregations

CPUSnapshotNode (com.jetbrains.actionscript.profiler.ui.node.CPUSnapshotNode)2 ColoredTreeCellRenderer (com.intellij.ui.ColoredTreeCellRenderer)1 Date (java.util.Date)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 MutableTreeNode (javax.swing.tree.MutableTreeNode)1