Example usage for com.vaadin.server FontAwesome HEART

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

Introduction

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

Prototype

FontAwesome HEART

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

Click Source Link

Usage

From source file:com.esofthead.mycollab.shell.view.components.AdRequestWindow.java

License:Open Source License

public AdRequestWindow(final SimpleUser user) {
    super("Need help!");
    this.setModal(true);
    this.setResizable(false);
    this.setWidth("600px");

    MVerticalLayout content = new MVerticalLayout();

    Label message = new Label("Hey <b>" + AppContext.getUser().getDisplayName() + "</b>, you've been "
            + "using MyCollab for a while now. And we hope you are happy with it. We spent countless hours and money developing this free "
            + "software for you. If you like it, please write a few words on twitter, blog or our "
            + "testimonial form. It will help other "
            + "people find this useful software quickly. <b> Thank you</b>", ContentMode.HTML);

    MVerticalLayout shareControls = new MVerticalLayout();
    Label rateSourceforge = new Label(
            new Div().appendChild(new Text(FontAwesome.THUMBS_O_UP.getHtml()), DivLessFormatter.EMPTY_SPACE(),
                    new A("http://sourceforge.net/projects/mycollab/reviews/new", "_blank")
                            .appendText("Rate us on Sourceforge"))
                    .setStyle("color:#006dac").write(),
            ContentMode.HTML);/*from w  w  w . jav a2 s  .  c  om*/

    Label tweetUs = new Label(new Div().appendChild(new Text(FontAwesome.TWITTER.getHtml()),
            DivLessFormatter.EMPTY_SPACE(),
            new A("https://twitter.com/intent/tweet?text=Im using MyCollab to manage all project activities, accounts and it works great @mycollabdotcom&source=webclient",
                    "_blank").appendText("Share on Twitter"))
            .setStyle("color:#006dac").write(), ContentMode.HTML);

    Label linkedIn = new Label(new Div().appendChild(new Text(FontAwesome.LINKEDIN_SQUARE.getHtml()),
            DivLessFormatter.EMPTY_SPACE(),
            new A("https://www.linkedin.com/cws/share?url=https%3A%2F%2Fwww.mycollab.com&original_referer=https%3A%2F%2Fwww.mycollab.com&token=&isFramed=false&lang=en_US",
                    "_blank").appendText("Share on LinkedIn"))
            .setStyle("color:#006dac").write(), ContentMode.HTML);

    Button testimonialBtn = new Button("Write a testimonial", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            AdRequestWindow.this.close();
            turnOffAdd(user);
            UI.getCurrent().addWindow(new TestimonialWindow());
        }
    });
    testimonialBtn.setStyleName(UIConstants.BUTTON_LINK);
    testimonialBtn.setIcon(FontAwesome.KEYBOARD_O);

    shareControls.with(rateSourceforge, tweetUs, linkedIn, testimonialBtn);

    MHorizontalLayout btnControls = new MHorizontalLayout();
    Button ignoreBtn = new Button("No, thanks", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            close();
            turnOffAdd(user);
        }
    });
    ignoreBtn.addStyleName(UIConstants.BUTTON_OPTION);

    Button loveBtn = new Button("I did", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            AdRequestWindow.this.close();
            NotificationUtil.showNotification("We appreciate your kindness action", "Thank you for your time");
            turnOffAdd(user);
        }
    });
    loveBtn.addStyleName(UIConstants.BUTTON_ACTION);
    loveBtn.setIcon(FontAwesome.HEART);

    btnControls.with(ignoreBtn, loveBtn);

    content.with(message, shareControls, btnControls).withAlign(btnControls, Alignment.MIDDLE_RIGHT);
    this.setContent(content);
}

From source file:com.mycollab.community.shell.view.components.AdRequestWindow.java

License:Open Source License

