public class CreateFromUsageUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CreateFromUsageUtils.ParameterNameExpression
Could be used for record component name as well
|
Constructor and Description |
---|
CreateFromUsageUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addClassesWithMember(java.lang.String memberName,
PsiFile file,
java.util.Set<? super java.lang.String> possibleClassNames,
boolean method,
boolean staticAccess) |
static void |
addClassesWithMember(java.lang.String memberName,
PsiFile file,
java.util.Set<? super java.lang.String> possibleClassNames,
boolean method,
boolean staticAccess,
boolean addObjectInheritors) |
static PsiReferenceExpression [] |
collectExpressions(PsiExpression expression,
java.lang.Class<? extends PsiElement>... scopes) |
static PsiClass |
createClass(CreateClassKind classKind,
PsiDirectory directory,
java.lang.String name,
PsiManager manager,
PsiElement contextElement,
PsiFile sourceFile,
java.lang.String superClassName) |
static PsiClass |
createClass(PsiJavaCodeReferenceElement referenceElement,
CreateClassKind classKind,
java.lang.String superClassName) |
static PsiType |
getParameterTypeByArgumentType(PsiType argType,
PsiManager psiManager,
GlobalSearchScope resolveScope)
Get a type suitable for parameter declaration based on given argument type
|
static ExpectedTypeInfo [] |
guessExpectedTypes(PsiExpression expression,
boolean allowVoidType) |
static boolean |
isAccessedForWriting(PsiExpression[] expressionOccurrences) |
static boolean |
isValidMethodReference(PsiReference reference,
PsiMethodCallExpression call) |
static void |
scheduleFileOrPackageCreationFailedMessageBox(IncorrectOperationException e,
java.lang.String name,
PsiDirectory directory,
boolean isPackage) |
static void |
setupEditor(PsiCodeBlock body,
Editor newEditor) |
static void |
setupEditor(PsiMethod method,
Editor newEditor) |
static void |
setupMethodBody(PsiMethod method) |
static void |
setupMethodBody(PsiMethod method,
PsiClass aClass) |
static void |
setupMethodBody(PsiMethod method,
PsiClass aClass,
FileTemplate template) |
static void |
setupMethodParameters(PsiMethod method,
TemplateBuilder builder,
PsiElement contextElement,
PsiSubstitutor substitutor,
PsiExpression[] arguments) |
static void |
setupSuperClassReference(PsiClass targetClass,
java.lang.String superClassName) |
public static boolean isValidMethodReference(PsiReference reference, PsiMethodCallExpression call)
public static void setupMethodBody(PsiMethod method) throws IncorrectOperationException
IncorrectOperationException
public static void setupMethodBody(PsiMethod method, PsiClass aClass) throws IncorrectOperationException
IncorrectOperationException
public static void setupMethodBody(PsiMethod method, PsiClass aClass, FileTemplate template) throws IncorrectOperationException
IncorrectOperationException
public static void setupEditor(PsiCodeBlock body, Editor newEditor)
public static void setupMethodParameters(PsiMethod method, TemplateBuilder builder, PsiElement contextElement, PsiSubstitutor substitutor, PsiExpression[] arguments)
public static PsiType getParameterTypeByArgumentType(PsiType argType, PsiManager psiManager, GlobalSearchScope resolveScope)
argType
- argument typepsiManager
- psiManager to useresolveScope
- type resolve scopepublic static PsiClass createClass(PsiJavaCodeReferenceElement referenceElement, CreateClassKind classKind, java.lang.String superClassName)
public static PsiClass createClass(CreateClassKind classKind, PsiDirectory directory, java.lang.String name, PsiManager manager, PsiElement contextElement, PsiFile sourceFile, java.lang.String superClassName)
public static void setupSuperClassReference(PsiClass targetClass, java.lang.String superClassName)
public static void scheduleFileOrPackageCreationFailedMessageBox(IncorrectOperationException e, java.lang.String name, PsiDirectory directory, boolean isPackage)
@SafeVarargs public static PsiReferenceExpression [] collectExpressions(PsiExpression expression, java.lang.Class<? extends PsiElement>... scopes)
public static ExpectedTypeInfo [] guessExpectedTypes(PsiExpression expression, boolean allowVoidType)
public static boolean isAccessedForWriting(PsiExpression[] expressionOccurrences)
public static void addClassesWithMember(java.lang.String memberName, PsiFile file, java.util.Set<? super java.lang.String> possibleClassNames, boolean method, boolean staticAccess)
public static void addClassesWithMember(java.lang.String memberName, PsiFile file, java.util.Set<? super java.lang.String> possibleClassNames, boolean method, boolean staticAccess, boolean addObjectInheritors)