当前位置: 首页>>代码示例>>Java>>正文


Java UserExpressionData类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:EnumerationChildrenRenderer.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:EnumerationChildrenRenderer.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ArrayMapRendererBase.java


注:本文中的com.intellij.debugger.impl.descriptors.data.UserExpressionData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。