HOME > SUPPORT > RIB RESETTING
Rib Resetting
In the Ribs model, controller classes are responsible for loading Swing UI panels, updating them, and responding to them. In the previous document, we explained the convention that the controller class have a getUI method. This document explains the convention of the resetUI method. Ribs encourages developers to put all of their UI updating into a single method called resetUI. This method will often have a line of code for each Swing UI control to be updated from the controller's model. As described in the previous document, controls are identified by name [ ui.get("Whatever") ] and updated using the universal accessor method [ ui.setValue("Whatever", aValue) ]. The resetUI() method Here is a typical resetUI method, perhaps from our controller example in the previous document:
The Ribs.reset(controller) method Ribs also provides a nice facility to schedule a delayed, coalesced reset, using the Ribs.reset(controller) method. This can be called from any code any number of times and results in a call to controller.resetUI at the end of the event loop. So any time your model changes behind the back of the UI, you can call Ribs.reset(Controller). |