Example usage for com.vaadin.shared Position MIDDLE_CENTER

List of usage examples for com.vaadin.shared Position MIDDLE_CENTER

Introduction

In this page you can find the example usage for com.vaadin.shared Position MIDDLE_CENTER.

Prototype

Position MIDDLE_CENTER

To view the source code for com.vaadin.shared Position MIDDLE_CENTER.

Click Source Link

Usage

From source file:com.cavisson.gui.dashboard.components.controls.CommonParts.java

License:Apache License

Panel notifications() {
    Panel p = new Panel("Notifications");
    VerticalLayout content = new VerticalLayout() {
        Notification notification = new Notification("");
        TextField title = new TextField("Title");
        TextArea description = new TextArea("Description");
        MenuBar style = new MenuBar();
        MenuBar type = new MenuBar();
        String typeString = "";
        String styleString = "";
        TextField delay = new TextField();
        {/*from   ww w.  ja  v  a  2 s  .  c om*/
            setSpacing(true);
            setMargin(true);

            title.setInputPrompt("Title for the notification");
            title.addValueChangeListener(new ValueChangeListener() {
                @Override
                public void valueChange(final ValueChangeEvent event) {
                    if (title.getValue() == null || title.getValue().length() == 0) {
                        notification.setCaption(null);
                    } else {
                        notification.setCaption(title.getValue());
                    }
                }
            });
            title.setValue("Notification Title");
            title.setWidth("100%");
            addComponent(title);

            description.setInputPrompt("Description for the notification");
            description.addStyleName("small");
            description.addValueChangeListener(new ValueChangeListener() {
                @Override
                public void valueChange(final ValueChangeEvent event) {
                    if (description.getValue() == null || description.getValue().length() == 0) {
                        notification.setDescription(null);
                    } else {
                        notification.setDescription(description.getValue());
                    }
                }
            });
            description.setValue(
                    "A more informative message about what has happened. Nihil hic munitissimus habendi senatus locus, nihil horum? Inmensae subtilitatis, obscuris et malesuada fames. Hi omnes lingua, institutis, legibus inter se differunt.");
            description.setWidth("100%");
            addComponent(description);

            Command typeCommand = new Command() {
                @Override
                public void menuSelected(final MenuItem selectedItem) {
                    if (selectedItem.getText().equals("Humanized")) {
                        typeString = "";
                        notification.setStyleName(styleString.trim());
                    } else {
                        typeString = selectedItem.getText().toLowerCase();
                        notification.setStyleName((typeString + " " + styleString.trim()).trim());
                    }
                    for (MenuItem item : type.getItems()) {
                        item.setChecked(false);
                    }
                    selectedItem.setChecked(true);
                }
            };

            type.setCaption("Type");
            MenuItem humanized = type.addItem("Humanized", typeCommand);
            humanized.setCheckable(true);
            humanized.setChecked(true);
            type.addItem("Tray", typeCommand).setCheckable(true);
            type.addItem("Warning", typeCommand).setCheckable(true);
            type.addItem("Error", typeCommand).setCheckable(true);
            type.addItem("System", typeCommand).setCheckable(true);
            addComponent(type);
            type.addStyleName("small");

            Command styleCommand = new Command() {
                @Override
                public void menuSelected(final MenuItem selectedItem) {
                    styleString = "";
                    for (MenuItem item : style.getItems()) {
                        if (item.isChecked()) {
                            styleString += " " + item.getText().toLowerCase();
                        }
                    }
                    if (styleString.trim().length() > 0) {
                        notification.setStyleName((typeString + " " + styleString.trim()).trim());
                    } else if (typeString.length() > 0) {
                        notification.setStyleName(typeString.trim());
                    } else {
                        notification.setStyleName(null);
                    }
                }
            };

            style.setCaption("Additional style");
            style.addItem("Dark", styleCommand).setCheckable(true);
            style.addItem("Success", styleCommand).setCheckable(true);
            style.addItem("Failure", styleCommand).setCheckable(true);
            style.addItem("Bar", styleCommand).setCheckable(true);
            style.addItem("Small", styleCommand).setCheckable(true);
            style.addItem("Closable", styleCommand).setCheckable(true);
            addComponent(style);
            style.addStyleName("small");

            CssLayout group = new CssLayout();
            group.setCaption("Fade delay");
            group.addStyleName("v-component-group");
            addComponent(group);

            delay.setInputPrompt("Infinite");
            delay.addStyleName("align-right");
            delay.addStyleName("small");
            delay.setWidth("7em");
            delay.addValueChangeListener(new ValueChangeListener() {
                @Override
                public void valueChange(final ValueChangeEvent event) {
                    try {
                        notification.setDelayMsec(Integer.parseInt(delay.getValue()));
                    } catch (Exception e) {
                        notification.setDelayMsec(-1);
                        delay.setValue("");
                    }

                }
            });
            delay.setValue("1000");
            group.addComponent(delay);

            Button clear = new Button(null, new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    delay.setValue("");
                }
            });
            clear.setIcon(FontAwesome.TIMES_CIRCLE);
            clear.addStyleName("last");
            clear.addStyleName("small");
            clear.addStyleName("icon-only");
            group.addComponent(clear);
            group.addComponent(new Label("  msec", ContentMode.HTML));

            GridLayout grid = new GridLayout(3, 3);
            grid.setCaption("Show in position");
            addComponent(grid);
            grid.setSpacing(true);

            Button pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.TOP_LEFT);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.TOP_CENTER);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.TOP_RIGHT);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.MIDDLE_LEFT);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.MIDDLE_CENTER);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.MIDDLE_RIGHT);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.BOTTOM_LEFT);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.BOTTOM_CENTER);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

            pos = new Button("", new ClickListener() {
                @Override
                public void buttonClick(final ClickEvent event) {
                    notification.setPosition(Position.BOTTOM_RIGHT);
                    notification.show(Page.getCurrent());
                }
            });
            pos.addStyleName("small");
            grid.addComponent(pos);

        }
    };
    p.setContent(content);

    return p;
}

