Search in sources :

Example 1 with InstancesWindow

use of com.intellij.debugger.memory.ui.InstancesWindow in project intellij-community by JetBrains.

the class ShowInstancesFromClassesViewAction method perform.

@Override
protected void perform(AnActionEvent e) {
    final Project project = e.getProject();
    final ReferenceType selectedClass = getSelectedClass(e);
    if (project != null && selectedClass != null) {
        final XDebugSession debugSession = XDebuggerManager.getInstance(project).getCurrentSession();
        if (debugSession != null) {
            new InstancesWindow(debugSession, limit -> selectedClass.instances(limit), selectedClass.name()).show();
        }
    }
}
Also used : ClassesTable(com.intellij.debugger.memory.ui.ClassesTable) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) ReferenceType(com.sun.jdi.ReferenceType) Project(com.intellij.openapi.project.Project) XDebuggerManager(com.intellij.xdebugger.XDebuggerManager) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) XDebugSession(com.intellij.xdebugger.XDebugSession) Project(com.intellij.openapi.project.Project) XDebugSession(com.intellij.xdebugger.XDebugSession) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) ReferenceType(com.sun.jdi.ReferenceType)

Example 2 with InstancesWindow

use of com.intellij.debugger.memory.ui.InstancesWindow in project intellij-community by JetBrains.

the class ShowNewInstancesAction method perform.

@Override
protected void perform(AnActionEvent e) {
    final Project project = e.getProject();
    final ReferenceType selectedClass = getSelectedClass(e);
    final InstancesProvider provider = e.getData(ClassesTable.NEW_INSTANCES_PROVIDER_KEY);
    final XDebugSession session = project != null ? XDebuggerManager.getInstance(project).getCurrentSession() : null;
    if (selectedClass != null && provider != null && session != null) {
        new InstancesWindow(session, provider, selectedClass.name()).show();
    }
}
Also used : InstancesProvider(com.intellij.debugger.memory.utils.InstancesProvider) Project(com.intellij.openapi.project.Project) XDebugSession(com.intellij.xdebugger.XDebugSession) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) ReferenceType(com.sun.jdi.ReferenceType)

Example 3 with InstancesWindow

use of com.intellij.debugger.memory.ui.InstancesWindow in project intellij-community by JetBrains.

the class ShowInstancesByClassAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
    final Project project = e.getProject();
    if (project != null) {
        final XDebugSession debugSession = XDebuggerManager.getInstance(project).getCurrentSession();
        final ObjectReference ref = getObjectReference(node);
        if (debugSession != null && ref != null) {
            final ReferenceType referenceType = ref.referenceType();
            new InstancesWindow(debugSession, l -> {
                final List<ObjectReference> instances = referenceType.instances(l);
                return instances == null ? Collections.emptyList() : instances;
            }, referenceType.name()).show();
        }
    }
}
Also used : List(java.util.List) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl) StringUtil(com.intellij.openapi.util.text.StringUtil) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) ReferenceType(com.sun.jdi.ReferenceType) Project(com.intellij.openapi.project.Project) XDebuggerManager(com.intellij.xdebugger.XDebuggerManager) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) ObjectReference(com.sun.jdi.ObjectReference) NotNull(org.jetbrains.annotations.NotNull) XDebugSession(com.intellij.xdebugger.XDebugSession) Collections(java.util.Collections) Project(com.intellij.openapi.project.Project) XDebugSession(com.intellij.xdebugger.XDebugSession) InstancesWindow(com.intellij.debugger.memory.ui.InstancesWindow) ObjectReference(com.sun.jdi.ObjectReference) List(java.util.List) ReferenceType(com.sun.jdi.ReferenceType)

Aggregations

InstancesWindow (com.intellij.debugger.memory.ui.InstancesWindow)3 Project (com.intellij.openapi.project.Project)3 XDebugSession (com.intellij.xdebugger.XDebugSession)3 ReferenceType (com.sun.jdi.ReferenceType)3 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)2 XDebuggerManager (com.intellij.xdebugger.XDebuggerManager)2 ClassesTable (com.intellij.debugger.memory.ui.ClassesTable)1 InstancesProvider (com.intellij.debugger.memory.utils.InstancesProvider)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)1 ObjectReference (com.sun.jdi.ObjectReference)1 Collections (java.util.Collections)1 List (java.util.List)1 NotNull (org.jetbrains.annotations.NotNull)1