mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
get rid of anonymous class
This commit is contained in:
+5
-10
@@ -15,10 +15,11 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.annotator.intentions.dynamic.elements;
|
||||
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.PsiModifier;
|
||||
import com.intellij.psi.PsiVariable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.annotator.intentions.dynamic.DynamicManager;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrDynamicImplicitProperty;
|
||||
|
||||
/**
|
||||
@@ -52,13 +53,7 @@ public class DPropertyElement extends DItemElement {
|
||||
if (type == null || type.trim().length() == 0) {
|
||||
type = CommonClassNames.JAVA_LANG_OBJECT;
|
||||
}
|
||||
myPsi = new GrDynamicImplicitProperty(manager, getName(), type, containingClassName) {
|
||||
@Override
|
||||
public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
|
||||
DynamicManager.getInstance(getProject()).replaceDynamicPropertyName(containingClassName, getName(), name);
|
||||
return super.setName(name);
|
||||
}
|
||||
};
|
||||
myPsi = new GrDynamicImplicitProperty(manager, getName(), type, containingClassName);
|
||||
|
||||
if (isStatic != null && isStatic.booleanValue()) {
|
||||
myPsi.getModifierList().addModifier(PsiModifier.STATIC);
|
||||
|
||||
+6
@@ -75,6 +75,12 @@ public class GrDynamicImplicitProperty extends GrImplicitVariableImpl implements
|
||||
return psiClass.getContainingFile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
|
||||
DynamicManager.getInstance(getProject()).replaceDynamicPropertyName(myContainingClassName, getName(), name);
|
||||
return super.setName(name);
|
||||
}
|
||||
|
||||
public String getPresentableText() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user