diff options
author | Kai Maetzel | 2003-10-06 17:57:59 +0000 |
---|---|---|
committer | Kai Maetzel | 2003-10-06 17:57:59 +0000 |
commit | 36759c13f8099ea9980644d88018e409fdbf0c70 (patch) | |
tree | 22463c22f73865182194d0d57889fa5c89d8aabb /org.eclipse.core.filebuffers | |
parent | 94fc937790fd97256344971b5e979af5a2c3f193 (diff) | |
download | eclipse.platform.text-36759c13f8099ea9980644d88018e409fdbf0c70.tar.gz eclipse.platform.text-36759c13f8099ea9980644d88018e409fdbf0c70.tar.xz eclipse.platform.text-36759c13f8099ea9980644d88018e409fdbf0c70.zip |
state validation work
Diffstat (limited to 'org.eclipse.core.filebuffers')
3 files changed, 34 insertions, 6 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java index 98f21a629..0d0e5569e 100644 --- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java +++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java @@ -82,23 +82,34 @@ public interface IFileBuffer { boolean isShared(); /** - * 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. + * 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. If state + * validation is not supported this operation does nothing. * * @param monitor the progress monitor - * @param computationContext the context in which the validation is performed, e.g., a SWT shell - * @exception CoreException if the underlying file can not be accessed to it's state cannot be changed + * @param computationContext the context in which the validation is + * performed, e.g., a SWT shell + * @exception CoreException if the underlying file can not be accessed to + * it's state cannot be changed */ void validateState(IProgressMonitor monitor, Object computationContext) throws CoreException; /** - * Returns whether the state of this file buffer has been validated. + * Returns whether the state of this file buffer has been validated. If + * state validation is not supported this method always returns <code>true</code>. * - * @return <code>true</code> if the state has been validated, <code>false</code> otherwise + * @return <code>true</code> if the state has been validated, <code>false</code> + * otherwise */ boolean isStateValidated(); /** + * Resets state validation. If state validation is supported, <code>isStateValidated</code> + * afterwars returns <code>false</code> unti the state is revalidated. + */ + void resetStateValidation(); + + /** * Returns the status of this file buffer. This is the result of the last operation peformed on this file buffer or * internally initiated by this file buffer. * diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java index c3618b95a..766bd2bdb 100644 --- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java +++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java @@ -157,6 +157,13 @@ public abstract class JavaFileBuffer extends AbstractFileBuffer { public boolean isStateValidated() { return true; } + + /* + * @see org.eclipse.core.filebuffers.IFileBuffer#resetStateValidation() + */ + public void resetStateValidation() { + // nop + } /** * Sends out the notification that the file serving as document input has been moved. diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java index b248aa72b..bf7ffe1d5 100644 --- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java +++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java @@ -317,6 +317,16 @@ public abstract class ResourceFileBuffer extends AbstractFileBuffer { public boolean isStateValidated() { return fIsStateValidated; } + + /* + * @see org.eclipse.core.filebuffers.IFileBuffer#resetStateValidation() + */ + public void resetStateValidation() { + if (fIsStateValidated) { + fIsStateValidated= false; + fManager.fireStateValidationChanged(this, fIsStateValidated); + } + } /** * Sends out the notification that the file serving as document input has been moved. |