com.google.gwt.user.client.ui.FormPanel Java Examples

The following examples show how to use com.google.gwt.user.client.ui.FormPanel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UploadStep.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
protected Widget asWidget(final Context context) {
    final FlowPanel panel = new FlowPanel();

    HTML description = new HTML(Console.CONSTANTS.common_label_chooseFile());
    description.getElement().setAttribute("style", "padding-bottom:15px;");
    panel.add(description);

    form = new FormPanel();

    // create a panel to hold all of the form widgets.
    VerticalPanel formPanel = new VerticalPanel();
    form.setWidget(formPanel);

    // create a FileUpload widgets.
    fileUpload = new FileUpload();
    fileUpload.setName("uploadFormElement");
    IdHelper.setId(fileUpload, id(), "file");
    formPanel.add(fileUpload);

    panel.add(form);
    return panel;
}
 
Example #2
Source File: SelectPatchStep.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected IsWidget body(final ApplyContext context) {
    FormPanel form = new FormPanel();
    FlowPanel panel = new FlowPanel();
    form.setWidget(panel);
    panel.add(new Label(Console.CONSTANTS.patch_manager_select_patch_body()));

    if (!context.standalone) {
        info = new HTML("");
        info.getElement().getStyle().setMarginTop(2, Style.Unit.EM);
        panel.add(info);
    }

    FlowPanel uploadPanel = new FlowPanel();
    uploadPanel.getElement().getStyle().setMarginTop(2, Style.Unit.EM);
    InlineLabel uploadLabel = new InlineLabel(Console.CONSTANTS.patch_manager_select_patch_upload());
    uploadLabel.getElement().getStyle().setMarginRight(1, Style.Unit.EM);
    uploadPanel.add(uploadLabel);
    context.fileUpload = new FileUpload();
    context.fileUpload.setName("patch_file");
    context.fileUpload.getElement().setId(asId(PREFIX, getClass(), "_Upload"));
    uploadPanel.add(context.fileUpload);
    panel.add(uploadPanel);

    errorMessages = new HTML(
            "<i class=\"icon-exclamation-sign\"></i> " + Console.CONSTANTS.patch_manager_select_file());
    errorMessages.addStyleName("error");
    errorMessages.setVisible(false);
    panel.add(errorMessages);

    return form;
}