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);
}
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);
}
Aggregations