private static int getWeight(NodeDescriptor<?> descriptor) {
    VirtualFile file = ((FileNodeDescriptor)descriptor).getElement().getFile();
    return file == null || file.isDirectory() ? 0 : 1;
  }
private static int getWeight(NodeDescriptor<?> descriptor)