List of usage examples for com.vaadin.ui ProgressBar setIndeterminate
public void setIndeterminate(boolean indeterminate)
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 www .j a v a2 s . c o m*/ } 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:com.cavisson.gui.dashboard.components.controls.Sliders.java
License:Apache License
public Sliders() { setMargin(true);//from w w w .ja v a 2 s .c om Label h1 = new Label("Sliders"); h1.addStyleName("h1"); addComponent(h1); HorizontalLayout row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); addComponent(row); Slider slider = new Slider("Horizontal"); slider.setValue(50.0); row.addComponent(slider); slider = new Slider("Horizontal, sized"); slider.setValue(50.0); slider.setWidth("200px"); row.addComponent(slider); slider = new Slider("Custom handle"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color1"); row.addComponent(slider); slider = new Slider("Custom track"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color2"); row.addComponent(slider); slider = new Slider("Custom indicator"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color3"); row.addComponent(slider); slider = new Slider("No indicator"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("no-indicator"); row.addComponent(slider); slider = new Slider("With ticks (not in IE8 & IE9)"); slider.setValue(3.0); slider.setWidth("200px"); slider.setMax(4); slider.addStyleName("ticks"); row.addComponent(slider); slider = new Slider("Toggle imitation"); slider.setWidth("50px"); slider.setResolution(0); slider.setMin(0); slider.setMax(1); row.addComponent(slider); slider = new Slider("Vertical"); slider.setValue(50.0); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Vertical, sized"); slider.setValue(50.0); slider.setOrientation(SliderOrientation.VERTICAL); slider.setHeight("200px"); row.addComponent(slider); slider = new Slider("Custom handle"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color1"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Custom track"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color2"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Custom indicator"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color3"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("No indicator"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("no-indicator"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("With ticks"); slider.setValue(3.0); slider.setHeight("200px"); slider.setMax(4); slider.addStyleName("ticks"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Disabled"); slider.setValue(50.0); slider.setEnabled(false); row.addComponent(slider); h1 = new Label("Progress Bars"); h1.addStyleName("h1"); addComponent(h1); row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); addComponent(row); pb = new ProgressBar(); pb.setCaption("Default"); pb.setWidth("300px"); // pb.setValue(0.6f); row.addComponent(pb); pb2 = new ProgressBar(); pb2.setCaption("Point style"); pb2.setWidth("300px"); pb2.addStyleName("point"); // pb2.setValue(0.6f); row.addComponent(pb2); if (!ValoThemeUI.isTestMode()) { ProgressBar pb3 = new ProgressBar(); pb3.setIndeterminate(true); pb3.setCaption("Indeterminate"); row.addComponent(pb3); } }
From source file:com.etest.valo.Sliders.java
License:Apache License
public Sliders() { setMargin(true);//w ww .j ava 2s . co m Label h1 = new Label("Sliders"); h1.addStyleName("h1"); addComponent(h1); HorizontalLayout row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); addComponent(row); Slider slider = new Slider("Horizontal"); slider.setValue(50.0); row.addComponent(slider); slider = new Slider("Horizontal, sized"); slider.setValue(50.0); slider.setWidth("200px"); row.addComponent(slider); slider = new Slider("Custom handle"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color1"); row.addComponent(slider); slider = new Slider("Custom track"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color2"); row.addComponent(slider); slider = new Slider("Custom indicator"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color3"); row.addComponent(slider); slider = new Slider("No indicator"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("no-indicator"); row.addComponent(slider); slider = new Slider("With ticks (not in IE8 & IE9)"); slider.setValue(3.0); slider.setWidth("200px"); slider.setMax(4); slider.addStyleName("ticks"); row.addComponent(slider); slider = new Slider("Toggle imitation"); slider.setWidth("50px"); slider.setResolution(0); slider.setMin(0); slider.setMax(1); row.addComponent(slider); slider = new Slider("Vertical"); slider.setValue(50.0); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Vertical, sized"); slider.setValue(50.0); slider.setOrientation(SliderOrientation.VERTICAL); slider.setHeight("200px"); row.addComponent(slider); slider = new Slider("Custom handle"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color1"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Custom track"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color2"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Custom indicator"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color3"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("No indicator"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("no-indicator"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("With ticks"); slider.setValue(3.0); slider.setHeight("200px"); slider.setMax(4); slider.addStyleName("ticks"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Disabled"); slider.setValue(50.0); slider.setEnabled(false); row.addComponent(slider); h1 = new Label("Progress Bars"); h1.addStyleName("h1"); addComponent(h1); row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); addComponent(row); pb = new ProgressBar(); pb.setCaption("Default"); pb.setWidth("300px"); // pb.setValue(0.6f); row.addComponent(pb); pb2 = new ProgressBar(); pb2.setCaption("Point style"); pb2.setWidth("300px"); pb2.addStyleName("point"); // pb2.setValue(0.6f); row.addComponent(pb2); if (!MainUI.isTestMode()) { ProgressBar pb3 = new ProgressBar(); pb3.setIndeterminate(true); pb3.setCaption("Indeterminate"); row.addComponent(pb3); } }
From source file:com.oodrive.nuage.webui.VvrManagerUi.java
License:Apache License
/** * Add a progress bar for long task.// w w w.j a v a2 s. com * * @return the layout */ public VerticalLayout addProgressBar() { final VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); final ProgressBar bar = new ProgressBar(); layout.addComponent(new Label("This operation can take some time. Please wait...")); bar.setIndeterminate(true); bar.setImmediate(true); layout.addComponent(bar); layout.setComponentAlignment(bar, Alignment.MIDDLE_CENTER); rootLayout.addComponent(layout, "top: 50%; left: 39%"); vvrManagerLayout.setEnabled(false); return layout; }
From source file:com.peergreen.webconsole.core.notifier.NotifierService.java
License:Open Source License
/** * Show current task/* w w w.j a v a 2 s . co m*/ */ protected void showTask() { if (currentTask == null) { currentTask = tasks.peek(); for (final Map.Entry<UI, HorizontalLayout> taskBar : tasksBars.entrySet()) { UI ui = taskBar.getKey(); if (isUIAvailable(ui)) { ui.access(new Runnable() { @Override public void run() { taskBar.getValue().removeAllComponents(); if (currentTask != null) { ProgressBar progressBar = new ProgressBar(); progressBar.setIndeterminate(true); progressBar.setVisible(true); taskBar.getValue().addComponent(progressBar); taskBar.getValue() .addComponent(new Label(currentTask.getMessage(), ContentMode.HTML)); } } }); } } } }
From source file:com.rex.components.valo.Sliders.java
License:Apache License
public Sliders() { setMargin(true);/*ww w . j a v a2 s . c o m*/ Label h1 = new Label("Sliders"); h1.addStyleName("h1"); addComponent(h1); HorizontalLayout row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); addComponent(row); Slider slider = new Slider("Horizontal"); slider.setValue(50.0); row.addComponent(slider); slider = new Slider("Horizontal, sized"); slider.setValue(50.0); slider.setWidth("200px"); row.addComponent(slider); slider = new Slider("Custom handle"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color1"); row.addComponent(slider); slider = new Slider("Custom track"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color2"); row.addComponent(slider); slider = new Slider("Custom indicator"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("color3"); row.addComponent(slider); slider = new Slider("No indicator"); slider.setValue(50.0); slider.setWidth("200px"); slider.addStyleName("no-indicator"); row.addComponent(slider); slider = new Slider("With ticks (not in IE8 & IE9)"); slider.setValue(3.0); slider.setWidth("200px"); slider.setMax(4); slider.addStyleName("ticks"); row.addComponent(slider); slider = new Slider("Toggle imitation"); slider.setWidth("50px"); slider.setResolution(0); slider.setMin(0); slider.setMax(1); row.addComponent(slider); slider = new Slider("Vertical"); slider.setValue(50.0); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Vertical, sized"); slider.setValue(50.0); slider.setOrientation(SliderOrientation.VERTICAL); slider.setHeight("200px"); row.addComponent(slider); slider = new Slider("Custom handle"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color1"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Custom track"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color2"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Custom indicator"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("color3"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("No indicator"); slider.setValue(50.0); slider.setHeight("200px"); slider.addStyleName("no-indicator"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("With ticks"); slider.setValue(3.0); slider.setHeight("200px"); slider.setMax(4); slider.addStyleName("ticks"); slider.setOrientation(SliderOrientation.VERTICAL); row.addComponent(slider); slider = new Slider("Disabled"); slider.setValue(50.0); slider.setEnabled(false); row.addComponent(slider); h1 = new Label("Progress Bars"); h1.addStyleName("h1"); addComponent(h1); row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); addComponent(row); pb = new ProgressBar(); pb.setCaption("Default"); pb.setWidth("300px"); // pb.setValue(0.6f); row.addComponent(pb); pb2 = new ProgressBar(); pb2.setCaption("Point style"); pb2.setWidth("300px"); pb2.addStyleName("point"); // pb2.setValue(0.6f); row.addComponent(pb2); if (!ReportEngineUI.isTestMode()) { ProgressBar pb3 = new ProgressBar(); pb3.setIndeterminate(true); pb3.setCaption("Indeterminate"); row.addComponent(pb3); } }
From source file:com.wintindustries.pfserver.interfaces.view.dashboard.LoadingView.java
public LoadingView() { setSizeFull();// ww w . j a v a 2 s . com VerticalLayout center = new VerticalLayout(); this.addComponent(center); this.setComponentAlignment(center, Alignment.MIDDLE_CENTER); center.setHeight("180px"); HorizontalLayout info = new HorizontalLayout(); Label title = new Label("PFServer Dashboard"); title.setSizeUndefined(); title.addStyleName(ValoTheme.LABEL_H4); title.addStyleName(ValoTheme.LABEL_COLORED); // center.addComponent(title); // center.setComponentAlignment(title, Alignment.BOTTOM_CENTER); Label loading = new Label("Initalizing"); loading.addStyleName(ValoTheme.LABEL_H1); loading.addStyleName(ValoTheme.LABEL_LIGHT); info.addComponent(loading); info.addComponent(title); info.setComponentAlignment(title, Alignment.MIDDLE_RIGHT); center.addComponent(info); info.setComponentAlignment(loading, Alignment.MIDDLE_LEFT); loading.setWidth("160px"); center.setComponentAlignment(info, Alignment.MIDDLE_CENTER); // center.addComponent(loading); // center.setComponentAlignment(loading, Alignment.TOP_CENTER); ProgressBar indeterminate = new ProgressBar(); indeterminate.setIndeterminate(true); center.addComponent(indeterminate); center.setComponentAlignment(indeterminate, Alignment.TOP_CENTER); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.HomeView.java
License:Open Source License
/** * sets the ContainerDataSource of this view. Should usually contain project information. Caption * is caption./*from w ww. jav a2s . c o m*/ * * @param homeViewInformation * @param caption */ public void setContainerDataSource(SpaceBean spaceBean, String newCaption) { caption = newCaption; currentBean = spaceBean; numberOfProjects = currentBean.getProjects().size(); projectGrid = new Grid(); GeneratedPropertyContainer gpcProjects = new GeneratedPropertyContainer(spaceBean.getProjects()); gpcProjects.removeContainerProperty("members"); gpcProjects.removeContainerProperty("id"); gpcProjects.removeContainerProperty("experiments"); gpcProjects.removeContainerProperty("contact"); gpcProjects.removeContainerProperty("contactPerson"); gpcProjects.removeContainerProperty("projectManager"); gpcProjects.removeContainerProperty("containsData"); gpcProjects.removeContainerProperty("containsResults"); gpcProjects.removeContainerProperty("containsAttachments"); gpcProjects.removeContainerProperty("description"); gpcProjects.removeContainerProperty("progress"); gpcProjects.removeContainerProperty("registrationDate"); gpcProjects.removeContainerProperty("registrator"); gpcProjects.removeContainerProperty("longDescription"); projectGrid.setContainerDataSource(gpcProjects); projectGrid.setHeightMode(HeightMode.ROW); projectGrid.setHeightByRows(20); // projectGrid.getColumn("space").setWidthUndefined(); // projectGrid.getColumn("code").setWidthUndefined(); // projectGrid.getColumn("secondaryName").setWidthUndefined(); // projectGrid.getColumn("principalInvestigator").setWidthUndefined(); projectGrid.getColumn("code").setHeaderCaption("Sub-Project").setWidth(150); // projectGrid.getColumn("space").setWidth(200); Column nameCol = projectGrid.getColumn("secondaryName"); nameCol.setHeaderCaption("Short Name"); nameCol.setMaximumWidth(450); projectGrid.getColumn("space").setMaximumWidth(350); projectGrid.getColumn("space").setHeaderCaption("Project"); projectGrid.getColumn("principalInvestigator").setHeaderCaption("Investigator"); projectGrid.setColumnOrder("code", "space", "secondaryName", "principalInvestigator"); projectGrid.setResponsive(true); helpers.GridFunctions.addColumnFilters(projectGrid, gpcProjects); gpcProjects.addGeneratedProperty("Summary", new PropertyValueGenerator<String>() { @Override public String getValue(Item item, Object itemId, Object propertyId) { return "show"; } @Override public Class<String> getType() { return String.class; } }); projectGrid.getColumn("Summary").setWidthUndefined(); projectGrid.getColumn("Summary").setRenderer(new ButtonRenderer(new RendererClickListener() { @Override public void click(RendererClickEvent event) { // Show loading window ProgressBar bar = new ProgressBar(); bar.setIndeterminate(true); VerticalLayout vl = new VerticalLayout(bar); vl.setComponentAlignment(bar, Alignment.MIDDLE_CENTER); vl.setWidth("50%"); vl.setSpacing(true); vl.setMargin(true); Window loadingWindow = new Window("Loading project summary..."); loadingWindow.setWidth("50%"); loadingWindow.setContent(vl); loadingWindow.center(); loadingWindow.setModal(true); loadingWindow.setResizable(false); QbicmainportletUI ui = (QbicmainportletUI) UI.getCurrent(); ui.addWindow(loadingWindow); // fetch summary and create docx in tmp folder ProjectBean proj = (ProjectBean) event.getItemId(); summaryFetcher.fetchSummaryComponent(proj.getCode(), proj.getSecondaryName(), proj.getDescription(), new ProjectSummaryReadyRunnable(summaryFetcher, loadingWindow, proj.getCode())); } })); projectGrid.getColumn("Summary").setWidth(100); projectGrid.addSelectionListener(new SelectionListener() { @Override public void select(SelectionEvent event) { Set<Object> selectedElements = event.getSelected(); if (selectedElements == null) { return; } ProjectBean selectedProject = (ProjectBean) selectedElements.iterator().next(); if (selectedProject == null) { return; } String entity = selectedProject.getId(); State state = (State) UI.getCurrent().getSession().getAttribute("state"); ArrayList<String> message = new ArrayList<String>(); message.add("clicked"); message.add(entity); message.add(ProjectView.navigateToLabel); state.notifyObservers(message); } }); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.PatientView.java
License:Open Source License
/** * //w w w. j a v a 2 s. c o m * @param list * @return */ private Component getMembersComponent() { membersLayout = new HorizontalLayout(); // membersLayout.setIcon(FontAwesome.USERS); // membersLayout.setCaption("Members"); membersLayout.setWidth("100%"); // final Button loadMembers = new Button("[+]"); // membersLayout.addComponent(loadMembers); // loadMembers.setStyleName(ValoTheme.BUTTON_LINK); // loadMembers.addClickListener(new ClickListener() { // @Override // public void buttonClick(ClickEvent event) { ProgressBar progress = new ProgressBar(); progress.setIndeterminate(true); Label info = new Label( "Searching for members. Can take several seconds on big projects. Please be patient."); info.setStyleName(ValoTheme.LABEL_SUCCESS); // membersLayout.addComponent(info); membersLayout.addComponent(progress); MemberWorker worker = new MemberWorker(); worker.start(); UI.getCurrent().setPollInterval(500); // loadMembers.setEnabled(false); return membersLayout; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.PatientView.java
License:Open Source License
public void loadGraph() { // LOGGER.debug(String.valueOf(graphSectionContent.getComponentCount() == 0)); if (graphSectionContent.getComponentCount() > 0) LOGGER.debug(String.valueOf(graphSectionContent.getComponent(0) instanceof Image)); if (graphSectionContent.getComponentCount() == 0 || !(graphSectionContent.getComponent(0) instanceof Image)) { ProgressBar progress = new ProgressBar(); progress.setIndeterminate(true); Label info = new Label( "Computing the project graph can take several seconds on big projects. Please be patient."); info.setStyleName(ValoTheme.LABEL_SUCCESS); graphSectionContent.removeAllComponents(); // graphSectionContent.addComponent(info); graphSectionContent.addComponent(progress); // graphSectionContent.setComponentAlignment(info, Alignment.MIDDLE_CENTER); graphSectionContent.setComponentAlignment(progress, Alignment.MIDDLE_CENTER); Worker worker = new Worker(getCurrent()); worker.start();/* w w w .j a v a 2s . c o m*/ UI.getCurrent().setPollInterval(500); } }