Search in sources :

Example 1 with AccountGroupSuggestOracle

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);
}
Also used : AccountGroupSuggestOracle(com.google.gerrit.client.ui.AccountGroupSuggestOracle) SmallHeading(com.google.gerrit.client.ui.SmallHeading) GerritCallback(com.google.gerrit.client.rpc.GerritCallback) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button) GroupInfo(com.google.gerrit.client.info.GroupInfo) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) RemoteSuggestBox(com.google.gerrit.client.ui.RemoteSuggestBox)

Example 2 with AccountGroupSuggestOracle

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);
}
Also used : AccountGroupSuggestOracle(com.google.gerrit.client.ui.AccountGroupSuggestOracle) SmallHeading(com.google.gerrit.client.ui.SmallHeading) AddMemberBox(com.google.gerrit.client.ui.AddMemberBox) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Aggregations

AccountGroupSuggestOracle (com.google.gerrit.client.ui.AccountGroupSuggestOracle)2 SmallHeading (com.google.gerrit.client.ui.SmallHeading)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Button (com.google.gwt.user.client.ui.Button)2 GroupInfo (com.google.gerrit.client.info.GroupInfo)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 AddMemberBox (com.google.gerrit.client.ui.AddMemberBox)1 RemoteSuggestBox (com.google.gerrit.client.ui.RemoteSuggestBox)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1