mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-55562: gwt: provide inspection to validate signatures of JavaScript Overlay Types
This commit is contained in:
+9
-6
@@ -23,16 +23,19 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class AddDefaultConstructorFix extends AddMethodFix {
|
||||
public AddDefaultConstructorFix(PsiClass aClass) {
|
||||
super(generateConstructor(aClass), aClass);
|
||||
setText(QuickFixBundle.message("add.default.constructor.text", aClass.getName()));
|
||||
this(aClass, GenerateConstructorHandler.getConstructorModifier(aClass));
|
||||
}
|
||||
|
||||
private static String generateConstructor(PsiClass aClass) {
|
||||
String constructorModifier = GenerateConstructorHandler.getConstructorModifier(aClass);
|
||||
if (constructorModifier == PsiModifier.PACKAGE_LOCAL) {
|
||||
public AddDefaultConstructorFix(PsiClass aClass, final String modifier) {
|
||||
super(generateConstructor(aClass, modifier), aClass);
|
||||
setText(QuickFixBundle.message("add.default.constructor.text", modifier, aClass.getName()));
|
||||
}
|
||||
|
||||
private static String generateConstructor(PsiClass aClass, final String modifier) {
|
||||
if (modifier == PsiModifier.PACKAGE_LOCAL) {
|
||||
return aClass.getName() + "() {}";
|
||||
}
|
||||
return constructorModifier + " " + aClass.getName() + "() {}";
|
||||
return modifier + " " + aClass.getName() + "() {}";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -80,6 +80,11 @@ public class QuickFixFactoryImpl extends QuickFixFactory {
|
||||
return new AddDefaultConstructorFix(aClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalQuickFixAndIntentionActionOnPsiElement createAddConstructorFix(@NotNull PsiClass aClass, String modifier) {
|
||||
return new AddDefaultConstructorFix(aClass, modifier);
|
||||
}
|
||||
|
||||
public LocalQuickFixAndIntentionActionOnPsiElement createMethodParameterTypeFix(@NotNull PsiMethod method,
|
||||
int index,
|
||||
@NotNull PsiType newType,
|
||||
|
||||
@@ -50,6 +50,7 @@ public abstract class QuickFixFactory {
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createImplementMethodsFix(@NotNull PsiClass psiElement);
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createMethodThrowsFix(@NotNull PsiMethod method, @NotNull PsiClassType exceptionClass, boolean shouldThrow, boolean showContainingClass);
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createAddDefaultConstructorFix(@NotNull PsiClass aClass);
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createAddConstructorFix(@NotNull PsiClass aClass, @Modifier String modifier);
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createMethodParameterTypeFix(@NotNull PsiMethod method, int index, @NotNull PsiType newType, boolean fixWholeHierarchy);
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createMakeClassInterfaceFix(@NotNull PsiClass aClass);
|
||||
public abstract LocalQuickFixAndIntentionActionOnPsiElement createMakeClassInterfaceFix(@NotNull PsiClass aClass, final boolean makeInterface);
|
||||
|
||||
@@ -3,7 +3,7 @@ class.to.import.chooser.title=Class to Import
|
||||
access.static.via.class.reference.family=Access static via class reference
|
||||
access.static.via.class.reference.text=Access static ''{1}.{0}'' via class ''{2}'' reference
|
||||
add.default.constructor.family=Add Default Constructor
|
||||
add.default.constructor.text=Add Public No-args Constructor to {0}
|
||||
add.default.constructor.text=Add {0} no-args constructor to {1}
|
||||
add.catch.clause.family=Add Exception to Catch Clause
|
||||
add.catch.clause.text=Add Catch Clause(s)
|
||||
add.exception.to.throws.inherited.method.warning.text=Method ''{0}'' is inherited.\n\
|
||||
|
||||
Reference in New Issue
Block a user