Package sc.bind

Annotation Type Bindable


  • @Target({TYPE,FIELD,METHOD})
    @Retention(RUNTIME)
    public @interface Bindable
    Use this annotation to mark properties as "bindable" - i.e. sending change events so they can be used as a source variable in a data binding expression using StrataCode's data binding libraries and the :=, =: and :=: operators. By default, the generated code includes a Bind.sendEvent to notify listeners when this property is used in a binding expression. For fields, getX and setX methods are generated using customizable templates for defining a property. If there already exists a setX method, a different template is used which by default renames the existing method calls it from the generated setX method. You can override either template to customize how events are sent. For example, the getX method could be modified to recompute the value for lazy evaluation. You can set @Bindable at the class level to make all properties bindable by default or on a field, getX or setX method.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean crossScope
      Set to true for those bindings where the changeEvents might come from some other thread operating in another context.
      int delay
      Set to 0 does the same thing as doLater=true.
      boolean doLater
      Set to true to run this binding in a doLater
      boolean history
      Set to true to enable recording of the history of values.
      boolean immediate
      Set to true to force immediate mode (default depends on BindingContext)
      boolean inactive
      Set this to true to initially disable the binding.
      boolean manual
      Set to true for properties that do their own 'sendEvent' calls, or to just eliminate warnings about unbinding properties when another means is used to refresh the binding
      boolean origin
      For trace or history include the origin - the stack trace and bindings leading up to this change.
      int priority
      For doLater=true, the priority to pass to the invokeLater call - 0 is the default that runs before refresh
      boolean queued
      Set to true to force queued mode (default depends on BindingContext)
      boolean sameValueCheck
      Should this binding not send a change event when setX is called with the same value.
      boolean skipNull
      Set to true to eliminate a null value being passed to a method as part of the binding
      boolean trace
      Set to enable selective tracing - each time the binding is initialized, set, retrieved, destroyed
      boolean verbose
      Set to enable verbose events on this binding - i.e.
    • Element Detail

      • manual

        boolean manual
        Set to true for properties that do their own 'sendEvent' calls, or to just eliminate warnings about unbinding properties when another means is used to refresh the binding
        Default:
        false
      • inactive

        boolean inactive
        Set this to true to initially disable the binding. It can be enabled via an api later - Bind.activate()
        Default:
        false
      • trace

        boolean trace
        Set to enable selective tracing - each time the binding is initialized, set, retrieved, destroyed
        Default:
        false
      • verbose

        boolean verbose
        Set to enable verbose events on this binding - i.e. a message for init, set, destroy operations
        Default:
        false
      • crossScope

        boolean crossScope
        Set to true for those bindings where the changeEvents might come from some other thread operating in another context. Adds extra thread-local lookup for the init and apply calls plus any necessary context switching overhead
        Default:
        false
      • skipNull

        boolean skipNull
        Set to true to eliminate a null value being passed to a method as part of the binding
        Default:
        false
      • queued

        boolean queued
        Set to true to force queued mode (default depends on BindingContext)
        Default:
        false
      • immediate

        boolean immediate
        Set to true to force immediate mode (default depends on BindingContext)
        Default:
        false
      • history

        boolean history
        Set to true to enable recording of the history of values. APIs for diagnostics. When combined (TODO - not implemented!)
        Default:
        false
      • origin

        boolean origin
        For trace or history include the origin - the stack trace and bindings leading up to this change. If neither are set, both are enabled by default so origin=true by itself will provide the most diagnostics on this property. TODO: not implemented
        Default:
        false
      • delay

        int delay
        Set to 0 does the same thing as doLater=true. Set to some number of milliseconds to run this binding with a delay.
        Default:
        -1
      • doLater

        boolean doLater
        Set to true to run this binding in a doLater
        Default:
        false
      • priority

        int priority
        For doLater=true, the priority to pass to the invokeLater call - 0 is the default that runs before refresh
        Default:
        0
      • sameValueCheck

        boolean sameValueCheck
        Should this binding not send a change event when setX is called with the same value.
        Default:
        false