Interface PropertyBinder


  • public interface PropertyBinder
    A role that allows to bind items of ResourceProperties to other objects, typically for managing a User Interface.
    Author:
    Fabrizio Giudici
    Stereotype:
    role
    • Field Detail

      • _PropertyBinder_

        static final java.lang.Class<PropertyBinder> _PropertyBinder_
    • Method Detail

      • bind

        <T> void bind​(@Nonnull
                      it.tidalwave.util.Key<T> propertyName,
                      @Nonnull
                      it.tidalwave.role.ui.BoundProperty<T> boundProperty,
                      @Nonnull
                      PropertyBinder.UpdateCallback callback)
        Binds a given property to a BoundProperty. This is useful for any kind of property types, with the exception of HTML documents.
        Parameters:
        propertyName - the property name in ResourceProperties
        boundProperty - the object to bind
        callback - the callback that will notify updates
      • createBoundDocument

        @Nonnull
        EmbeddedServer.Document createBoundDocument​(@Nonnull
                                                    it.tidalwave.util.Key<java.lang.String> propertyName,
                                                    @Nonnull
                                                    PropertyBinder.UpdateCallback callback)
        Creates a Document bound to the given property. This is useful for HTML documents, since they undergo a special processing for being edited in a HTML viewer (CSS and JavaScript resources are inserted in the head). FIXME: I don't like the asymmetry with bind(), that accepts a BoundProperty. This is due to the fact that BoundProperty is mutable, while Document is immutable. Actually, a mutable Document would be acceptable.
        Parameters:
        propertyName - the property name in ResourceProperties
        callback - the callback that will notify updates
        Returns:
        the bound document