Search in sources :

Example 1 with VoidResult

use of com.google.gerrit.client.VoidResult in project gerrit by GerritCodeReview.

the class AccountGroupInfoScreen method initGroupOptions.

private void initGroupOptions() {
    final VerticalPanel groupOptionsPanel = new VerticalPanel();
    final VerticalPanel vp = new VerticalPanel();
    vp.setStyleName(Gerrit.RESOURCES.css().groupOptionsPanel());
    vp.add(new SmallHeading(AdminConstants.I.headingGroupOptions()));
    visibleToAllCheckBox = new CheckBox(AdminConstants.I.isVisibleToAll());
    vp.add(visibleToAllCheckBox);
    groupOptionsPanel.add(vp);
    saveGroupOptions = new Button(AdminConstants.I.buttonSaveGroupOptions());
    saveGroupOptions.setEnabled(false);
    saveGroupOptions.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            GroupApi.setGroupOptions(getGroupUUID(), visibleToAllCheckBox.getValue(), new GerritCallback<VoidResult>() {

                @Override
                public void onSuccess(final VoidResult result) {
                    saveGroupOptions.setEnabled(false);
                }
            });
        }
    });
    groupOptionsPanel.add(saveGroupOptions);
    add(groupOptionsPanel);
    final OnEditEnabler enabler = new OnEditEnabler(saveGroupOptions);
    enabler.listenTo(visibleToAllCheckBox);
}
Also used : 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) VoidResult(com.google.gerrit.client.VoidResult) Button(com.google.gwt.user.client.ui.Button) CheckBox(com.google.gwt.user.client.ui.CheckBox) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) OnEditEnabler(com.google.gerrit.client.ui.OnEditEnabler)

Example 2 with VoidResult

use of com.google.gerrit.client.VoidResult in project gerrit by GerritCodeReview.

the class AccountGroupInfoScreen method initDescription.

private void initDescription() {
    final VerticalPanel vp = new VerticalPanel();
    vp.setStyleName(Gerrit.RESOURCES.css().groupDescriptionPanel());
    vp.add(new SmallHeading(AdminConstants.I.headingDescription()));
    descTxt = new NpTextArea();
    descTxt.setVisibleLines(6);
    descTxt.setCharacterWidth(60);
    vp.add(descTxt);
    saveDesc = new Button(AdminConstants.I.buttonSaveDescription());
    saveDesc.setEnabled(false);
    saveDesc.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            final String txt = descTxt.getText().trim();
            GroupApi.setGroupDescription(getGroupUUID(), txt, new GerritCallback<VoidResult>() {

                @Override
                public void onSuccess(final VoidResult result) {
                    saveDesc.setEnabled(false);
                }
            });
        }
    });
    vp.add(saveDesc);
    add(vp);
}
Also used : 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) VoidResult(com.google.gerrit.client.VoidResult) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) NpTextArea(com.google.gwtexpui.globalkey.client.NpTextArea)

Aggregations

VoidResult (com.google.gerrit.client.VoidResult)2 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)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 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)1 CheckBox (com.google.gwt.user.client.ui.CheckBox)1 NpTextArea (com.google.gwtexpui.globalkey.client.NpTextArea)1