Ejemplo n.º 1
0
  @Override
  public PsiElement getChildValueExpression(DebuggerTreeNode node, DebuggerContext context)
      throws EvaluateException {
    FieldDescriptor fieldDescriptor = (FieldDescriptor) node.getDescriptor();

    PsiElementFactory elementFactory =
        JavaPsiFacade.getInstance(node.getProject()).getElementFactory();
    try {
      return elementFactory.createExpressionFromText(
          "this." + fieldDescriptor.getField().name(),
          DebuggerUtils.findClass(
              fieldDescriptor.getObject().referenceType().name(),
              context.getProject(),
              context.getDebugProcess().getSearchScope()));
    } catch (IncorrectOperationException e) {
      throw new EvaluateException(
          DebuggerBundle.message("error.invalid.field.name", fieldDescriptor.getField().name()),
          null);
    }
  }