use of com.google.gerrit.client.ui.TextAreaActionDialog in project gerrit by GerritCodeReview.
the class RevertAction method call.
static void call(final Button b, final Change.Id id, final String revision, final String commitSubject) {
// TODO Replace ActionDialog with a nicer looking display.
b.setEnabled(false);
new TextAreaActionDialog(Util.C.revertChangeTitle(), Util.C.headingRevertMessage()) {
{
sendButton.setText(Util.C.buttonRevertChangeSend());
message.setText(Util.M.revertChangeDefaultMessage(commitSubject, revision));
}
@Override
public void onSend() {
ChangeApi.revert(id.get(), getMessageText(), new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(result.legacyId()));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
Aggregations