Search in sources :

Example 1 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class NewAgreementScreen method renderSelf.

private void renderSelf() {
    current = null;
    agreementGroup.setVisible(false);
    finalGroup.setVisible(false);
    radios.clear();
    final SmallHeading hdr = new SmallHeading();
    if (available.isEmpty()) {
        hdr.setText(Util.C.newAgreementNoneAvailable());
    } else {
        hdr.setText(Util.C.newAgreementSelectTypeHeading());
    }
    radios.add(hdr);
    for (final AgreementInfo cla : available) {
        final RadioButton r = new RadioButton("cla_id", cla.name());
        r.addStyleName(Gerrit.RESOURCES.css().contributorAgreementButton());
        radios.add(r);
        if (mySigned.contains(cla.name())) {
            r.setEnabled(false);
            final Label l = new Label(Util.C.newAgreementAlreadySubmitted());
            l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementAlreadySubmitted());
            radios.add(l);
        } else {
            r.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(final ClickEvent event) {
                    showCLA(cla);
                }
            });
        }
        if (cla.description() != null && !cla.description().equals("")) {
            final Label l = new Label(cla.description());
            l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementShortDescription());
            radios.add(l);
        }
    }
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) AgreementInfo(com.google.gerrit.client.info.AgreementInfo) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Label(com.google.gwt.user.client.ui.Label) InlineLabel(com.google.gwt.user.client.ui.InlineLabel) RadioButton(com.google.gwt.user.client.ui.RadioButton)

Example 2 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class RegisterScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    setPageTitle(Util.C.welcomeToGerritCodeReview());
    final FlowPanel formBody = new FlowPanel();
    final FlowPanel contactGroup = new FlowPanel();
    contactGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
    contactGroup.add(new SmallHeading(Util.C.welcomeReviewContact()));
    final HTML whereFrom = new HTML(Util.C.welcomeContactFrom());
    whereFrom.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
    contactGroup.add(whereFrom);
    contactGroup.add(new ContactPanelShort() {

        @Override
        protected void display(AccountInfo account) {
            super.display(account);
            if ("".equals(nameTxt.getText())) {
                // No name? Encourage the user to provide us something.
                //
                nameTxt.setFocus(true);
                save.setEnabled(true);
            }
        }
    });
    formBody.add(contactGroup);
    if (Gerrit.getUserAccount().username() == null && Gerrit.info().auth().canEdit(AccountFieldName.USER_NAME)) {
        final FlowPanel fp = new FlowPanel();
        fp.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
        fp.add(new SmallHeading(Util.C.welcomeUsernameHeading()));
        final Grid userInfo = new Grid(1, 2);
        final CellFormatter fmt = userInfo.getCellFormatter();
        userInfo.setStyleName(Gerrit.RESOURCES.css().infoBlock());
        userInfo.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
        fp.add(userInfo);
        fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
        fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
        fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().bottomheader());
        UsernameField field = new UsernameField();
        if (LocaleInfo.getCurrentLocale().isRTL()) {
            userInfo.setText(0, 1, Util.C.userName());
            userInfo.setWidget(0, 0, field);
            fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().header());
        } else {
            userInfo.setText(0, 0, Util.C.userName());
            userInfo.setWidget(0, 1, field);
            fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
        }
        formBody.add(fp);
    }
    if (Gerrit.info().hasSshd()) {
        final FlowPanel sshKeyGroup = new FlowPanel();
        sshKeyGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
        sshKeyGroup.add(new SmallHeading(Util.C.welcomeSshKeyHeading()));
        final HTML whySshKey = new HTML(Util.C.welcomeSshKeyText());
        whySshKey.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
        sshKeyGroup.add(whySshKey);
        sshKeyGroup.add(new SshPanel() {

            {
                setKeyTableVisible(false);
            }
        });
        formBody.add(sshKeyGroup);
    }
    final FlowPanel choices = new FlowPanel();
    choices.setStyleName(Gerrit.RESOURCES.css().registerScreenNextLinks());
    if (Gerrit.info().auth().useContributorAgreements()) {
        final FlowPanel agreementGroup = new FlowPanel();
        agreementGroup.setStyleName(Gerrit.RESOURCES.css().registerScreenSection());
        agreementGroup.add(new SmallHeading(Util.C.welcomeAgreementHeading()));
        final HTML whyAgreement = new HTML(Util.C.welcomeAgreementText());
        whyAgreement.setStyleName(Gerrit.RESOURCES.css().registerScreenExplain());
        agreementGroup.add(whyAgreement);
        choices.add(new InlineHyperlink(Util.C.newAgreement(), PageLinks.SETTINGS_NEW_AGREEMENT));
        choices.add(new InlineHyperlink(Util.C.welcomeAgreementLater(), nextToken));
        formBody.add(agreementGroup);
    } else {
        choices.add(new InlineHyperlink(Util.C.welcomeContinue(), nextToken));
    }
    formBody.add(choices);
    final FormPanel form = new FormPanel();
    form.add(formBody);
    add(form);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) InlineHyperlink(com.google.gerrit.client.ui.InlineHyperlink) FormPanel(com.google.gwt.user.client.ui.FormPanel) Grid(com.google.gwt.user.client.ui.Grid) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) HTML(com.google.gwt.user.client.ui.HTML) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) AccountInfo(com.google.gerrit.client.info.AccountInfo)

Example 3 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading 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 4 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading 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)

Example 5 with SmallHeading

use of com.google.gerrit.client.ui.SmallHeading in project gerrit by GerritCodeReview.

the class AccountGroupMembersScreen method initMemberList.

private void initMemberList() {
    addMemberBox = new AddMemberBox(AdminConstants.I.buttonAddGroupMember(), AdminConstants.I.defaultAccountName(), new AccountSuggestOracle());
    addMemberBox.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doAddNewMember();
        }
    });
    members = new MemberTable();
    members.addStyleName(Gerrit.RESOURCES.css().groupMembersTable());
    delMember = new Button(AdminConstants.I.buttonDeleteGroupMembers());
    delMember.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            members.deleteChecked();
        }
    });
    memberPanel = new FlowPanel();
    memberPanel.add(new SmallHeading(AdminConstants.I.headingMembers()));
    memberPanel.add(addMemberBox);
    memberPanel.add(members);
    memberPanel.add(delMember);
    add(memberPanel);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) AccountSuggestOracle(com.google.gerrit.client.ui.AccountSuggestOracle) 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

SmallHeading (com.google.gerrit.client.ui.SmallHeading)17 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)8 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)8 Button (com.google.gwt.user.client.ui.Button)7 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)7 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)4 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)3 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)3 VoidResult (com.google.gerrit.client.VoidResult)2 AccountGroupSuggestOracle (com.google.gerrit.client.ui.AccountGroupSuggestOracle)2 AddMemberBox (com.google.gerrit.client.ui.AddMemberBox)2 FormPanel (com.google.gwt.user.client.ui.FormPanel)2 HTML (com.google.gwt.user.client.ui.HTML)2 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)2 Label (com.google.gwt.user.client.ui.Label)2 RadioButton (com.google.gwt.user.client.ui.RadioButton)2 NpTextArea (com.google.gwtexpui.globalkey.client.NpTextArea)2 ActionButton (com.google.gerrit.client.actions.ActionButton)1 AccountInfo (com.google.gerrit.client.info.AccountInfo)1