@Nullable private static List<String> extractPath(@NotNull EditorSchemeAttributeDescriptor descriptor) { if (descriptor instanceof ColorAndFontDescription) { String name = descriptor.toString(); List<String> path = new ArrayList<String>(); int separatorStart = name.indexOf(NAME_SEPARATOR); int nextChunkStart = 0; while (separatorStart > 0) { path.add(name.substring(nextChunkStart, separatorStart)); nextChunkStart = separatorStart + NAME_SEPARATOR.length(); separatorStart = name.indexOf(NAME_SEPARATOR, nextChunkStart); } if (nextChunkStart < name.length()) { path.add(name.substring(nextChunkStart)); } return path; } return null; }
@Override public int compare(EditorSchemeAttributeDescriptor o1, EditorSchemeAttributeDescriptor o2) { return StringUtil.naturalCompare(o1.toString(), o2.toString()); }
public MyTreeNode(@NotNull EditorSchemeAttributeDescriptor descriptor) { super(descriptor); myName = descriptor.toString(); }