title: How to use automatic text binding with checkbox SWT button
body: <p>I'm using JFace databinding framework to link checkbox selection with model:</p>
  
  <pre class="lang-java prettyprint-override"><code>final DataBindingContext ctx = new DataBindingContext();
  final Realm realm = ctx.getValidationRealm();
  final IViewerObservableValue selection = ViewersObservables.observeSingleSelection(viewer);
  final IObservableValue selectionObservable = BeansObservables.observeDetailValue(realm, selection, "isSelected", boolean.class);
  final UpdateValueStrategy strategy = new UpdateValueStrategy(true, UpdateValueStrategy.POLICY_UPDATE);
  ctx.bindValue(SWTObservables.observeSelection(button), selectionObservable, strategy, strategy);
  </code></pre>
  
  <p>The presentation needs to use the checkbox's text to display specific information about the current selection, but it's not possible to use <code>observeText(Control)</code>:</p>
  
  <pre class="lang-java prettyprint-override"><code>final UpdateValueStrategy update = new UpdateValueStrategy(true, UpdateValueStrategy.POLICY_NEVER);
  ctx.bindValue(SWTObservables.observeText(button), textObservable, null, update);
  </code></pre>
  
  <p>It causes an SWTException: </p>
  
  <blockquote>
    <p><em>Could not create the view: Widget [org.eclipse.swt.widgets.Button] is not supported.</em></p>
  </blockquote>
  
  <p>Is there a way to do text binding on SWT Button ?</p>
  
  <h2>EDIT</h2>
  
  <p>The fast solution is to put a Label next the checkbox, then the binding could be done easily with <code>SWTObservables.observeText(label)</code></p>
  
  <h2>SOLUTION</h2>
  
  <p>It works on eclipse 3.7</p>