Search in sources :

Example 1 with AgreementInfo

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

Aggregations

AgreementInfo (com.google.gerrit.client.info.AgreementInfo)1 SmallHeading (com.google.gerrit.client.ui.SmallHeading)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)1 Label (com.google.gwt.user.client.ui.Label)1 RadioButton (com.google.gwt.user.client.ui.RadioButton)1