Search in sources :

Example 6 with IErlElementDelta

use of org.erlide.engine.model.root.IErlElementDelta in project erlide_eclipse by erlang.

the class DefaultErlangFoldingStructureProvider method elementChanged.

@Override
public void elementChanged(final IErlElement element) {
    if (fEditor == null) {
        return;
    }
    final IDocumentProvider provider = fEditor.getDocumentProvider();
    if (provider == null) {
        return;
    }
    final IEditorInput input = fEditor.getEditorInput();
    if (input == null) {
        return;
    }
    fCachedDocument = provider.getDocument(input);
    if (fCachedDocument == null) {
        return;
    }
    // fHasHeaderComment = false;
    try {
        final ProjectionAnnotationModel model = fEditor.getAdapter(ProjectionAnnotationModel.class);
        if (model == null) {
            return;
        }
        fCachedModel = model;
        if (element instanceof IErlModule && element != fModule) {
            return;
        }
        final IErlElementDelta d = ErlangEngine.getInstance().getModel().createElementDelta(IErlElementDelta.CHANGED, IErlElementDelta.F_CONTENT, fModule);
        processDelta(d);
    } finally {
        fCachedDocument = null;
        fCachedModel = null;
    }
}
Also used : ProjectionAnnotationModel(org.eclipse.jface.text.source.projection.ProjectionAnnotationModel) IDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider) IErlElementDelta(org.erlide.engine.model.root.IErlElementDelta) IErlModule(org.erlide.engine.model.root.IErlModule) IEditorInput(org.eclipse.ui.IEditorInput)

Aggregations

IErlElementDelta (org.erlide.engine.model.root.IErlElementDelta)6 IResourceDelta (org.eclipse.core.resources.IResourceDelta)1 ProjectionAnnotationModel (org.eclipse.jface.text.source.projection.ProjectionAnnotationModel)1 IEditorInput (org.eclipse.ui.IEditorInput)1 IDocumentProvider (org.eclipse.ui.texteditor.IDocumentProvider)1 ErlElementDelta (org.erlide.engine.internal.model.root.ErlElementDelta)1 ErlModelException (org.erlide.engine.model.ErlModelException)1 IErlElement (org.erlide.engine.model.IErlElement)1 IElementChangedListener (org.erlide.engine.model.root.IElementChangedListener)1 IErlModule (org.erlide.engine.model.root.IErlModule)1 ErlangEditor (org.erlide.ui.editors.erl.ErlangEditor)1