I’ve been working with Eclipse RCP for sometime now. I went through Vogella’s tutorials, and they were great. I’ve also gone through ‘Eclipse Rich Client Platform’ book from Addison-Wesley. I’ve reached the point where I’m using the Databinding framework. Specifically, I’m using DatabindingContext, WidgetProperties, and BeanProperties. I’m trying to use it with checkbox. My code is as shown:
widgetValue = WidgetProperties.selection().observe(btnSupplementalPersonnel);
modelValue = BeanProperties.value(HO.class,"supplementalPersonnel").observe(ho);
ctx.bindValue(widgetValue, modelValue);
btnSupplementalPersonnel is defined as follows:
Button btnSupplementalPersonnel = toolkit.createButton(gClient, "Supplemental Personnel", SWT.CHECK);
However, my code throws a NullPointerException at this point. I’ve gone through lots of material to establish the problem, but I can’t seem to figure it out. Any help will be highly appreciated.
Sorry guys, I figured this out. It was sloppiness on my part; the binding code was executing even before widget creation code, hence the NullPointerException. I’ll be more careful next time.