use of com.google.gerrit.client.changes.ChangeList in project gerrit by GerritCodeReview.
the class ChangeScreen method onLoad.
@Override
protected void onLoad() {
super.onLoad();
CallbackGroup group = new CallbackGroup();
if (Gerrit.isSignedIn()) {
ChangeList.query("change:" + changeId.get() + " has:draft", Collections.<ListChangesOption>emptySet(), group.add(new AsyncCallback<ChangeList>() {
@Override
public void onSuccess(ChangeList result) {
hasDraftComments = result.length() > 0;
}
@Override
public void onFailure(Throwable caught) {
}
}));
ChangeApi.editWithFiles(changeId.get(), group.add(new AsyncCallback<EditInfo>() {
@Override
public void onSuccess(EditInfo result) {
edit = result;
}
@Override
public void onFailure(Throwable caught) {
}
}));
}
loadChangeInfo(true, group.addFinal(new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(final ChangeInfo info) {
info.init();
initCurrentRevision(info);
final RevisionInfo rev = info.revision(revision);
CallbackGroup group = new CallbackGroup();
loadCommit(rev, group);
group.addListener(new GerritCallback<Void>() {
@Override
public void onSuccess(Void result) {
if (base.isBase() && rev.isMerge()) {
base = DiffObject.parse(info.legacyId(), Gerrit.getUserPreferences().defaultBaseForMerges().getBase());
}
loadConfigInfo(info, base);
JsArray<MessageInfo> mAr = info.messages();
for (int i = 0; i < mAr.length(); i++) {
if (mAr.get(i).tag() != null) {
hideTaggedComments.setVisible(true);
break;
}
}
}
});
group.done();
}
}));
}
Aggregations