本文整理汇总了Java中com.vaadin.ui.ProgressBar类的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar类的具体用法?Java ProgressBar怎么用?Java ProgressBar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProgressBar类属于com.vaadin.ui包,在下文中一共展示了ProgressBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ReleasesView
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public ReleasesView() {
setSizeFull();
setMargin(false);
ButtonBar buttonBar = new ButtonBar();
addButton = buttonBar.addButton("Add", FontAwesome.PLUS, e -> add());
editButton = buttonBar.addButton("Edit", FontAwesome.EDIT, e -> edit());
exportButton = buttonBar.addButton("Export", FontAwesome.DOWNLOAD, e -> export());
archiveButton = buttonBar.addButton("Archive", FontAwesome.ARCHIVE, e -> archive());
// TODO add support for the archive button
archiveButton.setVisible(false);
finalizeButton = buttonBar.addButton("Finalize", FontAwesome.CUBE, e -> finalize());
addComponent(buttonBar);
enableDisableButtonsForSelectionSize(0);
grid = new Grid();
grid.setSizeFull();
grid.setSelectionMode(SelectionMode.MULTI);
grid.addItemClickListener(e->rowClicked(e));
grid.addSelectionListener((e) -> rowSelected(e));
container = new BeanItemContainer<>(ReleasePackage.class);
grid.setContainerDataSource(container);
grid.setColumns("name", "versionLabel", "releaseDate", "released");
grid.sort("releaseDate", SortDirection.DESCENDING);
addComponent(grid);
setExpandRatio(grid, 1);
progressBar = new ProgressBar(0.0f);
}
示例2: initView
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
private void initView() {
this.loadingSign = new ProgressBar();
this.loadingSign.setIndeterminate(true);
this.loadingSign.setId("loadingSign");
Label title = new Label("Available models");
title.setId("label_availableModels");
addComponent(title);
this.availableModelsTree = new Tree();
this.availableModelsTree.setId("tree_availableModels");
this.availableModelsTree.setWidth(30, Unit.EM);
Tree tree = availableModelsTree;
tree.addContainerProperty(CAPTION_PROPERTY, String.class, "");
tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
tree.setItemCaptionPropertyId(CAPTION_PROPERTY);
this.buttonStartSession = new Button("Start");
this.buttonStartSession.setId("button_start");
this.buttonStartSession.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
String selectedModelPath = (String) tree.getValue();
if(selectedModelPath.endsWith(".wtspec4m")) {
startSession(selectedModelPath);
}
}
});
addComponent(this.buttonStartSession);
addComponent(this.loadingSign);
Panel treeViewContainer = new Panel();
treeViewContainer.setId("panel_treeViewContainer");
treeViewContainer.setContent(this.availableModelsTree);
addComponent(treeViewContainer);
}
示例3: ProgressIndicatorWindow
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public ProgressIndicatorWindow() {
center();
setVisible(true);
setResizable(false);
setDraggable(false);
setImmediate(true);
setModal(true);
setClosable(false);
setCaption("Loading");
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setWidth("100%");
this.currentStatus = new Label();
this.currentStatus.addStyleName(StyleConstants.TEXT_ALIGN_CENTER);
this.currentStatus.setSizeFull();
this.currentStatus.setImmediate(true);
ProgressBar progressBar = new ProgressBar();
progressBar.setSizeFull();
progressBar.setIndeterminate(true);
progressBar.setImmediate(true);
progressBar.setVisible(true);
layout.addComponent(progressBar);
layout.addComponent(this.currentStatus);
layout.setComponentAlignment(this.currentStatus, Alignment.MIDDLE_CENTER);
layout.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER);
setContent(layout);
}
示例4: UIWorkProgressTracker
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
protected UIWorkProgressTracker(final AbstractPrototypeComponent parent)
{
super(parent, new HorizontalLayout());
this.progressor = new ProgressBar();
this.status = new Label();
setSizeFull();
defineWithin(super.layout);
SimpleEventManager.getInstance().attach(new JobProgressHandler(JobHasProgressedEvent.class));
SimpleEventManager.getInstance().attach(new JobJustStartedHandler(JobJustStartedEvent.class));
SimpleEventManager.getInstance().attach(new JobDoneHandler(JobDoneEvent.class));
}
示例5: receiveUpload
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
@Override
public OutputStream receiveUpload(String filename, String mimeType) {
importLayout.removeAllComponents();
ProgressBar bar = new ProgressBar();
bar.setIndeterminate(true);
importLayout.addComponent(bar);
importLayout.setComponentAlignment(bar, Alignment.MIDDLE_CENTER);
return os;
}
示例6: refreshDetails
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
protected void refreshDetails(final Trigger trigger, final IDb db, final Settings settings) {
final HorizontalLayout executingLayout = new HorizontalLayout();
executingLayout.setSizeFull();
final ProgressBar p = new ProgressBar();
p.setIndeterminate(true);
executingLayout.addComponent(p);
tabSheet.addTab(executingLayout, "Details", FontAwesome.SPINNER, 0);
tabSheet.setSelectedTab(executingLayout);
TriggerTableLayout triggerTable = new TriggerTableLayout(trigger, settings, new Refresher() {
public void refresh() {
tabSheet.removeTab(tabSheet.getTab(0));
refreshDetails(trigger, db, settings);
}
});
boolean select = tabSheet.getSelectedTab().equals(executingLayout);
tabSheet.removeComponent(executingLayout);
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSizeFull();
layout.addComponent(triggerTable);
tabSheet.addTab(layout, "Details", null, 0);
if (select) {
tabSheet.setSelectedTab(layout);
}
}
示例7: UploadComponent
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public UploadComponent(String buttonCaption, String sessionId, int maxSize, String folderPath) {
upload = new Upload();
this.addComponent(upload);
this.maxSize = maxSize;
upload.setReceiver( this);
this.directory = folderPath;
upload.setButtonCaption(buttonCaption);
upload.addSucceededListener((Upload.SucceededListener) this);
upload.addFailedListener((Upload.FailedListener) this);
upload.addProgressListener((Upload.ProgressListener) this);
upload.addFinishedListener((Upload.FinishedListener) this);
processingLayout = new HorizontalLayout();
processingLayout.setSpacing(true);
processingLayout.setVisible(false);
this.addComponent(processingLayout);
progressBar = new ProgressBar();
processingLayout.addComponent(progressBar);
cancelProcessing = new Button("cancel", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
cancelled = true;
upload.interruptUpload();
}
});
processingLayout.addComponent(cancelProcessing);
}
示例8: ProgressBarIndicator
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public ProgressBarIndicator() {
super("progressBar");
this.progressIndicator = new ProgressBar();
this.progressIndicator.setWidth("100%");
this.progressStatusLabel = new Label();
this.progressStatusLabel.setWidth("100%");
this.progressStatusLabel.setHeight("100%");
this.addComponent(this.progressIndicator, "progressbar-container");
this.addComponent(this.progressStatusLabel, "progressbar-status");
}
示例9: LazyLoadingIndicator
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
/**
* Create new lazy loading indicator with given message
* @param message Message shown to user
*/
public LazyLoadingIndicator(String message) {
addStyleName("lazy-loading");
progressBar = new ProgressBar();
progressBar.addStyleName("lazy-loading-pbar");
progressBar.setIndeterminate(true);
addComponent(progressBar);
messageLabel = new Label(message != null ? message : DEFAULT_MESSAGE);
messageLabel.addStyleName("lazy-loading-message");
addComponent(messageLabel);
}
示例10: startProcessor
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
protected void startProcessor() {
final ProgressBar progressBar = new ProgressBar();
progressBar.setWidth(400, Unit.PIXELS);
final Window progressWindow = new Window("Progress", progressBar);
progressWindow.setClosable(false);
progressWindow.setResizable(false);
progressWindow.center();
new Thread(new Runnable() {
@Override
public void run() {
new Processor(new ProgressListener() {
@Override
public void onProgress(final long progress) {
UI.getCurrent().access(new Runnable() {
@Override
public void run() {
// 0 .. 1
final float progressBarValue = (float) progress / Processor.MAX_PROGRESS;
progressBar.setValue(progressBarValue);
if (progress == Processor.MAX_PROGRESS) {
UI.getCurrent().setPollInterval(-1);
UI.getCurrent().removeWindow(progressWindow);
}
}
});
}
}).run();
}
}).start();
UI.getCurrent().setPollInterval(250);
UI.getCurrent().addWindow(progressWindow);
}
示例11: getToolbar
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public HorizontalLayout getToolbar() {
if (toolbarLayout == null) {
toolbarLayout = new HorizontalLayout();
toolbarLayout.addComponent(super.createRefreshButton(this));
Label spaceEater = new Label(" ");
toolbarLayout.addComponent(spaceEater);
toolbarLayout.setExpandRatio(spaceEater, 1);
diskUsageBar = new ProgressBar(0f);
diskUsageBar.setCaption(DISK_USAGE_BAR_CAPTION);
diskUsageBar.setStyleName("big");
diskUsageBar.setWidth(300, Unit.PIXELS);
toolbarLayout.addComponent(diskUsageBar);
toolbarLayout.setExpandRatio(diskUsageBar, 1);
toolbarLayout.addComponent(super.getApp().getTitle());
toolbarLayout.setWidth("100%");
toolbarLayout.setStyleName("toolbar");
}
return toolbarLayout;
}
示例12: ImportSelectFile
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public ImportSelectFile(final ImportWizardView importView)
{
this.progressBar = new ProgressBar();
this.progressBar.setCaption("Progress");
this.progressBar.setWidth("100%");
this.progressBar.setHeight(100.0f, Unit.POINTS);
}
示例13: creatreProgressBar
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
private static ProgressBar creatreProgressBar() {
final ProgressBar progressBarIndicator = new ProgressBar(0F);
progressBarIndicator.addStyleName("bulk-upload-label");
progressBarIndicator.setSizeFull();
return progressBarIndicator;
}
示例14: getProgressBar
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
/**
* @return the progressBar
*/
public ProgressBar getProgressBar() {
return progressBar;
}
示例15: InProgressDialog
import com.vaadin.ui.ProgressBar; //导入依赖的package包/类
public InProgressDialog(String caption, InProgressWorker<T> worker, BackgroundRefresherService backgroundService, String failureMessage) {
this.backgroundService = backgroundService;
this.worker = worker;
this.failureMessage = failureMessage;
setWidth(300, Unit.PIXELS);
setHeight(150, Unit.PIXELS);
setCaption("Working...");
setModal(true);
VerticalLayout content = new VerticalLayout();
setContent(content);
HorizontalLayout middle = new HorizontalLayout();
middle.setSpacing(true);
middle.setMargin(true);
ProgressBar pg = new ProgressBar();
pg.setIndeterminate(true);
middle.addComponent(pg);
if (isNotBlank(caption)) {
Label label = new Label(caption);
middle.addComponent(label);
}
content.addComponent(middle);
content.setExpandRatio(middle, 1);
HorizontalLayout buttonBar = new HorizontalLayout();
buttonBar.setWidth(100, Unit.PERCENTAGE);
buttonBar.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
Button dismiss = new Button("Dismiss");
dismiss.addStyleName(ValoTheme.BUTTON_PRIMARY);
dismiss.setClickShortcut(KeyCode.ENTER);
dismiss.addClickListener(new ClickListener() {
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
InProgressDialog.this.close();
}
});
buttonBar.addComponent(dismiss);
buttonBar.setComponentAlignment(dismiss, Alignment.MIDDLE_RIGHT);
content.addComponent(buttonBar);
}