use of com.google.gerrit.client.ui.ProjectListPopup in project gerrit by GerritCodeReview.
the class MyWatchedProjectsScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
createWidgets();
/* top table */
grid = new Grid(2, 2);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.setText(0, 0, Util.C.watchedProjectName());
final HorizontalPanel hp = new HorizontalPanel();
hp.add(nameBox);
hp.add(browse);
grid.setWidget(0, 1, hp);
grid.setText(1, 0, Util.C.watchedProjectFilter());
grid.setWidget(1, 1, filterTxt);
final CellFormatter fmt = grid.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().header());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
final FlowPanel fp = new FlowPanel();
fp.setStyleName(Gerrit.RESOURCES.css().addWatchPanel());
fp.add(grid);
fp.add(addNew);
add(fp);
/* bottom table */
add(watchesTab);
add(delSel);
/* popup */
projectsPopup = new ProjectListPopup() {
@Override
protected void onMovePointerTo(String projectName) {
// prevent user input from being overwritten by simply poping up
if (!projectsPopup.isPoppingUp() || "".equals(nameBox.getText())) {
nameBox.setText(projectName);
}
}
@Override
protected void openRow(String projectName) {
nameBox.setText(projectName);
doAddNew();
}
};
projectsPopup.initPopup(Util.C.projects(), PageLinks.SETTINGS_PROJECTS);
}
use of com.google.gerrit.client.ui.ProjectListPopup in project gerrit by GerritCodeReview.
the class CreateProjectScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
setPageTitle(AdminConstants.I.createProjectTitle());
addCreateProjectPanel();
/* popup */
projectsPopup = new ProjectListPopup() {
@Override
protected void onMovePointerTo(String projectName) {
// prevent user input from being overwritten by simply poping up
if (!projectsPopup.isPoppingUp() || "".equals(parent.getText())) {
parent.setText(projectName);
}
}
};
projectsPopup.initPopup(AdminConstants.I.projects(), PageLinks.ADMIN_PROJECTS);
}
Aggregations