List of usage examples for com.vaadin.ui ProgressBar ProgressBar
public ProgressBar(float progress)
From source file:annis.gui.docbrowser.DocBrowserController.java
License:Apache License
public void openDocVis(String corpus, String doc, Visualizer visConfig, Button btn) { final String canonicalTitle = corpus + " > " + doc + " - " + "Visualizer: " + visConfig.getDisplayName(); final String tabCaption = StringUtils.substring(canonicalTitle, 0, 15) + "..."; if (visibleVisHolder.containsKey(canonicalTitle)) { Panel visHolder = visibleVisHolder.get(canonicalTitle); ui.getSearchView().getTabSheet().setSelectedTab(visHolder); return;/*from w w w.ja v a 2 s . c om*/ } Panel visHolder = new Panel(); visHolder.setSizeFull(); visHolder.addDetachListener(new ClientConnector.DetachListener() { @Override public void detach(ClientConnector.DetachEvent event) { visibleVisHolder.remove(canonicalTitle); } }); // first set loading indicator ProgressBar progressBar = new ProgressBar(1.0f); progressBar.setIndeterminate(true); progressBar.setSizeFull(); VerticalLayout layoutProgress = new VerticalLayout(progressBar); layoutProgress.setSizeFull(); layoutProgress.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER); visHolder.setContent(layoutProgress); Tab visTab = ui.getSearchView().getTabSheet().addTab(visHolder, tabCaption); visTab.setDescription(canonicalTitle); visTab.setIcon(EYE_ICON); visTab.setClosable(true); ui.getSearchView().getTabSheet().setSelectedTab(visTab); // register visible visHolder this.visibleVisHolder.put(canonicalTitle, visHolder); Background.run(new DocVisualizerFetcher(corpus, doc, canonicalTitle, visConfig.getType(), visHolder, visConfig, btn, UI.getCurrent())); }
From source file:annis.gui.resultview.SingleResultPanel.java
License:Apache License
private void showReloadingProgress() { //remove the old visualizer for (VisualizerPanel v : visualizers) { this.removeComponent(v); }/*from w ww. j a va2s .com*/ // first set loading indicator reloadVisualizer = new ProgressBar(1.0f); reloadVisualizer.setIndeterminate(true); reloadVisualizer.setSizeFull(); reloadVisualizer.setHeight(150, Unit.PIXELS); addComponent(reloadVisualizer); }
From source file:com.esofthead.mycollab.vaadin.ui.ProgressBarIndicator.java
License:Open Source License
public ProgressBarIndicator(final int total, final int remaining, final Boolean displayPercentage) { super("progressBar"); float value = (total != 0) ? ((float) (total - remaining) / total) : 1; this.progressIndicator = new ProgressBar(new Float(value)); this.progressIndicator.setWidth("100%"); if (displayPercentage) { if (total > 0) { this.progressStatusLabel = new Label(String.format("%.0f", value * 100) + "%"); } else {/*from w w w . j av a2 s. c o m*/ this.progressStatusLabel = new Label("100%"); } } else { this.progressStatusLabel = new Label(String.valueOf(total - remaining) + "/" + String.valueOf(total)); } this.progressStatusLabel.setWidth("100%"); this.progressStatusLabel.setHeight("100%"); this.addComponent(this.progressIndicator, "progressbar-container"); this.addComponent(this.progressStatusLabel, "progressbar-status"); }
From source file:com.ocs.dynamo.ui.composite.form.ProgressForm.java
License:Apache License
/** * Displays a layout that contains a progress bar and a status label */// ww w . j av a 2 s. co m private void progressMode() { // lazily build the layout if (progressLayout == null) { progressLayout = new DefaultVerticalLayout(true, true); progressBar = new ProgressBar(0.0f); progressBar.setSizeFull(); progressLayout.addComponent(progressBar); status = new Label(); progressLayout.addComponent(status); } progressBar.setValue(0.0f); status.setValue(""); setCompositionRoot(progressLayout); }
From source file:de.unioninvestment.eai.portal.portlet.crud.export.ExportDialog.java
License:Apache License
@SuppressWarnings("serial") private void init() { setCaption(Context.getMessage("portlet.crud.dialog.export.title")); setModal(true);/*from w w w . ja v a 2 s.c om*/ setResizable(false); setWidth("400px"); addCloseListener(new CloseListener() { @Override public void windowClose(CloseEvent e) { handleWindowCloseEvent(); } }); indicator = new ProgressBar(0.0f); indicator.setWidth("100%"); UI.getCurrent().setPollInterval(1000); if (automaticDownload) { VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.addComponent(indicator); setContent(layout); } else { HorizontalLayout layout = new HorizontalLayout(); layout.setWidth("100%"); layout.setMargin(true); layout.setSpacing(true); downloadLink = new Link(); downloadLink.setStyleName(LiferayTheme.BUTTON_LINK); downloadLink.setCaption(Context.getMessage("portlet.crud.dialog.export.download")); downloadLink.setEnabled(false); layout.addComponents(indicator, downloadLink); layout.setComponentAlignment(indicator, Alignment.MIDDLE_CENTER); layout.setComponentAlignment(downloadLink, Alignment.MIDDLE_CENTER); layout.setExpandRatio(indicator, 1f); setContent(layout); } }
From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java
License:Apache License
/** * @return badgeLayoutOERCreator//from w w w .j a v a2 s .c o m */ private HorizontalLayout buildBadgeLayoutOERCreator() { badgeLayoutOERCreator = new HorizontalLayout(); badgeLayoutOERCreator.setWidth("100%"); badgeLayoutOERCreator.setMargin(false); badgeLayoutOERCreator.setSpacing(false); imageLayoutOERCreator = new VerticalLayout(); imageLayoutOERCreator.setWidth("100%"); imageLayoutOERCreator.setMargin(false); imageLayoutOERCreator.setSpacing(false); badgeLayoutOERCreator.addComponent(imageLayoutOERCreator); badgeLayoutOERCreator.setExpandRatio(imageLayoutOERCreator, 0.2f); labelBadgeOERCreator = new Label("OER Creator"); imageLayoutOERCreator.addComponent(labelBadgeOERCreator); imageBadgeOC.setId("OER_CREATOR"); imageLayoutOERCreator.addComponent(imageBadgeOC); tableAchOERCreator = new Table(); popupViewAchOERCreator = new PopupView(null, tableAchOERCreator); imageLayoutOERCreator.addComponent(popupViewAchOERCreator); barLayoutOERCreator = new VerticalLayout(); barLayoutOERCreator.setId("BL_OER_CREATOR"); barLayoutOERCreator.setWidth("100%"); badgeLayoutOERCreator.addComponent(barLayoutOERCreator); badgeLayoutOERCreator.setExpandRatio(barLayoutOERCreator, 0.8f); starLayoutOERCreator = new HorizontalLayout(); starLayoutOERCreator.setWidth("100%"); starLayoutOERCreator.setSpacing(false); starLayoutOERCreator.setMargin(false); barLayoutOERCreator.addComponent(starLayoutOERCreator); starLayoutOERCreator.addComponent(imageBadgeStar1OC); starLayoutOERCreator.addComponent(imageBadgeStar2OC); starLayoutOERCreator.addComponent(imageBadgeStar3OC); starLayoutOERCreator.addComponent(imageBadgeFlagOC); progressBarOERCreator = new ProgressBar(0.0f); progressBarOERCreator.setId("PB_OER_CREATOR"); progressBarOERCreator.setWidth("100%"); progressBarOERCreator.setHeight("100%"); barLayoutOERCreator.addComponent(progressBarOERCreator); levelLayoutOERCreator = new HorizontalLayout(); levelLayoutOERCreator.setWidth("100%"); labelLevelNoviceOC = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML); levelLayoutOERCreator.addComponent(labelLevelNoviceOC); labelLevelInterOC = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML); levelLayoutOERCreator.addComponent(labelLevelInterOC); labelLevelAdvOC = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML); levelLayoutOERCreator.addComponent(labelLevelAdvOC); labelLevelExpOC = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML); ; levelLayoutOERCreator.addComponent(labelLevelExpOC); barLayoutOERCreator.addComponent(levelLayoutOERCreator); tableTasksOERCreator = new Table(); popupViewTasksOERCreator = new PopupView(null, tableTasksOERCreator); barLayoutOERCreator.addComponent(popupViewTasksOERCreator); return badgeLayoutOERCreator; }
From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java
License:Apache License
/** * @return badgeLayoutReviewer//from w w w. j a va 2s . co m */ private HorizontalLayout buildBadgeLayoutReviewer() { badgeLayoutReviewer = new HorizontalLayout(); badgeLayoutReviewer.setWidth("100%"); badgeLayoutReviewer.setMargin(false); badgeLayoutReviewer.setSpacing(false); imageLayoutReviewer = new VerticalLayout(); imageLayoutReviewer.setWidth("100%"); imageLayoutReviewer.setMargin(false); imageLayoutReviewer.setSpacing(false); badgeLayoutReviewer.addComponent(imageLayoutReviewer); badgeLayoutReviewer.setExpandRatio(imageLayoutReviewer, 0.2f); labelBadgeReviewer = new Label("Reviewer"); imageLayoutReviewer.addComponent(labelBadgeReviewer); imageBadgeRev.setId("REVIEWER"); imageLayoutReviewer.addComponent(imageBadgeRev); tableAchReviewer = new Table(); popupViewAchReviewer = new PopupView(null, tableAchReviewer); imageLayoutReviewer.addComponent(popupViewAchReviewer); barLayoutReviewer = new VerticalLayout(); barLayoutReviewer.setId("BL_REVIEWER"); barLayoutReviewer.setWidth("100%"); badgeLayoutReviewer.addComponent(barLayoutReviewer); badgeLayoutReviewer.setExpandRatio(barLayoutReviewer, 0.8f); starLayoutReviewer = new HorizontalLayout(); starLayoutReviewer.setWidth("100%"); starLayoutReviewer.setSpacing(false); starLayoutReviewer.setMargin(false); barLayoutReviewer.addComponent(starLayoutReviewer); starLayoutReviewer.addComponent(imageBadgeStar1Rev); starLayoutReviewer.addComponent(imageBadgeStar2Rev); starLayoutReviewer.addComponent(imageBadgeStar3Rev); starLayoutReviewer.addComponent(imageBadgeFlagRev); progressBarReviewer = new ProgressBar(0.0f); progressBarReviewer.setId("PB_REVIEWER"); progressBarReviewer.setWidth("100%"); progressBarReviewer.setHeight("100%"); barLayoutReviewer.addComponent(progressBarReviewer); levelLayoutReviewer = new HorizontalLayout(); levelLayoutReviewer.setWidth("100%"); labelLevelNoviceRev = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML); levelLayoutReviewer.addComponent(labelLevelNoviceRev); labelLevelInterRev = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML); levelLayoutReviewer.addComponent(labelLevelInterRev); labelLevelAdvRev = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML); levelLayoutReviewer.addComponent(labelLevelAdvRev); labelLevelExpRev = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML); ; levelLayoutReviewer.addComponent(labelLevelExpRev); barLayoutReviewer.addComponent(levelLayoutReviewer); tableTasksReviewer = new Table(); popupViewTasksReviewer = new PopupView(null, tableTasksReviewer); barLayoutReviewer.addComponent(popupViewTasksReviewer); return badgeLayoutReviewer; }
From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java
License:Apache License
/** * @return badgeLayoutNetworker//w ww. j a v a 2 s . c o m */ private HorizontalLayout buildBadgeLayoutNetworker() { badgeLayoutNetworker = new HorizontalLayout(); badgeLayoutNetworker.setWidth("100%"); badgeLayoutNetworker.setMargin(false); badgeLayoutNetworker.setSpacing(false); imageLayoutNetworker = new VerticalLayout(); imageLayoutNetworker.setWidth("100%"); imageLayoutNetworker.setMargin(false); imageLayoutNetworker.setSpacing(false); badgeLayoutNetworker.addComponent(imageLayoutNetworker); badgeLayoutNetworker.setExpandRatio(imageLayoutNetworker, 0.2f); labelBadgeNetworker = new Label("Networker"); imageLayoutNetworker.addComponent(labelBadgeNetworker); imageBadgeNet.setId("NETWORKER"); imageLayoutNetworker.addComponent(imageBadgeNet); tableAchNetworker = new Table(); popupViewAchNetworker = new PopupView(null, tableAchNetworker); imageLayoutNetworker.addComponent(popupViewAchNetworker); barLayoutNetworker = new VerticalLayout(); barLayoutNetworker.setId("BL_NETWORKER"); barLayoutNetworker.setWidth("100%"); badgeLayoutNetworker.addComponent(barLayoutNetworker); badgeLayoutNetworker.setExpandRatio(barLayoutNetworker, 0.8f); starLayoutNetworker = new HorizontalLayout(); starLayoutNetworker.setWidth("100%"); starLayoutNetworker.setSpacing(false); starLayoutNetworker.setMargin(false); barLayoutNetworker.addComponent(starLayoutNetworker); starLayoutNetworker.addComponent(imageBadgeStar1Net); starLayoutNetworker.addComponent(imageBadgeStar2Net); starLayoutNetworker.addComponent(imageBadgeStar3Net); starLayoutNetworker.addComponent(imageBadgeFlagNet); progressBarNetworker = new ProgressBar(0.0f); progressBarNetworker.setId("PB_NETWORKER"); progressBarNetworker.setWidth("100%"); progressBarNetworker.setHeight("100%"); barLayoutNetworker.addComponent(progressBarNetworker); levelLayoutNetworker = new HorizontalLayout(); levelLayoutNetworker.setWidth("100%"); labelLevelNoviceNet = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML); levelLayoutNetworker.addComponent(labelLevelNoviceNet); labelLevelInterNet = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML); levelLayoutNetworker.addComponent(labelLevelInterNet); labelLevelAdvNet = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML); levelLayoutNetworker.addComponent(labelLevelAdvNet); labelLevelExpNet = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML); ; levelLayoutNetworker.addComponent(labelLevelExpNet); barLayoutNetworker.addComponent(levelLayoutNetworker); tableTasksNetworker = new Table(); popupViewTasksNetworker = new PopupView(null, tableTasksNetworker); barLayoutNetworker.addComponent(popupViewTasksNetworker); return badgeLayoutNetworker; }
From source file:org.eclipse.hawkbit.ui.management.targettable.TargetBulkUpdateWindowLayout.java
License:Open Source License
private static ProgressBar creatreProgressBar() { final ProgressBar progressBarIndicator = new ProgressBar(0F); progressBarIndicator.addStyleName("bulk-upload-label"); progressBarIndicator.setSizeFull();/*from w ww .ja v a2 s. c om*/ return progressBarIndicator; }
From source file:org.hip.vif.admin.admin.ui.UpgradeView.java
License:Open Source License
/** UpgradeView constructor. * * @param inVersionInstance String the instance's version (i.e. the version of the tables) * @param inVersionSoftware String the version according to the installed version * @param inThread {@link UpgradeTask} the thread managing the upgrade */ public UpgradeView(final String inVersionInstance, final String inVersionSoftware, final UpgradeThread inThread) { final IMessages lMessages = Activator.getMessages(); final VerticalLayout lLayout = initLayout(lMessages, "admin.menu.upgrade"); //$NON-NLS-1$ final Label lFeedbackMsg = new Label( String.format(TMPL_FEEDBACK, lMessages.getMessage("admin.upgrade.feedback.failure")), //$NON-NLS-1$ ContentMode.HTML);//from w ww. j a v a2 s . c o m lFeedbackMsg.setVisible(false); lLayout.addComponent(lFeedbackMsg); final Label lFailures = new Label("", ContentMode.HTML); //$NON-NLS-1$ lLayout.addComponent(lFailures); lFailures.setVisible(false); final LabelValueTable lTable = new LabelValueTable(); lTable.addRow(lMessages.getMessage("admin.upgrade.version.instance"), inVersionInstance); //$NON-NLS-1$ lTable.addRow(lMessages.getMessage("admin.upgrade.version.app"), inVersionSoftware); //$NON-NLS-1$ lLayout.addComponent(lTable); lLayout.addComponent(RiplaViewHelper.createSpacer()); final Button lUpgrade = new Button(lMessages.getMessage("admin.menu.upgrade")); //$NON-NLS-1$ lLayout.addComponent(lUpgrade); lLayout.addComponent(RiplaViewHelper.createSpacer()); final ProgressBar lProgress = new ProgressBar(new Float(0.0)); lProgress.setWidth(200, Unit.PIXELS); lProgress.setVisible(false); lLayout.addComponent(lProgress); lUpgrade.addClickListener(new Button.ClickListener() { @Override public void buttonClick(final ClickEvent inEvent) { lProgress.setVisible(true); lProgress.setEnabled(true); lUpgrade.setEnabled(false); UI.getCurrent().setPollInterval(POLL_RUN); final Collection<IVIFUpgrade> lFailed = inThread.upgrade(inVersionInstance, inVersionSoftware, lProgress); lProgress.setVisible(false); if (lFailed.isEmpty()) { lFeedbackMsg.setVisible(false); lFailures.setVisible(false); } else { lFeedbackMsg.setVisible(true); lFailures.setPropertyDataSource( new ObjectProperty<String>(renderFailures(lFailed), String.class)); lFailures.setVisible(true); } lUpgrade.setEnabled(true); } }); }