Example usage for com.vaadin.ui ProgressBar ProgressBar

List of usage examples for com.vaadin.ui ProgressBar ProgressBar

Introduction

In this page you can find the example usage for com.vaadin.ui ProgressBar ProgressBar.

Prototype

public ProgressBar() 

Source Link

Document

Creates a new progress bar initially set to 0% progress.

Usage

From source file:pl.exsio.plupload.field.PluploadField.java

License:Open Source License

@Override
protected Component initContent() {

    this.layout = new HorizontalLayout();
    this.layout.setStyleName("plupload-field");
    this.layout.setSpacing(true);

    this.uploader.setMultiSelection(false);
    this.uploader.setStyleName("plupload-field-uploader");
    if (byte[].class.equals(this.returnTypeClass)) {
        this.uploader.setChunkHandlerFactory(new ByteArrayChunkHandlerFactory());
    }//from   w  w  w  .j  a  v  a2  s.com

    this.progressBar = new ProgressBar();
    this.progressBar.setIndeterminate(false);
    this.progressBar.setValue(0f);
    this.progressBar.setWidth("128px");
    this.progressBar.setStyleName("plupload-field-progressbar");
    this.progressBar.setVisible(false);

    this.nameLabel = new Label();
    this.nameLabel.setStyleName("plupload-field-name");
    this.nameLabel.setWidth("128px");

    this.removeButton = new Button(this.removeLabel, FontAwesome.TIMES);
    this.removeButton.setVisible(false);
    this.removeButton.setStyleName("plupload-field-remove");

    VerticalLayout vlayout = new VerticalLayout();

    vlayout.addComponent(this.nameLabel);
    vlayout.addComponent(this.progressBar);

    this.layout.addComponent(this.uploader);
    this.layout.addComponent(vlayout);
    this.layout.addComponent(this.removeButton);
    this.layout.setComponentAlignment(this.removeButton, Alignment.TOP_RIGHT);

    return layout;
}

From source file:steps.FinishStep.java

License:Open Source License

public FinishStep(final Wizard w, AttachmentConfig attachmentConfig) {
    this.w = w;/*w w  w .  j  a  v  a 2  s  .co  m*/
    this.attachConfig = attachmentConfig;

    main = new VerticalLayout();
    main.setMargin(true);
    main.setSpacing(true);
    Label header = new Label("Summary and File Upload");
    main.addComponent(Styles.questionize(header,
            "Here you can download spreadsheets of the samples in your experiment "
                    + "and upload informative files belonging to your project, e.g. treatment information. "
                    + "It might take a few minutes for your files to show up in our project browser.",
            "Last Step"));
    summary = new Label();
    summary.setContentMode(ContentMode.PREFORMATTED);
    Panel summaryPane = new Panel();
    summaryPane.setContent(summary);
    summaryPane.setWidth("550px");
    main.addComponent(summaryPane);

    downloads = new VerticalLayout();
    downloads.setCaption("Download Spreadsheets:");
    downloads.setSpacing(true);
    dlEntities = new Button("Sample Sources");
    dlExtracts = new Button("Sample Extracts");
    dlPreps = new Button("Sample Preparations");
    dlEntities.setEnabled(false);
    dlExtracts.setEnabled(false);
    dlPreps.setEnabled(false);
    downloads.addComponent(dlEntities);
    downloads.addComponent(dlExtracts);
    downloads.addComponent(dlPreps);

    this.bar = new ProgressBar();
    this.info = new Label();
    info.setCaption("Preparing Spreadsheets");
    main.addComponent(bar);
    main.addComponent(info);
    main.addComponent(downloads);

    browserLink = new Button("Show in Project Browser");
    main.addComponent(browserLink);

    attach = new CheckBox("Upload Additional Files");
    // attach.setVisible(false);
    attach.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            uploads.setVisible(attach.getValue());
            w.getFinishButton().setVisible(!attach.getValue());
        }
    });
    main.addComponent(Styles.questionize(attach,
            "Upload one or more small files pertaining to the experimental design of this project.",
            "Upload Attachments"));
}

From source file:steps.SummaryRegisterStep.java

License:Open Source License

