本文整理汇总了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;
}
示例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);
}
示例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();
}
示例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);
}
示例5: valueOf
import com.intellij.ide.util.treeView.NodeDescriptor; //导入方法依赖的package包/类
@Override
public String valueOf(NodeDescriptor node) {
return node.toString();
}