Package org.eclipse.cdt.core.model
Interface IOpenable
- All Superinterfaces:
IBufferChangedListener
- All Known Subinterfaces:
IArchive
,IArchiveContainer
,IBinary
,IBinaryContainer
,ICContainer
,ICModel
,ICProject
,ISourceRoot
,ITranslationUnit
,IWorkingCopy
An openable is an element that can be opened, saved, and closed.
An openable might or might not have an associated buffer.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this element and its buffer (if any).Returns the buffer opened for this element, ornull
if this element does not have a buffer.boolean
returns true if the associated buffer has some unsaved changesboolean
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.Methods inherited from interface org.eclipse.cdt.core.model.IBufferChangedListener
bufferChanged
-
Method Details
-
close
Closes this element and its buffer (if any).- Throws:
CModelException
-
getBuffer
Returns the buffer opened for this element, ornull
if this element does not have a buffer.- Throws:
CModelException
-
hasUnsavedChanges
returns true if the associated buffer has some unsaved changes- Throws:
CModelException
-
isConsistent
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
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
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
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
-