Search in sources :

Example 6 with PyDebugValue

use of com.jetbrains.python.debugger.PyDebugValue in project intellij-community by JetBrains.

the class PyViewNumericContainerAction method update.

@Override
public void update(AnActionEvent e) {
    e.getPresentation().setVisible(false);
    TreePath[] paths = getSelectedPaths(e.getDataContext());
    if (paths != null) {
        if (paths.length > 1) {
            e.getPresentation().setVisible(false);
            return;
        }
        XValueNodeImpl node = getSelectedNode(e.getDataContext());
        if (node != null && node.getValueContainer() instanceof PyDebugValue && node.isComputed()) {
            PyDebugValue debugValue = (PyDebugValue) node.getValueContainer();
            String nodeType = debugValue.getType();
            if ("ndarray".equals(nodeType)) {
                e.getPresentation().setText("View as Array");
                e.getPresentation().setVisible(true);
            } else if (("DataFrame".equals(nodeType))) {
                e.getPresentation().setText("View as DataFrame");
                e.getPresentation().setVisible(true);
            } else {
                e.getPresentation().setVisible(false);
            }
        } else {
            e.getPresentation().setVisible(false);
        }
    }
}
Also used : PyDebugValue(com.jetbrains.python.debugger.PyDebugValue) TreePath(javax.swing.tree.TreePath) XValueNodeImpl(com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)

Example 7 with PyDebugValue

use of com.jetbrains.python.debugger.PyDebugValue in project intellij-community by JetBrains.

the class PyConsoleTask method setValue.

protected void setValue(String varName, String value) throws PyDebuggerException {
    PyDebugValue val = getValue(varName);
    myCommunication.changeVariable(val, value);
}
Also used : PyDebugValue(com.jetbrains.python.debugger.PyDebugValue)

Example 8 with PyDebugValue

use of com.jetbrains.python.debugger.PyDebugValue in project intellij-community by JetBrains.

the class GetFrameCommand method processResponse.

@Override
protected void processResponse(final ProtocolFrame response) throws PyDebuggerException {
    super.processResponse(response);
    final List<PyDebugValue> values = ProtocolParser.parseValues(response.getPayload(), myDebugProcess);
    myFrameVariables = new XValueChildrenList(values.size());
    for (PyDebugValue value : values) {
        if (!value.getName().startsWith(RemoteDebugger.TEMP_VAR_PREFIX)) {
            final PyDebugValue debugValue = extend(value);
            myFrameVariables.add(debugValue.getName(), debugValue);
        }
    }
}
Also used : PyDebugValue(com.jetbrains.python.debugger.PyDebugValue) XValueChildrenList(com.intellij.xdebugger.frame.XValueChildrenList)

Example 9 with PyDebugValue

use of com.jetbrains.python.debugger.PyDebugValue in project intellij-community by JetBrains.

the class PyViewNumericContainerAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
    Project p = e.getProject();
    if (p != null && node != null && node.getValueContainer() instanceof PyDebugValue && node.isComputed()) {
        PyDebugValue debugValue = (PyDebugValue) node.getValueContainer();
        showNumericViewer(p, debugValue);
    }
}
Also used : PyDebugValue(com.jetbrains.python.debugger.PyDebugValue) Project(com.intellij.openapi.project.Project)

Aggregations

PyDebugValue (com.jetbrains.python.debugger.PyDebugValue)9 Project (com.intellij.openapi.project.Project)1 XValueChildrenList (com.intellij.xdebugger.frame.XValueChildrenList)1 XValueNodeImpl (com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl)1 PyDebuggerException (com.jetbrains.python.debugger.PyDebuggerException)1 TreePath (javax.swing.tree.TreePath)1