List of usage examples for com.google.gwt.user.client.ui TextBox setVisibleLength
public void setVisibleLength(int length)
From source file:com.google.gwt.maps.sample.hellomaps.client.Geocoder2Demo.java
License:Apache License
public Geocoder2Demo() { Panel panel = new FlowPanel(); final FormPanel form = new FormPanel(); form.setAction("#"); Panel formElements = new FlowPanel(); Label label = new Label("Search for an address:"); formElements.add(label);//from w ww . j a va2 s . co m final TextBox addressBox = new TextBox(); addressBox.setVisibleLength(40); formElements.add(addressBox); Button submit = new Button("Search"); submit.addClickListener(new ClickListener() { public void onClick(Widget sender) { form.submit(); } }); formElements.add(submit); form.add(formElements); form.addFormHandler(new FormHandler() { public void onSubmit(FormSubmitEvent event) { showAddress(addressBox.getText()); event.setCancelled(true); } public void onSubmitComplete(FormSubmitCompleteEvent event) { } }); panel.add(form); map = new MapWidget(LatLng.newInstance(34, 0), 1); map.setSize("100%", "480px"); panel.add(map); Grid grid = new Grid((sampleAddresses.length / NUM_ADDRESS_COLUMNS) + 1, NUM_ADDRESS_COLUMNS); for (int i = 0; i < sampleAddresses.length; i++) { final String address = sampleAddresses[i]; Button link = new Button(address); // Hyperlink link = new Hyperlink(address, true, // "Extracting Structured Address Information"); link.addClickListener(new ClickListener() { public void onClick(Widget sender) { addressBox.setText(address); form.submit(); } }); grid.setWidget(i / NUM_ADDRESS_COLUMNS, i % NUM_ADDRESS_COLUMNS, link); } panel.add(grid); initWidget(panel); geocoder = new Geocoder(); }
From source file:com.google.gwt.maps.sample.hellomaps.client.GeocoderDemo.java
License:Apache License
public GeocoderDemo() { Panel panel = new FlowPanel(); final FormPanel form = new FormPanel(); form.setAction("#"); Panel formElements = new FlowPanel(); final TextBox address = new TextBox(); address.setVisibleLength(60); address.setText("10 10th Street, Atlanta, GA"); formElements.add(address);/* w w w . ja v a2 s. co m*/ formElements.add(buildLatLngPanel()); this.displayLatLng(ATLANTA); Button submit = new Button("Go!"); submit.addClickListener(new ClickListener() { public void onClick(Widget sender) { form.submit(); } }); formElements.add(submit); form.add(formElements); form.addFormHandler(new FormHandler() { public void onSubmit(FormSubmitEvent event) { showAddress(address.getText()); event.setCancelled(true); } public void onSubmitComplete(FormSubmitCompleteEvent event) { } }); panel.add(form); map = new MapWidget(ATLANTA, 13); map.setSize("500px", "300px"); panel.add(map); initWidget(panel); geocoder = new Geocoder(); }
From source file:com.GTDF.client.GWT_Transxchange2GoogleTransit.java
License:Apache License
public void onModuleLoad() { String wikiUserName = readUsername(); //Service Start final TextBox textBoxServiceStartGz = new TextBox(); TabPanel tabs = new TabPanel(); tabs.setStyleName(".gwt-TabBar"); tabs.setWidth("100%"); tabs.setHeight("100%"); //-------------------------EDJ ---------------- DockPanel dock = new DockPanel(); dock.setSize("663px", "220px"); dock.setStyleName("gwt-TabBar"); VerticalPanel TransformWindow = new VerticalPanel(); TransformWindow.setStyleName("weather-input-panel"); //Agency URL//from w w w. j av a 2 s . c o m HorizontalPanel AgencyURL = new HorizontalPanel(); Label url_lbl = new Label("Agency URL:"); url_lbl.setWidth("90"); final TextBox textBoxUrl = new TextBox(); textBoxUrl.setText("http://www.agency.org"); textBoxUrl.setVisibleLength(40); AgencyURL.add(url_lbl); AgencyURL.add(textBoxUrl); //----------- //Route Type HorizontalPanel RType = new HorizontalPanel(); Label rt_lbl = new Label("Route Type:"); rt_lbl.setWidth("90"); final ListBox listBoxDefaultRouteType = new ListBox(); listBoxDefaultRouteType.setVisibleItemCount(1); listBoxDefaultRouteType.addItem("Tram"); listBoxDefaultRouteType.addItem("Subway"); listBoxDefaultRouteType.addItem("Rail"); listBoxDefaultRouteType.addItem("Bus"); listBoxDefaultRouteType.addItem("Ferry"); listBoxDefaultRouteType.addItem("Cable car"); listBoxDefaultRouteType.addItem("Gondola"); listBoxDefaultRouteType.addItem("Funicular"); listBoxDefaultRouteType.setSelectedIndex(0); RType.add(rt_lbl); RType.add(listBoxDefaultRouteType); //----------- //Time Zone VerticalPanel TZ = new VerticalPanel(); Label tz_lbl = new Label("Time Zone:"); tz_lbl.setWidth("90"); HorizontalPanel Continent = new HorizontalPanel(); Label continent_lbl = new Label("Continent:"); continent_lbl.setWidth("90"); final ListBox listBoxTimezoneP = new ListBox(); listBoxTimezoneP.addItem("Africa"); listBoxTimezoneP.addItem("America"); listBoxTimezoneP.addItem("Antarctica"); listBoxTimezoneP.addItem("Artic"); listBoxTimezoneP.addItem("Asia"); listBoxTimezoneP.addItem("Atlantic"); listBoxTimezoneP.addItem("Australia"); listBoxTimezoneP.addItem("Europe"); listBoxTimezoneP.addItem("Indian"); listBoxTimezoneP.addItem("Pacific"); listBoxTimezoneP.setVisibleItemCount(1); listBoxTimezoneP.setSelectedIndex(0); Continent.add(continent_lbl); Continent.add(listBoxTimezoneP); HorizontalPanel Region = new HorizontalPanel(); Label region_lbl = new Label("Region:"); region_lbl.setWidth("90"); final ListBox listBoxTimezoneS = new ListBox(); switchTimezone(listBoxTimezoneS, 0); Region.add(region_lbl); Region.add(listBoxTimezoneS); TZ.add(tz_lbl); TZ.add(Continent); TZ.add(Region); //----------- Button dialogButton = new Button("Show Dialog", new ClickListener() { public void onClick(Widget sender) { //EDJ DialogBox dlg = new MyDialog(); int left = 120; int top = 300; dlg.setPopupPosition(left, top); dlg.show(); } }); final Label labelOutdir = new Label(); // Displays wikiuser final Label labelResultGz = new Label(); final Label labelResult = new Label(); final Label labelResultUser = new Label(); final FormPanel uploadFormGz = new FormPanel(); uploadFormGz.setAction(GWT.getModuleBaseURL() + "upload"); uploadFormGz.setEncoding(FormPanel.ENCODING_MULTIPART); uploadFormGz.setMethod(FormPanel.METHOD_POST); //Upload final HorizontalPanel uploadPanelGz = new HorizontalPanel(); Label upload_lbl = new Label("Upload File:"); upload_lbl.setWidth("90"); uploadPanelGz.add(upload_lbl); //uploadPanelGz.add(upload_tb); //uploadPanelGz.add(upload_btn); //-------------- // Add hidden widget to pass user name to FileUploadServlet for verification against wiki user table final Hidden hwGz = new Hidden("username", wikiUserName); uploadPanelGz.add(hwGz); // Add hidden widget to pass service start to FileUploadServlet final Hidden ssGz = new Hidden("prefix"); uploadPanelGz.add(ssGz); final FileUpload uploadGz = new FileUpload(); uploadGz.setName("uploadFormElement"); uploadPanelGz.add(uploadGz); //final VerticalPanel uploadPanelGz = new VerticalPanel(); uploadFormGz.setWidget(uploadPanelGz); /* * Add Transxchange2GoogleTransit file upload */ final FormPanel uploadForm = new FormPanel(); uploadForm.setAction(GWT.getModuleBaseURL() + "upload"); uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART); uploadForm.setMethod(FormPanel.METHOD_POST); final VerticalPanel uploadPanel = new VerticalPanel(); uploadForm.setWidget(uploadPanel); // Add hidden widget to pass user name to FileUploadServlet for verification against wiki user table final Hidden hw = new Hidden("username", wikiUserName); uploadPanel.add(hw); final FileUpload upload = new FileUpload(); upload.setName("uploadFormElement"); uploadPanel.add(upload); /* * Verify user and enable action buttons if user exists */ WikiUserServiceAsync wikiUserService = (WikiUserServiceAsync) GWT.create(WikiUserService.class); ServiceDefTarget endpoint = (ServiceDefTarget) wikiUserService; String moduleRelativeURL = GWT.getModuleBaseURL() + "WikiUser"; endpoint.setServiceEntryPoint(moduleRelativeURL); AsyncCallback callback = new AsyncCallback() { public void onSuccess(Object result) { Button buttonGz = new Button("Upload", new ClickListener() { public void onClick(Widget sender) { // Extract service start and pass as prefix String serviceStart = textBoxServiceStartGz.getText(); ssGz.setValue(serviceStart); // Upload selected infile to server uploadFormGz.submit(); //EDJ DialogBox dlg = new MyDialog(); int left = 120; int top = 300; dlg.setPopupPosition(left, top); dlg.show(); } }); Button button = new Button("Transform", new ClickListener() { public void onClick(Widget sender) { // Upload selected infile to server uploadForm.submit(); } }); if (result != "LOGGED") { button.setEnabled(false); buttonGz.setEnabled(false); labelResultUser.setText((String) result); } uploadPanel.add(button); uploadPanelGz.add(buttonGz); } public void onFailure(Throwable caught) { try { throw caught; } catch (InvocationException e) { labelResult.setText("InvocationException: " + e.getMessage()); } catch (Throwable e) { labelResult.setText("callback failed: " + e.getMessage()); } } }; wikiUserService.wikiUserVerify(wikiUserName, callback); /* * Upload google_transit.zip file */ uploadFormGz.addFormHandler(new FormHandler() { public void onSubmitComplete(FormSubmitCompleteEvent event) { labelResultGz.setText((String) event.getResults()); } public void onSubmit(FormSubmitEvent event) { // Upload infile to server String inFilename = uploadGz.getFilename(); if (inFilename.length() == 0) { Window.alert("Infile required"); return; } } }); /* * Upload TransXChange file and call Transxchange2GoogleTransit servlet when "transform" button is pushed */ uploadForm.addFormHandler(new FormHandler() { public void onSubmitComplete(FormSubmitCompleteEvent event) { labelResult.setText((String) event.getResults()); // Start transformation String parseArgs = upload.getFilename(); parseArgs = parseArgs + " " + textBoxUrl.getText(); parseArgs = parseArgs + " " + listBoxTimezoneP.getItemText(listBoxTimezoneP.getSelectedIndex()); String helpString = listBoxTimezoneS.getItemText(listBoxTimezoneS.getSelectedIndex()); parseArgs = parseArgs + "/" + helpString.substring(0, helpString.indexOf(' ')); parseArgs = parseArgs + " " + listBoxDefaultRouteType.getSelectedIndex(); parseArgs = parseArgs + " " + labelOutdir.getText(); // call server through GWT asynchronous RPC Transxchange2GoogleTransitServiceAsync transxchange2GoogleTransitService = (Transxchange2GoogleTransitServiceAsync) GWT .create(Transxchange2GoogleTransitService.class); ServiceDefTarget endpoint = (ServiceDefTarget) transxchange2GoogleTransitService; String moduleRelativeURL = GWT.getModuleBaseURL() + "GTDF"; endpoint.setServiceEntryPoint(moduleRelativeURL); AsyncCallback callback = new AsyncCallback() { public void onSuccess(Object result) { labelResult.setText((String) result); } public void onFailure(Throwable caught) { try { throw caught; } catch (InvocationException e) { labelResult.setText("InvocationException: " + e.getMessage()); } catch (Throwable e) { labelResult.setText("callback failed: " + e.getMessage()); } } }; transxchange2GoogleTransitService.transxchange2GoogleTransit_transform(parseArgs, callback); } public void onSubmit(FormSubmitEvent event) { // Upload infile to server String inFilename = upload.getFilename(); if (inFilename.length() == 0) { Window.alert("Infile required"); return; } } }); /* * Add UI elements * Better practice (for future reference): use CSS */ TransformWindow.add(AgencyURL); TransformWindow.add(RType); TransformWindow.add(TZ); TransformWindow.add(uploadPanelGz); TransformWindow.add(uploadPanel); TransformWindow.add(dialogButton); tabs.add(TransformWindow, "TransXChange"); //tabs.add(TZ, "Transformation2"); tabs.selectTab(0); dock.add(tabs, DockPanel.CENTER); RootPanel.get("tab_area").add(dock); /* RootPanel.get("gz_servicestart").add(textBoxServiceStartGz); RootPanel.get("gz_infile").add(uploadFormGz); RootPanel.get("url").add(textBoxUrl); RootPanel.get("timezoneP").add(listBoxTimezoneP); RootPanel.get("timezoneS").add(listBoxTimezoneS); RootPanel.get("defaultroutetype").add(listBoxDefaultRouteType); RootPanel.get("outdir").add(labelOutdir); labelOutdir.setText(wikiUserName); RootPanel.get("user_result").add(labelResultUser); RootPanel.get("gz_result").add(labelResultGz); RootPanel.get("result").add(labelResult); RootPanel.get("infile").add(uploadForm); */ // Primary time zone (Africa, Europe, ...) selected listBoxTimezoneP.addChangeListener(new ChangeListener() { public void onChange(Widget sender) { switchTimezone(listBoxTimezoneS, listBoxTimezoneP.getSelectedIndex()); } }); //---------------------------------------------------------------------------------------------- //----------------------------------------EDJ--------------------------------------------------- }
From source file:com.threerings.gwt.ui.Widgets.java
License:Open Source License
/** * Configures a text box with all of the configuration that you're bound to want to do. This is * useful for configuring a PasswordTextBox. *//*from www. j ava2 s . co m*/ public static TextBox initTextBox(TextBox box, String text, int maxLength, int visibleLength) { if (text != null) { box.setText(text); } box.setMaxLength(maxLength > 0 ? maxLength : 255); if (visibleLength > 0) { box.setVisibleLength(visibleLength); } return box; }
From source file:com.tractionsoftware.gwt.demo.color.client.ColorDemo.java
License:Apache License
private static final TextBox createTextBox(String text) { TextBox ret = new TextBox(); ret.setVisibleLength(20); ret.setText(text);// w w w .j a v a 2s.co m return ret; }
From source file:com.tractionsoftware.gwt.demo.opacity.client.OpacityDemo.java
License:Apache License
private static final TextBox createTextBox(String text) { TextBox ret = new TextBox(); ret.setVisibleLength(10); ret.setText(text);// w ww . j a v a2s . c o m return ret; }
From source file:com.xpn.xwiki.watch.client.ui.dialog.EditTagsDialog.java
License:Open Source License
protected Widget getParametersPanel() { FlowPanel paramsPanel = new FlowPanel(); Label tagsLabel = new Label(); tagsLabel.setStyleName("tags-label"); tagsLabel.setText(app.getTranslation(getDialogTranslationName() + ".tags")); paramsPanel.add(tagsLabel);// w w w .j ava 2 s . c om TextBox tagsTextBox = new TextBox(); tagsTextBox.setVisibleLength(30); tagsTextBox.setName("tags"); WordListSuggestOracle tagListOracle = new WordListSuggestOracle(new TagListSuggestOracle((Watch) this.app), Constants.PROPERTY_TAGS_SEPARATORS_EDIT, true); tagsSuggestBox = new SuggestBox(tagListOracle, tagsTextBox); tagsTextBox.addStyleName(getCSSName("tags")); if (tags != null) { tagsTextBox.setText(tags); } paramsPanel.add(tagsSuggestBox); return paramsPanel; }
From source file:edu.caltech.ipac.firefly.ui.GwtUtil.java
public static Widget makeTextInput(String text, String tip, String value, int length, TextBox textBox) { HorizontalPanel hp = new HorizontalPanel(); Label label = new Label(text); label.setTitle(tip);/*from w w w.j a v a 2s . c o m*/ textBox.setText(value); textBox.setTitle(tip); textBox.setVisibleLength(length); hp.add(label); hp.add(GwtUtil.getFiller(5, 1)); hp.add(textBox); return hp; }
From source file:edu.caltech.ipac.firefly.ui.PopupUtil.java
public static BaseDialog showInputDialog(Widget parent, String msg, String intialValue, int preferWidth, final ClickHandler okHandler, final ClickHandler cancelHandler) { final TextBox text = new TextBox(); text.setVisibleLength(preferWidth); if (!StringUtils.isEmpty(intialValue)) { text.setText(intialValue);//from ww w.j a v a 2 s . co m } final BaseDialog dialog = new BaseDialog(parent, ButtonType.OK_CANCEL, "Input Dialog", true, null) { protected void inputComplete() { if (okHandler != null) { okHandler.onClick(new ClickEvent() { @Override public Object getSource() { return text.getText(); } }); } } protected void inputCanceled() { if (cancelHandler != null) cancelHandler.onClick(null); } }; text.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent ev) { final char keyCode = ev.getCharCode(); DeferredCommand.addCommand(new Command() { public void execute() { if (keyCode == KeyCodes.KEY_ENTER) { dialog.getButton(BaseDialog.ButtonID.OK).click(); } } }); } }); VerticalPanel vp = new VerticalPanel(); vp.setSpacing(5); vp.add(new HTML("<h3>" + msg + "</h3>")); vp.add(text); dialog.setWidget(vp); dialog.setVisible(true); text.setFocus(true); return dialog; }
From source file:edu.ucsb.eucalyptus.admin.client.ClusterInfoTable.java
License:Open Source License
private Grid addClusterEntry(int row, ClusterInfoWeb clusterInfo, final StorageInfoWeb storageInfo) { final ArrayList<String> storageParams = storageInfo.getStorageParams(); numStorageParams = storageParams.size() / 4; Grid g = new Grid(8 + numStorageParams, 2); g.setStyleName("euca-table"); if (row > 0) { g.setStyleName("euca-nonfirst-cluster-entry"); }/* w ww . ja v a 2 s . co m*/ g.setCellPadding(4); int i = 0; // row 1 g.setWidget(i, 0, new HTML("<b>Name:</b>")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final HorizontalPanel namePanel = new HorizontalPanel(); namePanel.setSpacing(0); if (clusterInfo.isCommitted()) { namePanel.add(new Label(clusterInfo.getName())); } else { final TextBox nb = new TextBox(); nb.addChangeListener(new ChangeCallback(this, row)); nb.setVisibleLength(12); nb.setText(clusterInfo.getName()); nb.addFocusListener(new FocusHandler(this.hint, this.warningMessage)); namePanel.add(nb); } namePanel.add(new Button("Deregister Cluster", new DeleteCallback(this, row))); g.setWidget(i, 1, namePanel); i++; // next row g.setWidget(i, 1, new Label("Cluster Controller")); i++; // next row g.setWidget(i, 0, new Label("Host:")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final TextBox hb = new TextBox(); hb.addChangeListener(new ChangeCallback(this, row)); hb.setVisibleLength(20); hb.setText(clusterInfo.getHost()); hb.addFocusListener(new FocusHandler(this.hint, this.warningMessage)); g.setWidget(i, 1, hb); i++; // next row /* g.setWidget( i, 0, new Label( "Port:" ) ); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final TextBox pb = new TextBox(); pb.addChangeListener (new ChangeCallback (this, row)); pb.setVisibleLength( 5 ); pb.setText( "" + clusterInfo.getPort() ); pb.addFocusListener (new FocusHandler (this.hint, this.warningMessage)); g.setWidget( i, 1, pb );*/ final TextBox reservedAddressesBox = new TextBox(); // declare here, set up after the checkbox later final CheckBox dynamicAddressesCheckbox = new CheckBox(); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); g.setWidget(i, 0, dynamicAddressesCheckbox); if (systemConfig.isDoDynamicPublicAddresses()) { dynamicAddressesCheckbox.setChecked(true); reservedAddressesBox.setEnabled(false); } else { dynamicAddressesCheckbox.setChecked(false); reservedAddressesBox.setEnabled(true); } dynamicAddressesCheckbox.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (((CheckBox) sender).isChecked()) { reservedAddressesBox.setEnabled(false); systemConfig.setDoDynamicPublicAddresses(true); } else { reservedAddressesBox.setEnabled(true); systemConfig.setDoDynamicPublicAddresses(false); } } }); g.setWidget(i, 1, new Label("Dynamic public IP address assignment")); i++; // next row g.setWidget(i, 0, new Label("Reserve for assignment")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); reservedAddressesBox.addChangeListener(new ChangeCallback(this, row)); reservedAddressesBox.setVisibleLength(5); reservedAddressesBox.setText("" + systemConfig.getSystemReservedPublicAddresses()); final HorizontalPanel reservedAddressesPanel = new HorizontalPanel(); reservedAddressesPanel.setSpacing(4); reservedAddressesPanel.add(reservedAddressesBox); reservedAddressesPanel.add(new HTML("public IP addresses")); reservedAddressesBox.setText("" + systemConfig.getSystemReservedPublicAddresses()); g.setWidget(i, 1, reservedAddressesPanel); i++; // next row g.setWidget(i, 0, new Label("Maximum of")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final TextBox publicAddressesBox = new TextBox(); publicAddressesBox.addChangeListener(new ChangeCallback(this, row)); publicAddressesBox.setVisibleLength(5); publicAddressesBox.setText("" + systemConfig.getMaxUserPublicAddresses()); final HorizontalPanel publicAddressesPanel = new HorizontalPanel(); publicAddressesPanel.setSpacing(4); publicAddressesPanel.add(publicAddressesBox); publicAddressesPanel.add(new HTML("public IP addresses per user")); g.setWidget(i, 1, publicAddressesPanel); i++; g.setWidget(i, 0, new Label("Use VLAN tags")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final TextBox minVlanBox = new TextBox(); minVlanBox.addChangeListener(new ChangeCallback(this, row)); minVlanBox.setVisibleLength(4); minVlanBox.setText(String.valueOf(clusterInfo.getMinVlans())); final TextBox maxVlanBox = new TextBox(); maxVlanBox.addChangeListener(new ChangeCallback(this, row)); maxVlanBox.setVisibleLength(4); maxVlanBox.setText(String.valueOf(clusterInfo.getMaxVlans())); final HorizontalPanel vlanPanel = new HorizontalPanel(); vlanPanel.setSpacing(4); vlanPanel.add(minVlanBox); vlanPanel.add(new HTML("through")); vlanPanel.add(maxVlanBox); g.setWidget(i, 1, vlanPanel); i++; // next row g.setWidget(i, 1, new Label("Storage Controller")); for (int paramidx = 0; paramidx < numStorageParams; ++paramidx) { i++; // next row if ("KEYVALUE".equals(storageParams.get(4 * paramidx))) { g.setWidget(i, 0, new Label(storageParams.get(4 * paramidx + 1) + ": ")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final TextBox propTextBox = new TextBox(); propTextBox.addChangeListener(new ChangeCallback(this, row)); propTextBox.setVisibleLength(30); propTextBox.setText(storageParams.get(4 * paramidx + 2)); propTextBox.addFocusListener(new FocusHandler(this.hint, this.warningMessage)); g.setWidget(i, 1, propTextBox); } else if ("PASSWORD".equals(storageParams.get(4 * paramidx))) { g.setWidget(i, 0, new Label(storageParams.get(4 * paramidx + 1) + ": ")); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); final TextBox propTextBox = new PasswordTextBox(); propTextBox.addChangeListener(new ChangeCallback(this, row)); propTextBox.setVisibleLength(30); propTextBox.setText(storageParams.get(4 * paramidx + 2)); propTextBox.addFocusListener(new FocusHandler(this.hint, this.warningMessage)); g.setWidget(i, 1, propTextBox); } else if ("BOOLEAN".equals(storageParams.get(4 * paramidx))) { final int index = paramidx; final CheckBox propCheckbox = new CheckBox(); g.getCellFormatter().setHorizontalAlignment(i, 0, HasHorizontalAlignment.ALIGN_RIGHT); g.setWidget(i, 0, propCheckbox); if (Boolean.parseBoolean(storageParams.get(4 * index + 2))) { propCheckbox.setChecked(true); } else { propCheckbox.setChecked(false); } propCheckbox.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (((CheckBox) sender).isChecked()) { storageParams.set(4 * index + 2, String.valueOf(true)); } else { storageParams.set(4 * index + 2, String.valueOf(false)); } } }); g.setWidget(i, 1, new Label(storageParams.get(paramidx * 4 + 1))); } } return g; }