public AdRequestWindow(final SimpleUser user) {
    super("No one has ever become poor by giving -  Anne Frank, diary of Anne Frank");
    this.withModal(true).withResizable(false).withWidth("800px").withCenter();

    MVerticalLayout content = new MVerticalLayout();

    Label message = new Label("Hey <b>" + UserUIContext.getUser().getDisplayName() + "</b>, you've been "
            + "using MyCollab for a while now, and we hope you are happy with it. We invested a lot of time and "
            + "money developing MyCollab. If you like it, please write a few words on twitter, blog or "
            + "our testimonial form. Your kindness helps this software be continued.", ContentMode.HTML);

    Label tweetUs = new Label(new Div().appendChild(new Text("&nbsp;&nbsp;" + FontAwesome.TWITTER.getHtml()),
            DivLessFormatter.EMPTY_SPACE(),
            new A("https://twitter.com/intent/tweet?text=I am using MyCollab to manage all project activities, "
                    + "accounts and it works great @mycollabdotcom&source=webclient", "_blank")
                            .appendText("Share on Twitter"))
            .setStyle("color:#006dac").write(), ContentMode.HTML);

    Label linkedIn = new Label(new Div().appendChild(
            new Text("&nbsp;&nbsp;" + FontAwesome.LINKEDIN_SQUARE.getHtml()), DivLessFormatter.EMPTY_SPACE(),
            new A("https://www.linkedin.com/cws/share?url=https%3A%2F%2Fwww.mycollab.com&original_referer=https%3A%2F%2Fwww.mycollab.com&token=&isFramed=false&lang=en_US",
                    "_blank").appendText("Share on LinkedIn"))
            .setStyle("color:#006dac").write(), ContentMode.HTML);

    Label testimonialAd = new Label(
            "A chance to get a free license of the premium MyCollab software for 10 users"
                    + ". If you execute one of the following:");
    Label rateSourceforge = new Label(
            new Div()
                    .appendChild(new Text("&nbsp;&nbsp;" + FontAwesome.FLAG_CHECKERED.getHtml()),
                            DivLessFormatter.EMPTY_SPACE(),
                            new A("https://community.mycollab.com/docs/developing-mycollab/translating/",
                                    "_blank").appendText(
                                            "Localize MyCollab to your language at least 20% of the phrases"))
                    .setStyle("color:#006dac").write(),
            ContentMode.HTML);/*  w ww  . java 2 s .  com*/
    MButton testimonialBtn = new MButton("Write a testimonial which is selected to post on our website",
            clickEvent -> {
                close();
                turnOffAdd(user);
                UI.getCurrent().addWindow(new TestimonialWindow());
            }).withIcon(FontAwesome.KEYBOARD_O).withStyleName(WebThemes.BUTTON_LINK);

    MButton ignoreBtn = new MButton("No, thanks", clickEvent -> {
        close();
        turnOffAdd(user);
    }).withStyleName(WebThemes.BUTTON_OPTION);

    MButton loveBtn = new MButton("I did", clickEvent -> {
        close();
        NotificationUtil.showNotification("We appreciate your kindness action", "Thank you for your time");
        turnOffAdd(user);
    }).withIcon(FontAwesome.HEART).withStyleName(WebThemes.BUTTON_ACTION);

    MHorizontalLayout btnControls = new MHorizontalLayout(ignoreBtn, loveBtn);
    content.with(message, rateSourceforge, tweetUs, linkedIn, testimonialAd, rateSourceforge,
            new MHorizontalLayout(ELabel.html("&nbsp;&nbsp;"), testimonialBtn).withSpacing(false),
            new Label("Sincerely,"), ELabel.html(new A("https://hainguyen.mycollab.com/about-me/", "_blank")
                    .appendText("Hai Nguyen").write()),
            btnControls).withAlign(btnControls, Alignment.MIDDLE_RIGHT);
    this.setContent(content);
}

From source file:com.mycollab.mobile.ui.AbstractPreviewItemComp.java

License:Open Source License

public void previewItem(final B item) {
    this.beanItem = item;

    CssLayout content = new CssLayout();
    content.addComponent(new MHorizontalLayout(ELabel.h2(initFormHeader())).withMargin(true)
            .withStyleName("border-bottom").withFullWidth());
    content.addComponent(previewForm);/*from w  w w  . j a  va2s  . co  m*/

    ComponentContainer buttonControls = createButtonControls();
    if (buttonControls instanceof VerticalLayout) {
        NavigationBarQuickMenu editBtn = new NavigationBarQuickMenu();
        editBtn.setContent(buttonControls);
        this.setRightComponent(editBtn);
    } else if (buttonControls instanceof HorizontalLayout) {
        if (StringUtils.isNotBlank(getType()) && !SiteConfiguration.isCommunityEdition()) {
            favoriteBtn = new MButton("", clickEvent -> toggleFavorite()).withIcon(FontAwesome.HEART)
                    .withStyleName(UIConstants.CIRCLE_BOX);
            ((HorizontalLayout) buttonControls).addComponent(favoriteBtn, 0);
        }
        this.setRightComponent(buttonControls);
    } else {
        throw new MyCollabException("Not support controls " + buttonControls);
    }

    if (favoriteBtn != null) {
        if (isFavorite()) {
            favoriteBtn.addStyleName("favorite-btn-selected");
        } else {
            favoriteBtn.addStyleName("favorite-btn");
        }
    }

    initRelatedComponents();

    ComponentContainer toolbarContent = createBottomPanel();
    if (toolbarContent != null) {
        content.addComponent(toolbarContent);
    }
    this.setContent(content);

    previewForm.setFormLayoutFactory(initFormLayoutFactory());
    previewForm.setBeanFormFieldFactory(initBeanFormFieldFactory());
}

From source file:com.mycollab.shell.view.components.AdRequestWindow.java

License:Open Source License

