Search in sources :

Example 11 with ChangeInfo

use of com.google.gerrit.client.info.ChangeInfo in project gerrit by GerritCodeReview.

the class QueryScreen method loadCallback.

@Override
protected AsyncCallback<ChangeList> loadCallback() {
    return new GerritCallback<ChangeList>() {

        @Override
        public void onSuccess(ChangeList result) {
            if (isAttached()) {
                if (result.length() == 1 && isSingleQuery(query)) {
                    ChangeInfo c = result.get(0);
                    Change.Id id = c.legacyId();
                    Gerrit.display(PageLinks.toChange(id));
                } else {
                    display(result);
                    QueryScreen.this.display();
                }
            }
        }
    };
}
Also used : GerritCallback(com.google.gerrit.client.rpc.GerritCallback) ChangeInfo(com.google.gerrit.client.info.ChangeInfo) Change(com.google.gerrit.reviewdb.client.Change)

Aggregations

ChangeInfo (com.google.gerrit.client.info.ChangeInfo)11 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)7 PopupPanel (com.google.gwt.user.client.ui.PopupPanel)4 EditInfo (com.google.gerrit.client.info.ChangeInfo.EditInfo)3 CallbackGroup (com.google.gerrit.client.rpc.CallbackGroup)3 RestApi (com.google.gerrit.client.rpc.RestApi)3 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)3 RevisionInfo (com.google.gerrit.client.info.ChangeInfo.RevisionInfo)2 Change (com.google.gerrit.reviewdb.client.Change)2 ChangeList (com.google.gerrit.client.changes.ChangeList)1 DiffInfo (com.google.gerrit.client.diff.DiffInfo)1 HttpCallback (com.google.gerrit.client.rpc.HttpCallback)1 HttpResponse (com.google.gerrit.client.rpc.HttpResponse)1 CherryPickDialog (com.google.gerrit.client.ui.CherryPickDialog)1 CreateChangeDialog (com.google.gerrit.client.ui.CreateChangeDialog)1 RebaseDialog (com.google.gerrit.client.ui.RebaseDialog)1 TextAreaActionDialog (com.google.gerrit.client.ui.TextAreaActionDialog)1 JsArray (com.google.gwt.core.client.JsArray)1 AddonInjector (net.codemirror.addon.AddonInjector)1