@Override
  public boolean isAvailableOnDataContext(@NotNull DataContext dataContext) {
    PsiElement element = PsiElementRenameHandler.getElement(dataContext);
    if (element == null || element instanceof SyntheticElement || !element.isWritable()) {
      return false;
    }
    if (!myProcessor.canProcessElement(element)) {
      return false;
    }
    final Project project = CommonDataKeys.PROJECT.getData(dataContext);
    if (project == null) {
      return false;
    }
    if (!PsiManager.getInstance(project).isInProject(element)) {
      return false;
    }
    return true;
  }
@Override
  public boolean isAvailableOnDataContext(@NotNull DataContext dataContext)