use of com.intellij.debugger.ui.tree.render.EnumerationChildrenRenderer 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());
}
}
use of com.intellij.debugger.ui.tree.render.EnumerationChildrenRenderer in project intellij-community by JetBrains.
the class DebuggerTreeRenderer method getValueIcon.
public static Icon getValueIcon(ValueDescriptorImpl valueDescriptor) {
Icon nodeIcon;
if (valueDescriptor instanceof FieldDescriptorImpl) {
FieldDescriptorImpl fieldDescriptor = (FieldDescriptorImpl) valueDescriptor;
nodeIcon = PlatformIcons.FIELD_ICON;
if (fieldDescriptor.getField().isFinal()) {
nodeIcon = new LayeredIcon(nodeIcon, AllIcons.Nodes.FinalMark);
}
if (fieldDescriptor.isStatic()) {
nodeIcon = new LayeredIcon(nodeIcon, AllIcons.Nodes.StaticMark);
}
} else if (valueDescriptor instanceof ThrownExceptionValueDescriptorImpl) {
nodeIcon = AllIcons.Nodes.ExceptionClass;
} else if (valueDescriptor instanceof MethodReturnValueDescriptorImpl) {
nodeIcon = AllIcons.Debugger.WatchLastReturnValue;
} else if (isParameter(valueDescriptor)) {
nodeIcon = PlatformIcons.PARAMETER_ICON;
} else if (valueDescriptor.isEnumConstant()) {
nodeIcon = PlatformIcons.ENUM_ICON;
} else if (valueDescriptor.isArray()) {
nodeIcon = AllIcons.Debugger.Db_array;
} else if (valueDescriptor.isPrimitive()) {
nodeIcon = AllIcons.Debugger.Db_primitive;
} else if (valueDescriptor instanceof WatchItemDescriptor) {
nodeIcon = AllIcons.Debugger.Watch;
} else {
nodeIcon = AllIcons.Debugger.Value;
}
if (valueDescriptor instanceof UserExpressionDescriptorImpl) {
EnumerationChildrenRenderer enumerationChildrenRenderer = EnumerationChildrenRenderer.getCurrent(((UserExpressionDescriptorImpl) valueDescriptor).getParentDescriptor());
if (enumerationChildrenRenderer != null && enumerationChildrenRenderer.isAppendDefaultChildren()) {
nodeIcon = AllIcons.Debugger.Watch;
}
}
// if watches in variables enabled, always use watch icon
if (valueDescriptor instanceof WatchItemDescriptor && nodeIcon != AllIcons.Debugger.Watch) {
XDebugSession session = XDebuggerManager.getInstance(valueDescriptor.getProject()).getCurrentSession();
if (session != null) {
XDebugSessionTab tab = ((XDebugSessionImpl) session).getSessionTab();
if (tab != null && tab.isWatchesInVariables()) {
nodeIcon = AllIcons.Debugger.Watch;
}
}
}
final Icon valueIcon = valueDescriptor.getValueIcon();
if (nodeIcon != null && valueIcon != null) {
nodeIcon = new RowIcon(nodeIcon, valueIcon);
}
return nodeIcon;
}
use of com.intellij.debugger.ui.tree.render.EnumerationChildrenRenderer 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();
}
}
Aggregations