@Override
  protected void update(@NotNull PresentationData data) {
    super.update(data);
    final PackageElement packageElement = getValue();

    try {
      if (packageElement == null || !packageElement.getPackage().isValid()) {
        setValue(null);
        return;
      }

      int fileCount = getFileCount(packageElement);
      if (fileCount == 0){
        setValue(null);
        return;
      }

      PsiPackage aPackage = packageElement.getPackage();
      String newName;
      if (getStructure().areFlattenPackages()) {
        newName = aPackage.getQualifiedName();
      }
      else {
        newName = myPresentationName != null ? myPresentationName : "";
      }

      int todoItemCount = getTodoItemCount(packageElement);

      data.setLocationString(IdeBundle.message("node.todo.group", todoItemCount));
      data.setPresentableText(newName);
    }
    catch (IndexNotReadyException e) {
      LOG.info(e);
      data.setPresentableText(JavaBundle.message("todo.index.not.available"));
    }
  }
@Override
  protected void update(@NotNull PresentationData data)