use of com.google.gerrit.client.projects.ProjectMap in project gerrit by GerritCodeReview.
the class CreateProjectScreen method initSuggestedParents.
private void initSuggestedParents() {
suggestedParentsTab = new ProjectsTable() {
{
table.setText(0, 1, AdminConstants.I.parentSuggestions());
}
@Override
protected void populate(final int row, final ProjectInfo k) {
final Anchor projectLink = new Anchor(k.name());
projectLink.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
parent.setText(getRowItem(row).name());
}
});
table.setWidget(row, 2, projectLink);
table.setText(row, 3, k.description());
setRowItem(row, k);
}
};
suggestedParentsTab.setVisible(false);
ProjectMap.parentCandidates(new GerritCallback<ProjectMap>() {
@Override
public void onSuccess(ProjectMap list) {
if (!list.isEmpty()) {
suggestedParentsTab.setVisible(true);
suggestedParentsTab.display(list);
suggestedParentsTab.finishDisplay();
}
}
});
}
Aggregations