From source file:com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget.java

License:Apache License

public CubaFileUploadWidget() {
    submitButton = new VButton();
    submitButton.addClickHandler(new ClickHandler() {
        @Override// w  w  w.  j  a v a 2  s .  c  o  m
        public void onClick(ClickEvent event) {
            fireNativeClick(getFileInputElement());
        }
    });
    add(submitButton);
    submitButton.setTabIndex(-1);

    setStyleName(DEFAULT_CLASSNAME);

    Element inputElement = Document.get().createFileInputElement();
    inputElement.setAttribute("name", "files[]");
    inputElement.setAttribute("title", " ");
    listenToFocusEvents(inputElement);

    getElement().appendChild(inputElement);

    fileUpload = new JQueryFileUploadOverlay(this) {
        protected boolean canceled = false;

        @Override
        protected boolean isValidFile(String name, double size) {
            if (fileSizeLimit > 0 && size > fileSizeLimit) {
                if (filePermissionsHandler != null) {
                    filePermissionsHandler.fileSizeLimitExceeded(name);
                }
                return false;
            }

            if (hasInvalidExtension(name)) {
                if (filePermissionsHandler != null) {
                    filePermissionsHandler.fileExtensionNotAllowed(name);
                }
                return false;
            }

            return true;
        }

        protected boolean hasInvalidExtension(String name) {
            if (permittedExtensions != null && !permittedExtensions.isEmpty()) {
                if (name.lastIndexOf(".") > 0) {
                    String fileExtension = name.substring(name.lastIndexOf("."), name.length());
                    return !permittedExtensions.contains(fileExtension.toLowerCase());
                }
                return true;
            }
            return false;
        }

        @Override
        protected void queueUploadStart() {
            // listen to events of new input element
            listenToFocusEvents(getFileInputElement());

            progressWindow = new CubaFileUploadProgressWindow();
            progressWindow.setOwner(CubaFileUploadWidget.this);
            progressWindow.addStyleName(getStylePrimaryName() + "-progresswindow");

            progressWindow.setVaadinModality(true);
            progressWindow.setDraggable(true);
            progressWindow.setResizable(false);
            progressWindow.setClosable(true);

            progressWindow.setCaption(progressWindowCaption);
            progressWindow.setCancelButtonCaption(cancelButtonCaption);

            progressWindow.closeListener = new CubaFileUploadProgressWindow.CloseListener() {
                @Override
                public void onClose() {
                    canceled = true;
                    // null progress to prevent repeated hide() call inside cancelUploading
                    progressWindow = null;

                    cancelUploading();

                    if (queueUploadListener != null) {
                        queueUploadListener.uploadFinished();
                    }
                }
            };

            progressWindow.setVisible(false);
            progressWindow.show();
            progressWindow.center();
            progressWindow.setVisible(true);

            canceled = false;
        }

        @Override
        protected void fileUploadStart(String fileName) {
            if (progressWindow != null) {
                progressWindow.setCurrentFileName(fileName);
            }
        }

        @Override
        protected void fileUploadSucceed(String fileName) {
            if (fileUploadedListener != null) {
                fileUploadedListener.fileUploaded(fileName);
            }
        }

        @Override
        protected void uploadProgress(double loaded, double total) {
            if (progressWindow != null) {
                float ratio = (float) (loaded / total);
                progressWindow.setProgress(ratio);
            }
        }

        @Override
        protected void queueUploadStop() {
            if (progressWindow != null) {
                progressWindow.hide();
                progressWindow = null;
            }

            getFileInputElement().focus();

            if (queueUploadListener != null) {
                queueUploadListener.uploadFinished();
            }
        }

        @Override
        protected void uploadFailed(String textStatus, String errorThrown) {
            if (ignoreExceptions) {
                if (progressWindow != null)
                    progressWindow.hide();
                return;
            }

            if (!canceled) {
                if (unableToUploadFileMessage != null) {
                    // show notification without server round trip, server may be unreachable
                    VNotification notification = VNotification.createNotification(-1,
                            CubaFileUploadWidget.this);
                    String fileName = "";
                    if (progressWindow != null) {
                        fileName = progressWindow.getCurrentFileName();
                    }

                    String message = "<h1>"
                            + WidgetUtil.escapeHTML(unableToUploadFileMessage.replace("%s", fileName))
                            + "</h1>";
                    notification.show(message, Position.MIDDLE_CENTER, "error");
                }

                canceled = true;
                cancelUploading();
            }
        }
    };
}

