Search in sources :

Example 1 with PsiEventType

use of com.intellij.psi.impl.PsiTreeChangeEventImpl.PsiEventType in project intellij-community by JetBrains.

the class JavaCodeBlockModificationListener method onTreeChanged.

@Override
protected void onTreeChanged(@NotNull PsiTreeChangeEventImpl event) {
    PsiModificationTracker tracker = myPsiManager.getModificationTracker();
    long cur = tracker.getOutOfCodeBlockModificationCount();
    super.onTreeChanged(event);
    if (cur == tracker.getOutOfCodeBlockModificationCount()) {
        PsiEventType code = event.getCode();
        if (code == PsiEventType.CHILD_ADDED || code == PsiEventType.CHILD_REMOVED || code == PsiEventType.CHILD_REPLACED) {
            if (hasClassesInside(event.getOldChild()) || event.getOldChild() != event.getChild() && hasClassesInside(event.getChild())) {
                onOutOfCodeBlockModification(event);
                doIncOutOfCodeBlockCounter();
            }
        }
    }
}
Also used : PsiModificationTracker(com.intellij.psi.util.PsiModificationTracker) PsiEventType(com.intellij.psi.impl.PsiTreeChangeEventImpl.PsiEventType)

Aggregations

PsiEventType (com.intellij.psi.impl.PsiTreeChangeEventImpl.PsiEventType)1 PsiModificationTracker (com.intellij.psi.util.PsiModificationTracker)1