Search in sources :

Example 6 with OnEditEnabler

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

the class NewAgreementScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    setPageTitle(Util.C.newAgreement());
    final FlowPanel formBody = new FlowPanel();
    radios = new VerticalPanel();
    formBody.add(radios);
    agreementGroup = new FlowPanel();
    agreementGroup.add(new SmallHeading(Util.C.newAgreementReviewLegalHeading()));
    agreementHtml = new HTML();
    agreementHtml.setStyleName(Gerrit.RESOURCES.css().contributorAgreementLegal());
    agreementGroup.add(agreementHtml);
    formBody.add(agreementGroup);
    finalGroup = new VerticalPanel();
    finalGroup.add(new SmallHeading(Util.C.newAgreementCompleteHeading()));
    final FlowPanel fp = new FlowPanel();
    yesIAgreeBox = new NpTextBox();
    yesIAgreeBox.setVisibleLength(Util.C.newAgreementIAGREE().length() + 8);
    yesIAgreeBox.setMaxLength(Util.C.newAgreementIAGREE().length());
    fp.add(yesIAgreeBox);
    fp.add(new InlineLabel(Util.M.enterIAGREE(Util.C.newAgreementIAGREE())));
    finalGroup.add(fp);
    submit = new Button(Util.C.buttonSubmitNewAgreement());
    submit.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doSign();
        }
    });
    finalGroup.add(submit);
    formBody.add(finalGroup);
    new OnEditEnabler(submit, yesIAgreeBox);
    final FormPanel form = new FormPanel();
    form.add(formBody);
    add(form);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) FormPanel(com.google.gwt.user.client.ui.FormPanel) RadioButton(com.google.gwt.user.client.ui.RadioButton) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) InlineLabel(com.google.gwt.user.client.ui.InlineLabel) HTML(com.google.gwt.user.client.ui.HTML) OnEditEnabler(com.google.gerrit.client.ui.OnEditEnabler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 7 with OnEditEnabler

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

the class ProjectInfoScreen method initDescription.

private void initDescription() {
    final VerticalPanel vp = new VerticalPanel();
    vp.add(new SmallHeading(AdminConstants.I.headingDescription()));
    descTxt = new NpTextArea();
    descTxt.setVisibleLines(6);
    descTxt.setCharacterWidth(60);
    vp.add(descTxt);
    add(vp);
    saveEnabler = new OnEditEnabler(saveProject);
    saveEnabler.listenTo(descTxt);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) NpTextArea(com.google.gwtexpui.globalkey.client.NpTextArea) OnEditEnabler(com.google.gerrit.client.ui.OnEditEnabler)

Aggregations

OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)7 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)6 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)5 Button (com.google.gwt.user.client.ui.Button)5 SmallHeading (com.google.gerrit.client.ui.SmallHeading)4 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)4 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)4 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)3 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)2 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)2 KeyPressHandler (com.google.gwt.event.dom.client.KeyPressHandler)2 Event (com.google.gwt.user.client.Event)2 CheckBox (com.google.gwt.user.client.ui.CheckBox)2 Grid (com.google.gwt.user.client.ui.Grid)2 ListBox (com.google.gwt.user.client.ui.ListBox)2 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)1 VoidResult (com.google.gerrit.client.VoidResult)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 GeneralPreferencesInfo (com.google.gerrit.extensions.client.GeneralPreferencesInfo)1