Example usage for com.vaadin.server FontAwesome COMMENTS

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

Introduction

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

Prototype

FontAwesome COMMENTS

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

Click Source Link

Usage

From source file:com.dungnv.streetfood.ui.DishItemUI.java

private void buildAction() {

    if ("1".equals(item.getDishStatus())) {
        lbTitle.addStyleName("lb-status-active");
    } else {/*from w w  w .  j  a v a2  s  .co m*/
        lbTitle.addStyleName("lb-status-inActive");
    }

    String info = !StringUtils.isNullOrEmpty(item.getId())
            ? "<b>" + com.kbdunn.vaadin.addons.fontawesome.FontAwesome.BARCODE.getHtml() + " " + item.getId()
                    + "</b>"
            : "<b>" + com.kbdunn.vaadin.addons.fontawesome.FontAwesome.BARCODE.getHtml() + " --</b>";

    info += !StringUtils.isNullOrEmpty(item.getRating())
            ? "&nbsp|" + FontAwesome.STAR_O.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getRating()
            : "&nbsp|" + FontAwesome.STAR_O.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    info += !StringUtils.isNullOrEmpty(item.getViewCount())
            ? "&nbsp|" + FontAwesome.EYE.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getViewCount()
            : "&nbsp|" + FontAwesome.EYE.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    info += !StringUtils.isNullOrEmpty(item.getCommentCount())
            ? "&nbsp|" + FontAwesome.COMMENTS.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getCommentCount()
            : "&nbsp|" + FontAwesome.COMMENTS.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    info += !StringUtils.isNullOrEmpty(item.getShareCount())
            ? "&nbsp|" + FontAwesome.SHARE_ALT.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getShareCount()
            : "&nbsp|" + FontAwesome.SHARE_ALT.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    if (!StringUtils.isNullOrEmpty(info)) {
        lbInfo.setCaption(info);
    }

    btnEdit.addClickListener((Button.ClickEvent event) -> {
        if (item != null) {
            DishInsert dishInsert = new DishInsert(item//
            , event.getButton().findAncestor(DishView.class)//
            , Constants.ACTION.UPDATE);
            dishInsert.setWidth("80%");
            dishInsert.setHeight("90%");
            dishInsert.setModal(true);
            FWUtils.reloadWindow(dishInsert);
            UI.getCurrent().addWindow(dishInsert);
        }
    });

    btnLink.addClickListener((Button.ClickEvent event) -> {
        if (item != null) {
            DishLink dishLink = new DishLink(item);
            dishLink.setWidth("80%");
            dishLink.setHeight("75%");
            dishLink.setModal(true);
            FWUtils.reloadWindow(dishLink);
            UI.getCurrent().addWindow(dishLink);
        }
    });

    btnDelete.addClickListener((Button.ClickEvent event) -> {
        ConfirmDialog.show(UI.getCurrent(), BundleUtils.getLanguage("lbl.confirm")//
        , BundleUtils.getLanguage("message.category.delete.confirm")//
        , BundleUtils.getLanguage("lbl.yes")//
        , BundleUtils.getLanguage("lbl.no")//
        , (ConfirmDialog cd) -> {
            if (cd.isConfirmed()) {
                UserDTO user = (UserDTO) VaadinSession.getCurrent().getAttribute(UserDTO.class.getName());
                ResultDTO result = ClientServiceImpl.getInstance().deleteDish(user.getUsername()//
                , getLocale().getLanguage(), getLocale().getCountry(), null, Long.valueOf(itemId));
                if (result != null && Constants.SUCCESS.equals(result.getMessage())) {
                    mainView.onSearch(Boolean.TRUE);
                    UI.getCurrent().removeWindow(event.getButton().findAncestor(Window.class));
                } else {
                    Notification.show(
                            result == null || result.getKey() == null ? Constants.FAIL : result.getKey(),
                            Notification.Type.ERROR_MESSAGE);
                }
            }
        });
    });

}

