diff options
author | Henri Sara <hesara@vaadin.com> | 2011-11-10 16:03:56 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2011-11-10 16:03:56 +0200 |
commit | 87b98101e1d271f76d11ba20599a9a7697f7bd04 (patch) | |
tree | 88d62a8043dd459462e011f8c0acc895df3a8eee | |
parent | eb7257495ea24adbcbd8146f680ddf664c637513 (diff) | |
download | vaadin-framework-87b98101e1d271f76d11ba20599a9a7697f7bd04.tar.gz vaadin-framework-87b98101e1d271f76d11ba20599a9a7697f7bd04.zip |
Eliminate generics related warnings in field factories.
-rw-r--r-- | src/com/vaadin/ui/BaseFieldFactory.java | 11 | ||||
-rw-r--r-- | src/com/vaadin/ui/DefaultFieldFactory.java | 13 | ||||
-rw-r--r-- | src/com/vaadin/ui/FormFieldFactory.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/TableFieldFactory.java | 2 |
4 files changed, 15 insertions, 13 deletions
diff --git a/src/com/vaadin/ui/BaseFieldFactory.java b/src/com/vaadin/ui/BaseFieldFactory.java index 73602700f5..d1dcf940e5 100644 --- a/src/com/vaadin/ui/BaseFieldFactory.java +++ b/src/com/vaadin/ui/BaseFieldFactory.java @@ -40,7 +40,7 @@ public class BaseFieldFactory implements FieldFactory { * * @see com.vaadin.ui.FieldFactory#createField(Class, Component) */ - public Field createField(Class<?> type, Component uiContext) { + public Field<?> createField(Class<?> type, Component uiContext) { return DefaultFieldFactory.createFieldByPropertyType(type); } @@ -49,7 +49,7 @@ public class BaseFieldFactory implements FieldFactory { * * @see com.vaadin.ui.FieldFactory#createField(Property, Component) */ - public Field createField(Property property, Component uiContext) { + public Field<?> createField(Property property, Component uiContext) { if (property != null) { return createField(property.getType(), uiContext); } else { @@ -62,9 +62,10 @@ public class BaseFieldFactory implements FieldFactory { * * @see com.vaadin.ui.FieldFactory#createField(Item, Object, Component) */ - public Field createField(Item item, Object propertyId, Component uiContext) { + public Field<?> createField(Item item, Object propertyId, + Component uiContext) { if (item != null && propertyId != null) { - final Field f = createField(item.getItemProperty(propertyId), + final Field<?> f = createField(item.getItemProperty(propertyId), uiContext); if (f instanceof AbstractComponent) { String name = DefaultFieldFactory @@ -81,7 +82,7 @@ public class BaseFieldFactory implements FieldFactory { * @see com.vaadin.ui.FieldFactory#createField(com.vaadin.data.Container, * java.lang.Object, java.lang.Object, com.vaadin.ui.Component) */ - public Field createField(Container container, Object itemId, + public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { return createField(container.getContainerProperty(itemId, propertyId), uiContext); diff --git a/src/com/vaadin/ui/DefaultFieldFactory.java b/src/com/vaadin/ui/DefaultFieldFactory.java index dda5de1aa5..3fd7f169ba 100644 --- a/src/com/vaadin/ui/DefaultFieldFactory.java +++ b/src/com/vaadin/ui/DefaultFieldFactory.java @@ -35,19 +35,20 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory protected DefaultFieldFactory() { } - public Field createField(Item item, Object propertyId, Component uiContext) { + public Field<?> createField(Item item, Object propertyId, + Component uiContext) { Class<?> type = item.getItemProperty(propertyId).getType(); - Field field = createFieldByPropertyType(type); + Field<?> field = createFieldByPropertyType(type); field.setCaption(createCaptionByPropertyId(propertyId)); return field; } - public Field createField(Container container, Object itemId, + public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { - Property containerProperty = container.getContainerProperty(itemId, + Property<?> containerProperty = container.getContainerProperty(itemId, propertyId); Class<?> type = containerProperty.getType(); - Field field = createFieldByPropertyType(type); + Field<?> field = createFieldByPropertyType(type); field.setCaption(createCaptionByPropertyId(propertyId)); return field; } @@ -110,7 +111,7 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory * the type of the property * @return the most suitable generic {@link Field} for given type */ - public static Field createFieldByPropertyType(Class<?> type) { + public static Field<?> createFieldByPropertyType(Class<?> type) { // Null typed properties can not be edited if (type == null) { return null; diff --git a/src/com/vaadin/ui/FormFieldFactory.java b/src/com/vaadin/ui/FormFieldFactory.java index a0dac130f8..99254d975f 100644 --- a/src/com/vaadin/ui/FormFieldFactory.java +++ b/src/com/vaadin/ui/FormFieldFactory.java @@ -37,5 +37,5 @@ public interface FormFieldFactory extends Serializable { * creating it. * @return Field the field suitable for editing the specified data. */ - Field createField(Item item, Object propertyId, Component uiContext); + Field<?> createField(Item item, Object propertyId, Component uiContext); } diff --git a/src/com/vaadin/ui/TableFieldFactory.java b/src/com/vaadin/ui/TableFieldFactory.java index 157032fa50..56539ef004 100644 --- a/src/com/vaadin/ui/TableFieldFactory.java +++ b/src/com/vaadin/ui/TableFieldFactory.java @@ -39,7 +39,7 @@ public interface TableFieldFactory extends Serializable { * @return A field suitable for editing the specified data or null if the * property should not be editable. */ - Field createField(Container container, Object itemId, Object propertyId, + Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext); } |