Date date = new Date();
String timeStamp = new Long(date.getTime()).toString();
carousel.clear();
carousel.getElement().setAttribute("id", "carousel" + timeStamp);
OLPanel ulpanel = new OLPanel();
carousel.add(ulpanel);
for (final Layout layout : Layout.values())
{
Hyperlink icon = new Hyperlink();
icon.addStyleName(StaticResourceBundle.INSTANCE.coreCss().layoutIcon());
icon.setText("layout");
icon.setTargetHistoryToken(Session.getInstance().generateUrl(new CreateUrlRequest()));
icon.addStyleName(layout.toString().toLowerCase());
icon.addClickHandler(new ClickHandler()
{
public void onClick(final ClickEvent event)
{
boolean shouldChange = true;
if (currentLayout.getNumberOfZones() > layout.getNumberOfZones())
{
shouldChange = jSNIFacade.confirm("You have a column that would be removed. "
+ "Should we move your apps for you?");
}
if (shouldChange)
{
Session.getInstance().getEventBus().notifyObservers(new HideNotificationEvent());
StartTabsModel.getInstance().setLayout(new SetTabLayoutRequest(layout, tabId));
}
}
});
ulpanel.add(icon);
}
setupCarousel(timeStamp);
loaded = true;
}
}