项目:EASyProducer
文件:Em
beddedXtextSourceEditor.java
@Override
public void addDocumentStateListener(IDocumentStateListener listener) {
if (null != listener) {
IXtextDocumentContentObserver delegatingListener = new DocumentContextObserver(listener);
documentStateListeners.put(listener,delegatingListener);
embeddedEditor.getDocument().addXtextDocumentContentObserver(delegatingListener);
}
}
项目:EASyProducer
文件:Em
beddedXtextSourceEditor.java
@Override
public void removeDocumentStateListener(IDocumentStateListener listener) {
if (null != listener) {
IXtextDocumentContentObserver delegatingListener = documentStateListeners.remove(listener);
if (null != delegatingListener && null != embeddedEditor) {
XtextDocument doc = embeddedEditor.getDocument();
if (null != doc) {
doc.removeXtextDocumentContentObserver(delegatingListener);
}
}
}
}