Search in sources :

Example 36 with Grid

use of com.google.gwt.user.client.ui.Grid in project gerrit by GerritCodeReview.

the class ProjectBranchesScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    initPageHeader();
    prev = PagingHyperlink.createPrev();
    prev.setVisible(false);
    next = PagingHyperlink.createNext();
    next.setVisible(false);
    addPanel = new FlowPanel();
    final Grid addGrid = new Grid(2, 2);
    addGrid.setStyleName(Gerrit.RESOURCES.css().addBranch());
    final int texBoxLength = 50;
    nameTxtBox = new HintTextBox();
    nameTxtBox.setVisibleLength(texBoxLength);
    nameTxtBox.setHintText(AdminConstants.I.defaultBranchName());
    nameTxtBox.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                doAddNewBranch();
            }
        }
    });
    addGrid.setText(0, 0, AdminConstants.I.columnBranchName() + ":");
    addGrid.setWidget(0, 1, nameTxtBox);
    irevTxtBox = new HintTextBox();
    irevTxtBox.setVisibleLength(texBoxLength);
    irevTxtBox.setHintText(AdminConstants.I.defaultRevisionSpec());
    irevTxtBox.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
                doAddNewBranch();
            }
        }
    });
    addGrid.setText(1, 0, AdminConstants.I.initialRevision() + ":");
    addGrid.setWidget(1, 1, irevTxtBox);
    addBranch = new Button(AdminConstants.I.buttonAddBranch());
    addBranch.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doAddNewBranch();
        }
    });
    addPanel.add(addGrid);
    addPanel.add(addBranch);
    branchTable = new BranchesTable();
    delBranch = new Button(AdminConstants.I.buttonDeleteBranch());
    delBranch.setStyleName(Gerrit.RESOURCES.css().branchTableDeleteButton());
    delBranch.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            branchTable.deleteChecked();
        }
    });
    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setStyleName(Gerrit.RESOURCES.css().branchTablePrevNextLinks());
    buttons.add(delBranch);
    buttons.add(prev);
    buttons.add(next);
    add(branchTable);
    add(buttons);
    add(addPanel);
}
Also used : HintTextBox(com.google.gerrit.client.ui.HintTextBox) KeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) KeyPressEvent(com.google.gwt.event.dom.client.KeyPressEvent) ActionButton(com.google.gerrit.client.actions.ActionButton) Button(com.google.gwt.user.client.ui.Button) Grid(com.google.gwt.user.client.ui.Grid) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel)

Example 37 with Grid

use of com.google.gwt.user.client.ui.Grid in project opentsdb by OpenTSDB.

the class QueryUi method makeAxesPanel.

/**
 * Builds the panel containing customizations for the axes of the graph.
 */
private Grid makeAxesPanel() {
    final Grid grid = new Grid(5, 3);
    grid.setText(0, 1, "Y");
    grid.setText(0, 2, "Y2");
    setTextAlignCenter(grid.getRowFormatter().getElement(0));
    grid.setText(1, 0, "Label");
    grid.setWidget(1, 1, ylabel);
    grid.setWidget(1, 2, y2label);
    grid.setText(2, 0, "Format");
    grid.setWidget(2, 1, yformat);
    grid.setWidget(2, 2, y2format);
    grid.setText(3, 0, "Range");
    grid.setWidget(3, 1, yrange);
    grid.setWidget(3, 2, y2range);
    grid.setText(4, 0, "Log scale");
    grid.setWidget(4, 1, ylog);
    grid.setWidget(4, 2, y2log);
    setTextAlignCenter(grid.getCellFormatter().getElement(4, 1));
    setTextAlignCenter(grid.getCellFormatter().getElement(4, 2));
    return grid;
}
Also used : Grid(com.google.gwt.user.client.ui.Grid)

Example 38 with Grid

use of com.google.gwt.user.client.ui.Grid in project drools-wb by kiegroup.

the class GuidedScoreCardEditor method getRuleAttributesPanel.

private Widget getRuleAttributesPanel() {
    ruleAttributesGrid = new Grid(2, 4);
    ruleAttributesGrid.setCellSpacing(5);
    ruleAttributesGrid.setCellPadding(5);
    ruleAttributesGrid.setText(0, 0, GuidedScoreCardConstants.INSTANCE.ruleFlowGroup());
    ruleAttributesGrid.setText(0, 1, GuidedScoreCardConstants.INSTANCE.agendaGroup());
    final String ruleFlowGroup = model.getRuleFlowGroup();
    final String agendaGroup = model.getAgendaGroup();
    tbRuleFlowGroup = TextBoxFactory.getTextBox(DataType.TYPE_STRING);
    if (!(ruleFlowGroup == null || ruleFlowGroup.isEmpty())) {
        tbRuleFlowGroup.setText(ruleFlowGroup);
    }
    tbAgendaGroup = TextBoxFactory.getTextBox(DataType.TYPE_STRING);
    if (!(agendaGroup == null || agendaGroup.isEmpty())) {
        tbAgendaGroup.setText(agendaGroup);
    }
    ruleAttributesGrid.setWidget(1, 0, tbRuleFlowGroup);
    ruleAttributesGrid.setWidget(1, 1, tbAgendaGroup);
    return ruleAttributesGrid;
}
Also used : Grid(com.google.gwt.user.client.ui.Grid)

Aggregations

Grid (com.google.gwt.user.client.ui.Grid)38 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)10 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)9 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)9 Label (com.google.gwt.user.client.ui.Label)7 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)7 Button (com.google.gwt.user.client.ui.Button)6 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)6 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)6 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)5 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)5 ColumnFormatter (com.google.gwt.user.client.ui.HTMLTable.ColumnFormatter)4 Image (com.google.gwt.user.client.ui.Image)4 CheckBox (com.google.gwt.user.client.ui.CheckBox)3 TextBox (com.google.gwt.user.client.ui.TextBox)3 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)2 NativeString (com.google.gerrit.client.rpc.NativeString)2 HintTextBox (com.google.gerrit.client.ui.HintTextBox)2 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)2 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)2