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


Java NodeDescriptor.toString方法代码示例

本文整理汇总了Java中com.intellij.ide.util.treeView.NodeDescriptor.toString方法的典型用法代码示例。如果您正苦于以下问题:Java NodeDescriptor.toString方法的具体用法?Java NodeDescriptor.toString怎么用?Java NodeDescriptor.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.util.treeView.NodeDescriptor的用法示例。


在下文中一共展示了NodeDescriptor.toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: forNodeDescriptorInTree

import com.intellij.ide.util.treeView.NodeDescriptor; //导入方法依赖的package包/类
public static CellAppearanceEx forNodeDescriptorInTree(Object node, boolean expanded) {
  NodeDescriptor descriptor = getNodeDescriptor(node);
  if (descriptor == null) return FileAppearanceService.getInstance().empty();
  String name = descriptor.toString();
  Object psiElement = descriptor.getElement();
  ModifiableCellAppearanceEx result;
  if (psiElement instanceof PsiElement && !((PsiElement)psiElement).isValid()) {
    result = CompositeAppearance.single(name);
  }
  else {
    PsiClass psiClass = getContainingClass(psiElement);
    if (isInheritedMember(node, psiClass) && psiClass != null) {
      CompositeAppearance.DequeEnd ending = new CompositeAppearance().getEnding();
      ending.addText(name, applyDeprecation(psiElement, SimpleTextAttributes.DARK_TEXT));
      ending.addComment(psiClass.getName(), applyDeprecation(psiClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
      result = ending.getAppearance();
    }
    else {
      SimpleTextAttributes textAttributes = applyDeprecation(psiElement, SimpleTextAttributes.REGULAR_ATTRIBUTES);
      result = CompositeAppearance.single(name, textAttributes);
    }
  }

  result.setIcon(descriptor.getIcon());
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:StructureNodeRenderer.java

示例2: convert

import com.intellij.ide.util.treeView.NodeDescriptor; //导入方法依赖的package包/类
@Override
public String convert(TreePath path) {
  final DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
  final Object userObject = node.getUserObject();
  if (userObject instanceof NodeDescriptor) {
    NodeDescriptor descr = (NodeDescriptor)userObject;
    return descr.toString();
  }
  return TO_STRING.convert(path);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TreeSpeedSearch.java

示例3: MyNodeDescriptor

import com.intellij.ide.util.treeView.NodeDescriptor; //导入方法依赖的package包/类
public MyNodeDescriptor(NodeDescriptor<PsiFileNode> nodeDescriptor) {
  super(nodeDescriptor.getProject(), null);
  myName = nodeDescriptor.toString();
  setIcon(LayeredIcon.create(nodeDescriptor.getIcon(), XpathIcons.Association_small));
  myColor = nodeDescriptor.getColor();
  myNode = nodeDescriptor.getElement();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AssociationsEditor.java

示例4: compare

import com.intellij.ide.util.treeView.NodeDescriptor; //导入方法依赖的package包/类
@Override
public int compare(NodeDescriptor nodeDescriptor1, NodeDescriptor nodeDescriptor2) {
  int weight1 = nodeDescriptor1.getWeight();
  int weight2 = nodeDescriptor2.getWeight();
  if (weight1 != weight2) {
    return weight1 - weight2;
  }
  String s1 = nodeDescriptor1.toString();
  String s2 = nodeDescriptor2.toString();
  if (s1 == null) return s2 == null ? 0 : -1;
  if (s2 == null) return +1;
  return StringUtil.naturalCompare(s1, s2);
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:14,代码来源:SchemaHierarchyBrowser.java

示例5: valueOf

import com.intellij.ide.util.treeView.NodeDescriptor; //导入方法依赖的package包/类
@Override
public String valueOf(NodeDescriptor node) {
  return node.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ElementColumnInfo.java


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