Java 类com.intellij.psi.impl.PsiTreeChangePreprocessorBase 实例源码

项目:tools-idea    文件:XmlPsiManager.java   
@Override
public void initComponent() {
  super.initComponent();
  new PsiTreeChangePreprocessorBase(myPsiManager) {
    @Override
    protected boolean isInsideCodeBlock(PsiElement element) {
      if (element instanceof PsiFileSystemItem) {
        return false;
      }

      if (element == null || element.getParent() == null) return true;

      final boolean isXml = element.getLanguage() instanceof XMLLanguage;
      // any xml element isn't inside a "code block"
      // cause we display even attributes and tag values in structure view
      return !isXml;
    }
  };
}