Search in sources :

Example 1 with HeapClassObjNode

use of com.android.tools.idea.editors.hprof.views.nodedata.HeapClassObjNode in project android by JetBrains.

the class ClassesTreeView method getTargetFiles.

@Nullable
private PsiClassNavigation[] getTargetFiles() {
    TreePath path = myTree.getSelectionPath();
    if (path.getPathCount() < 2) {
        return null;
    }
    assert path.getLastPathComponent() instanceof HeapNode;
    HeapNode node = (HeapNode) path.getLastPathComponent();
    if (node instanceof HeapClassObjNode) {
        ClassObj classObj = ((HeapClassObjNode) node).getClassObj();
        String className = classObj.getClassName();
        int arrayIndex = className.indexOf("[");
        if (arrayIndex >= 0) {
            className = className.substring(0, arrayIndex);
        }
        return PsiClassNavigation.getNavigationForClass(myProject, className);
    }
    return null;
}
Also used : ClassObj(com.android.tools.perflib.heap.ClassObj) HeapNode(com.android.tools.idea.editors.hprof.views.nodedata.HeapNode) TreePath(javax.swing.tree.TreePath) HeapClassObjNode(com.android.tools.idea.editors.hprof.views.nodedata.HeapClassObjNode) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

HeapClassObjNode (com.android.tools.idea.editors.hprof.views.nodedata.HeapClassObjNode)1 HeapNode (com.android.tools.idea.editors.hprof.views.nodedata.HeapNode)1 ClassObj (com.android.tools.perflib.heap.ClassObj)1 TreePath (javax.swing.tree.TreePath)1 Nullable (org.jetbrains.annotations.Nullable)1