String (TreePath o) { Object node = o.getLastPathComponent(); if (node instanceof DefaultMutableTreeNode) { Object object = ((DefaultMutableTreeNode)node).getUserObject(); if (object instanceof Group) return ((Group)object).getName(); if (object instanceof QuickList) return ((QuickList)object).getName(); String actionId; if (object instanceof String) { actionId = (String)object; } else if (object instanceof Pair) { Object obj = ((Pair<?, ?>)object).first; if (obj instanceof Group group) return group.getName(); actionId = (String)obj; } else { return ""; } if (Strings.isEmpty(actionId)) return ""; AnAction action = ActionManager.getInstance().getAction(actionId); if (action != null) { return action.getTemplatePresentation().getText(); } } return ""; }