Search in sources :

Example 1 with RebaseDialog

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

the class RebaseAction method call.

static void call(final Button b, final String project, final String branch, final Change.Id id, final String revision, final boolean enabled) {
    b.setEnabled(false);
    new RebaseDialog(project, branch, id, enabled) {

        @Override
        public void onSend() {
            ChangeApi.rebase(id.get(), revision, getBase(), new GerritCallback<ChangeInfo>() {

                @Override
                public void onSuccess(ChangeInfo result) {
                    sent = true;
                    hide();
                    Gerrit.display(PageLinks.toChange(id));
                }

                @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();
}
Also used : GerritCallback(com.google.gerrit.client.rpc.GerritCallback) RebaseDialog(com.google.gerrit.client.ui.RebaseDialog) ChangeInfo(com.google.gerrit.client.info.ChangeInfo) PopupPanel(com.google.gwt.user.client.ui.PopupPanel)

Aggregations

ChangeInfo (com.google.gerrit.client.info.ChangeInfo)1 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)1 RebaseDialog (com.google.gerrit.client.ui.RebaseDialog)1 PopupPanel (com.google.gwt.user.client.ui.PopupPanel)1