new Observer<GotGadgetDefinitionCategoriesResponseEvent>()
{
public void update(final GotGadgetDefinitionCategoriesResponseEvent event)
{
gadgetTab.addSet("All", GadgetDefinitionModel.getInstance(), new GadgetMetaDataRenderer(),
new GetGalleryItemsRequest("recent", "", 0, 0), "Recent");
gadgetTab.addSet("All", GadgetDefinitionModel.getInstance(), new GadgetMetaDataRenderer(),
new GetGalleryItemsRequest("popularity", "", 0, 0), "Popular");
for (String category : event.getResponse())
{
gadgetTab.addSet(category, GadgetDefinitionModel.getInstance(),
new GadgetMetaDataRenderer(), new GetGalleryItemsRequest("recent", category, 0, 0),
"Recent");
gadgetTab.addSet(category, GadgetDefinitionModel.getInstance(),
new GadgetMetaDataRenderer(), new GetGalleryItemsRequest("popularity", category, 0,
0), "Popular");
}
Session.getInstance().getEventBus().removeObserver(
GotGadgetDefinitionCategoriesResponseEvent.class, this);
}
});
Session.getInstance().getEventBus().addObserver(GotGadgetDefinitionCategoriesResponseEvent.class,
new Observer<GotGadgetDefinitionCategoriesResponseEvent>()
{
public void update(final GotGadgetDefinitionCategoriesResponseEvent event)
{
if (Session.getInstance().getParameterValue("action").equals("newApp")
|| Session.getInstance().getParameterValue("action").equals("editApp"))
{
renderCreateOrEditGadget(event.getResponse());
}
}
});
Session.getInstance().getEventBus().addObserver(GotThemeDefinitionsResponseEvent.class,
new Observer<GotThemeDefinitionsResponseEvent>()
{
public void update(final GotThemeDefinitionsResponseEvent event)
{
themeTab.render(event.getResponse(), "There are no themes in this category.");
}
});
Session.getInstance().getEventBus().addObserver(GotThemeDefinitionCategoriesResponseEvent.class,
new Observer<GotThemeDefinitionCategoriesResponseEvent>()
{
public void update(final GotThemeDefinitionCategoriesResponseEvent event)
{
themeTab.addSet("All", ThemeModel.getInstance(), new ThemeRenderer(),
new GetGalleryItemsRequest("recent", "", 0, 0), "Recent");
themeTab.addSet("All", ThemeModel.getInstance(), new ThemeRenderer(),
new GetGalleryItemsRequest("popularity", "", 0, 0), "Popular");
for (String category : event.getResponse())
{
themeTab.addSet(category, ThemeModel.getInstance(), new ThemeRenderer(),
new GetGalleryItemsRequest("recent", category, 0, 0), "Recent");
themeTab.addSet(category, ThemeModel.getInstance(), new ThemeRenderer(),
new GetGalleryItemsRequest("popularity", category, 0, 0), "Popular");
}
Session.getInstance().getEventBus().removeObserver(
GotThemeDefinitionCategoriesResponseEvent.class, this);