 |
Beans Binding 0.6.1 Release Available
Posted by shan_man on June 22, 2007 at 02:41 PM | Comments (6)
Taking into consideration the feedback that I've received since yesterday's blog on the 0.6 release of Beans Binding,
I've just released 0.6.1 with simpler and more intuitive method names and constants. It's available at
http://beansbinding.dev.java.net
Full details, straight from the release notes:
API Changes/Additions
UpdateStrategy.READ_FROM_SOURCE has been renamed to the shorter
UpdateStrategy.READ
TextChangeStategy is now a top-level enum. In addition, the values
CHANGE_ON_TYPE, CHANGE_ON_ACTION_OR_FOCUS_LOST
and CHANGE_ON_FOCUS_LOST
have been shortened to ON_TYPE,
ON_ACTION_OR_FOCUS_LOST, ON_FOCUS_LOST.
Binding.Parameter has been renamed to Binding.ParameterKey and
Binding.setValue/getValue have been given the more appropriate names
Binding.putParameter/getParameter.
All Swing ParameterKeys are now in a top-level ParameterKeys class.
They've been renamed as appropriate to reflect the fact that they are constants.
A few have also been shortened.
SwingBindingSupport has been removed. Documentation for Swing binding
is now in the package-level documentation.
To see how some of these changes affect you, let's look at two examples:
Before:
Binding b = new Binding(list, null, table, "elements");
b.addChildBinding("${firstName}, null)
.setValue(SwingBindingSupport.TableColumnParameter, 0)
.setValue(SwingBindingSupport.TableColumnClassParameter, String.class);
After:
Binding b = new Binding(list, null, table, "elements");
b.addChildBinding("${firstName}, null)
.putParameter(ParameterKeys.COLUMN, 0)
.putParameter(ParameterKeys.COLUMN_CLASS, String.class);
Likewise, before:
Binding b = new Binding(object, "${property}", textField, "text");
b.setValue(SwingBindingSupport.TextChangeStrategyParameter,
SwingBindingSupport.TextChangeStrategy.CHANGE_ON_TYPE);
After:
Binding b = new Binding(object, "${property}", textField, "text");
binding.putParameter(ParameterKeys.TEXT_CHANGE_STRATEGY,
TextChangeStrategy.ON_TYPE);
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Hi shan_man,
I still feels the method putParameter is a little bit strange (with getParamter, like your are exposing the underline Map api?). I think setParameter or addParameter is better.
Thanks,
Wayne
Posted by: zwe on June 24, 2007 at 07:24 PM
-
Hi zwe! I did consider both setParameter and addParameter and actually decided against both of them for different reasons. The problem with using the set prefix is that the method doesn't really follow the beans pattern, as set might suggest. The problem I had with the add prefix is that it suggests you can add the same parameter more than once. In reality, the method is supposed to behave the same as a map, and therefore I felt it appropriate to borrow the put prefix. Thanks!
Posted by: shan_man on June 25, 2007 at 10:46 AM
-
Sorry, but is the JSR-295 EG considered dead? I haven't seen an announce of this release in the EG mailing list...
Posted by: yole on June 26, 2007 at 03:27 AM
-
Hi yole. I'm truly sorry for how it's appeared, but the EG is definitely not dead. I had planned to announce 0.6 to the EG in parallel with the blog. But I quickly got caught up in 0.6.1 which I wanted to get out for NetBeans to incorporate into their next milestone.
I'm going to announce it now. But even more important, I have a bunch of ideas that I'm looking to run by the EG today. You'll see the e-mails soon. Thanks!
Posted by: shan_man on June 26, 2007 at 06:27 AM
-
Hi, how i can create a binding to a JSpinner component??
Posted by: saomxand on August 22, 2007 at 07:57 AM
-
Since JSpinner doesn't fire property change notifications for its "value" property, it's another component that Beans Binding will need to provide an adapter for. This hasn't been included yet in the project, but when it is, you'll be able to bind to a JSpinner's value just like with a JSlider. Thanks!
Posted by: shan_man on August 27, 2007 at 07:38 AM
|