Beispiel #1
0
 @Override
 public PsiElement add(@NotNull PsiElement element) throws IncorrectOperationException {
   CheckUtil.checkWritable(this);
   TreeElement elementCopy = ChangeUtil.copyToElement(element);
   calcTreeElement().addInternal(elementCopy, elementCopy, null, null);
   elementCopy = ChangeUtil.decodeInformation(elementCopy);
   return SourceTreeToPsiMap.treeElementToPsi(elementCopy);
 }
Beispiel #2
0
 @Override
 public PsiElement addAfter(@NotNull PsiElement element, PsiElement anchor)
     throws IncorrectOperationException {
   CheckUtil.checkWritable(this);
   TreeElement elementCopy = ChangeUtil.copyToElement(element);
   calcTreeElement()
       .addInternal(
           elementCopy, elementCopy, SourceTreeToPsiMap.psiElementToTree(anchor), Boolean.FALSE);
   elementCopy = ChangeUtil.decodeInformation(elementCopy);
   return SourceTreeToPsiMap.treeElementToPsi(elementCopy);
 }