UISupport
Convenience view layer controls to assist with the formatting, validation, and data entry acceleration. Tailored for use with JGoodies Binding. Includes:
- Date field group controller
- Calendar popup
- Real-time text field spell checker
- Decimal field caret controller
- Binding helper methods
Use
/*
* Recommended use pattern is to collect the DB bindings
* and UISupport features into a single post-initialization
* method relative to a view:
*/
void initialize() {
// create all view controls
bind();
}
void bind() {
...
// for a JFormattedTextField named 'decField'
Bindings.bind(decField, presentationModel.getModel(Bill.FEE));
UIBind.formatter(decField, UIBind.CURRENCY);
UIBind.decimalCaretController(decField);
...
// for a JFormattedTextField named 'datedField'
Bindings.bind(datedField, presentationModel.getModel(Action.DATED));
UIBind.formatter(datedField, UIBind.DATE);
UIBind.dateVerifier(datedField);
UIBind.calendarPopup(datedField);
...
// for a JFormattedTextField named 'dueDateField' (forms a date group)
Bindings.bind(dueDateField, presentationModel.getModel(Action.DUEDATE));
UIBind.formatter(dueDateField, UIBind.DATE, datedField);
UIBind.dateVerifier(dueDateField, UIBind.FIRST, datedField);
UIBind.calendarPopup(dueDateField);
...
}