public AdRequestWindow(final SimpleUser user) {
    super("Need help!");
    this.setModal(true);
    this.setResizable(false);
    this.setWidth("600px");

    MVerticalLayout content = new MVerticalLayout();

    Label message = new Label("Hey <b>" + AppContext.getUser().getDisplayName() + "</b>, you've been "
            + "using MyCollab for a while now. And we hope you are happy with it. We spent countless hours and money developing this free "
            + "software for you. If you like it, please write a few words on twitter, blog or our "
            + "testimonial form. It will help other "
            + "people find this useful software quickly. <b> Thank you</b>", ContentMode.HTML);

    MVerticalLayout shareControls = new MVerticalLayout();
    Label rateSourceforge = new Label(
            new Div().appendChild(new Text(FontAwesome.THUMBS_O_UP.getHtml()), DivLessFormatter.EMPTY_SPACE(),
                    new A("http://sourceforge.net/projects/mycollab/reviews/new", "_blank")
                            .appendText("Rate us on Sourceforge"))
                    .setStyle("color:#006dac").write(),
            ContentMode.HTML);/* w w w  .j  a  v  a2 s  .  c  om*/

    Label tweetUs = new Label(new Div().appendChild(new Text(FontAwesome.TWITTER.getHtml()),
            DivLessFormatter.EMPTY_SPACE(),
            new A("https://twitter.com/intent/tweet?text=Im using MyCollab to manage all project activities, accounts and it works great @mycollabdotcom&source=webclient",
                    "_blank").appendText("Share on Twitter"))
            .setStyle("color:#006dac").write(), ContentMode.HTML);

    Label linkedIn = new Label(new Div().appendChild(new Text(FontAwesome.LINKEDIN_SQUARE.getHtml()),
            DivLessFormatter.EMPTY_SPACE(),
            new A("https://www.linkedin.com/cws/share?url=https%3A%2F%2Fwww.mycollab.com&original_referer=https%3A%2F%2Fwww.mycollab.com&token=&isFramed=false&lang=en_US",
                    "_blank").appendText("Share on LinkedIn"))
            .setStyle("color:#006dac").write(), ContentMode.HTML);

    MButton testimonialBtn = new MButton("Write a testimonial", clickEvent -> {
        close();
        turnOffAdd(user);
        UI.getCurrent().addWindow(new TestimonialWindow());
    }).withIcon(FontAwesome.KEYBOARD_O).withStyleName(UIConstants.BUTTON_LINK);

    shareControls.with(rateSourceforge, tweetUs, linkedIn, testimonialBtn);

    MButton ignoreBtn = new MButton("No, thanks", clickEvent -> {
        close();
        turnOffAdd(user);
    }).withStyleName(UIConstants.BUTTON_OPTION);

    MButton loveBtn = new MButton("I did", clickEvent -> {
        close();
        NotificationUtil.showNotification("We appreciate your kindness action", "Thank you for your time");
        turnOffAdd(user);
    }).withIcon(FontAwesome.HEART).withStyleName(UIConstants.BUTTON_ACTION);

    MHorizontalLayout btnControls = new MHorizontalLayout(ignoreBtn, loveBtn);
    content.with(message, shareControls, btnControls).withAlign(btnControls, Alignment.MIDDLE_RIGHT);
    this.setContent(content);
}

From source file:com.mycollab.vaadin.web.ui.AbstractPreviewItemComp.java

License:Open Source License

public AbstractPreviewItemComp(String headerText, FontAwesome iconResource, ReadViewLayout layout) {
    ELabel headerLbl = ELabel.h2("").withWidthUndefined();
    this.previewLayout = layout;

    header = new MHorizontalLayout().withStyleName("hdr-view").withFullWidth();
    header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    if (iconResource != null) {
        String title = iconResource.getHtml() + " " + headerText;
        headerLbl.setValue(title);/*from w w w.  j av a  2s  .  co  m*/
    } else {
        headerLbl.setValue(headerText);
    }

    if (SiteConfiguration.isCommunityEdition()) {
        header.with(headerLbl).expand(headerLbl);
    } else {
        favoriteBtn = new MButton("", clickEvent -> toggleFavorite()).withIcon(FontAwesome.HEART);

        Label spaceLbl = new Label();
        header.with(headerLbl, favoriteBtn, spaceLbl).expand(spaceLbl);
    }

    this.addComponent(header);
    ComponentContainer extraComp;
    if ((extraComp = createExtraControls()) != null) {
        this.addComponent(extraComp);
    }
    initContent();
}

From source file:gov.va.ehtac.appsonfhir.ui.Tools.java

public Tools() {
    setCaption("Patient Tools");
    final HorizontalButtonGroup hGroup = new HorizontalButtonGroup();
    Button weightBTN = new Button("Weight Scale");
    weightBTN.setIcon(FontAwesome.DELICIOUS);
    weightBTN.setWidth("310px");
    Button heartRateBTN = new Button("Heart Rate");
    heartRateBTN.setIcon(FontAwesome.HEART);
    heartRateBTN.setWidth("310px");
    Button bloodPressureBTN = new Button("Blood Pressure");
    bloodPressureBTN.setIcon(FontAwesome.HEART_O);
    bloodPressureBTN.setWidth("310px");
    Button glucoseBTN = new Button("Diabetes Management");
    glucoseBTN.setIcon(FontAwesome.FILE_CODE_O);
    glucoseBTN.setWidth("310px");
    hGroup.addComponent(weightBTN);/*w  w w . ja  v a  2 s.  c  o  m*/
    hGroup.addComponent(heartRateBTN);
    hGroup.addComponent(bloodPressureBTN);
    hGroup.addComponent(glucoseBTN);

    setContent(new CssLayout(hGroup));
}