List of usage examples for com.vaadin.ui ProgressBar ProgressBar
public ProgressBar()
From source file:com.etest.valo.Tables.java
License:Apache License
static void configure(Table table, boolean footer, boolean sized, boolean expandRatios, boolean stripes, boolean verticalLines, boolean horizontalLines, boolean borderless, boolean headers, boolean compact, boolean small, boolean rowIndex, boolean rowCaption, boolean rowIcon, boolean componentsInRows) { table.setSelectable(true);/*from w w w . j a v a 2s. c om*/ table.setMultiSelect(true); table.setSortEnabled(true); table.setColumnCollapsingAllowed(true); table.setColumnReorderingAllowed(true); table.setPageLength(6); table.addActionHandler(MainUI.getActionHandler()); table.setDragMode(TableDragMode.MULTIROW); table.setDropHandler(new DropHandler() { @Override public AcceptCriterion getAcceptCriterion() { return AcceptAll.get(); } @Override public void drop(DragAndDropEvent event) { Notification.show(event.getTransferable().toString()); } }); table.setColumnAlignment(MainUI.DESCRIPTION_PROPERTY, Align.RIGHT); table.setColumnAlignment(MainUI.INDEX_PROPERTY, Align.CENTER); table.removeContainerProperty("textfield"); table.removeGeneratedColumn("textfield"); table.removeContainerProperty("button"); table.removeGeneratedColumn("button"); table.removeContainerProperty("label"); table.removeGeneratedColumn("label"); table.removeContainerProperty("checkbox"); table.removeGeneratedColumn("checkbox"); table.removeContainerProperty("datefield"); table.removeGeneratedColumn("datefield"); table.removeContainerProperty("combobox"); table.removeGeneratedColumn("combobox"); table.removeContainerProperty("optiongroup"); table.removeGeneratedColumn("optiongroup"); table.removeContainerProperty("slider"); table.removeGeneratedColumn("slider"); table.removeContainerProperty("progress"); table.removeGeneratedColumn("progress"); if (componentsInRows) { table.addContainerProperty("textfield", TextField.class, null); table.addGeneratedColumn("textfield", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { TextField tf = new TextField(); tf.setInputPrompt("Type here"); // tf.addStyleName("compact"); if ((Integer) itemId % 2 == 0) { tf.addStyleName("borderless"); } return tf; } }); table.addContainerProperty("datefield", TextField.class, null); table.addGeneratedColumn("datefield", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { DateField tf = new DateField(); tf.addStyleName("compact"); if ((Integer) itemId % 2 == 0) { tf.addStyleName("borderless"); } return tf; } }); table.addContainerProperty("combobox", TextField.class, null); table.addGeneratedColumn("combobox", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { ComboBox tf = new ComboBox(); tf.setInputPrompt("Select"); tf.addStyleName("compact"); if ((Integer) itemId % 2 == 0) { tf.addStyleName("borderless"); } return tf; } }); table.addContainerProperty("button", Button.class, null); table.addGeneratedColumn("button", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { Button b = new Button("Button"); b.addStyleName("small"); return b; } }); table.addContainerProperty("label", TextField.class, null); table.addGeneratedColumn("label", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { Label label = new Label("Label component"); label.setSizeUndefined(); label.addStyleName("bold"); return label; } }); table.addContainerProperty("checkbox", TextField.class, null); table.addGeneratedColumn("checkbox", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { CheckBox cb = new CheckBox(null, true); return cb; } }); table.addContainerProperty("optiongroup", TextField.class, null); table.addGeneratedColumn("optiongroup", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { OptionGroup op = new OptionGroup(); op.addItem("Male"); op.addItem("Female"); op.addStyleName("horizontal"); return op; } }); table.addContainerProperty("slider", TextField.class, null); table.addGeneratedColumn("slider", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { Slider s = new Slider(); s.setValue(30.0); return s; } }); table.addContainerProperty("progress", TextField.class, null); table.addGeneratedColumn("progress", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { ProgressBar bar = new ProgressBar(); bar.setValue(0.7f); return bar; } }); } table.setFooterVisible(footer); if (footer) { table.setColumnFooter(MainUI.CAPTION_PROPERTY, "caption"); table.setColumnFooter(MainUI.DESCRIPTION_PROPERTY, "description"); table.setColumnFooter(MainUI.ICON_PROPERTY, "icon"); table.setColumnFooter(MainUI.INDEX_PROPERTY, "index"); } if (sized) { table.setWidth("400px"); table.setHeight("300px"); } else { table.setSizeUndefined(); } if (expandRatios) { if (!sized) { table.setWidth("100%"); } } table.setColumnExpandRatio(MainUI.CAPTION_PROPERTY, expandRatios ? 1.0f : 0); table.setColumnExpandRatio(MainUI.DESCRIPTION_PROPERTY, expandRatios ? 1.0f : 0); if (!stripes) { table.addStyleName("no-stripes"); } else { table.removeStyleName("no-stripes"); } if (!verticalLines) { table.addStyleName("no-vertical-lines"); } else { table.removeStyleName("no-vertical-lines"); } if (!horizontalLines) { table.addStyleName("no-horizontal-lines"); } else { table.removeStyleName("no-horizontal-lines"); } if (borderless) { table.addStyleName("borderless"); } else { table.removeStyleName("borderless"); } if (!headers) { table.addStyleName("no-header"); } else { table.removeStyleName("no-header"); } if (compact) { table.addStyleName("compact"); } else { table.removeStyleName("compact"); } if (small) { table.addStyleName("small"); } else { table.removeStyleName("small"); } if (!rowIndex && !rowCaption && rowIcon) { table.setRowHeaderMode(RowHeaderMode.HIDDEN); } if (rowIndex) { table.setRowHeaderMode(RowHeaderMode.INDEX); } if (rowCaption) { table.setRowHeaderMode(RowHeaderMode.PROPERTY); table.setItemCaptionPropertyId(MainUI.CAPTION_PROPERTY); } else { table.setItemCaptionPropertyId(null); } if (rowIcon) { table.setRowHeaderMode(RowHeaderMode.ICON_ONLY); table.setItemIconPropertyId(MainUI.ICON_PROPERTY); } else { table.setItemIconPropertyId(null); } }
From source file:com.hivesys.dashboard.view.repository.RepositoryUpload.java
public RepositoryUpload() { final Label infoLabel = new Label("asasasasasasasxasx"); final VerticalLayout dropPane = new VerticalLayout(infoLabel); dropPane.setComponentAlignment(infoLabel, Alignment.MIDDLE_CENTER); dropPane.setWidth(280.0f, Unit.PIXELS); dropPane.setHeight(200.0f, Unit.PIXELS); dropPane.addStyleName("drop-area"); progress = new ProgressBar(); progress.setIndeterminate(true);//from w w w . j a va2 s . com progress.setVisible(false); dropPane.addComponent(progress); final DragAndDropBox dropBox = new DragAndDropBox(dropPane, progress) { @Override void processFile(String name, String type, ByteArrayOutputStream bas) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }; dropBox.setSizeUndefined(); }
From source file:com.logicbomb.newschool.MyAppWidgetSet.core.DayWidget.java
public DayWidget() { //Creating Panel Panel iPanel = new Panel(); iPanel.addStyleName("backColorWhite"); iPanel.setWidth("876px"); iPanel.setHeight("41px"); ProgressBar iDayProgressBar = new ProgressBar(); iDayProgressBar.setCaption("Period 3, 10th October"); iDayProgressBar.setWidth("875px"); iDayProgressBar.setValue(0.3f);/* w ww .ja v a 2 s.c om*/ addComponent(iDayProgressBar); //Adding Panel to Vertical Layout addComponent(iPanel); VerticalLayout iVerticalLayout = new VerticalLayout(); GridLayout iGridLayout = new GridLayout(9, 1); iGridLayout.setWidth("1000px"); iGridLayout.setHeight("40px"); for (int i = 1; i <= 8; i++) { HourWidget iHourAtAGlanceWidget = new HourWidget(i, 8); iHourAtAGlanceWidget.setSizeFull(); iGridLayout.addComponent(iHourAtAGlanceWidget); iGridLayout.setColumnExpandRatio(i, 1); } iVerticalLayout.addComponent(iGridLayout); iPanel.setContent(iVerticalLayout); }
From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.tagging.components.SearchEngineMetaDescription.java
License:Open Source License
private Component createSEOProgressBar() { ProgressBar seoProgressBar = new ProgressBar(); seoProgressBar.setWidth("250px"); seoProgressBar.setValue(0.5f);/*from w w w. j av a 2s .c o m*/ HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(new Label("SEO Rating:")); layout.addComponent(seoProgressBar); layout.setSpacing(true); layout.setMargin(new MarginInfo(false, false, true, false)); NativeButton addUpdateButton = new NativeButton("", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { // do nothing } }); addUpdateButton.addStyleName("update-button"); addUpdateButton.setHeight("28px"); addUpdateButton.setCaption("Update"); addUpdateButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { updateMetaDescriptionPreview(textArea.getValue()); } }); layout.addComponent(addUpdateButton); return layout; }
From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.umbrellacontent.UmbrellaContentViewImpl.java
License:Open Source License
private Component createSEOProgressBar() { ProgressBar seoProgressBar = new ProgressBar(); seoProgressBar.setWidth("300px"); seoProgressBar.setValue(0.5f);// ww w .j ava 2 s .c o m HorizontalLayout layout = new HorizontalLayout(); layout.addComponent(new Label("SEO Rating:")); layout.addComponent(seoProgressBar); layout.setSpacing(true); layout.setMargin(new MarginInfo(false, false, true, false)); return layout; }
From source file:com.oodrive.nuage.webui.VvrManagerUi.java
License:Apache License
/** * Add a progress bar for long task.//from w ww . j a va 2 s . c om * * @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 . jav a 2 s . c om */ 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);/*w w w. j a va 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 (!ReportEngineUI.isTestMode()) { ProgressBar pb3 = new ProgressBar(); pb3.setIndeterminate(true); pb3.setCaption("Indeterminate"); row.addComponent(pb3); } }
From source file:com.rex.components.valo.Tables.java
License:Apache License
static void configure(Table table, Grid grid, boolean footer, boolean sized, boolean expandRatios, boolean stripes, boolean verticalLines, boolean horizontalLines, boolean borderless, boolean headers, boolean compact, boolean small, boolean rowIndex, boolean rowCaption, boolean rowIcon, boolean componentsInRows) { table.setSelectable(true);/*from w w w. ja va 2s . c o m*/ table.setMultiSelect(true); grid.setSelectionMode(SelectionMode.MULTI); table.setSortEnabled(true); for (Column c : grid.getColumns()) { if (!c.getPropertyId().equals("icon")) { c.setSortable(true); } c.setHidable(true); } table.setColumnCollapsingAllowed(true); table.setColumnReorderingAllowed(true); grid.setColumnReorderingAllowed(true); table.setPageLength(6); grid.setHeightByRows(6); table.addActionHandler(ReportEngineUI.getActionHandler()); table.setDragMode(TableDragMode.MULTIROW); table.setDropHandler(new DropHandler() { @Override public AcceptCriterion getAcceptCriterion() { return AcceptAll.get(); } @Override public void drop(DragAndDropEvent event) { Notification.show(event.getTransferable().toString()); } }); table.setColumnAlignment(ReportEngineUI.DESCRIPTION_PROPERTY, Align.RIGHT); table.setColumnAlignment(ReportEngineUI.INDEX_PROPERTY, Align.CENTER); table.removeContainerProperty("textfield"); table.removeGeneratedColumn("textfield"); table.removeContainerProperty("button"); table.removeGeneratedColumn("button"); table.removeContainerProperty("label"); table.removeGeneratedColumn("label"); table.removeContainerProperty("checkbox"); table.removeGeneratedColumn("checkbox"); table.removeContainerProperty("datefield"); table.removeGeneratedColumn("datefield"); table.removeContainerProperty("combobox"); table.removeGeneratedColumn("combobox"); table.removeContainerProperty("optiongroup"); table.removeGeneratedColumn("optiongroup"); table.removeContainerProperty("slider"); table.removeGeneratedColumn("slider"); table.removeContainerProperty("progress"); table.removeGeneratedColumn("progress"); if (componentsInRows) { table.addContainerProperty("textfield", TextField.class, null); table.addGeneratedColumn("textfield", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { TextField tf = new TextField(); tf.setInputPrompt("Type here"); // tf.addStyleName("compact"); if ((Integer) itemId % 2 == 0) { tf.addStyleName("borderless"); } return tf; } }); table.addContainerProperty("datefield", TextField.class, null); table.addGeneratedColumn("datefield", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { DateField tf = new DateField(); tf.addStyleName("compact"); if ((Integer) itemId % 2 == 0) { tf.addStyleName("borderless"); } return tf; } }); table.addContainerProperty("combobox", TextField.class, null); table.addGeneratedColumn("combobox", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { ComboBox tf = new ComboBox(); tf.setInputPrompt("Select"); tf.addStyleName("compact"); if ((Integer) itemId % 2 == 0) { tf.addStyleName("borderless"); } return tf; } }); table.addContainerProperty("button", Button.class, null); table.addGeneratedColumn("button", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { Button b = new Button("Button"); b.addStyleName("small"); return b; } }); table.addContainerProperty("label", TextField.class, null); table.addGeneratedColumn("label", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { Label label = new Label("Label component"); label.setSizeUndefined(); label.addStyleName("bold"); return label; } }); table.addContainerProperty("checkbox", TextField.class, null); table.addGeneratedColumn("checkbox", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { CheckBox cb = new CheckBox(null, true); return cb; } }); table.addContainerProperty("optiongroup", TextField.class, null); table.addGeneratedColumn("optiongroup", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { OptionGroup op = new OptionGroup(); op.addItem("Male"); op.addItem("Female"); op.addStyleName("horizontal"); return op; } }); table.addContainerProperty("slider", TextField.class, null); table.addGeneratedColumn("slider", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { Slider s = new Slider(); s.setValue(30.0); return s; } }); table.addContainerProperty("progress", TextField.class, null); table.addGeneratedColumn("progress", new ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { ProgressBar bar = new ProgressBar(); bar.setValue(0.7f); return bar; } }); } table.setFooterVisible(footer); if (footer) { table.setColumnFooter(ReportEngineUI.CAPTION_PROPERTY, "caption"); table.setColumnFooter(ReportEngineUI.DESCRIPTION_PROPERTY, "description"); table.setColumnFooter(ReportEngineUI.ICON_PROPERTY, "icon"); table.setColumnFooter(ReportEngineUI.INDEX_PROPERTY, "index"); } if (sized) { table.setWidth("400px"); grid.setWidth("400px"); table.setHeight("300px"); grid.setHeight("300px"); } else { table.setSizeUndefined(); grid.setSizeUndefined(); } if (componentsInRows) { table.setWidth("100%"); } else { table.setWidth(null); } if (expandRatios) { if (!sized) { table.setWidth("100%"); } } table.setColumnExpandRatio(ReportEngineUI.CAPTION_PROPERTY, expandRatios ? 1.0f : 0); table.setColumnExpandRatio(ReportEngineUI.DESCRIPTION_PROPERTY, expandRatios ? 1.0f : 0); if (!stripes) { table.addStyleName("no-stripes"); } else { table.removeStyleName("no-stripes"); } if (!verticalLines) { table.addStyleName("no-vertical-lines"); } else { table.removeStyleName("no-vertical-lines"); } if (!horizontalLines) { table.addStyleName("no-horizontal-lines"); } else { table.removeStyleName("no-horizontal-lines"); } if (borderless) { table.addStyleName("borderless"); } else { table.removeStyleName("borderless"); } if (!headers) { table.addStyleName("no-header"); } else { table.removeStyleName("no-header"); } if (compact) { table.addStyleName("compact"); } else { table.removeStyleName("compact"); } if (small) { table.addStyleName("small"); } else { table.removeStyleName("small"); } if (!rowIndex && !rowCaption && rowIcon) { table.setRowHeaderMode(RowHeaderMode.HIDDEN); } if (rowIndex) { table.setRowHeaderMode(RowHeaderMode.INDEX); } if (rowCaption) { table.setRowHeaderMode(RowHeaderMode.PROPERTY); table.setItemCaptionPropertyId(ReportEngineUI.CAPTION_PROPERTY); } else { table.setItemCaptionPropertyId(null); } if (rowIcon) { table.setRowHeaderMode(RowHeaderMode.ICON_ONLY); table.setItemIconPropertyId(ReportEngineUI.ICON_PROPERTY); } else { table.setItemIconPropertyId(null); } }
From source file:com.trender.user.component.wizard.ListenStepWizardStudy.java
@Override public Component getContent() { content = new VerticalLayout(); content.setSizeFull();//from w ww . ja va 2s. com content.setMargin(true); mainText = new Label( "?, , ??? ?? ?!"); mainText.setStyleName("h2"); content.addComponent(mainText); progressBar = new ProgressBar(); progressBar.setWidth(100, Unit.PERCENTAGE); content.addComponent(progressBar); return content; }