Trait/Object

com.thoughtworks.binding.bindable

Bindable

Related Docs: object Bindable | package bindable

Permalink

trait Bindable[-From] extends Serializable

A dependent type class that witnesses a type that can be converted to a Binding[Value].

Source
package.scala
Example:
  1. The implicit conversion to Binding can be enabled by the following import statement:

    import com.thoughtworks.binding.bindable._

    Then, a @dom XHTML template can establish data-binding on any parameter as long as a Bindable type class for the parameter type is available.

    @dom
    def mySection[A: Bindable.Lt[?, String]](parameter: A) = {
      <img class={parameter.bind}/>
    }

    Note that the ? syntax requires the Scala plug-in kind-projector, which can be enabled by adding the following setting into your build.sbt:

    addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.10")
    
    The mySection method accepts any parameter who is a subtype of Binding[String].

    import com.thoughtworks.binding._, Binding._
    Binding {
      mySection(Binding("my-class-1")).bind.className should be("my-class-1")
      mySection(Constant("my-class-2")).bind.className should be("my-class-2")
    }.watch()

    And the mySection method also accepts String parameter.

    Binding {
      mySection("my-class-3").bind.className should be("my-class-3")
    }.watch()

    mySection should not accept irrelevant parameter types like scala.List or scala.Int.

    "mySection(List.empty)" shouldNot compile
    "mySection(42)" shouldNot compile
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Bindable
  2. Serializable
  3. Serializable
  4. Any
Implicitly
  1. by toBindableSeqOps
  2. by toBindableOps
  3. by bindableToBinding
  4. by any2stringadd
  5. by StringFormat
  6. by Ensuring
  7. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Value

    Permalink

Abstract Value Members

  1. abstract def getClass(): Class[_]

    Permalink
    Definition Classes
    Any
  2. abstract def toBinding(from: From): Binding[Value]

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to any2stringadd[Bindable[From]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Bindable[From], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to ArrowAssoc[Bindable[From]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. final macro def bind: Value

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[Bindable[From], Value] is in scope.
    Definition Classes
    Binding
  8. def bindSeq: BindingSeq[BindableSeq.Value]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[Bindable[From]] is in scope.
    Definition Classes
    Ops
  9. def ensuring(cond: (Bindable[From]) ⇒ Boolean, msg: ⇒ Any): Bindable[From]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ensuring[Bindable[From]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (Bindable[From]) ⇒ Boolean): Bindable[From]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ensuring[Bindable[From]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): Bindable[From]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ensuring[Bindable[From]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): Bindable[From]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ensuring[Bindable[From]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  14. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to StringFormat[Bindable[From]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. def hashCode(): Int

    Permalink
    Definition Classes
    Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def toBindingSeq: BindingSeq[BindableSeq.Value]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[Bindable[From]] is in scope.
    Definition Classes
    Ops
  18. def toString(): String

    Permalink
    Definition Classes
    Any
  19. final def unwatch(): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[Bindable[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @inline()
  20. final def watch(): Unit

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[Bindable[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @inline()
  21. def [B](y: B): (Bindable[From], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to ArrowAssoc[Bindable[From]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def self: Bindable[From]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[Bindable[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindable: Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }).self
    Definition Classes
    Ops
  2. def self: Bindable[From]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableOps in com.thoughtworks.binding.bindable.Bindable.ToBindableOps. This conversion will take place only if an implicit value of type Bindable[Bindable[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindable: Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }).self
    Definition Classes
    Ops
  3. def toBinding: Binding[Value]

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableOps in com.thoughtworks.binding.bindable.Bindable.ToBindableOps. This conversion will take place only if an implicit value of type Bindable[Bindable[From]] is in scope.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (bindable: Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }).toBinding
    Definition Classes
    Ops
  4. val typeClassInstance: BindableSeq[Bindable[From]] { type Value = tc.Value }

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableSeqOps in com.thoughtworks.binding.bindable.BindableSeq.ToBindableSeqOps. This conversion will take place only if an implicit value of type BindableSeq[Bindable[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindable: Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }).typeClassInstance
    Definition Classes
    Ops
  5. val typeClassInstance: Bindable[Bindable[From]] { type Value = tc.Value }

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} } performed by method toBindableOps in com.thoughtworks.binding.bindable.Bindable.ToBindableOps. This conversion will take place only if an implicit value of type Bindable[Bindable[From]] is in scope.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (bindable: Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }).typeClassInstance
    Definition Classes
    Ops

Deprecated Value Members

  1. final macro def each: Value

    Permalink
    Implicit information
    This member is added by an implicit conversion from Bindable[From] to Binding[Value] performed by method bindableToBinding in com.thoughtworks.binding.bindable. This conversion will take place only if an implicit value of type Lt[Bindable[From], Value] is in scope.
    Definition Classes
    Binding
    Annotations
    @deprecated
    Deprecated

    (Since version 7.0.0) Use bind instead

Inherited from Serializable

Inherited from Serializable

Inherited from Any

Inherited by implicit conversion toBindableSeqOps from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }

Inherited by implicit conversion toBindableOps from Bindable[From] to Ops[Bindable[From]] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[com.thoughtworks.binding.bindable.Bindable[From]]{type Value = tc.Value} }

Inherited by implicit conversion bindableToBinding from Bindable[From] to Binding[Value]

Inherited by implicit conversion any2stringadd from Bindable[From] to any2stringadd[Bindable[From]]

Inherited by implicit conversion StringFormat from Bindable[From] to StringFormat[Bindable[From]]

Inherited by implicit conversion Ensuring from Bindable[From] to Ensuring[Bindable[From]]

Inherited by implicit conversion ArrowAssoc from Bindable[From] to ArrowAssoc[Bindable[From]]

Ungrouped