public class PsiToDocumentSynchronizer extends PsiTreeChangeAdapter
Modifier and Type | Class and Description |
---|---|
static class |
PsiToDocumentSynchronizer.DocumentChangeTransaction |
Modifier and Type | Method and Description |
---|---|
void |
beforeChildAddition(PsiTreeChangeEvent event)
Invoked just before adding a child to the tree.
Parent element is returned by event.getParent() .Added child is returned by event.getChild . |
void |
beforeChildRemoval(PsiTreeChangeEvent event)
Invoked just before removal of a child from the tree.
Child to be removed is returned by event.getChild() .Parent element is returned by event.getParent() . |
void |
beforeChildrenChange(PsiTreeChangeEvent event)
Invoked before a mass change of children of the specified node.
The parent the nodes of which are changing is returned by event.getParent() . |
void |
beforeChildReplacement(PsiTreeChangeEvent event)
Invoked just before replacement of a child in the tree by another element.
Child to be replaced is returned by event.getOldChild() .Parent element is returned by event.getParent() . |
void |
childAdded(PsiTreeChangeEvent event)
Invoked just after adding of a new child to the tree.
The added child is returned by event.getChild() .Parent element is returned by event.getParent() . |
void |
childRemoved(PsiTreeChangeEvent event)
Invoked just after removal of a child from the tree.
The removed child is returned by event.getChild() . |
void |
childrenChanged(PsiTreeChangeEvent event)
Invoked after a mass change of children of the specified node.
The parent the nodes of which have changed is returned by event.getParent() . |
void |
childReplaced(PsiTreeChangeEvent event)
Invoked just after replacement of a child in the tree by another element.
The replaced child is returned by event.getOldChild() . |
boolean |
commitTransaction(Document document) |
PsiToDocumentSynchronizer.DocumentChangeTransaction |
getTransaction(Document document) |
void |
insertString(Document document,
int offset,
java.lang.String s) |
boolean |
isDocumentAffectedByTransactions(Document document) |
boolean |
isIgnorePsiEvents() |
boolean |
isInSynchronization(Document document) |
static void |
performAtomically(PsiFile file,
java.lang.Runnable runnable) |
void |
replaceString(Document document,
int startOffset,
int endOffset,
java.lang.String s) |
void |
setIgnorePsiEvents(boolean ignorePsiEvents) |
void |
startTransaction(Project project,
Document doc,
PsiElement scope) |
boolean |
toProcessPsiEvent() |
beforeChildMovement, beforePropertyChange, childMoved, propertyChanged
public PsiToDocumentSynchronizer.DocumentChangeTransaction getTransaction(Document document)
public boolean isInSynchronization(Document document)
public static void performAtomically(PsiFile file, java.lang.Runnable runnable)
public void beforeChildAddition(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getParent()
.event.getChild
.beforeChildAddition
in interface PsiTreeChangeListener
beforeChildAddition
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void beforeChildRemoval(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getChild()
.event.getParent()
.beforeChildRemoval
in interface PsiTreeChangeListener
beforeChildRemoval
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void beforeChildReplacement(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getOldChild()
.event.getParent()
.beforeChildReplacement
in interface PsiTreeChangeListener
beforeChildReplacement
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void beforeChildrenChange(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getParent()
.beforeChildrenChange
in interface PsiTreeChangeListener
beforeChildrenChange
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void childAdded(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getChild()
.event.getParent()
.childAdded
in interface PsiTreeChangeListener
childAdded
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void childRemoved(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getChild()
. Note that
only equals()
, hashCode()
, isValid()
methods
can be safely invoked for this element, because it's not valid anymore.event.getParent()
.childRemoved
in interface PsiTreeChangeListener
childRemoved
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void childReplaced(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getOldChild()
. Note that
only equals()
, hashCode()
, isValid()
methods
can be safely invoked for this element, because it's not valid anymore.event.getNewChild()
.event.getParent()
.childReplaced
in interface PsiTreeChangeListener
childReplaced
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void childrenChanged(PsiTreeChangeEvent event)
PsiTreeChangeListener
event.getParent()
.childrenChanged
in interface PsiTreeChangeListener
childrenChanged
in class PsiTreeChangeAdapter
event
- the event object describing the change.public void setIgnorePsiEvents(boolean ignorePsiEvents)
public boolean isIgnorePsiEvents()
public boolean toProcessPsiEvent()
public void replaceString(Document document, int startOffset, int endOffset, java.lang.String s)
public void insertString(Document document, int offset, java.lang.String s)
public void startTransaction(Project project, Document doc, PsiElement scope)
public boolean commitTransaction(Document document)
public boolean isDocumentAffectedByTransactions(Document document)