public SummaryRegisterStep() {
    main = new VerticalLayout();
    main.setMargin(true);/*from  ww  w  .  j a va 2  s .co m*/
    main.setSpacing(true);
    Label header = new Label("Sample Registration");
    main.addComponent(Styles.questionize(header,
            "Here you can download a spreadsheet of the samples in your experiment "
                    + "and register your project in the database. "
                    + "Registering samples may take a few seconds.",
            "Sample Registration"));

    summary = new ExperimentSummaryTable();

    summaryComponent = new CustomVisibilityComponent(Styles.questionize(summary,
            "This is a summary of samples for Sample Sources/Patients, Tissue Extracts and "
                    + "samples that will be measured.",
            "Experiment Summary"));
    summaryComponent.setVisible(false);
    main.addComponent(summaryComponent.getInnerComponent());

    downloadTSV = new Button("Download Spreadsheet");
    downloadTSV.setEnabled(false);
    HorizontalLayout tsvInfo = new HorizontalLayout();
    tsvInfo.addComponent(downloadTSV);
    main.addComponent(Styles.questionize(tsvInfo,
            "You can download a technical spreadsheet to register your samples at a later time instead. More informative spreadsheets are available in the next step.",
            "TSV Download"));

    Container cont = new IndexedContainer();
    cont.addContainerProperty("caption", String.class, "");
    cont.getContainerProperty(cont.addItem(), "caption").setValue(paidOption);
    cont.getContainerProperty(cont.addItem(), "caption").setValue(freeOption);
    optionGroup = new FlexibleOptionGroup(cont);
    optionGroup.setItemCaptionPropertyId("caption");

    optionLayout = new VerticalLayout();
    Iterator<FlexibleOptionGroupItemComponent> iter;
    iter = optionGroup.getItemComponentIterator();
    while (iter.hasNext()) {
        FlexibleOptionGroupItemComponent fogItemComponent = iter.next();
        Label caption = new Label(fogItemComponent.getCaption());
        caption.setWidth("400px");
        optionLayout.addComponent(new HorizontalLayout(fogItemComponent, caption));
    }

    main.addComponent(optionLayout);
    optionGroup.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            testRegEnabled();
        }
    });

    register = new Button("Register All Samples");
    register.setEnabled(false);
    main.addComponent(register);

    registerInfo = new Label();
    bar = new ProgressBar();
    main.addComponent(registerInfo);
    main.addComponent(bar);
}

From source file:ui.helper.ImageDropBox.java

License:Apache License

public ImageDropBox(Integer userId, final Layout root) {
    super(root);//from  w  w w  .  j a  va 2 s.c  o m
    setDropHandler(this);
    this.userId = userId;
    rootLayout = root;
    progress = new ProgressBar();
    progress.setIndeterminate(true);
    progress.setVisible(false);
    root.addComponent(progress);
}

From source file:uicomponents.WizardUploadsPanel.java

License:Open Source License

public WizardUploadsPanel(String project, List<String> expOptions, String userID, int uploadSize) {
    setCaption("Upload Planning Files");
    this.userID = userID;
    this.project = project;
    attachments = new HashMap<Object, AttachmentInformation>();

    initUpload(uploadSize);/*from   w w  w .j  a va 2s .c  o  m*/

    fileInfo = new StandardTextField("Description");
    addComponent(fileInfo);
    fileInfo.setVisible(false);

    context = new ComboBox("Attach to...");
    context.setVisible(false);
    context.setNullSelectionAllowed(false);
    context.setStyleName(Styles.boxTheme);
    context.addItems(expOptions);
    context.addItem("General Infos");
    addComponent(context);

    add = new Button("Add");
    addComponent(add);
    add.setVisible(false);

    initTable();

    bar = new ProgressBar();
    bar.setVisible(false);
    info = new Label();
    addComponent(bar);
    addComponent(info);

    commit = new Button("Commit Files");
    addComponent(commit);
    commit.setVisible(false);

    setSpacing(true);
    addListeners();
}

From source file:views.StandaloneTSVImport.java

License:Open Source License

