SimpleDateFormat format = new SimpleDateFormat("EEEE");
dayOfWeekComboBox.setRenderer(new DefaultListRenderer(
new FormatStringValue(format)));
Converter<?, ?> days = new DayOfWeekConverter(calendar);
BindingGroup group = new BindingGroup();
group.addBinding(Bindings.createAutoBinding(READ,
selectionModes, BeanProperty.create("selectedItem"),
monthView, BeanProperty.create("selectionMode")));
group.addBinding(Bindings.createAutoBinding(READ,
traversable, BeanProperty.create("selected"),
monthView, BeanProperty.create("traversable")));
Binding dayOfWeek = Bindings.createAutoBinding(READ,
dayOfWeekComboBox, BeanProperty.create("selectedItem"),
monthView, BeanProperty.create("firstDayOfWeek"));
dayOfWeek.setConverter(days);
group.addBinding(dayOfWeek);
Binding flagged = Bindings.createAutoBinding(READ,
flaggedDates, BeanProperty.create("date"),
this, BeanProperty.create("lastFlagged"));
group.addBinding(flagged);
Binding unselectable = Bindings.createAutoBinding(READ,
unselectableDates, BeanProperty.create("date"),
this, BeanProperty.create("lastUnselectable"));
group.addBinding(unselectable);
group.addBinding(Bindings.createAutoBinding(READ,
upperBound, BeanProperty.create("date"),
this, BeanProperty.create("upperBound")));
group.addBinding(Bindings.createAutoBinding(READ,
lowerBound, BeanProperty.create("date"),
this, BeanProperty.create("lowerBound")));
group.bind();
// PENDING JW: removed the color selection stuff for now
// future will be to use highlighters anyway - revisit then
}