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


Java Renderer类代码示例

本文整理汇总了Java中com.intellij.debugger.ui.tree.render.Renderer的典型用法代码示例。如果您正苦于以下问题:Java Renderer类的具体用法?Java Renderer怎么用?Java Renderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Renderer类属于com.intellij.debugger.ui.tree.render包,在下文中一共展示了Renderer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public Renderer readRenderer(Element root) throws InvalidDataException {
  if (root == null) {
    return null;
  }

  if (!RENDERER_TAG.equals(root.getName())) {
    throw new InvalidDataException("Cannot read renderer - tag name is not '" + RENDERER_TAG + "'");
  }

  final String rendererId = root.getAttributeValue(RENDERER_ID);
  if(rendererId == null) {
    throw new InvalidDataException("unknown renderer ID: " + rendererId);
  }

  final Renderer renderer = createRenderer(rendererId);
  if(renderer == null) {
    throw new InvalidDataException("unknown renderer ID: " + rendererId);
  }

  renderer.readExternal(root);

  return renderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:NodeRendererSettings.java

示例2: getArrayRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
@Nullable
public static ArrayRenderer getArrayRenderer(XValue value)
{
	if(value instanceof JavaValue)
	{
		ValueDescriptorImpl descriptor = ((JavaValue) value).getDescriptor();
		Renderer lastRenderer = descriptor.getLastRenderer();
		if(lastRenderer instanceof CompoundNodeRenderer)
		{
			ChildrenRenderer childrenRenderer = ((CompoundNodeRenderer) lastRenderer).getChildrenRenderer();
			if(childrenRenderer instanceof ExpressionChildrenRenderer)
			{
				lastRenderer = ExpressionChildrenRenderer.getLastChildrenRenderer(descriptor);
				if(lastRenderer == null)
				{
					lastRenderer = ((ExpressionChildrenRenderer) childrenRenderer).getPredictedRenderer();
				}
			}
		}
		if(lastRenderer instanceof ArrayRenderer)
		{
			return (ArrayRenderer) lastRenderer;
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:ArrayAction.java

示例3: calcIdLabel

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
private String calcIdLabel() {
  //translate only strings in quotes
  if(isShowIdLabel() && myValueReady) {
    final Value value = getValue();
    Renderer lastRenderer = getLastRenderer();
    final EvaluationContextImpl evalContext = myStoredEvaluationContext;
    return evalContext != null && lastRenderer != null && !evalContext.getSuspendContext().isResumed()?
                           ((NodeRendererImpl)lastRenderer).getIdLabel(value, evalContext.getDebugProcess()) :
                           null;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ValueDescriptorImpl.java

示例4: writeRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public Element writeRenderer(Renderer renderer) throws WriteExternalException {
  Element root = new Element(RENDERER_TAG);
  if(renderer != null) {
    root.setAttribute(RENDERER_ID  , renderer.getUniqueId());
    renderer.writeExternal(root);
  }
  return root;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:NodeRendererSettings.java

示例5: createRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public Renderer createRenderer(final String rendererId) {
  if (ClassRenderer.UNIQUE_ID.equals(rendererId)) {
    return myClassRenderer;
  }
  else if (ArrayRenderer.UNIQUE_ID.equals(rendererId)) {
    return myArrayRenderer;
  }
  else if (PrimitiveRenderer.UNIQUE_ID.equals(rendererId)) {
    return myPrimitiveRenderer;
  }
  else if(HexRenderer.UNIQUE_ID.equals(rendererId)) {
    return myHexRenderer;
  }
  else if(rendererId.equals(ExpressionChildrenRenderer.UNIQUE_ID)) {
    return new ExpressionChildrenRenderer();
  }
  else if(rendererId.equals(LabelRenderer.UNIQUE_ID)) {
    return new LabelRenderer();
  }
  else if(rendererId.equals(EnumerationChildrenRenderer.UNIQUE_ID)) {
    return new EnumerationChildrenRenderer();
  }
  else if(rendererId.equals(ToStringRenderer.UNIQUE_ID)) {
    return myToStringRenderer;
  }
  else if(rendererId.equals(CompoundNodeRenderer.UNIQUE_ID) || rendererId.equals(REFERENCE_RENDERER)) {
    return createCompoundReferenceRenderer("unnamed", CommonClassNames.JAVA_LANG_OBJECT, null, null);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:NodeRendererSettings.java

示例6: setArrayRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public static void setArrayRenderer(ArrayRenderer newRenderer, @NotNull XValueNodeImpl node, @NotNull DebuggerContextImpl debuggerContext)
{
	XValue container = node.getValueContainer();

	ArrayRenderer renderer = getArrayRenderer(container);
	if(renderer == null)
	{
		return;
	}

	ValueDescriptorImpl descriptor = ((JavaValue) container).getDescriptor();

	DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
	if(debugProcess != null)
	{
		debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext())
		{
			@Override
			public void contextAction(@NotNull SuspendContextImpl suspendContext) throws Exception
			{
				final Renderer lastRenderer = descriptor.getLastRenderer();
				if(lastRenderer instanceof ArrayRenderer)
				{
					((JavaValue) container).setRenderer(newRenderer, node);
					node.invokeNodeUpdate(() -> node.getTree().expandPath(node.getPath()));
				}
				else if(lastRenderer instanceof CompoundNodeRenderer)
				{
					final CompoundNodeRenderer compoundRenderer = (CompoundNodeRenderer) lastRenderer;
					final ChildrenRenderer childrenRenderer = compoundRenderer.getChildrenRenderer();
					if(childrenRenderer instanceof ExpressionChildrenRenderer)
					{
						ExpressionChildrenRenderer.setPreferableChildrenRenderer(descriptor, newRenderer);
						((JavaValue) container).reBuild(node);
					}
				}
			}
		});
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:41,代码来源:ArrayAction.java

示例7: calcIdLabel

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
private String calcIdLabel()
{
	//translate only strings in quotes
	if(isShowIdLabel() && myValueReady)
	{
		final Value value = getValue();
		Renderer lastRenderer = getLastRenderer();
		final EvaluationContextImpl evalContext = myStoredEvaluationContext;
		return evalContext != null && lastRenderer != null && !evalContext.getSuspendContext().isResumed() ? ((NodeRendererImpl) lastRenderer).getIdLabel(value, evalContext.getDebugProcess()) :
				null;
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:ValueDescriptorImpl.java

示例8: getLastRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public Renderer getLastRenderer() {
  return myRenderer != null ? myRenderer: myAutoRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ValueDescriptorImpl.java

示例9: isBase

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public boolean isBase(final Renderer renderer) {
  return renderer == myPrimitiveRenderer || renderer == myArrayRenderer || renderer == myClassRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:NodeRendererSettings.java

示例10: getLastRenderer

import com.intellij.debugger.ui.tree.render.Renderer; //导入依赖的package包/类
public Renderer getLastRenderer()
{
	return myRenderer != null ? myRenderer : myAutoRenderer;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:5,代码来源:ValueDescriptorImpl.java


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