Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2003-08-26 17:12:50 +0000
committerDani Megert2003-08-26 17:12:50 +0000
commit3494f1de8c4c4117a14449820a0251865c78363b (patch)
tree4ba9d9671cc44de2814b613633760da87b196df9 /org.eclipse.core.filebuffers
parent3a88fb6ac9064424984fb394ca3d873489ca5b58 (diff)
downloadeclipse.platform.text-3494f1de8c4c4117a14449820a0251865c78363b.tar.gz
eclipse.platform.text-3494f1de8c4c4117a14449820a0251865c78363b.tar.xz
eclipse.platform.text-3494f1de8c4c4117a14449820a0251865c78363b.zip
Fixed bug 35027
Diffstat (limited to 'org.eclipse.core.filebuffers')
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java7
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffer.java8
2 files changed, 15 insertions, 0 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 c8d60f93a..4bace6fd7 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
@@ -34,6 +34,13 @@ public interface IFileBuffer {
* @return the underlying file of this file buffer
*/
IFile getUnderlyingFile();
+
+ /**
+ * Returns whether the underlying file of this file buffer has changed.
+ *
+ * @return <code>true</code> if the underlying file of this file buffer has changed
+ */
+ boolean hasUnderlyingFileChanged();
/**
* Reverts the contents of this file buffer to the content of its underlying file. After
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffer.java
index e58f2eb6f..809a4dee8 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffer.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffer.java
@@ -217,6 +217,7 @@ public abstract class FileBuffer implements IFileBuffer {
fFile= file;
fFileSynchronizer= new FileSynchronizer();
refreshFile(monitor);
+ fModificationStamp= fFile.getModificationStamp();
initializeFileBufferContent(monitor);
addFileBufferContentListeners();
@@ -337,4 +338,11 @@ public abstract class FileBuffer implements IFileBuffer {
ILog log= Platform.getPlugin(FileBuffersPlugin.PLUGIN_ID).getLog();
log.log(exception.getStatus());
}
+
+ /*
+ * @see IFileBuffer#hasUnderlyingFileChanged()
+ */
+ public boolean hasUnderlyingFileChanged() {
+ return fModificationStamp != fFile.getModificationStamp();
+ }
}

Back to the top