Search in sources :

Example 1 with InstancesProvider

use of com.intellij.debugger.memory.utils.InstancesProvider 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 2 with InstancesProvider

use of com.intellij.debugger.memory.utils.InstancesProvider in project intellij-community by JetBrains.

the class ShowNewInstancesAction method isEnabled.

@Override
protected boolean isEnabled(AnActionEvent e) {
    final ReferenceType selectedClass = getSelectedClass(e);
    final InstancesProvider provider = e.getData(ClassesTable.NEW_INSTANCES_PROVIDER_KEY);
    final int count = getInstancesCount(e);
    return super.isEnabled(e) && selectedClass != null && provider != null && count > 0;
}
Also used : InstancesProvider(com.intellij.debugger.memory.utils.InstancesProvider) ReferenceType(com.sun.jdi.ReferenceType)

Aggregations

InstancesProvider (com.intellij.debugger.memory.utils.InstancesProvider)2 ReferenceType (com.sun.jdi.ReferenceType)2 InstancesWindow (com.intellij.debugger.memory.ui.InstancesWindow)1 Project (com.intellij.openapi.project.Project)1 XDebugSession (com.intellij.xdebugger.XDebugSession)1