diff options
author | Artur Signell <artur@vaadin.com> | 2016-09-06 21:56:19 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-09-07 11:42:20 +0300 |
commit | a18552fb252e452ce93642a946db67af6708a91d (patch) | |
tree | d063abbf8472e0a7a314927150ef4a7ccae330f1 /shared | |
parent | a3a84d7fb1d87e77ec2cbffdbe6978e62d5d3ab7 (diff) | |
download | vaadin-framework-a18552fb252e452ce93642a946db67af6708a91d.tar.gz vaadin-framework-a18552fb252e452ce93642a946db67af6708a91d.zip |
Add AbstractTextField client side to make mapping 1:1
Change-Id: I4439b995a769d22e0eded7132e2fb09123c25a49
Diffstat (limited to 'shared')
3 files changed, 65 insertions, 39 deletions
diff --git a/shared/src/main/java/com/vaadin/shared/ui/textarea/TextAreaState.java b/shared/src/main/java/com/vaadin/shared/ui/textarea/TextAreaState.java index a56b45ea7e..a5f3205d6d 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/textarea/TextAreaState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/textarea/TextAreaState.java @@ -17,9 +17,9 @@ package com.vaadin.shared.ui.textarea; import com.vaadin.shared.annotations.DelegateToWidget; import com.vaadin.shared.annotations.NoLayout; -import com.vaadin.shared.ui.textfield.TextFieldState; +import com.vaadin.shared.ui.textfield.AbstractTextFieldState; -public class TextAreaState extends TextFieldState { +public class TextAreaState extends AbstractTextFieldState { { primaryStyleName = "v-textarea"; } diff --git a/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java b/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java new file mode 100644 index 0000000000..b35fd89a27 --- /dev/null +++ b/shared/src/main/java/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java @@ -0,0 +1,59 @@ +/* + * 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.AbstractFieldState; +import com.vaadin.shared.annotations.DelegateToWidget; +import com.vaadin.shared.annotations.NoLayout; + +/** + * State class for AbstractTextField. + */ +public abstract class AbstractTextFieldState extends AbstractFieldState { + + /** + * Maximum character count in text field. + */ + @DelegateToWidget + @NoLayout + public int maxLength = -1; + + /** + * Number of visible columns in the TextField. + */ + public int columns = 0; + + /** + * The prompt to display in an empty field. Null when disabled. + */ + @DelegateToWidget + @NoLayout + public String placeholder = null; + + /** + * The text in the field. + */ + @DelegateToWidget + @NoLayout + public String text = ""; + + @NoLayout + public ValueChangeMode valueChangeMode = ValueChangeMode.LAZY; + + @NoLayout + public int valueChangeTimeout = 400; + +} 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 f30af9ec78..02fe1c7f30 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 @@ -15,44 +15,11 @@ */ package com.vaadin.shared.ui.textfield; -import com.vaadin.shared.AbstractFieldState; -import com.vaadin.shared.annotations.DelegateToWidget; -import com.vaadin.shared.annotations.NoLayout; - -public class TextFieldState extends AbstractFieldState { +/** + * State class for TextField. + */ +public class TextFieldState extends AbstractTextFieldState { { primaryStyleName = "v-textfield"; } - - /** - * Maximum character count in text field. - */ - @DelegateToWidget - @NoLayout - public int maxLength = -1; - - /** - * Number of visible columns in the TextField. - */ - public int columns = 0; - - /** - * The prompt to display in an empty field. Null when disabled. - */ - @DelegateToWidget - @NoLayout - public String placeholder = null; - - /** - * The text in the field - */ - @DelegateToWidget - @NoLayout - public String text = ""; - - @NoLayout - public ValueChangeMode valueChangeMode = ValueChangeMode.LAZY; - - @NoLayout - public int valueChangeTimeout = 400; } |