{
Session.getInstance().getEventBus().notifyObservers(
new UpdateHistoryEvent(new CreateUrlRequest(Page.START)));
Session.getInstance().getEventBus().notifyObservers(
new ShowNotificationEvent(new Notification(text)));
}
}
});
setupGalleryTabTemplateEvents();
Session.getInstance().getEventBus().addObserver(UserLoggedInEvent.class, new Observer<UserLoggedInEvent>()
{
public void update(final UserLoggedInEvent event)
{
Session.getInstance().getEventBus().notifyObservers(GalleryPageLoadedEvent.getEvent());
}
});
final HashMap<String, String> gadgetParams = new HashMap<String, String>();
gadgetParams.put("tab", Session.getInstance().getParameterValue("tab"));
gadgetParams.put("galleryTab", "Apps");
final HashMap<String, String> themeParams = new HashMap<String, String>();
themeParams.put("tab", Session.getInstance().getParameterValue("tab"));
themeParams.put("galleryTab", "Themes");
Session.getInstance().getEventBus().addObserver(InsertedGadgetDefinitionResponseEvent.class,
new Observer<InsertedGadgetDefinitionResponseEvent>()
{
public void update(final InsertedGadgetDefinitionResponseEvent arg1)
{
Session.getInstance().getEventBus().notifyObservers(
new UpdateHistoryEvent(new CreateUrlRequest(Page.GALLERY, gadgetParams)));
gadgetTab.reload();
Session.getInstance().getEventBus().notifyObservers(
new ShowNotificationEvent(new Notification("Your app has been successfully added")));
}
});
Session.getInstance().getEventBus().addObserver(UpdatedGadgetDefinitionResponseEvent.class,
new Observer<UpdatedGadgetDefinitionResponseEvent>()
{
public void update(final UpdatedGadgetDefinitionResponseEvent arg1)
{
Session.getInstance().getEventBus().notifyObservers(
new UpdateHistoryEvent(new CreateUrlRequest(Page.GALLERY, gadgetParams)));
gadgetTab.reload();
Session.getInstance().getEventBus().notifyObservers(
new ShowNotificationEvent(new Notification("Your app has been successfully saved")));
}
});
Session.getInstance().getEventBus().addObserver(InsertedThemeResponseEvent.class,
new Observer<InsertedThemeResponseEvent>()
{
public void update(final InsertedThemeResponseEvent arg1)
{
Session.getInstance().getEventBus().notifyObservers(
new UpdateHistoryEvent(new CreateUrlRequest(Page.GALLERY, themeParams)));
themeTab.reload();
Session.getInstance().getEventBus().notifyObservers(
new ShowNotificationEvent(new Notification("Your theme has been successfully added")));
}
});
Session.getInstance().getEventBus().addObserver(UpdatedThemeResponseEvent.class,
new Observer<UpdatedThemeResponseEvent>()
{
public void update(final UpdatedThemeResponseEvent arg1)
{
Session.getInstance().getEventBus().notifyObservers(
new UpdateHistoryEvent(new CreateUrlRequest(Page.GALLERY, themeParams)));
themeTab.reload();
Session.getInstance().getEventBus().notifyObservers(
new ShowNotificationEvent(new Notification("Your theme has been successfully saved")));
}
});
Session.getInstance().getEventBus().addObserver(GotStartPageTabsResponseEvent.class,
new Observer<GotStartPageTabsResponseEvent>()