Example usage for com.google.gwt.widgetideas.client ProgressBar ProgressBar

List of usage examples for com.google.gwt.widgetideas.client ProgressBar ProgressBar

Introduction

In this page you can find the example usage for com.google.gwt.widgetideas.client ProgressBar ProgressBar.

Prototype

public ProgressBar(double minProgress, double maxProgress) 

Source Link

Document

Create a progress bar within the given range.

Usage

From source file:eu.europeana.uim.gui.cp.client.europeanawidgets.ImportResourcesWidget.java

License:EUPL

/**
 * Creates an import dialog//from   w  w  w .j  av a2s  . com
 * 
 * @return
 */
private DialogBox createImportDialog() {
    // Create a dialog box and set the caption text
    final DialogBox dialogBox = new DialogBox();
    progressBar = new ProgressBar(0, 100);
    progressBar.setWidth("100%");

    dialogBox.ensureDebugId("impDialogBox");
    dialogBox.setText(EuropeanaClientConstants.IMPORTMENULABEL);
    dialogBox.setModal(true);

    Button closeButton = new Button();
    closeButton.setText("Close");

    closeButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            dialogBox.hide();
            progressBar.setProgress(0);
            impResultsTable.removeAllRows();
        }
    });

    // Create a table to layout the content
    VerticalPanel dialogContents = new VerticalPanel();

    dialogContents.setSpacing(4);
    dialogBox.setWidget(dialogContents);
    dialogContents.add(progressBar);

    ScrollPanel scrollPanel = new ScrollPanel();

    scrollPanel.setWidth("600px");
    scrollPanel.setHeight("500px");

    scrollPanel.add(impResultsTable);

    dialogContents.add(scrollPanel);

    dialogContents.add(closeButton);
    HTML details = new HTML("ImportStatus");

    dialogContents.setCellHorizontalAlignment(details, HasHorizontalAlignment.ALIGN_CENTER);
    return dialogBox;
}