コード例 #1
0
  protected boolean isValidElement(PsiElement element) {
    PsiConstructorCall constructorCall = (PsiConstructorCall) element;
    PsiMethod method = constructorCall.resolveConstructor();
    PsiExpressionList argumentList = constructorCall.getArgumentList();
    PsiClass targetClass = getTargetClasses(constructorCall).get(0);

    return !CreateFromUsageUtils.shouldCreateConstructor(targetClass, argumentList, method);
  }
 @Override
 protected boolean isValidElement(PsiElement element) {
   PsiMethodCallExpression methodCall = (PsiMethodCallExpression) element;
   PsiMethod method = (PsiMethod) methodCall.getMethodExpression().resolve();
   PsiExpressionList argumentList = methodCall.getArgumentList();
   List<PsiClass> classes = getTargetClasses(element);
   return !classes.isEmpty()
       && !CreateFromUsageUtils.shouldCreateConstructor(classes.get(0), argumentList, method);
 }