/**
* Add Wookie widgets to the page if the server is available.
*/
private void populateWookiePanel() {
WookieServerConnection wookieServerConnection = UserApplication
.getWookieServerConnection(true);
// Trick to (re)connect to Wookie server in case it has
// been (re)started after Simal's initial connection setup.
if(!wookieServerConnection.isAvailable()) {
wookieServerConnection.initialise();
}
// Show all widgets in a gallery
try {
add(new WookieWidgetGalleryPanel("widgetGallery"));
} catch (SimalException e) {
UserReportableException ure = new UserReportableException(
"Unable to retrieve widgets from Woookie for Gallery",
ToolsPage.class, e);
setResponsePage(new ErrorReportPage(ure));
}
// all instantiated widgets
try {
RepeatingView repeating = new RepeatingView("instantiatedWidgets");
Iterator<Widget> itr = wookieServerConnection.getAvailableWidgets()
.values().iterator();
Widget widget;
while (itr.hasNext()) {
widget = itr.next();
Iterator<WidgetInstance> instances = widget.getInstances().iterator();