Eclipse CDT
Pre-release 3.0

org.eclipse.cdt.core.model
Interface IOpenable

All Superinterfaces:
IBufferChangedListener
All Known Subinterfaces:
IArchive, IArchiveContainer, IBinary, IBinaryContainer, ICContainer, ICModel, ICProject, ISourceRoot, ITranslationUnit, IWorkingCopy

public interface IOpenable
extends IBufferChangedListener

An openable is an element that can be opened, saved, and closed. An openable might or might not have an associated buffer.


Method Summary
 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(IProgressMonitor progress)
          Makes this element consistent with its underlying resource or buffer by updating the element's structure and properties as necessary.
 void makeConsistent(IProgressMonitor progress, boolean forced)
           
 void open(IProgressMonitor progress)
          Opens this element and all parent elements that are not already open.
 void save(IProgressMonitor progress, boolean force)
          Saves any changes in this element's buffer to its underlying resource via a workspace resource operation.
 
Methods inherited from interface org.eclipse.cdt.core.model.IBufferChangedListener
bufferChanged
 

Method Detail

close

void close()
           throws CModelException
Closes this element and its buffer (if any).

Throws:
CModelException

getBuffer

IBuffer getBuffer()
                  throws CModelException
Returns the buffer opened for this element, or null if this element does not have a buffer.

Throws:
CModelException

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(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(IProgressMonitor progress,
                    boolean forced)
                    throws CModelException
Throws:
CModelException

open

void open(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(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

Eclipse CDT
Pre-release 3.0

Copyright (c) IBM Corp. and others 2004. All Rights Reserved.