public interface IFileBuffer
It is not specified whether simultaneous editing sessions can be owned by different threads.
Clients are not supposed to implement that interface. Instances of this type
are obtained from a IFileBufferManager
.
Modifier and Type | Method and Description |
---|---|
void |
commit(IProgressMonitor monitor,
boolean overwrite)
Commits this file buffer by changing the contents of the underlying file to
the contents of this file buffer.
|
ISchedulingRule |
computeCommitRule()
Computes the scheduling rule that is required for committing a changed buffer.
|
ISchedulingRule |
computeValidateStateRule()
Computes the scheduling rule that is required for validating the state of the buffer.
|
IContentType |
getContentType()
Returns the content type of this file buffer or
null
if none could be determined. |
IPath |
getLocation()
Returns the location of this file buffer.
|
long |
getModificationStamp()
Returns the modification stamp of the file underlying this file buffer.
|
IStatus |
getStatus()
Returns the status of this file buffer.
|
boolean |
isCommitable()
Returns whether this file buffer is commitable.
|
boolean |
isDirty()
Returns whether changes have been applied to this file buffer since initialization, or the most
recent
revert or commit call. |
boolean |
isShared()
Returns whether this file buffer is shared by more than one client.
|
boolean |
isStateValidated()
Returns whether the state of this file buffer has been validated.
|
boolean |
isSynchronizationContextRequested()
Returns whether a synchronization context has been requested for this
file buffer and not yet released.
|
boolean |
isSynchronized()
Returns whether this file buffer is synchronized with the file system.
|
void |
releaseSynchronizationContext()
The caller no longer requests the synchronization context for this file
buffer.
|
void |
requestSynchronizationContext()
The caller requests that the synchronization context is used to
synchronize this file buffer with its underlying file.
|
void |
resetStateValidation()
Resets state validation.
|
void |
revert(IProgressMonitor monitor)
Reverts the contents of this file buffer to the content of its underlying file.
|
void |
setDirty(boolean isDirty)
Sets the dirty state of the file buffer to the given value.
|
void |
validateState(IProgressMonitor monitor,
Object computationContext)
Validates the state of this file buffer and tries to bring the buffer's
underlying file into a state in which it can be modified.
|
IPath getLocation()
The location is either a full path of a workspace resource or an absolute path in the local file system.
boolean isShared()
true
if this file buffer is shared by more than one clientboolean isSynchronized()
true
if the file buffer is synchronized with the file systemlong getModificationStamp()
boolean isCommitable()
true
if the file buffer is commitable,
false
otherwiseISchedulingRule computeCommitRule()
null
void commit(IProgressMonitor monitor, boolean overwrite) throws CoreException
isDirty
returns false
and isSynchronized
returns
true
.monitor
- the progress monitoroverwrite
- indicates whether the underlying file should be overwritten if it is not synchronized with the file systemCoreException
- if writing or accessing the underlying file failsvoid revert(IProgressMonitor monitor) throws CoreException
isDirty
returns false
and
isSynchronized
returns true
.monitor
- the progress monitorCoreException
- if reading or accessing the underlying file failsboolean isDirty()
revert
or commit
call.true
if changes have been applied to this buffervoid setDirty(boolean isDirty)
isDirty
returns the previously set
value.isDirty
- true
if the buffer should be marked dirty, false
otherwiseISchedulingRule computeValidateStateRule()
null
void validateState(IProgressMonitor monitor, Object computationContext) throws CoreException
monitor
- the progress monitorcomputationContext
- the context in which the validation is performed, e.g., a SWT shellCoreException
- if the underlying file can not be accessed to it's state cannot be changedboolean isStateValidated()
true
.true
if the state has been validated, false
otherwisevoid resetStateValidation()
isStateValidated
afterwards returns false
until the state is revalidated.IStatus getStatus()
void requestSynchronizationContext()
void releaseSynchronizationContext()
boolean isSynchronizationContextRequested()
true
if a synchronization context is requested,
false
otherwiseIContentType getContentType() throws CoreException
null
if none could be determined. If the file buffer is dirty, the
returned content type is determined by the buffer's dirty state.null
CoreException
- if reading or accessing the underlying file
failsGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.