summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/data/Buffered.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2011-12-15 19:28:00 +0200
committerArtur Signell <artur@vaadin.com>2011-12-15 20:17:15 +0200
commit0b7aa89b7fd8c9429e32ebee3ec7feeb8ca8e993 (patch)
tree32e767ecac6408ee11436b197b145b8e2d4c1ad1 /src/com/vaadin/data/Buffered.java
parentd7d139a95c5106db60715b0b86782cdfdee8a0db (diff)
downloadvaadin-framework-0b7aa89b7fd8c9429e32ebee3ec7feeb8ca8e993.tar.gz
vaadin-framework-0b7aa89b7fd8c9429e32ebee3ec7feeb8ca8e993.zip
#8127 Added setBuffered and isBuffered to com.vaadin.data.Buffered
Diffstat (limited to 'src/com/vaadin/data/Buffered.java')
-rw-r--r--src/com/vaadin/data/Buffered.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/com/vaadin/data/Buffered.java b/src/com/vaadin/data/Buffered.java
index 7fc552f5d6..6498ca519d 100644
--- a/src/com/vaadin/data/Buffered.java
+++ b/src/com/vaadin/data/Buffered.java
@@ -131,6 +131,44 @@ public interface Buffered extends Serializable {
public void setReadThrough(boolean readThrough) throws SourceException;
/**
+ * Sets the object's buffered mode to the specified status.
+ * <p>
+ * When the object is in buffered mode, an internal buffer will be used to
+ * store changes until {@link #commit()} is called. Calling
+ * {@link #discard()} will revert the internal buffer to the value of the
+ * data source.
+ * </p>
+ * <p>
+ * This is an easier way to use {@link #setReadThrough(boolean)} and
+ * {@link #setWriteThrough(boolean)} and not as error prone. Changing
+ * buffered mode will change both the read through and write through state
+ * of the object.
+ * </p>
+ * <p>
+ * Mixing calls to {@link #setBuffered(boolean)}/{@link #isBuffered()} and
+ * {@link #setReadThrough(boolean)}/{@link #isReadThrough()} or
+ * {@link #setWriteThrough(boolean)}/{@link #isWriteThrough()} is generally
+ * a bad idea.
+ * </p>
+ *
+ * @param buffered
+ * true if buffered mode should be turned on, false otherwise
+ * @since 7.0
+ */
+ public void setBuffered(boolean buffered);
+
+ /**
+ * Checks the buffered mode of this Object.
+ * <p>
+ * This method only returns true if both read and write buffering is used.
+ * </p>
+ *
+ * @return true if buffered mode is on, false otherwise
+ * @since 7.0
+ */
+ public boolean isBuffered();
+
+ /**
* Tests if the value stored in the object has been modified since it was
* last updated from the data source.
*