Search in sources :

Example 31 with Grid

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

the class Generator method setupLeftPanel.

void setupLeftPanel() {
    topPanel.setHTML(2, 0, "<span id=\"errorMessageID\" class=\"" + StylesDefs.ERROR_MESSAGE + "\"></span>");
    // fills up the list of generators
    for (GeneratorSource generator : generators) {
        genList.addItem(generator.getName());
        setGridStyle(generator.getWidget());
    }
    sizeList.addItem("Small", "120");
    sizeList.addItem("Medium", "230");
    sizeList.addItem("Large", "350");
    sizeList.setSelectedIndex(2);
    ecLevelList.addItem("L");
    ecLevelList.addItem("M");
    ecLevelList.addItem("Q");
    ecLevelList.addItem("H");
    ecLevelList.setSelectedIndex(0);
    encodingList.addItem("UTF-8");
    encodingList.addItem("ISO-8859-1");
    encodingList.addItem("Shift_JIS");
    encodingList.setSelectedIndex(0);
    // updates the second row of the table with the content of the selected generator
    genList.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent Event) {
            int i = genList.getSelectedIndex();
            setWidget(i);
        }
    });
    // grid for the generator picker
    HTMLTable selectionTable = new Grid(1, 2);
    selectionTable.setText(0, 0, "Contents");
    selectionTable.setWidget(0, 1, genList);
    setGridStyle(selectionTable);
    topPanel.setWidget(0, 0, selectionTable);
    // grid for the generate button
    HTMLTable generateGrid = new Grid(1, 2);
    setGridStyle(generateGrid);
    Button generateButton = new Button("Generate &rarr;");
    generateButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            generate();
        }
    });
    generateGrid.setWidget(0, 1, generateButton);
    topPanel.setWidget(4, 0, generateGrid);
    HTMLTable configTable = new Grid(3, 2);
    configTable.setText(0, 0, "Barcode size");
    configTable.setWidget(0, 1, sizeList);
    configTable.setText(1, 0, "Error correction");
    configTable.setWidget(1, 1, ecLevelList);
    configTable.setText(2, 0, "Character encoding");
    configTable.setWidget(2, 1, encodingList);
    setGridStyle(configTable);
    topPanel.setWidget(3, 0, configTable);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Button(com.google.gwt.user.client.ui.Button) Grid(com.google.gwt.user.client.ui.Grid) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HTMLTable(com.google.gwt.user.client.ui.HTMLTable)

Example 32 with Grid

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

the class GeoLocationGenerator method getWidget.

@Override
public Grid getWidget() {
    if (table != null) {
        return table;
    }
    table = new Grid(3, 2);
    table.setText(0, 0, "Latitude");
    table.setWidget(0, 1, latitude);
    table.setText(1, 0, "Longitude");
    table.setWidget(1, 1, longitude);
    table.setText(2, 0, "Query");
    table.setWidget(2, 1, query);
    return table;
}
Also used : Grid(com.google.gwt.user.client.ui.Grid)

Example 33 with Grid

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

the class PhoneNumberGenerator method getWidget.

@Override
public Grid getWidget() {
    if (table != null) {
        return table;
    }
    table = new Grid(1, 2);
    table.setText(0, 0, "Phone number");
    table.setWidget(0, 1, number);
    return table;
}
Also used : Grid(com.google.gwt.user.client.ui.Grid)

Example 34 with Grid

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

the class SmsAddressGenerator method getWidget.

@Override
public Grid getWidget() {
    if (table != null) {
        return table;
    }
    table = new Grid(2, 2);
    table.setText(0, 0, "Phone number");
    table.setWidget(0, 1, number);
    table.setText(1, 0, "Message");
    table.setWidget(1, 1, message);
    return table;
}
Also used : Grid(com.google.gwt.user.client.ui.Grid)

Example 35 with Grid

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

the class Screen method onInitUI.

protected void onInitUI() {
    final FlowPanel me = (FlowPanel) getWidget();
    me.add(header = new Grid(1, Cols.values().length));
    me.add(body);
    headerText = new InlineLabel();
    if (titleWidget == null) {
        titleWidget = headerText;
    }
    FlowPanel title = new FlowPanel();
    title.add(titleWidget);
    title.setStyleName(Gerrit.RESOURCES.css().screenHeader());
    header.setWidget(0, Cols.Title.ordinal(), title);
    header.setStyleName(Gerrit.RESOURCES.css().screenHeader());
    header.getCellFormatter().setHorizontalAlignment(0, Cols.FarEast.ordinal(), HasHorizontalAlignment.ALIGN_RIGHT);
    // force FarEast all the way to the right
    header.getCellFormatter().setWidth(0, Cols.FarEast.ordinal(), "100%");
}
Also used : Grid(com.google.gwt.user.client.ui.Grid) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) InlineLabel(com.google.gwt.user.client.ui.InlineLabel)

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