@Override
  protected boolean isEnabled(@NotNull RootsSelection selection, @NotNull Module module) {
    final ModuleType moduleType = ModuleType.get(module);
    if (!moduleType.isSupportedRootType(myRootType) || ModuleSourceRootEditHandler.getEditHandler(myRootType) == null
        || (selection.myHaveSelectedFilesUnderSourceRoots && !moduleType.isMarkInnerSupportedFor(myRootType))) {
      return false;
    }

    if (!selection.mySelectedDirectories.isEmpty()) {
      return true;
    }

    for (SourceFolder root : selection.mySelectedRoots) {
      if (!myRootType.equals(root.getRootType())) {
        return true;
      }
    }
    return false;
  }
@Override
  protected boolean isEnabled(@NotNull RootsSelection selection, @NotNull Module module)