HOME > SUPPORT > RIB RESPONDING
Rib Responding
Whereas other Java UI builders only solve the problem of UI layout, Ribs also provides a simple and complete solution to reset and respond to Swing UI controls (otherwise known as binding). Solving this problem eliminates a significant amount of tedious code in the form of action, change and selection listeners. It also further enforces a clean separation between controller code and UI code. This automatic configuration takes place when you load a rib file with Ribs.getRib(myController). This method configures all UI controls to call the respondUI method of the controller whenever the user modifies a UI control's value. The respondUI() method Here is a typical respondUI method, perhaps from our controller example in the previous documents:
Configuring an arbitrary callback method It's important to note that the Ribs designer lets you change the default callback method on any individual control. So it's easy, for instance, to configure a "CancelButton" to simply call a method called performCancel(). However, one benefit to using the respondUI convention is a single point of entry for all UI response. This improvise maintenance by making it convenient for developers new to a project to quickly track all UI response for a UI panel without having to inspect individual panel controls in the Ribs designer. |