Interface IOpenable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes this element and its buffer (if any).
      IBuffer getBuffer()
      Returns the buffer opened for this element, or null if this element does not have a buffer.
      boolean hasUnsavedChanges()
      returns true if the associated buffer has some unsaved changes
      boolean isConsistent()
      Returns whether the element is consistent with its underlying resource or buffer.
      boolean isOpen()
      Returns whether this CFile is open.
      void makeConsistent​(org.eclipse.core.runtime.IProgressMonitor progress)
      Makes this element consistent with its underlying resource or buffer by updating the element's structure and properties as necessary.
      void makeConsistent​(org.eclipse.core.runtime.IProgressMonitor progress, boolean forced)  
      void open​(org.eclipse.core.runtime.IProgressMonitor progress)
      Opens this element and all parent elements that are not already open.
      void save​(org.eclipse.core.runtime.IProgressMonitor progress, boolean force)
      Saves any changes in this element's buffer to its underlying resource via a workspace resource operation.
    • Method Detail

      • hasUnsavedChanges

        boolean hasUnsavedChanges()
                           throws CModelException
        returns true if the associated buffer has some unsaved changes
        Throws:
        CModelException
      • isConsistent

        boolean isConsistent()
                      throws CModelException
        Returns whether the element is consistent with its underlying resource or buffer. The element is consistent when opened, and is consistent if the underlying resource or buffer has not been modified since it was last consistent.
        Throws:
        CModelException
      • isOpen

        boolean isOpen()
        Returns whether this CFile is open.
      • makeConsistent

        void makeConsistent​(org.eclipse.core.runtime.IProgressMonitor progress)
                     throws CModelException
        Makes this element consistent with its underlying resource or buffer by updating the element's structure and properties as necessary.
        Throws:
        CModelException
      • makeConsistent

        void makeConsistent​(org.eclipse.core.runtime.IProgressMonitor progress,
                            boolean forced)
                     throws CModelException
        Throws:
        CModelException
      • open

        void open​(org.eclipse.core.runtime.IProgressMonitor progress)
           throws CModelException
        Opens this element and all parent elements that are not already open. For translation units, a buffer is opened on the contents of the underlying resource.
        Throws:
        CModelException
      • save

        void save​(org.eclipse.core.runtime.IProgressMonitor progress,
                  boolean force)
           throws CModelException
        Saves any changes in this element's buffer to its underlying resource via a workspace resource operation.

        The force parameter controls how this method deals with cases where the workbench is not completely in sync with the local file system.

        Throws:
        CModelException