summaryrefslogtreecommitdiffstats
path: root/compatibility-server
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2016-10-27 16:13:44 +0300
committerVaadin Code Review <review@vaadin.com>2016-11-01 10:26:33 +0000
commit48c249a13ecca8c4c8bd68814850e5e3cdd37d81 (patch)
treeb1f066b2bdd48b09b38b27bd677abba1b0d5d5fc /compatibility-server
parent92d697b9886896f1dad41026ba3519563838f93e (diff)
downloadvaadin-framework-48c249a13ecca8c4c8bd68814850e5e3cdd37d81.tar.gz
vaadin-framework-48c249a13ecca8c4c8bd68814850e5e3cdd37d81.zip
Replace setRequired & HasRequired with setRequiredIndicator
Vaadin 7 compatiblity fields still use setRequired via AbstractField (legacy). Public setRequiredIndicator is added to AbstractField, AbstractMultiSelect and AbstractSingleSelect. Internally it is still handled on AbstractComponent & -Connector level. Changes the declarative syntax, required -> required-indicator-visible. Fixes vaadin/framework8-issue#419 Change-Id: I940dc66944d27584bd78e5452aee627ee3abd03a
Diffstat (limited to 'compatibility-server')
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java31
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/Field.java6
2 files changed, 1 insertions, 36 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
index eb6255e37a..f8188faa4d 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
@@ -1433,42 +1433,11 @@ public abstract class AbstractField<T> extends AbstractLegacyComponent
removePropertyListeners();
}
- /**
- * Is this field required. Required fields must filled by the user.
- *
- * If the field is required, it is visually indicated in the user interface.
- * Furthermore, setting field to be required implicitly adds "non-empty"
- * validator and thus isValid() == false or any isEmpty() fields. In those
- * cases validation errors are not painted as it is obvious that the user
- * must fill in the required fields.
- *
- * On the other hand, for the non-required fields isValid() == true if the
- * field isEmpty() regardless of any attached validators.
- *
- *
- * @return <code>true</code> if the field is required, otherwise
- * <code>false</code>.
- */
@Override
public boolean isRequired() {
return getState(false).required;
}
- /**
- * Sets the field required. Required fields must filled by the user.
- *
- * If the field is required, it is visually indicated in the user interface.
- * Furthermore, setting field to be required implicitly adds "non-empty"
- * validator and thus isValid() == false or any isEmpty() fields. In those
- * cases validation errors are not painted as it is obvious that the user
- * must fill in the required fields.
- *
- * On the other hand, for the non-required fields isValid() == true if the
- * field isEmpty() regardless of any attached validators.
- *
- * @param required
- * Is the field required.
- */
@Override
public void setRequired(boolean required) {
getState().required = required;
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Field.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Field.java
index d98153da29..1594bc28b5 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Field.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Field.java
@@ -16,8 +16,6 @@
package com.vaadin.v7.ui;
-import com.vaadin.data.HasRequired;
-import com.vaadin.data.HasValue.ValueChangeEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.Component.Focusable;
import com.vaadin.v7.data.BufferedValidatable;
@@ -48,7 +46,7 @@ import com.vaadin.v7.data.Property;
@Deprecated
public interface Field<T> extends Component, BufferedValidatable, Property<T>,
Property.ValueChangeNotifier, Property.ValueChangeListener,
- Property.Editor, Focusable, HasRequired {
+ Property.Editor, Focusable {
/**
* Is this field required.
*
@@ -58,7 +56,6 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>,
* <code>false</code>.
* @since 3.1
*/
- @Override
public boolean isRequired();
/**
@@ -68,7 +65,6 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>,
* Is the field required.
* @since 3.1
*/
- @Override
public void setRequired(boolean required);
/**