item.setSubMenu(subMenu);
item.setCommand(null);
}
protected void reloadLocale(final String localeName, final MenuItem target) {
final ConfirmDialog dialog = new ConfirmDialog(i18n.WarningLocaleReload());
dialog.addOkButtonHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
String href = Window.Location.getHref();
if (href.contains("&locale=")) {
href = removeParameterFromHref("locale", href);
} else if (href.contains("?locale=")) {
href = removeParameterFromHref("locale", href);
}
if (href.contains("?")) {
href += "&locale=" + localeName;
} else {
href += "?locale=" + localeName;
}
Window.Location.replace(href);
dialog.hide();
}
});
dialog.showRelativeTo(target);
}