diff options
author | Henri Sara <hesara@vaadin.com> | 2011-11-08 18:02:55 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2011-11-08 18:02:55 +0200 |
commit | 0ab1d01c8da1f280370452fa2427708fd6de513e (patch) | |
tree | 4bf67b8a478da3b25af35c33c031c837ef2cc2e7 /src/com/vaadin/ui/ProgressIndicator.java | |
parent | a61302616430cbbfc97cbdbb85fe294842b3409c (diff) | |
download | vaadin-framework-0ab1d01c8da1f280370452fa2427708fd6de513e.tar.gz vaadin-framework-0ab1d01c8da1f280370452fa2427708fd6de513e.zip |
Parameterize Property and Field with the value type.
The interfaces Property and Field and most of their implementations are
now parameterized with the type of their value. The method getValue()
returns the Property type but setValue() takes Object as its parameter.
No implicit conversions between value type and strings are performed in
most locations (fields).
Among others, AbstractTextField, DateField and RichTextArea not have
specific value types and do not accept arbitrary values.
Most locations requiring migration will be visible as compilation
errors, with the exception of some cases where a non-parameterized
Property or Field (or one parametrized with Object) is used.
Not yet done:
- Label
- converters
- setValue() parameterization (causes much more migration effort)
Diffstat (limited to 'src/com/vaadin/ui/ProgressIndicator.java')
-rw-r--r-- | src/com/vaadin/ui/ProgressIndicator.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/vaadin/ui/ProgressIndicator.java b/src/com/vaadin/ui/ProgressIndicator.java index 6f2758f323..7bf4bc56af 100644 --- a/src/com/vaadin/ui/ProgressIndicator.java +++ b/src/com/vaadin/ui/ProgressIndicator.java @@ -26,7 +26,7 @@ import com.vaadin.terminal.gwt.client.ui.VProgressIndicator; */ @SuppressWarnings("serial") @ClientWidget(VProgressIndicator.class) -public class ProgressIndicator extends AbstractField implements Property, +public class ProgressIndicator extends AbstractField<Number> implements Property.Viewer, Property.ValueChangeListener { /** @@ -125,11 +125,12 @@ public class ProgressIndicator extends AbstractField implements Property, * @see com.vaadin.ui.AbstractField#getValue() */ @Override - public Object getValue() { + public Number getValue() { if (dataSource == null) { throw new IllegalStateException("Datasource must be set"); } - return dataSource.getValue(); + // TODO conversions to eliminate cast + return (Number) dataSource.getValue(); } /** @@ -138,7 +139,7 @@ public class ProgressIndicator extends AbstractField implements Property, * * @param newValue * the New value of the ProgressIndicator. - * @see com.vaadin.ui.AbstractField#setValue(java.lang.Object) + * @see com.vaadin.ui.AbstractField#setValue() */ @Override public void setValue(Object newValue) { @@ -163,7 +164,7 @@ public class ProgressIndicator extends AbstractField implements Property, * @see com.vaadin.ui.AbstractField#getType() */ @Override - public Class<?> getType() { + public Class<? extends Number> getType() { if (dataSource == null) { throw new IllegalStateException("Datasource must be set"); } |