You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FormFieldFactory.java 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.ui;
  5. import java.io.Serializable;
  6. import com.vaadin.data.Item;
  7. /**
  8. * Factory interface for creating new Field-instances based on {@link Item},
  9. * property id and uiContext (the component responsible for displaying fields).
  10. * Currently this interface is used by {@link Form}, but might later be used by
  11. * some other components for {@link Field} generation.
  12. *
  13. * <p>
  14. *
  15. * @author Vaadin Ltd.
  16. * @version
  17. * @VERSION@
  18. * @since 6.0
  19. * @see TableFieldFactory
  20. */
  21. public interface FormFieldFactory extends Serializable {
  22. /**
  23. * Creates a field based on the item, property id and the component (most
  24. * commonly {@link Form}) where the Field will be presented.
  25. *
  26. * @param item
  27. * the item where the property belongs to.
  28. * @param propertyId
  29. * the Id of the property.
  30. * @param uiContext
  31. * the component where the field is presented, most commonly this
  32. * is {@link Form}. uiContext will not necessary be the parent
  33. * component of the field, but the one that is responsible for
  34. * creating it.
  35. * @return Field the field suitable for editing the specified data.
  36. */
  37. Field<?> createField(Item item, Object propertyId, Component uiContext);
  38. }