From source file:com.haulmont.cuba.web.widgets.client.jqueryfileupload.CubaFileUploadWidget.java

License:Apache License

public CubaFileUploadWidget() {
    submitButton = new VButton();
    submitButton.addClickHandler(new ClickHandler() {
        @Override//  w  w w.  j  ava2s. c om
        public void onClick(ClickEvent event) {
            fireNativeClick(getFileInputElement());
        }
    });
    add(submitButton);
    submitButton.setTabIndex(-1);

    setStyleName(DEFAULT_CLASSNAME);

    Element inputElement = Document.get().createFileInputElement();
    inputElement.setAttribute("name", "files[]");
    if (!BrowserInfo.get().isIE() && !BrowserInfo.get().isEdge()) {
        inputElement.setAttribute("title", " ");
    }
    listenToFocusEvents(inputElement);

    getElement().appendChild(inputElement);

    fileUpload = new JQueryFileUploadOverlay(this) {
        protected boolean canceled = false;

        @Override
        protected boolean isValidFile(String name, double size) {
            if (fileSizeLimit > 0 && size > fileSizeLimit) {
                if (filePermissionsHandler != null) {
                    filePermissionsHandler.fileSizeLimitExceeded(name);
                }
                return false;
            }

            if (hasInvalidExtension(name)) {
                if (filePermissionsHandler != null) {
                    filePermissionsHandler.fileExtensionNotAllowed(name);
                }
                return false;
            }

            return true;
        }

        protected boolean hasInvalidExtension(String name) {
            if (permittedExtensions != null && !permittedExtensions.isEmpty()) {
                if (name.lastIndexOf(".") > 0) {
                    String fileExtension = name.substring(name.lastIndexOf("."), name.length());
                    return !permittedExtensions.contains(fileExtension.toLowerCase());
                }
                return true;
            }
            return false;
        }

        @Override
        protected void queueUploadStart() {
            // listen to events of new input element
            listenToFocusEvents(getFileInputElement());

            progressWindow = new CubaFileUploadProgressWindow();
            progressWindow.setOwner(CubaFileUploadWidget.this);
            progressWindow.addStyleName(getStylePrimaryName() + "-progresswindow");

            progressWindow.setVaadinModality(true);
            progressWindow.setDraggable(true);
            progressWindow.setResizable(false);
            progressWindow.setClosable(true);

            progressWindow.setCaption(progressWindowCaption);
            progressWindow.setCancelButtonCaption(cancelButtonCaption);

            progressWindow.closeListener = new CubaFileUploadProgressWindow.CloseListener() {
                @Override
                public void onClose() {
                    canceled = true;
                    // null progress to prevent repeated hide() call inside cancelUploading
                    progressWindow = null;

                    cancelUploading();

                    if (queueUploadListener != null) {
                        queueUploadListener.uploadFinished();
                    }
                }
            };

            progressWindow.setVisible(false);
            progressWindow.show();
            progressWindow.center();
            progressWindow.setVisible(true);

            canceled = false;
        }

        @Override
        protected void fileUploadStart(String fileName) {
            if (progressWindow != null) {
                progressWindow.setCurrentFileName(fileName);
            }
        }

        @Override
        protected void fileUploadSucceed(String fileName) {
            if (fileUploadedListener != null) {
                fileUploadedListener.fileUploaded(fileName);
            }
        }

        @Override
        protected void uploadProgress(double loaded, double total) {
            if (progressWindow != null) {
                float ratio = (float) (loaded / total);
                progressWindow.setProgress(ratio);
            }
        }

        @Override
        protected void queueUploadStop() {
            if (progressWindow != null) {
                progressWindow.hide();
                progressWindow = null;
            }

            getFileInputElement().focus();

            if (queueUploadListener != null) {
                queueUploadListener.uploadFinished();
            }
        }

        @Override
        protected void uploadFailed(String textStatus, String errorThrown) {
            if (ignoreExceptions) {
                if (progressWindow != null)
                    progressWindow.hide();
                return;
            }

            if (!canceled) {
                if (unableToUploadFileMessage != null) {
                    // show notification without server round trip, server may be unreachable
                    VNotification notification = VNotification.createNotification(-1,
                            CubaFileUploadWidget.this);
                    String fileName = "";
                    if (progressWindow != null) {
                        fileName = progressWindow.getCurrentFileName();
                    }

                    String message = "<h1>"
                            + WidgetUtil.escapeHTML(unableToUploadFileMessage.replace("%s", fileName))
                            + "</h1>";
                    notification.show(message, Position.MIDDLE_CENTER, "error");
                }

                canceled = true;
                cancelUploading();
            }
        }
    };
}

