February 2014
Beginner
1248 pages
62h 25m
English
Once you’ve defined the custom cell layout, updating the CoverViewerController to use it requires a single line of code, which you should add as the last statement in the CoverViewerController’s initialize method:
booksListView.setCellFactory((listView) -> new ImageTextCell());
In this case, we pass to ListView method setCellFactory a lambda expression that returns a new object of the ImageTextCell class. Each time the ListView requires a new cell, this lambda expression will be invoked to get a new cell and the cell’s update method will be called to create the custom cell presentation.
The argument to setCellFactory is an implementation of the functional interface CallBack (package ...
Read now
Unlock full access