Search in sources :

Example 1 with ProjectMap

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();
            }
        }
    });
}
Also used : Anchor(com.google.gwt.user.client.ui.Anchor) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ProjectsTable(com.google.gerrit.client.ui.ProjectsTable) ProjectMap(com.google.gerrit.client.projects.ProjectMap) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) ProjectInfo(com.google.gerrit.client.projects.ProjectInfo)

Aggregations

ProjectInfo (com.google.gerrit.client.projects.ProjectInfo)1 ProjectMap (com.google.gerrit.client.projects.ProjectMap)1 ProjectsTable (com.google.gerrit.client.ui.ProjectsTable)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Anchor (com.google.gwt.user.client.ui.Anchor)1