From source file:com.jain.addon.component.upload.JUploader.java

License:Apache License

protected void interruptUpload() {
    upload.interruptUpload();/*w  w  w .  j  a v  a 2 s. c o  m*/
    I18NProvider provider = ((I18NUI) getUI()).getI18nProvider();
    Notification n = new Notification(provider.getTitle(getLocale(), interruptionMessage),
            Type.TRAY_NOTIFICATION);
    n.setPosition(Position.MIDDLE_CENTER);
    n.setDescription(provider.getMessage(getLocale(), interruptionMessage));
    n.show(getUI().getPage());
    pi.setVisible(false);
    upload.setVisible(true);
}

From source file:com.jain.addon.helper.JNHelper.java

License:Apache License

/**
 * Method to create Notification//from  www .  j  a  va  2s.  co m
 * @param currentUI
 * @param title
 * @param message
 * @param params
 * @return Notification
 */
public static Notification createNotification(UI currentUI, String title, String message, Object... params) {
    I18NProvider provider = null;
    if (currentUI instanceof I18NUI)
        provider = ((I18NUI) currentUI).getI18nProvider();
    else
        provider = DefaultI18NResourceProvider.instance();

    Notification notification = new Notification(provider.getTitle(currentUI.getLocale(), title, params),
            Notification.Type.TRAY_NOTIFICATION);
    notification.setPosition(Position.MIDDLE_CENTER);
    notification.setDescription(provider.getMessage(currentUI.getLocale(), message, params));
    return notification;
}

From source file:com.jain.common.VaadinHelper.java

License:Apache License

