|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A file buffer represents a file that can be edited by more than one client. Editing is session oriented. This means that editing is a sequence of modification steps. The start of the sequence and the end of the sequence are explicitly indicated. There are no time constraints connected with the sequence of modification steps. A file buffer reifies editing sessions and allows them to interleave.
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
.
Method Summary | |
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. |
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 |
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 |
isSynchronized()
Returns whether this file buffer is synchronized with the file system. |
void |
resetStateValidation()
Resets state validation. |
void |
revert(IProgressMonitor monitor)
Reverts the contents of this file buffer to the content of its underlying file. |
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. |
Method Detail |
public IPath getLocation()
The location is either a full path of a workspace resource or an absolute path in the local file system.
public boolean isSynchronized()
true
if the file buffer is synchronized with the file systempublic void revert(IProgressMonitor monitor) throws CoreException
isDirty
returns false
and
isSynchronized
returns true
.
monitor
- the progress monitor
CoreException
- if reading or accessing the underlying file failspublic 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 system
CoreException
- if writing or accessing the underlying file failspublic boolean isDirty()
revert
or commit
call.
true
if changes have been applied to this bufferpublic boolean isShared()
true
if this file buffer is shared by more than one clientpublic void validateState(IProgressMonitor monitor, Object computationContext) throws CoreException
monitor
- the progress monitorcomputationContext
- the context in which the validation is
performed, e.g., a SWT shell
CoreException
- if the underlying file can not be accessed to
it's state cannot be changedpublic boolean isStateValidated()
true
.
true
if the state has been validated, false
otherwisepublic void resetStateValidation()
isStateValidated
afterwards returns false
until the state is revalidated.
public IStatus getStatus()
public long getModificationStamp()
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.