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 →");
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);
}
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;
}
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;
}
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;
}
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%");
}
Aggregations