Search in sources :

Example 1 with AllocationStack

use of com.android.tools.profiler.proto.MemoryProfiler.AllocationStack in project android by JetBrains.

the class MemoryInstanceView method instanceChanged.

private void instanceChanged() {
    if (mySplitter == null || myInstanceObject == myStage.getSelectedInstance()) {
        return;
    }
    myInstanceObject = myStage.getSelectedInstance();
    if (myInstanceObject == null) {
        mySplitter.setSecondComponent(null);
        return;
    }
    AllocationStack callStack = myInstanceObject.getCallStack();
    if (callStack == null || callStack.getStackFramesList().size() == 0) {
        return;
    }
    DefaultListModel<StackTraceElement> model = new DefaultListModel<>();
    callStack.getStackFramesList().forEach(frame -> model.addElement(new StackTraceElement(frame.getClassName(), frame.getMethodName(), frame.getFileName(), frame.getLineNumber())));
    mySplitter.setSecondComponent(new JBScrollPane(new JBList(model)));
}
Also used : JBList(com.intellij.ui.components.JBList) JBScrollPane(com.intellij.ui.components.JBScrollPane) AllocationStack(com.android.tools.profiler.proto.MemoryProfiler.AllocationStack)

Aggregations

AllocationStack (com.android.tools.profiler.proto.MemoryProfiler.AllocationStack)1 JBList (com.intellij.ui.components.JBList)1 JBScrollPane (com.intellij.ui.components.JBScrollPane)1