use of com.google.gerrit.client.ui.AccountGroupSuggestOracle in project gerrit by GerritCodeReview.
the class AccountGroupInfoScreen method initOwner.
private void initOwner() {
final VerticalPanel ownerPanel = new VerticalPanel();
ownerPanel.setStyleName(Gerrit.RESOURCES.css().groupOwnerPanel());
ownerPanel.add(new SmallHeading(AdminConstants.I.headingOwner()));
final AccountGroupSuggestOracle accountGroupOracle = new AccountGroupSuggestOracle();
ownerTxt = new RemoteSuggestBox(accountGroupOracle);
ownerTxt.setStyleName(Gerrit.RESOURCES.css().groupOwnerTextBox());
ownerTxt.setVisibleLength(60);
ownerPanel.add(ownerTxt);
saveOwner = new Button(AdminConstants.I.buttonChangeGroupOwner());
saveOwner.setEnabled(false);
saveOwner.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
final String newOwner = ownerTxt.getText().trim();
if (newOwner.length() > 0) {
AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner);
String ownerId = ownerUuid != null ? ownerUuid.get() : newOwner;
GroupApi.setGroupOwner(getGroupUUID(), ownerId, new GerritCallback<GroupInfo>() {
@Override
public void onSuccess(final GroupInfo result) {
updateOwnerGroup(result);
saveOwner.setEnabled(false);
}
});
}
}
});
ownerPanel.add(saveOwner);
add(ownerPanel);
}
use of com.google.gerrit.client.ui.AccountGroupSuggestOracle in project gerrit by GerritCodeReview.
the class AccountGroupMembersScreen method initIncludeList.
private void initIncludeList() {
accountGroupSuggestOracle = new AccountGroupSuggestOracle();
addIncludeBox = new AddMemberBox(AdminConstants.I.buttonAddIncludedGroup(), AdminConstants.I.defaultAccountGroupName(), accountGroupSuggestOracle);
addIncludeBox.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNewInclude();
}
});
includes = new IncludeTable();
includes.addStyleName(Gerrit.RESOURCES.css().groupIncludesTable());
delInclude = new Button(AdminConstants.I.buttonDeleteIncludedGroup());
delInclude.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
includes.deleteChecked();
}
});
includePanel = new FlowPanel();
includePanel.add(new SmallHeading(AdminConstants.I.headingIncludedGroups()));
includePanel.add(addIncludeBox);
includePanel.add(includes);
includePanel.add(delInclude);
add(includePanel);
}
Aggregations