Console.CONSTANTS.common_label_type());
typeItem.setDefaultToFirst(true);
typeItem.setValues(UIHelper.enumFormItemsForScopedRoleTyp());
final MultiselectListBoxItem scopeItem = new MultiselectListBoxItem("scope",
Console.CONSTANTS.administration_scope(), 3);
final CheckBoxItem includeAllItem = new CheckBoxItem("includeAll",
Console.CONSTANTS.administration_include_all());
form.setFields(nameItem, baseRoleItem, typeItem, scopeItem, includeAllItem);
layout.add(form.asWidget());
typeItem.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(final ChangeEvent event) {
Role.Type type = typeItem.getValue();
updateScope(type, scopeItem, form);
}
});
updateScope(typeItem.getValue(), scopeItem, form);
DialogueOptions options = new DialogueOptions(
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
FormValidation validation = form.validate();
if (!validation.hasErrors()) {
Role scopedRole = new Role(nameItem.getValue(), nameItem.getValue(),
baseRoleItem.getValue(), typeItem.getValue(), scopeItem.getValue());
scopedRole.setIncludeAll(includeAllItem.getValue());
presenter.addScopedRole(scopedRole);
}
}
},
new ClickHandler() {