Search in sources :

Example 1 with SmaliClassDescriptor

use of org.jf.smalidea.psi.leaf.SmaliClassDescriptor in project smali by JesusFreke.

the class SmaliClassTypeElement method handleElementRename.

@Override
public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
    SmaliClassDescriptor descriptor = getReferenceNameElement();
    if (descriptor == null) {
        throw new IncorrectOperationException();
    }
    SmaliClassDescriptor newDescriptor = new SmaliClassDescriptor(NameUtils.javaToSmaliType(newElementName));
    CodeEditUtil.setNodeGenerated(newDescriptor, true);
    this.replaceChild(descriptor, newDescriptor);
    return this;
}
Also used : IncorrectOperationException(com.intellij.util.IncorrectOperationException) SmaliClassDescriptor(org.jf.smalidea.psi.leaf.SmaliClassDescriptor)

Aggregations

IncorrectOperationException (com.intellij.util.IncorrectOperationException)1 SmaliClassDescriptor (org.jf.smalidea.psi.leaf.SmaliClassDescriptor)1