本文整理汇总了Java中com.intellij.debugger.impl.descriptors.data.UserExpressionData类的典型用法代码示例。如果您正苦于以下问题:Java UserExpressionData类的具体用法?Java UserExpressionData怎么用?Java UserExpressionData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UserExpressionData类属于com.intellij.debugger.impl.descriptors.data包,在下文中一共展示了UserExpressionData类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildChildren
import com.intellij.debugger.impl.descriptors.data.UserExpressionData; //导入依赖的package包/类
@Override
public void buildChildren(Value value, ChildrenBuilder builder, EvaluationContext evaluationContext)
{
NodeManager nodeManager = builder.getNodeManager();
NodeDescriptorFactory descriptorFactory = builder.getDescriptorManager();
List<DebuggerTreeNode> children = new ArrayList<>();
int idx = 0;
for(ChildInfo childInfo : myChildren)
{
UserExpressionData data = new UserExpressionData((ValueDescriptorImpl) builder.getParentDescriptor(), getClassName(), childInfo.myName, childInfo.myExpression);
data.setEnumerationIndex(idx++);
UserExpressionDescriptor descriptor = descriptorFactory.getUserExpressionDescriptor(builder.getParentDescriptor(), data);
if(childInfo.myOnDemand)
{
descriptor.putUserData(OnDemandRenderer.ON_DEMAND_CALCULATED, false);
}
children.add(nodeManager.createNode(descriptor, evaluationContext));
}
builder.addChildren(children, !myAppendDefaultChildren);
if(myAppendDefaultChildren)
{
DebugProcessImpl.getDefaultRenderer(value).buildChildren(value, builder, evaluationContext);
}
}
示例2: buildChildren
import com.intellij.debugger.impl.descriptors.data.UserExpressionData; //导入依赖的package包/类
public void buildChildren(Value value, ChildrenBuilder builder, EvaluationContext evaluationContext) {
NodeManager nodeManager = builder.getNodeManager();
NodeDescriptorFactory descriptorFactory = builder.getDescriptorManager();
List<DebuggerTreeNode> children = new ArrayList<DebuggerTreeNode>();
for (Pair<String, TextWithImports> pair : myChildren) {
children.add(nodeManager.createNode(descriptorFactory.getUserExpressionDescriptor(
builder.getParentDescriptor(),
new UserExpressionData((ValueDescriptorImpl)builder.getParentDescriptor(), getClassName(), pair.getFirst(), pair.getSecond())), evaluationContext)
);
}
builder.setChildren(children);
}
示例3: buildChildren
import com.intellij.debugger.impl.descriptors.data.UserExpressionData; //导入依赖的package包/类
/** Builds a list of {@link DebuggerTreeNode}'s that are the children of this node. */
@Override
public void buildChildren(Value value, ChildrenBuilder builder, EvaluationContext evaluationContext) {
DebuggerManagerThreadImpl.assertIsManagerThread();
List<DebuggerTreeNode> children = new ArrayList<DebuggerTreeNode>();
NodeManagerImpl nodeManager = (NodeManagerImpl)builder.getNodeManager();
NodeDescriptorFactory descriptorFactory = builder.getDescriptorManager();
int size;
try {
size = getArrayMapSize(value, evaluationContext);
} catch (Exception e) {
size = 0;
}
for (int i = 0, n = Math.min(size, MAX_CHILDREN); i < n; i++) {
// For each entry, display the value at that entry. TODO: we need to show the key corresponding to this as well.
// We used to show the key and value by using the following expression:
// String expression = String.format("new Object[] {this.keyAt(%1$d), this.valueAt(%2$d)}", i, i);
// But it turns out that this throws "java.lang.ClassNotFoundException: [LObject;"
// Until we find an alternate scheme, just show the value.
String expression = String.format("this.valueAt(%1$d)", i);
UserExpressionData descriptorData =
new UserExpressionData((ValueDescriptorImpl)builder.getParentDescriptor(), myFqn, String.format("value[%1$d]", i),
new TextWithImportsImpl(CodeFragmentKind.EXPRESSION,
expression,
"",
StdFileTypes.JAVA));
UserExpressionDescriptor userExpressionDescriptor =
descriptorFactory.getUserExpressionDescriptor(builder.getParentDescriptor(), descriptorData);
DebuggerTreeNode arrayMapItemNode = nodeManager.createNode(userExpressionDescriptor, evaluationContext);
children.add(arrayMapItemNode);
}
if (size > MAX_CHILDREN) {
children.add(nodeManager.createMessageNode(new MessageDescriptor(MORE_ELEMENTS, MessageDescriptor.SPECIAL)));
}
builder.setChildren(children);
}