Search in sources :

Example 1 with UserExpressionDescriptorImpl

use of com.intellij.debugger.ui.impl.watch.UserExpressionDescriptorImpl in project intellij-community by JetBrains.

the class RemoveCustomFieldAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
    UserExpressionDescriptorImpl descriptor = (UserExpressionDescriptorImpl) ((JavaValue) node.getValueContainer()).getDescriptor();
    EnumerationChildrenRenderer enumerationChildrenRenderer = getParentEnumerationRenderer(descriptor);
    if (enumerationChildrenRenderer != null) {
        enumerationChildrenRenderer.getChildren().remove(descriptor.getEnumerationIndex());
        TreeNode parent = node.getParent();
        int index = parent.getIndex(node);
        int indexToSelect = index + 1 < parent.getChildCount() ? index + 1 : index - 1;
        TreeUtil.selectNode(node.getTree(), indexToSelect >= 0 ? parent.getChildAt(indexToSelect) : parent);
        XDebuggerUtilImpl.rebuildTreeAndViews(node.getTree());
    }
}
Also used : EnumerationChildrenRenderer(com.intellij.debugger.ui.tree.render.EnumerationChildrenRenderer) UserExpressionDescriptorImpl(com.intellij.debugger.ui.impl.watch.UserExpressionDescriptorImpl) TreeNode(javax.swing.tree.TreeNode)

Example 2 with UserExpressionDescriptorImpl

use of com.intellij.debugger.ui.impl.watch.UserExpressionDescriptorImpl in project intellij-community by JetBrains.

the class EditCustomFieldAction method perform.

@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
    ValueDescriptorImpl descriptor = ((JavaValue) node.getValueContainer()).getDescriptor();
    EnumerationChildrenRenderer enumerationChildrenRenderer = getParentEnumerationRenderer(descriptor);
    if (enumerationChildrenRenderer != null) {
        new CustomFieldInplaceEditor(node, (UserExpressionDescriptorImpl) descriptor, enumerationChildrenRenderer).show();
    }
}
Also used : EnumerationChildrenRenderer(com.intellij.debugger.ui.tree.render.EnumerationChildrenRenderer) ValueDescriptorImpl(com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl) JavaValue(com.intellij.debugger.engine.JavaValue) UserExpressionDescriptorImpl(com.intellij.debugger.ui.impl.watch.UserExpressionDescriptorImpl) CustomFieldInplaceEditor(com.intellij.debugger.ui.tree.render.CustomFieldInplaceEditor)

Aggregations

UserExpressionDescriptorImpl (com.intellij.debugger.ui.impl.watch.UserExpressionDescriptorImpl)2 EnumerationChildrenRenderer (com.intellij.debugger.ui.tree.render.EnumerationChildrenRenderer)2 JavaValue (com.intellij.debugger.engine.JavaValue)1 ValueDescriptorImpl (com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl)1 CustomFieldInplaceEditor (com.intellij.debugger.ui.tree.render.CustomFieldInplaceEditor)1 TreeNode (javax.swing.tree.TreeNode)1