use of com.google.gerrit.client.ui.CreateChangeDialog in project gerrit by GerritCodeReview.
the class CreateChangeAction method call.
static void call(final Button b, final String project) {
// TODO Replace CreateChangeDialog with a nicer looking display.
b.setEnabled(false);
new CreateChangeDialog(new Project.NameKey(project)) {
{
sendButton.setText(AdminConstants.I.buttonCreate());
message.setText(AdminConstants.I.buttonCreateDescription());
}
@Override
public void onSend() {
ChangeApi.createChange(project, getDestinationBranch(), getDestinationTopic(), message.getText(), null, 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