Example usage for com.vaadin.server FontAwesome BOLT

List of usage examples for com.vaadin.server FontAwesome BOLT

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome BOLT.

Prototype

FontAwesome BOLT

To view the source code for com.vaadin.server FontAwesome BOLT.

Click Source Link

Usage

From source file:views.MetadataUploadView.java

License:Open Source License

private void createNotRightTypeDialogue(String headline, String moreInfo, String barcode) {
    Window subWindow = new Window(" Wrong data type!");
    subWindow.setWidth("400px");

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);/*  w ww.jav  a2 s  .c  om*/
    layout.setMargin(true);
    Label preInfo = new Label(
            "Data of barcode " + barcode + " in this column doesn't fit the attribute type. " + moreInfo);
    layout.addComponent(preInfo);
    Button ok = new Button("Ignore Column.");
    Button no = new Button("Select different attribute.");
    ok.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            getActiveTable().removeContainerProperty(headline);
            subWindow.close();
        }
    });
    no.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            resetAttribute(headline);
            subWindow.close();
        }
    });
    layout.addComponent(ok);
    layout.addComponent(no);

    subWindow.setContent(layout);
    // Center it in the browser window
    subWindow.center();
    subWindow.setModal(true);
    subWindow.setIcon(FontAwesome.BOLT);
    subWindow.setResizable(false);
    ProjectwizardUI ui = (ProjectwizardUI) UI.getCurrent();
    ui.addWindow(subWindow);
}

From source file:views.MetadataUploadView.java

License:Open Source License

private void showStatus() {
    boolean ready = true;
    for (Object colName : getActiveTable().getContainerPropertyIds()) {
        String selected = getSelectedProperty(colName);
        ready &= selected != null && !selected.isEmpty();
    }//  ww w . j  a v  a2 s  . co m
    if (ready) {
        fillCollisionsList();
        if (collisions.size() > 0) {
            Window subWindow = new Window(" Collisions found!");
            subWindow.setWidth("400px");

            VerticalLayout layout = new VerticalLayout();
            layout.setSpacing(true);
            layout.setMargin(true);
            Label preInfo = new Label("The following entries exist and would need to be overwritten:");
            layout.addComponent(preInfo);
            TextArea tf = new TextArea();
            tf.setWidth("350px");
            tf.setValue(StringUtils.join(collisions, ""));
            tf.setStyleName(Styles.areaTheme);
            layout.addComponent(tf);
            String overwriteInfo = "In order to keep your data safe, you are not allowed to overwrite existing information by default. "
                    + "You can either remove the columns in question (choose 'ignore column') or contact QBiC.";
            if (overWriteAllowed)
                overwriteInfo = "You can either remove the columns in question (choose 'ignore column') "
                        + "before sending it to the Database or overwrite the metadata.";
            Label info = new Label(overwriteInfo);
            Button ok = new Button("Got it!");
            ok.addClickListener(new ClickListener() {

                @Override
                public void buttonClick(ClickEvent event) {
                    subWindow.close();
                }
            });
            layout.addComponent(info);
            layout.addComponent(ok);

            subWindow.setContent(layout);
            // Center it in the browser window
            subWindow.center();
            subWindow.setModal(true);
            subWindow.setIcon(FontAwesome.BOLT);
            subWindow.setResizable(false);
            ProjectwizardUI ui = (ProjectwizardUI) UI.getCurrent();
            ui.addWindow(subWindow);
        } else {
            Styles.notification("No collisions found!",
                    "You can update the metadata in our database without overwriting something. To do so press 'Send to Database'",
                    NotificationType.DEFAULT);
        }
        send.setEnabled(collisions.isEmpty() || overWriteAllowed);
    } else
        send.setEnabled(false);
}