aboutsummaryrefslogtreecommitdiffstats
path: root/shared/src
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2014-09-10 15:21:09 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2014-09-19 11:39:01 +0000
commitfcb564daacec11992703e4821ae784c0d3b305dd (patch)
tree5ece928f624676a5a04c6a3c7e7f10b679b649a6 /shared/src
parent8de9a37bae7b663e31750c5a195e28038637a318 (diff)
downloadvaadin-framework-fcb564daacec11992703e4821ae784c0d3b305dd.tar.gz
vaadin-framework-fcb564daacec11992703e4821ae784c0d3b305dd.zip
Implement Vaadin-specific editor row bind/cancel handling (#13334)
Change-Id: I9a6326a065b3ca159dd1b4237de1dbf8fa8e10ff
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java49
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java48
2 files changed, 97 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java b/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java
new file mode 100644
index 0000000000..1c99a5035d
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/grid/EditorRowClientRpc.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.grid;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+/**
+ * An RPC interface for the grid editor row server-to-client communications.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public interface EditorRowClientRpc extends ClientRpc {
+
+ /**
+ * Tells the client to open the editor row and bind data to it.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void bind(int rowIndex);
+
+ /**
+ * Tells the client to cancel editing and hide the editor row.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void cancel(int rowIndex);
+
+ /**
+ * Confirms a pending {@link EditorRowServerRpc#bind(int) bind request} sent
+ * by the client.
+ */
+ void confirmBind();
+}
diff --git a/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java b/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java
new file mode 100644
index 0000000000..45705ca924
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/grid/EditorRowServerRpc.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.grid;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+/**
+ * An RPC interface for the grid editor row client-to-server communications.
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public interface EditorRowServerRpc extends ServerRpc {
+
+ /**
+ * Asks the server to open the editor row and bind data to it. When a bind
+ * request is sent, it must be acknowledged with a
+ * {@link EditorRowClientRpc#confirmBind() confirm call} before the client
+ * can open the editor.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void bind(int rowIndex);
+
+ /**
+ * Tells the server to cancel editing. When sending a cancel request, the
+ * client does not need to wait for confirmation by the server before hiding
+ * the editor row.
+ *
+ * @param rowIndex
+ * the index of the edited row
+ */
+ void cancel(int rowIndex);
+}