use of com.google.gerrit.client.info.GpgKeyInfo in project gerrit by GerritCodeReview.
the class MyGpgKeysScreen method refreshKeys.
private void refreshKeys() {
AccountApi.self().view("gpgkeys").get(NativeMap.copyKeysIntoChildren("id", new GerritCallback<NativeMap<GpgKeyInfo>>() {
@Override
public void onSuccess(NativeMap<GpgKeyInfo> result) {
List<GpgKeyInfo> list = Natives.asList(result.values());
// TODO(dborowitz): Sort on something more meaningful, like
// created date?
Collections.sort(list, new Comparator<GpgKeyInfo>() {
@Override
public int compare(GpgKeyInfo a, GpgKeyInfo b) {
return a.id().compareTo(b.id());
}
});
keys.clear();
keyText.setText("");
errorPanel.setVisible(false);
addButton.setEnabled(true);
if (!list.isEmpty()) {
keys.setVisible(true);
for (GpgKeyInfo k : list) {
keys.addOneKey(k);
}
showKeyTable(true);
showAddKeyBlock(false);
} else {
keys.setVisible(false);
showAddKeyBlock(true);
showKeyTable(false);
}
display();
}
}));
}
Aggregations