From source file:com.dungnv.streetfood.ui.RestaurantItemUI.java

private void buildAction() {

    if ("1".equals(item.getRestaurantStatus())) {
        lbTitle.addStyleName("lb-status-active");
    } else {/* www . j a  v a 2s  .  c o  m*/
        lbTitle.addStyleName("lb-status-inActive");
    }

    String info = !StringUtils.isNullOrEmpty(item.getId())
            ? "<b>" + com.kbdunn.vaadin.addons.fontawesome.FontAwesome.BARCODE.getHtml() + " " + item.getId()
                    + "</b>"
            : "<b>" + com.kbdunn.vaadin.addons.fontawesome.FontAwesome.BARCODE.getHtml() + " --</b>";

    info += !StringUtils.isNullOrEmpty(item.getRating())
            ? "&nbsp|" + FontAwesome.STAR_O.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getRating()
            : "&nbsp|" + FontAwesome.STAR_O.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    info += !StringUtils.isNullOrEmpty(item.getViewCount())
            ? "&nbsp|" + FontAwesome.EYE.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getViewCount()
            : "&nbsp|" + FontAwesome.EYE.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    info += !StringUtils.isNullOrEmpty(item.getCommentCount())
            ? "&nbsp|" + FontAwesome.COMMENTS.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getCommentCount()
            : "&nbsp|" + FontAwesome.COMMENTS.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";

    info += !StringUtils.isNullOrEmpty(item.getShareCount())
            ? "&nbsp|" + FontAwesome.SHARE_ALT.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getShareCount()
            : "&nbsp|" + FontAwesome.SHARE_ALT.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--";
    //        
    //        info += !StringUtils.isNullOrEmpty(item.getOperatingTimeStart())
    //                ? "&nbsp|" + FontAwesome.CLOCK_O.getHtml() + "&nbsp&nbsp:&nbsp&nbsp" + item.getOperatingTimeStart() + " / "
    //                : "&nbsp|" + FontAwesome.CLOCK_O.getHtml() + "&nbsp&nbsp:&nbsp&nbsp--:--" + " / ";
    //        
    //        info += !StringUtils.isNullOrEmpty(item.getOperatingTimeEnd())
    //                ?  item.getOperatingTimeEnd() : "--:--" ;

    if (!StringUtils.isNullOrEmpty(info)) {
        lbInfo.setCaption(info);
    }

    btnEdit.addClickListener((Button.ClickEvent event) -> {
        if (item != null) {
            RestaurantInsert restaurantInsert = new RestaurantInsert(item//
            , event.getButton().findAncestor(RestaurantView.class)//
            , Constants.ACTION.UPDATE);
            restaurantInsert.setWidth("80%");
            restaurantInsert.setHeight("90%");
            restaurantInsert.setModal(true);
            FWUtils.reloadWindow(restaurantInsert);
            UI.getCurrent().addWindow(restaurantInsert);
        }
    });

    btnLink.addClickListener((Button.ClickEvent event) -> {
        if (item != null) {
            RestaurantLink restaurantLink = new RestaurantLink(item);
            restaurantLink.setWidth("80%");
            restaurantLink.setHeight("75%");
            restaurantLink.setModal(true);
            FWUtils.reloadWindow(restaurantLink);
            UI.getCurrent().addWindow(restaurantLink);
        }
    });

    btnDelete.addClickListener((Button.ClickEvent event) -> {
        ConfirmDialog.show(UI.getCurrent(), BundleUtils.getLanguage("lbl.confirm")//
        , BundleUtils.getLanguage("message.category.delete.confirm")//
        , BundleUtils.getLanguage("lbl.yes")//
        , BundleUtils.getLanguage("lbl.no")//
        , (ConfirmDialog cd) -> {
            if (cd.isConfirmed()) {
                UserDTO user = (UserDTO) VaadinSession.getCurrent().getAttribute(UserDTO.class.getName());
                ResultDTO result = ClientServiceImpl.getInstance().deleteRestaurant(user.getUsername()//
                , getLocale().getLanguage(), getLocale().getCountry(), null, Long.valueOf(itemId));
                if (result != null && Constants.SUCCESS.equals(result.getMessage())) {
                    mainView.onSearch(Boolean.TRUE);
                    UI.getCurrent().removeWindow(event.getButton().findAncestor(Window.class));
                } else {
                    Notification.show(
                            result == null || result.getKey() == null ? Constants.FAIL : result.getKey(),
                            Notification.Type.ERROR_MESSAGE);
                }
            }
        });
    });

}