public static Notification createNotificationMessage(String title, String message, Object... params) {
    I18NProvider provider = DefaultI18NResourceProvider.instance();
    AuthenticatedUser currentUser = CDIComponent.getInstance(AuthenticatedUser.class);
    Notification n = new Notification(provider.getTitle(currentUser.getLocale(), title, params),
            Notification.Type.TRAY_NOTIFICATION);
    n.setPosition(Position.MIDDLE_CENTER);
    n.setDescription(provider.getMessage(currentUser.getLocale(), message, params));
    return n;//from  ww  w .ja  v a  2s .  c o m
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.PatientStatusComponent.java

License:Open Source License

public void updateUI(final ProjectBean currentBean) {
    BeanItemContainer<ExperimentStatusBean> experimentstatusBeans = datahandler
            .computeIvacPatientStatus(currentBean);

    int finishedExperiments = 0;
    status.removeAllComponents();//from   ww  w  . j a  va2 s.c o m
    status.setWidth(100.0f, Unit.PERCENTAGE);

    // Generate button caption column
    final GeneratedPropertyContainer gpc = new GeneratedPropertyContainer(experimentstatusBeans);
    gpc.addGeneratedProperty("started", new PropertyValueGenerator<String>() {

        @Override
        public Class<String> getType() {
            return String.class;
        }

        @Override
        public String getValue(Item item, Object itemId, Object propertyId) {
            String status = null;

            if ((double) item.getItemProperty("status").getValue() > 0.0) {
                status = "<span class=\"v-icon\" style=\"font-family: " + FontAwesome.CHECK.getFontFamily()
                        + ";color:" + "#2dd085" + "\">&#x"
                        + Integer.toHexString(FontAwesome.CHECK.getCodepoint()) + ";</span>";
            } else {
                status = "<span class=\"v-icon\" style=\"font-family: " + FontAwesome.TIMES.getFontFamily()
                        + ";color:" + "#f54993" + "\">&#x"
                        + Integer.toHexString(FontAwesome.TIMES.getCodepoint()) + ";</span>";
            }

            return status.toString();
        }
    });
    gpc.removeContainerProperty("identifier");

    experiments.setContainerDataSource(gpc);
    // experiments.setHeaderVisible(false);
    // experiments.setHeightMode(HeightMode.ROW);
    experiments.setHeightByRows(gpc.size());
    experiments.setWidth(Page.getCurrent().getBrowserWindowWidth() * 0.6f, Unit.PIXELS);

    experiments.getColumn("status").setRenderer(new ProgressBarRenderer());
    // experiments.setColumnOrder("started", "code", "description", "status", "download",
    // "runWorkflow");
    experiments.setColumnOrder("started", "code", "description", "status", "workflow");

    experiments.getColumn("workflow").setRenderer(new ButtonRenderer(new RendererClickListener() {
        @Override
        public void click(RendererClickEvent event) {
            ExperimentStatusBean esb = (ExperimentStatusBean) event.getItemId();
            TabSheet parent = (TabSheet) getParent();
            PatientView pv = (PatientView) parent.getParent().getParent();
            WorkflowComponent wp = pv.getWorkflowComponent();

            // TODO WATCH OUT NUMBER OF WORKFLOW TAB IS HARDCODED AT THE MOMENT, NO BETTER SOLUTION
            // FOUND SO FAR, e.g. get Tab by Name ?

            // TODO idea get description of item to navigate to the correct workflow ?!
            if (esb.getDescription().equals("Barcode Generation")) {
                ArrayList<String> message = new ArrayList<String>();
                message.add("clicked");
                message.add(currentBean.getId());
                //TODO navigate to barcode dragon rawwwr
                //          message.add(BarcodeView.navigateToLabel);
                //          state.notifyObservers(message);
            } else if (esb.getDescription().equals("Variant Annotation")) {
                /*
                 * ArrayList<String> message = new ArrayList<String>(); message.add("clicked");
                 * StringBuilder sb = new StringBuilder("type="); sb.append("workflowExperimentType");
                 * sb.append("&"); sb.append("id="); sb.append(currentBean.getId()); sb.append("&");
                 * sb.append("experiment="); sb.append("Q_WF_NGS_VARIANT_ANNOTATION");
                 * message.add(sb.toString()); message.add(WorkflowView.navigateToLabel);
                 * state.notifyObservers(message);
                 */

                Map<String, String> args = new HashMap<String, String>();
                args.put("id", currentBean.getId());
                args.put("type", "workflowExperimentType");
                args.put("experiment", "Q_WF_NGS_VARIANT_ANNOTATION");
                parent.setSelectedTab(9);
                wp.update(args);

            } else if (esb.getDescription().equals("Epitope Prediction")) {
                /*
                 * ArrayList<String> message = new ArrayList<String>(); message.add("clicked");
                 * StringBuilder sb = new StringBuilder("type="); sb.append("workflowExperimentType");
                 * sb.append("&"); sb.append("id="); sb.append(currentBean.getId()); sb.append("&");
                 * sb.append("experiment="); sb.append("Q_WF_NGS_EPITOPE_PREDICTION");
                 * message.add(sb.toString()); message.add(WorkflowView.navigateToLabel);
                 * state.notifyObservers(message);
                 */
                Map<String, String> args = new HashMap<String, String>();
                args.put("id", currentBean.getId());
                args.put("type", "workflowExperimentType");
                args.put("experiment", "Q_WF_NGS_EPITOPE_PREDICTION");
                parent.setSelectedTab(9);
                wp.update(args);
            } else if (esb.getDescription().equals("HLA Typing")) {
                /*
                 * ArrayList<String> message = new ArrayList<String>(); message.add("clicked");
                 * StringBuilder sb = new StringBuilder("type="); sb.append("workflowExperimentType");
                 * sb.append("&"); sb.append("id="); sb.append(currentBean.getId()); sb.append("&");
                 * sb.append("experiment="); sb.append("Q_WF_NGS_HLATYPING"); message.add(sb.toString());
                 * message.add(WorkflowView.navigateToLabel); state.notifyObservers(message);
                 */
                Map<String, String> args = new HashMap<String, String>();
                args.put("id", currentBean.getId());
                args.put("type", "workflowExperimentType");
                args.put("experiment", "Q_WF_NGS_HLATYPING");
                parent.setSelectedTab(9);
                wp.update(args);
            }

            else {
                Notification notif = new Notification("Workflow not (yet) available.", Type.TRAY_NOTIFICATION);
                // Customize it
                notif.setDelayMsec(60000);
                notif.setPosition(Position.MIDDLE_CENTER);
                // Show it in the page
                notif.show(Page.getCurrent());
            }
        }
    }));

    experiments.getColumn("started").setRenderer(new HtmlRenderer());

    ProgressBar progressBar = new ProgressBar();
    progressBar.setCaption("Overall Progress");
    progressBar.setWidth(Page.getCurrent().getBrowserWindowWidth() * 0.6f, Unit.PIXELS);
    progressBar.setStyleName("patientprogress");

    status.addComponent(progressBar);
    status.addComponent(experiments);
    status.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER);
    status.setComponentAlignment(experiments, Alignment.MIDDLE_CENTER);

    /**
     * Defined Experiments for iVac - Barcodes available -> done with project creation (done) -
     * Sequencing done (Status Q_NGS_MEASUREMENT) - Variants annotated (Status
     * Q_NGS_VARIANT_CALLING) - HLA Typing done (STATUS Q_NGS_WF_HLA_TYPING) - Epitope Prediction
     * done (STATUS Q_WF_NGS_EPITOPE_PREDICTION)
     */

    for (Iterator i = experimentstatusBeans.getItemIds().iterator(); i.hasNext();) {
        ExperimentStatusBean statusBean = (ExperimentStatusBean) i.next();

        finishedExperiments += statusBean.getStatus();

        // statusBean.setDownload("Download");
        statusBean.setWorkflow("Run");
    }

    progressBar.setValue((float) finishedExperiments / experimentstatusBeans.size());
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.WorkflowComponent.java

License:Open Source License

void showNotification(String message) {
    Notification notif = new Notification(message, Type.TRAY_NOTIFICATION);
    // Customize it
    notif.setDelayMsec(60000);/*from  w  ww  .j  av  a 2 s  .co m*/
    notif.setPosition(Position.MIDDLE_CENTER);
    // Show it in the page
    notif.show(Page.getCurrent());

}

From source file:dhbw.clippinggorilla.utilities.ui.VaadinUtils.java

public static void middleInforNotification(String caption, String descripton) {
    Notification not = new Notification(caption, null, Notification.Type.TRAY_NOTIFICATION, true);
    not.setDelayMsec(1000);// ww  w  . ja  v  a  2  s. com
    not.setPosition(Position.MIDDLE_CENTER);
    not.show(Page.getCurrent());
}

From source file:edu.kit.dama.ui.admin.utils.UIComponentTools.java

License:Apache License

/**
 * Show a notification with caption <i>caption</i>, message <i>message</i>
 * of type <i>pType</i> for <i>delay</i> milliseconds at middle_center
 * position.//ww  w  . j a v  a  2s  . com
 *
 * @param caption The caption.
 * @param message The message.
 * @param delay The delay (ms) until the nofication disappears.
 * @param pType The notification type.
 */
private static void showNotification(String caption, String message, int delay, Notification.Type pType) {
    showNotification(caption, message, delay, pType, Position.MIDDLE_CENTER);
}