Glimmer development has finally resumed.
I added data-binding support for Combo boxes.
I also committed a Rakefile to be able to run tests using jrake.
Simply run: jrake test_core
Right now, it only covers the core tests for Glimmer. In the future, I will add a task to handle all tests in the test directory.
class Person
attr_accessor :country, :country_options
def initialize
self.country_options=["", "Canada", "US", "Mexico"]
self.country = "Canada"
end
end
class HelloCombo
include Glimmer
def launch
shell {
combo(:read_only) {
selection bind(Person.new, :country)
}
}.open
end
end
HelloCombo.new.launch
This produces a tiny shell with a combo box that has "Canada" preselected:


Since convention over configuration is one of the principles behind Glimmer's design, when declaring data-binding for a combo box, there is no need to declare it for both the property being bound (e.g. country) and the collection that contains the available options (e.g. US, Canada, Mexico.) Simply ensure that the collection property on the model follows the convention of having the same name as the property being bound suffixed with "_options", and Glimmer will figure out the rest during data-binding.
Take a look at this unit test for more details on how combo box data-binding is expected to work:
http://dev.eclipse.org/svnroot/technology/org.eclipse.glimmer.core/test/glimmer_combo_data_binding_test.rbNext up is List box data-binding support. Stay tuned!