@Override protected String getElementText(@NotNull Object element) { if (!(element instanceof UsageNode)) return element.toString(); UsageNode node = (UsageNode) element; if (node instanceof StringNode) return ""; Usage usage = node.getUsage(); if (usage == MORE_USAGES_SEPARATOR) return ""; GroupNode group = (GroupNode) node.getParent(); return usage.getPresentation().getPlainText() + group; }
public void restore() { final UsageNode node = myUsageNodes.get(myUsage); if (node == NULL_NODE || node == null) { return; } final DefaultMutableTreeNode parentGroupingNode = (DefaultMutableTreeNode) node.getParent(); if (parentGroupingNode != null) { final TreePath treePath = new TreePath(parentGroupingNode.getPath()); myTree.expandPath(treePath); if (mySelected) { myTree.addSelectionPath(treePath.pathByAddingChild(node)); } } }