aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeppo Kurki <teppo.kurki@vaadin.com>2015-05-25 12:09:23 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2015-05-26 08:25:22 +0000
commit469a53e1256f143f506f8a3b59ef7fc505353495 (patch)
tree44ade1bd574e3c97e752dd4fcc324201cda0f438 /server
parentfad6e73e62c53802092e824c67dd901e73683e6a (diff)
downloadvaadin-framework-469a53e1256f143f506f8a3b59ef7fc505353495.tar.gz
vaadin-framework-469a53e1256f143f506f8a3b59ef7fc505353495.zip
Add unbuffered editing mode to Grid
Save and cancel buttons are hidden and the backing field group is set to unbuffered mode. Change-Id: I7da46ae3f1b84cc5ac8c918be38919962aff88ed
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/Grid.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 21bfd1b68f..fc5adbbff0 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -6019,6 +6019,39 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
EditorCloseEvent.class, listener);
}
+ /**
+ * Sets the buffered editor mode. The default mode is buffered (
+ * <code>true</code>).
+ *
+ * @since
+ * @param editorBuffered
+ * <code>true</code> to enable buffered editor,
+ * <code>false</code> to disable it
+ * @throws IllegalStateException
+ * If editor is active while attempting to change the buffered
+ * mode.
+ */
+ public void setEditorBuffered(boolean editorBuffered)
+ throws IllegalStateException {
+ if (isEditorActive()) {
+ throw new IllegalStateException(
+ "Can't change editor unbuffered mode while editor is active.");
+ }
+ getState().editorBuffered = editorBuffered;
+ editorFieldGroup.setBuffered(editorBuffered);
+ }
+
+ /**
+ * Gets the buffered editor mode.
+ *
+ * @since
+ * @return <code>true</code> if buffered editor is enabled,
+ * <code>false</code> otherwise
+ */
+ public boolean isEditorBuffered() {
+ return getState().editorBuffered;
+ }
+
@Override
public void addItemClickListener(ItemClickListener listener) {
addListener(GridConstants.ITEM_CLICK_EVENT_ID, ItemClickEvent.class,