aboutsummaryrefslogtreecommitdiffstats
path: root/shared/src
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-08-24 23:10:54 +0300
committerArtur Signell <artur@vaadin.com>2016-08-25 11:03:06 +0300
commit983a4e3417a0b3ad63ee3dc921b4b46305e30a8d (patch)
treef1e6585f06fbc98618a0c233289d31bf796a3aed /shared/src
parent848b877d479b704280814509335b1bd0814af2df (diff)
downloadvaadin-framework-983a4e3417a0b3ad63ee3dc921b4b46305e30a8d.tar.gz
vaadin-framework-983a4e3417a0b3ad63ee3dc921b4b46305e30a8d.zip
Use RPC for TextField cursor position and selection range updates
Change-Id: I48595a1d1a9a1620739d00a499d996026bd51000
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldClientRpc.java39
-rw-r--r--shared/src/main/java/com/vaadin/shared/ui/textfield/TextFieldState.java9
2 files changed, 39 insertions, 9 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldClientRpc.java b/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldClientRpc.java
new file mode 100644
index 0000000000..171707d848
--- /dev/null
+++ b/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldClientRpc.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2016 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.textfield;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+/**
+ * Server to client RPC interface for AbstractTextField.
+ *
+ */
+public interface AbstractTextFieldClientRpc extends ClientRpc {
+ /**
+ * Selects the given range in the field.
+ *
+ * @param start
+ * the start of the range
+ * @param length
+ * the length to select
+ */
+ void selectRange(int start, int length);
+
+ /**
+ * Selects everything in the field.
+ */
+ void selectAll();
+}
diff --git a/shared/src/main/java/com/vaadin/shared/ui/textfield/TextFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/textfield/TextFieldState.java
index a61a2897f7..f30af9ec78 100644
--- a/shared/src/main/java/com/vaadin/shared/ui/textfield/TextFieldState.java
+++ b/shared/src/main/java/com/vaadin/shared/ui/textfield/TextFieldState.java
@@ -51,15 +51,6 @@ public class TextFieldState extends AbstractFieldState {
public String text = "";
@NoLayout
- public int selectionStart = -1;
-
- @NoLayout
- public int selectionLength = 0;
-
- @NoLayout
- public int cursorPosition = 0;
-
- @NoLayout
public ValueChangeMode valueChangeMode = ValueChangeMode.LAZY;
@NoLayout