localeItem.setValueMap(new String[] {"en", "de", "zh_Hans", "pt_BR", "fr", "es", "ja"});
//CheckBoxItem useCache = new CheckBoxItem(Preferences.Key.USE_CACHE.getToken(), Preferences.Key.USE_CACHE.getTitle());
CheckBoxItem enableAnalytics = new CheckBoxItem(Preferences.Key.ANALYTICS.getToken(), Preferences.Key.ANALYTICS.getTitle());
ProductConfig productConfig = GWT.create(ProductConfig.class);
if (productConfig.getProfile() == COMMUNITY) {
form.setFields(localeItem, enableAnalytics);
} else {
form.setFields(localeItem);
}
Widget formWidget = form.asWidget();
formWidget.getElement().setAttribute("style", "margin:15px");
DialogueOptions options = new DialogueOptions(
Console.CONSTANTS.common_label_save(),
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.onSaveDialogue(form.getUpdatedEntity());
presenter.hideView();
Feedback.confirm(Console.MESSAGES.restartRequired(), Console.MESSAGES.restartRequiredConfirm(),
new Feedback.ConfirmationHandler()
{
@Override
public void onConfirmation(boolean isConfirmed) {
// Ignore: it crashes the browser..
/*if(isConfirmed){
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
reload();
}
});
} */
}
});
}
},
Console.CONSTANTS.common_label_cancel(),
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.onCancelDialogue();
}
}
);
options.getElement().setAttribute("style", "padding:10px");
SafeHtmlBuilder html = new SafeHtmlBuilder();
html.appendHtmlConstant("<ul>");
html.appendHtmlConstant("<li>").appendEscaped("Locale: The user interface language.");
if (productConfig.getProfile() == COMMUNITY) {
html.appendHtmlConstant("<li>").appendEscaped("Analytics: We track browser and operating system information in order to improve the user interface. ");
html.appendEscaped("You can disable the analytics feature at anytime.");
}
html.appendHtmlConstant("</ul>");
StaticHelpPanel help = new StaticHelpPanel(html.toSafeHtml());