Beans Binding 0.6 Release Available
Just a short note to announce that I've posted the 0.6 release of the Beans Binding project at http://beansbinding.dev.java.net
In this release:
- Improved
JTablesupport - More default converters
- Name your
Bindings - Compile-time type safety for setting
Parameters - A handful of method renames
Full details, straight from the release notes:
API Changes/Additions
Binding.addBinding/removeBinding/getBindingshave been renamed to the more descriptiveBinding.addChildBinding/removeChildBinding/getChildBindingsBinding.setSourcePath/getSourcePathhave been renamed to the more appropriateBinding.setSourceExpression/getSourceExpressionTo enforce compile-time type safety, the
Objectvarargs parameter has been removed from all constructors and methods inBindingandBindingContext. You must now callsetValuedirectly. To allow for method chaining,setValuenow returns theBinding. As an example, replace this binding:Binding b = new Binding(source, "${property}", target, "property", Parameter1, param1Value, Parameter2, param2Value);with this:
Binding b = new Binding(source, "${property}", target, "property"); b.setValue(Parameter1, param1Value).setValue(Parameter2, param2Value);Some
BindingandBindingContextmethods were updated to throw the more appropriateIllegalArgumentException(rather thanIllegalStateException) for certain conditions.Bindingnow has a name property. The ability to name a binding assists in debugging. Its main goal, however, is to make it possible to fetch bindings by name. This will show its full utility with future changes making it easier to validate and then commit or revert bindings as a group.To support naming a binding, the following API additions have been made to
Binding:- Constructors that take a
Stringname parameter void setName(String name)String getName()addChildBindingmethods that take aStringname parameterBinding getChildBinding(String name)
In addition, the following additions have been made to
BindingContext:addBindingmethods that take aStringname parameterBinding getBinding(String name)
- Constructors that take a
Added a
Parameterto control the editability of aJTablewhen it is the target of a binding. A newEditableParameterhas been added toSwingBindingSupportto control this. It can be used on a top-level binding to control the editability of the entire JTable, and/or on the binding's individual child bindings to control editability of individual columns. For example, to make all columns non-editable, except for the first:Binding b = new Binding(list, null, table, "elements"); // whole table is non-editable b.setValue(SwingBindingSupport.EditableParameter, false); b.addChildBinding("${firstName}, null) .setValue(SwingBindingSupport.TableColumnParameter, 0) // this column IS editable .setValue(SwingBindingSupport.EditableParameter, true); b.addChildBinding("${lastName}, null) .setValue(SwingBindingSupport.TableColumnParameter, 1);
Issues Resolved
- 2: Need converters between various types and String
- 5: JTable binding support doesn't support sorting and filtering
Other
The JavaDoc in Binding and SwingBindingSupport has been updated to reflect the
change to use EL for the source "property".
- Login or register to post comments
- Printer-friendly version
- shan_man's blog
- 1350 reads





