Class EmbeddedEditorBuffer

  • All Implemented Interfaces:
    AutoCloseable, org.eclipse.handly.buffer.IBuffer, org.eclipse.handly.snapshot.ISnapshotProvider, org.eclipse.handly.util.IReferenceCountable

    public class EmbeddedEditorBuffer
    extends Object
    implements org.eclipse.handly.buffer.IBuffer
    Implements IBuffer on top of a Xtext EmbeddedEditor, that works only with document.
    • Constructor Summary

      Constructors 
      Constructor Description
      EmbeddedEditorBuffer​(org.eclipse.jface.text.IDocument document)
      Creates a new buffer instance based on given document.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRef()  
      org.eclipse.handly.buffer.IBufferChange applyChange​(org.eclipse.handly.buffer.IBufferChange change, org.eclipse.core.runtime.IProgressMonitor pm)  
      org.eclipse.jface.text.IDocument getDocument()  
      org.eclipse.handly.snapshot.ISnapshot getSnapshot()  
      boolean isDirty()  
      void release()  
      void save​(org.eclipse.handly.context.IContext context, org.eclipse.core.runtime.IProgressMonitor pm)  
      • Methods inherited from interface org.eclipse.handly.buffer.IBuffer

        addListener, getAnnotationModel, getSupportedListenerMethods, removeListener
      • Methods inherited from interface org.eclipse.handly.util.IReferenceCountable

        close
    • Constructor Detail

      • EmbeddedEditorBuffer

        public EmbeddedEditorBuffer​(org.eclipse.jface.text.IDocument document)
                             throws org.eclipse.core.runtime.CoreException
        Creates a new buffer instance based on given document.

        It is the client responsibility to release the created buffer after it is no longer needed.

        Parameters:
        document - not null
        Throws:
        org.eclipse.core.runtime.CoreException
    • Method Detail

      • getDocument

        public org.eclipse.jface.text.IDocument getDocument()
        Specified by:
        getDocument in interface org.eclipse.handly.buffer.IBuffer
      • getSnapshot

        public org.eclipse.handly.snapshot.ISnapshot getSnapshot()
        Specified by:
        getSnapshot in interface org.eclipse.handly.buffer.IBuffer
        Specified by:
        getSnapshot in interface org.eclipse.handly.snapshot.ISnapshotProvider
      • applyChange

        public org.eclipse.handly.buffer.IBufferChange applyChange​(org.eclipse.handly.buffer.IBufferChange change,
                                                                   org.eclipse.core.runtime.IProgressMonitor pm)
                                                            throws org.eclipse.core.runtime.CoreException
        Specified by:
        applyChange in interface org.eclipse.handly.buffer.IBuffer
        Throws:
        org.eclipse.core.runtime.CoreException
      • isDirty

        public boolean isDirty()
        Specified by:
        isDirty in interface org.eclipse.handly.buffer.IBuffer
      • save

        public void save​(org.eclipse.handly.context.IContext context,
                         org.eclipse.core.runtime.IProgressMonitor pm)
                  throws org.eclipse.core.runtime.CoreException
        Specified by:
        save in interface org.eclipse.handly.buffer.IBuffer
        Throws:
        org.eclipse.core.runtime.CoreException
      • addRef

        public void addRef()
        Specified by:
        addRef in interface org.eclipse.handly.buffer.IBuffer
        Specified by:
        addRef in interface org.eclipse.handly.util.IReferenceCountable
        Specified by:
        addRef in interface org.eclipse.handly.snapshot.ISnapshotProvider
      • release

        public void release()
        Specified by:
        release in interface org.eclipse.handly.buffer.IBuffer
        Specified by:
        release in interface org.eclipse.handly.util.IReferenceCountable
        Specified by:
        release in interface org.eclipse.handly.snapshot.ISnapshotProvider