public void execute() {
popup.hide();
final UserGroup group = new UserGroup();
group.setOwner(user);
final EditGroupPanel editGroupPanel = new EditGroupPanel(null, callback, null, group, false, false);
final PromptDialogBox editGroupDialogBox = new PromptDialogBox("Create New Group", "OK", null, "Cancel", false, true);
editGroupDialogBox.setContent(editGroupPanel);
editGroupDialogBox.setFocusWidget(editGroupPanel.getNameTextBox());
editGroupDialogBox.setValidatorCallback(new IDialogValidatorCallback() {
public boolean validate() {
if (editGroupPanel.getNameTextBox().getText() == null || "".equals(editGroupPanel.getNameTextBox().getText())) {
MessageDialogBox dialog = new MessageDialogBox("Error", "Enter a group name.", true, true, true);
dialog.center();
return false;
}
return true;
}
});
editGroupDialogBox.setCallback(new IDialogCallback() {
public void okPressed() {
if (!editGroupPanel.apply()) {
editGroupDialogBox.center();
}
}
public void cancelPressed() {