From source file:com.esofthead.mycollab.module.project.view.bug.BugReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    final TabSheetLazyLoadComponent tabBugDetail = new TabSheetLazyLoadComponent();
    tabBugDetail.addTab(commentList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT),
            FontAwesome.COMMENTS);
    tabBugDetail.addTab(historyList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_HISTORY),
            FontAwesome.HISTORY);/*from   w  w  w. jav  a2  s  . c  o  m*/
    return tabBugDetail;
}

From source file:com.esofthead.mycollab.module.project.view.bug.ComponentReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    final TabSheetLazyLoadComponent tabContainer = new TabSheetLazyLoadComponent();
    tabContainer.addTab(commentDisplay, AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT),
            FontAwesome.COMMENTS);
    tabContainer.addTab(historyLogList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_HISTORY),
            FontAwesome.HISTORY);//from   www.  j  a va 2  s .  c  o m
    return tabContainer;
}

From source file:com.esofthead.mycollab.module.project.view.milestone.MilestoneReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    final TabSheetLazyLoadComponent tabContainer = new TabSheetLazyLoadComponent();
    tabContainer.addTab(this.commentListComp, AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT),
            FontAwesome.COMMENTS);
    tabContainer.addTab(historyListComp, AppContext.getMessage(ProjectCommonI18nEnum.TAB_HISTORY),
            FontAwesome.HISTORY);/*from   ww w . ja v a  2  s .c  om*/
    return tabContainer;
}

From source file:com.esofthead.mycollab.module.project.view.page.PageReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    final TabSheetLazyLoadComponent tabContainer = new TabSheetLazyLoadComponent();
    tabContainer.addTab(this.commentListComp, AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT),
            FontAwesome.COMMENTS);
    return tabContainer;
}

From source file:com.esofthead.mycollab.module.project.view.task.TaskGroupReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    final TabSheetLazyLoadComponent tabContainer = new TabSheetLazyLoadComponent();
    tabContainer.addTab(commentList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT),
            FontAwesome.COMMENTS);
    tabContainer.addTab(historyList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_HISTORY),
            FontAwesome.HISTORY);/*from  ww w.  j  a  v  a 2 s. c om*/
    return tabContainer;
}

From source file:com.esofthead.mycollab.module.project.view.task.TaskReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createBottomPanel() {
    TabSheetLazyLoadComponent tabTaskDetail = new TabSheetLazyLoadComponent();
    tabTaskDetail.addTab(commentList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_COMMENT, 0),
            FontAwesome.COMMENTS);
    tabTaskDetail.addTab(historyList, AppContext.getMessage(ProjectCommonI18nEnum.TAB_HISTORY),
            FontAwesome.HISTORY);/*from   w  ww .j a va  2s .  c o  m*/
    return tabTaskDetail;
}

From source file:com.hybridbpm.ui.component.bpm.TaskLayout.java

License:Apache License

private void createDiscussionTab() {
    if (hCase != null) {
        taskCommentsLayout = new TaskCommentsLayout(hCase.getId().toString(), taskId);
        taskCommentsLayout.initUI();// w ww  .  ja va2s  .  c o  m
        tabSheet.addTab(taskCommentsLayout, "Comments", FontAwesome.COMMENTS);
    }
}