Search in sources :

Example 1 with ArrayElementDescriptorImpl

use of com.intellij.debugger.ui.impl.watch.ArrayElementDescriptorImpl in project intellij-community by JetBrains.

the class ArrayRenderer method getChildValueExpression.

public PsiExpression getChildValueExpression(DebuggerTreeNode node, DebuggerContext context) {
    LOG.assertTrue(node.getDescriptor() instanceof ArrayElementDescriptorImpl, node.getDescriptor().getClass().getName());
    ArrayElementDescriptorImpl descriptor = (ArrayElementDescriptorImpl) node.getDescriptor();
    PsiElementFactory elementFactory = JavaPsiFacade.getInstance(node.getProject()).getElementFactory();
    try {
        LanguageLevel languageLevel = LanguageLevelProjectExtension.getInstance(node.getProject()).getLanguageLevel();
        return elementFactory.createExpressionFromText("this[" + descriptor.getIndex() + "]", elementFactory.getArrayClass(languageLevel));
    } catch (IncorrectOperationException e) {
        LOG.error(e);
        return null;
    }
}
Also used : LanguageLevel(com.intellij.pom.java.LanguageLevel) PsiElementFactory(com.intellij.psi.PsiElementFactory) IncorrectOperationException(com.intellij.util.IncorrectOperationException) ArrayElementDescriptorImpl(com.intellij.debugger.ui.impl.watch.ArrayElementDescriptorImpl)

Aggregations

ArrayElementDescriptorImpl (com.intellij.debugger.ui.impl.watch.ArrayElementDescriptorImpl)1 LanguageLevel (com.intellij.pom.java.LanguageLevel)1 PsiElementFactory (com.intellij.psi.PsiElementFactory)1 IncorrectOperationException (com.intellij.util.IncorrectOperationException)1