Search in sources :

Example 1 with ProjectListPopup

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);
}
Also used : Grid(com.google.gwt.user.client.ui.Grid) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) ProjectListPopup(com.google.gerrit.client.ui.ProjectListPopup)

Example 2 with ProjectListPopup

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);
}
Also used : ProjectListPopup(com.google.gerrit.client.ui.ProjectListPopup)

Aggregations

ProjectListPopup (com.google.gerrit.client.ui.ProjectListPopup)2 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 Grid (com.google.gwt.user.client.ui.Grid)1 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1