use of com.google.gerrit.client.info.PushCertificateInfo in project gerrit by GerritCodeReview.
the class ChangeScreen method renderPushCertificate.
private void renderPushCertificate(RevisionInfo revInfo, FlowPanel panel) {
if (!enableSignedPush()) {
return;
}
Image status = new Image();
panel.add(status);
status.setStyleName(style.pushCertStatus());
if (!revInfo.hasPushCertificate() || revInfo.pushCertificate().key() == null) {
status.setResource(Gerrit.RESOURCES.question());
status.setTitle(Util.C.pushCertMissing());
return;
}
PushCertificateInfo certInfo = revInfo.pushCertificate();
GpgKeyInfo.Status s = certInfo.key().status();
switch(s) {
case BAD:
status.setResource(Gerrit.RESOURCES.redNot());
status.setTitle(problems(Util.C.pushCertBad(), certInfo));
break;
case OK:
status.setResource(Gerrit.RESOURCES.warning());
status.setTitle(problems(Util.C.pushCertOk(), certInfo));
break;
case TRUSTED:
status.setResource(Gerrit.RESOURCES.greenCheck());
status.setTitle(Util.C.pushCertTrusted());
break;
}
}
Aggregations