public void initView(Upload upload) {
    HorizontalLayout optionsInfo = new HorizontalLayout();
    optionsInfo.addComponent(importOptions);
    optionsInfo.addComponent(infos);/*  w  ww  . j  a v  a 2s . com*/

    // design type selection and info
    addComponent(optionsInfo);

    // file upload component
    this.upload = upload;
    addComponent(this.upload);
    upload.setEnabled(false);

    // missing info input layout
    addComponent(questionaire);

    // summary of imortet samples
    summary = new ExperimentSummaryTable();
    summary.setVisible(false);
    addComponent(summary);

    // sample registration button
    register = new Button("Register All");
    register.setVisible(false);
    addComponent(register);

    // registration progress information
    registerInfo = new Label();
    bar = new ProgressBar();
    registerInfo.setVisible(false);
    bar.setVisible(false);
    addComponent(registerInfo);
    addComponent(bar);
}

From source file:views.WizardBarcodeView.java

License:Open Source License

/**
 * Creates a new component view for barcode creation
 * /* w  w  w  .ja va2s .com*/
 * @param spaces List of available openBIS spaces
 * @param isAdmin
 * @param gen
 */
public WizardBarcodeView(List<String> spaces, boolean isAdmin, SampleFilterGenerator gen) {
    VerticalLayout left = new VerticalLayout();
    VerticalLayout right = new VerticalLayout();
    initSampleTable(gen);
    right.addComponent(sampleTable);

    left.setSpacing(true);
    left.setMargin(true);
    right.setSpacing(true);
    right.setMargin(true);

    SampleToBarcodeFieldTranslator translator = new SampleToBarcodeFieldTranslator();
    this.isAdmin = isAdmin;

    spaceBox = new ComboBox("Project", spaces);
    spaceBox.setStyleName(Styles.boxTheme);
    spaceBox.setFilteringMode(FilteringMode.CONTAINS);
    spaceBox.setNullSelectionAllowed(false);
    spaceBox.setImmediate(true);

    projectBox = new ComboBox("Sub-Project");
    projectBox.setStyleName(Styles.boxTheme);
    projectBox.setEnabled(false);
    projectBox.setImmediate(true);
    projectBox.setNullSelectionAllowed(false);

    left.addComponent(Styles.questionize(spaceBox, "Name of the project", "Project Name"));
    left.addComponent(Styles.questionize(projectBox, "QBiC project code and project name", "Sub-Project"));

    initExperimentTable();
    left.addComponent(Styles.questionize(experimentTable,
            "This table gives an overview of tissue samples and extracted materials"
                    + " for which barcodes can be printed. You can select one or multiple rows.",
            "Sample Overview"));

    sortby = new OptionGroup("Sort Barcode Sheet/Stickers By");
    sortby.addItems(SortBy.values());
    sortby.setValue(SortBy.BARCODE_ID);
    left.addComponent(sortby);

    sheetPreview = new SheetOptionComponent(translator);
    tubePreview = new BarcodePreviewComponent(translator);

    tabs = new TabSheet();
    tabs.setStyleName(ValoTheme.TABSHEET_FRAMED);
    tabs.addTab(sheetPreview, "Sample Sheet");
    tabs.addTab(tubePreview, "Barcode Stickers");
    tabsTab = new CustomVisibilityComponent(tabs);
    tabsTab.setVisible(false);
    left.addComponent(Styles.questionize(tabsTab, "Prepare an A4 sample sheet or barcodes for sample tubes.",
            "Barcode Preparation"));

    info = new Label();
    bar = new ProgressBar();
    bar.setVisible(false);
    left.addComponent(info);
    left.addComponent(bar);

    prepareBarcodes = new Button("Prepare Barcodes");
    prepareBarcodes.setEnabled(false);
    left.addComponent(prepareBarcodes);

    printerSelection = new ComboBox("Printer");
    printerSelection.setVisible(isAdmin);
    printerSelection.setWidth("300px");
    printerSelection.setStyleName(Styles.boxTheme);
    printerSelection.setVisible(false);
    printerSelection.setNullSelectionAllowed(false);
    left.addComponent(printerSelection);

    printTubeCodes = new Button("Print Barcodes");
    printTubeCodes.setVisible(isAdmin);
    printTubeCodes.setEnabled(false);
    left.addComponent(printTubeCodes);

    download = new Button("Download");
    download.setEnabled(false);
    left.addComponent(download);
    addComponent(left);
    addComponent(right);
    disablePreview();
}