for (final CarouselActionInfo carouselAction : carouselActions) {
if (null == carouselAction.getValueMap()) {
// button action
IButton button = new EnhancedIButton(carouselAction.getTitle());
button.setDisabled(true);
button.setOverflow(Overflow.VISIBLE);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
disableAllFooterControls();
if (carouselAction.confirmMessage != null) {
String message = carouselAction.confirmMessage.replaceAll("\\#", "TODO:");
SC.ask(message, new BooleanCallback() {
public void execute(Boolean confirmed) {
if (confirmed) {
carouselAction.action.executeAction(null);
} else {
refreshCarouselInfo();
}
}
});
} else {
carouselAction.action.executeAction(null);
}
}
});
carouselAction.actionCanvas = button;
footer.addMember(button);
} else {
// menu action
Menu menu = new Menu();
final Map<String, ? extends Object> menuEntries = carouselAction.getValueMap();
for (final String key : menuEntries.keySet()) {
MenuItem item = new MenuItem(key);
item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
public void onClick(MenuItemClickEvent event) {
disableAllFooterControls();
carouselAction.getAction().executeAction(menuEntries.get(key));
}
});
menu.addItem(item);
}
IMenuButton menuButton = new IMenuButton(carouselAction.getTitle());
menuButton.setMenu(menu);
menuButton.setDisabled(true);
menuButton.setOverflow(Overflow.VISIBLE);
menuButton.setShowMenuBelow(false);
carouselAction.actionCanvas = menuButton;
footer.addMember(menuButton);
}
}
for (Canvas extraWidgetCanvas : extraWidgetsInMainFooter) {
footer.addMember(extraWidgetCanvas);
}
footer.addMember(new LayoutSpacer());
widthButton = new EnhancedIButton(MSG.common_button_fixedWidth());
widthButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
carouselUsingFixedWidths = !carouselUsingFixedWidths;
widthButton.setTitle(carouselUsingFixedWidths ? MSG.common_button_scaleToFit() : MSG
.common_button_fixedWidth());
buildCarousel(true);
}
});
footer.addMember(widthButton);
if (isShowFooterRefresh()) {
this.refreshButton = new EnhancedIButton(MSG.common_button_refresh());
refreshButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
disableAllFooterControls();
refresh();
}
});
footer.addMember(refreshButton);
}
previousButton = new EnhancedIButton(MSG.common_button_previous());
previousButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
disableAllFooterControls();
previous();
}
});
footer.addMember(previousButton);
nextButton = new EnhancedIButton(MSG.common_button_next(), ButtonColor.BLUE);
nextButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
disableAllFooterControls();
next();
}