Interface PropertyBinder
-
public interface PropertyBinder
A role that allows to bind items ofResourceProperties
to other objects, typically for managing a User Interface.- Author:
- Fabrizio Giudici
- Stereotype:
- role
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
PropertyBinder.UpdateCallback
A callback that notifies when an item has been updated.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<PropertyBinder>
_PropertyBinder_
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> void
bind(it.tidalwave.util.Key<T> propertyName, it.tidalwave.role.ui.BoundProperty<T> boundProperty, PropertyBinder.UpdateCallback callback)
Binds a given property to aBoundProperty
.EmbeddedServer.Document
createBoundDocument(it.tidalwave.util.Key<java.lang.String> propertyName, PropertyBinder.UpdateCallback callback)
Creates a Document bound to the given property.
-
-
-
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 aBoundProperty
. This is useful for any kind of property types, with the exception of HTML documents.- Parameters:
propertyName
- the property name inResourceProperties
boundProperty
- the object to bindcallback
- 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 inResourceProperties
callback
- the callback that will notify updates- Returns:
- the bound document
-
-