title: JavaFX - How to bind Task progress property to another property within the call() method
body: <p>I am trying to figure out how to bind the progress property of a Task to the property of an object being used inside the Task's call function.  </p>
  
  <p>Conceptually, I have an object that does a certain amount of work and exposes its progress via DoubleProperties.  Since I would like to to do this (long running) task off of the JavaFX main thread, I would like to wrap it in a Task object and be able to show the progress of the underlying object.  However it seems like the only way to update the progress in a Task is through the updateProgress() method, which takes concrete numbers instead of Observables.  Similarly, the progressProperty is exposed as a ReadOnlyDoubleProperty, so I can't set the property that way, nor override the progressProperty() method to return the property I would like to use to display progress.  </p>
  
  <p>More concretely, this is would I would like to do:</p>
  
  <pre><code>final FooBuilder builder = new FooBuilder();
  Task&lt;Void&gt; task = new Task&lt;Void&gt;() {
      @Override
      protected Void call() throws Exception {
  
           //
           // bind to FooBuilders progress property here...but how?
           // Progress of doLongBuildThing is reflected in an exposed
           // DoubleProperty in the FooBuilder class.
           //
           //       
  
           builder.doLongBuildingThing(); 
           return null;
      }           
  };
  </code></pre>
  
  <p>This seems like such a basic thing that it should be pretty easy, yet I am not seeing a straightforward way to accomplish it. Any help would be appreciated.  </p>
  
  <p>TIA.</p>
  
  <ul>
  <li>chooks</li>
  </ul>