diff options
Diffstat (limited to 'src/com/vaadin')
20 files changed, 38 insertions, 33 deletions
diff --git a/src/com/vaadin/data/Container.java b/src/com/vaadin/data/Container.java index 4c2d969c83..15b8a0a2d4 100644 --- a/src/com/vaadin/data/Container.java +++ b/src/com/vaadin/data/Container.java @@ -121,7 +121,7 @@ public interface Container extends Serializable { * ID of the Property to retrieve * @return Property with the given ID or <code>null</code> */ - public Property getContainerProperty(Object itemId, Object propertyId); + public Property<?> getContainerProperty(Object itemId, Object propertyId); /** * Gets the data type of all Properties identified by the given Property ID. diff --git a/src/com/vaadin/data/Item.java b/src/com/vaadin/data/Item.java index 103a9cf177..6d1224ebcb 100644 --- a/src/com/vaadin/data/Item.java +++ b/src/com/vaadin/data/Item.java @@ -30,7 +30,7 @@ public interface Item extends Serializable { * identifier of the Property to get * @return the Property with the given ID or <code>null</code> */ - public Property getItemProperty(Object id); + public Property<?> getItemProperty(Object id); /** * Gets the collection of IDs of all Properties stored in the Item. diff --git a/src/com/vaadin/data/util/AbstractBeanContainer.java b/src/com/vaadin/data/util/AbstractBeanContainer.java index 4e5cb182b2..a562edf8a6 100644 --- a/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -104,7 +104,8 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends + " not found"); } try { - Property<IDTYPE> property = pd.createProperty(bean); + Property<IDTYPE> property = (Property<IDTYPE>) pd + .createProperty(bean); return property.getValue(); } catch (MethodException e) { throw new IllegalArgumentException(e); @@ -256,7 +257,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { Item item = getItem(itemId); if (item == null) { return null; @@ -371,7 +372,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends * The id of the property */ private void addValueChangeListener(Item item, Object propertyId) { - Property property = item.getItemProperty(propertyId); + Property<?> property = item.getItemProperty(propertyId); if (property instanceof ValueChangeNotifier) { // avoid multiple notifications for the same property if // multiple filters are in use @@ -390,7 +391,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends * The id of the property */ private void removeValueChangeListener(Item item, Object propertyId) { - Property property = item.getItemProperty(propertyId); + Property<?> property = item.getItemProperty(propertyId); if (property instanceof ValueChangeNotifier) { ((ValueChangeNotifier) property).removeListener(this); } diff --git a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java index 3633154c4a..bbccd37394 100644 --- a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -641,7 +641,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Container Don't add a JavaDoc comment here, we use the default * documentation from implemented interface. */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { return container.getContainerProperty(itemId, propertyId); } diff --git a/src/com/vaadin/data/util/ContainerOrderedWrapper.java b/src/com/vaadin/data/util/ContainerOrderedWrapper.java index 1bf9a49a3d..51be30bf7e 100644 --- a/src/com/vaadin/data/util/ContainerOrderedWrapper.java +++ b/src/com/vaadin/data/util/ContainerOrderedWrapper.java @@ -437,7 +437,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Container Don't add a JavaDoc comment here, we use the default * documentation from implemented interface. */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { return container.getContainerProperty(itemId, propertyId); } diff --git a/src/com/vaadin/data/util/FilesystemContainer.java b/src/com/vaadin/data/util/FilesystemContainer.java index 76a7b90376..c95eb4a8a1 100644 --- a/src/com/vaadin/data/util/FilesystemContainer.java +++ b/src/com/vaadin/data/util/FilesystemContainer.java @@ -459,7 +459,7 @@ public class FilesystemContainer implements Container.Hierarchical { * the property's ID. * @return the requested property's value, or <code>null</code> */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { if (!(itemId instanceof File)) { return null; @@ -609,7 +609,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the specified property of this file. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { return getContainerProperty(file, id); } diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java index 79d9d89b90..b7e72c3467 100644 --- a/src/com/vaadin/data/util/IndexedContainer.java +++ b/src/com/vaadin/data/util/IndexedContainer.java @@ -150,7 +150,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { if (!containsId(itemId)) { return null; } @@ -680,7 +680,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Item#getItemProperty(java.lang.Object) */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { return new IndexedContainerProperty(itemId, id); } diff --git a/src/com/vaadin/data/util/MethodProperty.java b/src/com/vaadin/data/util/MethodProperty.java index 3809029223..092c72e5f1 100644 --- a/src/com/vaadin/data/util/MethodProperty.java +++ b/src/com/vaadin/data/util/MethodProperty.java @@ -170,7 +170,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { @SuppressWarnings("unchecked") public MethodProperty(Object instance, String beanPropertyName) { - final Class beanClass = instance.getClass(); + final Class<?> beanClass = instance.getClass(); // Assure that the first letter is upper cased (it is a common // mistake to write firstName, not FirstName). @@ -474,7 +474,9 @@ public class MethodProperty<T> extends AbstractProperty<T> { * {@link #setValue(Object newValue)} is called. */ @SuppressWarnings("unchecked") - public MethodProperty(Class type, Object instance, Method getMethod, + // cannot use "Class<? extends T>" because of automatic primitive type + // conversions + public MethodProperty(Class<?> type, Object instance, Method getMethod, Method setMethod, Object[] getArgs, Object[] setArgs, int setArgumentIndex) { @@ -495,13 +497,13 @@ public class MethodProperty<T> extends AbstractProperty<T> { } // Gets the return type from get method - type = convertPrimitiveType(type); + Class<? extends T> convertedType = (Class<? extends T>) convertPrimitiveType(type); this.getMethod = getMethod; this.setMethod = setMethod; setArguments(getArgs, setArgs, setArgumentIndex); this.instance = instance; - this.type = type; + this.type = convertedType; } /** @@ -673,6 +675,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { // convert using a string constructor try { // Gets the string constructor + @SuppressWarnings("rawtypes") final Constructor constr = type .getConstructor(new Class[] { String.class }); diff --git a/src/com/vaadin/data/util/MethodPropertyDescriptor.java b/src/com/vaadin/data/util/MethodPropertyDescriptor.java index 1d7944dc6c..b56df34831 100644 --- a/src/com/vaadin/data/util/MethodPropertyDescriptor.java +++ b/src/com/vaadin/data/util/MethodPropertyDescriptor.java @@ -123,7 +123,7 @@ public class MethodPropertyDescriptor<BT> implements return propertyType; } - public Property createProperty(Object bean) { + public Property<?> createProperty(Object bean) { return new MethodProperty<Object>(propertyType, bean, readMethod, writeMethod); } diff --git a/src/com/vaadin/data/util/NestedPropertyDescriptor.java b/src/com/vaadin/data/util/NestedPropertyDescriptor.java index b452fdbc49..1a11263587 100644 --- a/src/com/vaadin/data/util/NestedPropertyDescriptor.java +++ b/src/com/vaadin/data/util/NestedPropertyDescriptor.java @@ -37,7 +37,8 @@ public class NestedPropertyDescriptor<BT> implements public NestedPropertyDescriptor(String name, Class<BT> beanType) throws IllegalArgumentException { this.name = name; - NestedMethodProperty property = new NestedMethodProperty(beanType, name); + NestedMethodProperty<?> property = new NestedMethodProperty<Object>( + beanType, name); this.propertyType = property.getType(); } @@ -49,8 +50,8 @@ public class NestedPropertyDescriptor<BT> implements return propertyType; } - public Property createProperty(BT bean) { - return new NestedMethodProperty(bean, name); + public Property<?> createProperty(BT bean) { + return new NestedMethodProperty<Object>(bean, name); } } diff --git a/src/com/vaadin/data/util/PropertysetItem.java b/src/com/vaadin/data/util/PropertysetItem.java index 6224d3a01c..321342eb64 100644 --- a/src/com/vaadin/data/util/PropertysetItem.java +++ b/src/com/vaadin/data/util/PropertysetItem.java @@ -57,7 +57,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * the identifier of the Property to get. * @return the Property with the given ID or <code>null</code> */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { return map.get(id); } diff --git a/src/com/vaadin/data/util/QueryContainer.java b/src/com/vaadin/data/util/QueryContainer.java index 10e308f43c..28c511d32f 100644 --- a/src/com/vaadin/data/util/QueryContainer.java +++ b/src/com/vaadin/data/util/QueryContainer.java @@ -229,7 +229,7 @@ public class QueryContainer implements Container, Container.Ordered, * otherwise. */ - public synchronized Property getContainerProperty(Object itemId, + public synchronized Property<?> getContainerProperty(Object itemId, Object propertyId) { if (!(itemId instanceof Integer && propertyId instanceof String)) { return null; @@ -532,7 +532,7 @@ public class QueryContainer implements Container, Container.Ordered, * identifier of the Property to get * @return the Property with the given ID or <code>null</code> */ - public Property getItemProperty(Object propertyId) { + public Property<?> getItemProperty(Object propertyId) { return getContainerProperty(id, propertyId); } diff --git a/src/com/vaadin/data/util/VaadinPropertyDescriptor.java b/src/com/vaadin/data/util/VaadinPropertyDescriptor.java index 37f030bbc2..50ca939b3a 100644 --- a/src/com/vaadin/data/util/VaadinPropertyDescriptor.java +++ b/src/com/vaadin/data/util/VaadinPropertyDescriptor.java @@ -39,5 +39,5 @@ public interface VaadinPropertyDescriptor<BT> extends Serializable { * @param bean * @return */ - public Property createProperty(BT bean); + public Property<?> createProperty(BT bean); }
\ No newline at end of file diff --git a/src/com/vaadin/data/util/sqlcontainer/RowItem.java b/src/com/vaadin/data/util/sqlcontainer/RowItem.java index fbcee76f37..fac0292efa 100644 --- a/src/com/vaadin/data/util/sqlcontainer/RowItem.java +++ b/src/com/vaadin/data/util/sqlcontainer/RowItem.java @@ -48,7 +48,7 @@ public final class RowItem implements Item { this.id = id; } - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { if (id instanceof String && id != null) { for (ColumnProperty cp : properties) { if (id.equals(cp.getPropertyId())) { diff --git a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index 1db5d406d7..110fd32913 100644 --- a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -227,7 +227,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { Item item = getItem(itemId); if (item == null) { return null; diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java index 0343419cf1..4361e1e9dd 100644 --- a/src/com/vaadin/ui/AbstractSelect.java +++ b/src/com/vaadin/ui/AbstractSelect.java @@ -730,7 +730,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements * * @see com.vaadin.data.Container#getContainerProperty(Object, Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { return items.getContainerProperty(itemId, propertyId); } diff --git a/src/com/vaadin/ui/DateField.java b/src/com/vaadin/ui/DateField.java index 040a2a4dd4..17ef83d839 100644 --- a/src/com/vaadin/ui/DateField.java +++ b/src/com/vaadin/ui/DateField.java @@ -544,7 +544,7 @@ public class DateField extends AbstractField<Date> implements Form f = (Form) parenOfDateField; Collection<?> visibleItemProperties = f.getItemPropertyIds(); for (Object fieldId : visibleItemProperties) { - Field field = f.getField(fieldId); + Field<?> field = f.getField(fieldId); if (field == this) { /* * this datefield is logically in a form. Do the same diff --git a/src/com/vaadin/ui/FieldFactory.java b/src/com/vaadin/ui/FieldFactory.java index e8351e52dd..4c32b827b6 100644 --- a/src/com/vaadin/ui/FieldFactory.java +++ b/src/com/vaadin/ui/FieldFactory.java @@ -30,7 +30,7 @@ public interface FieldFactory extends FormFieldFactory, TableFieldFactory { * @return Field the field suitable for editing the specified data. * */ - Field createField(Class<?> type, Component uiContext); + Field<?> createField(Class<?> type, Component uiContext); /** * Creates a field based on the property datasource. @@ -41,6 +41,6 @@ public interface FieldFactory extends FormFieldFactory, TableFieldFactory { * the component where the field is presented. * @return Field the field suitable for editing the specified data. */ - Field createField(Property property, Component uiContext); + Field<?> createField(Property property, Component uiContext); }
\ No newline at end of file diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java index ed83649453..b7ba23aee3 100644 --- a/src/com/vaadin/ui/Form.java +++ b/src/com/vaadin/ui/Form.java @@ -599,7 +599,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, * * @see com.vaadin.data.Item#getItemProperty(Object) */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { final Field<?> field = fields.get(id); if (field == null) { // field does not exist or it is not (yet) created for this property @@ -1129,7 +1129,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, * * @return the Field. */ - private Field getFirstFocusableField() { + private Field<?> getFirstFocusableField() { if (getItemPropertyIds() != null) { for (Object id : getItemPropertyIds()) { if (id != null) { diff --git a/src/com/vaadin/ui/RichTextArea.java b/src/com/vaadin/ui/RichTextArea.java index dc0055c7db..545a0e0a21 100644 --- a/src/com/vaadin/ui/RichTextArea.java +++ b/src/com/vaadin/ui/RichTextArea.java @@ -222,7 +222,7 @@ public class RichTextArea extends AbstractField<String> { } @Override - public Class getType() { + public Class<String> getType() { return String.class; } |