List of usage examples for com.vaadin.server FontAwesome BARCODE
FontAwesome BARCODE
To view the source code for com.vaadin.server FontAwesome BARCODE.
Click Source Link
From source file:com.dungnv.streetfood.ui.ArticleItemUI.java
private void buildAction() { 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.getViewCount()) ? " |" + FontAwesome.EYE.getHtml() + "  :  " + item.getViewCount() : " |" + FontAwesome.EYE.getHtml() + "  :  --"; if (!StringUtils.isNullOrEmpty(info)) { lbInfo.setCaption(info);//from w ww.jav a 2 s. co m } btnLink.addClickListener((Button.ClickEvent event) -> { if (item != null) { ArticleLink dishLink = new ArticleLink(item); dishLink.setWidth("80%"); dishLink.setHeight("75%"); dishLink.setModal(true); FWUtils.reloadWindow(dishLink); UI.getCurrent().addWindow(dishLink); } }); btnEdit.addClickListener((Button.ClickEvent event) -> { if (item != null) { ArticleInsert articleInsert = new ArticleInsert(item// , event.getButton().findAncestor(ArticleView.class)// , Constants.ACTION.UPDATE); articleInsert.setWidth("80%"); articleInsert.setHeight("90%"); articleInsert.setModal(true); FWUtils.reloadWindow(articleInsert); UI.getCurrent().addWindow(articleInsert); } }); 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().deleteArticle(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.CategoryItemUI.java
private void buildAction() { 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>"; if (!StringUtils.isNullOrEmpty(info)) { lbInfo.setCaption(info);/*w w w . java 2 s .c o m*/ } btnEdit.addClickListener((Button.ClickEvent event) -> { if (item != null) { CategoryInsert CategoryInsert = new CategoryInsert(item// , event.getButton().findAncestor(CategoryView.class)// , Constants.ACTION.UPDATE); CategoryInsert.setWidth("80%"); CategoryInsert.setHeight("90%"); CategoryInsert.setModal(true); FWUtils.reloadWindow(CategoryInsert); UI.getCurrent().addWindow(CategoryInsert); } }); btnLink.addClickListener((Button.ClickEvent event) -> { if (item != null) { CategoryLink CategoryInsert = new CategoryLink(item); CategoryInsert.setWidth("80%"); CategoryInsert.setHeight("75%"); CategoryInsert.setModal(true); FWUtils.reloadWindow(CategoryInsert); UI.getCurrent().addWindow(CategoryInsert); } }); 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().deleteCategory(user.getUsername()// , getLocale().getLanguage(), getLocale().getCountry(), null, 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.DishItemUI.java
private void buildAction() { if ("1".equals(item.getDishStatus())) { lbTitle.addStyleName("lb-status-active"); } else {/*from ww w .ja va2 s. 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()) ? " |" + FontAwesome.STAR_O.getHtml() + "  :  " + item.getRating() : " |" + FontAwesome.STAR_O.getHtml() + "  :  --"; info += !StringUtils.isNullOrEmpty(item.getViewCount()) ? " |" + FontAwesome.EYE.getHtml() + "  :  " + item.getViewCount() : " |" + FontAwesome.EYE.getHtml() + "  :  --"; info += !StringUtils.isNullOrEmpty(item.getCommentCount()) ? " |" + FontAwesome.COMMENTS.getHtml() + "  :  " + item.getCommentCount() : " |" + FontAwesome.COMMENTS.getHtml() + "  :  --"; info += !StringUtils.isNullOrEmpty(item.getShareCount()) ? " |" + FontAwesome.SHARE_ALT.getHtml() + "  :  " + item.getShareCount() : " |" + FontAwesome.SHARE_ALT.getHtml() + "  :  --"; 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 {/*from w w w. j ava 2 s .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()) ? " |" + FontAwesome.STAR_O.getHtml() + "  :  " + item.getRating() : " |" + FontAwesome.STAR_O.getHtml() + "  :  --"; info += !StringUtils.isNullOrEmpty(item.getViewCount()) ? " |" + FontAwesome.EYE.getHtml() + "  :  " + item.getViewCount() : " |" + FontAwesome.EYE.getHtml() + "  :  --"; info += !StringUtils.isNullOrEmpty(item.getCommentCount()) ? " |" + FontAwesome.COMMENTS.getHtml() + "  :  " + item.getCommentCount() : " |" + FontAwesome.COMMENTS.getHtml() + "  :  --"; info += !StringUtils.isNullOrEmpty(item.getShareCount()) ? " |" + FontAwesome.SHARE_ALT.getHtml() + "  :  " + item.getShareCount() : " |" + FontAwesome.SHARE_ALT.getHtml() + "  :  --"; // // info += !StringUtils.isNullOrEmpty(item.getOperatingTimeStart()) // ? " |" + FontAwesome.CLOCK_O.getHtml() + "  :  " + item.getOperatingTimeStart() + " / " // : " |" + FontAwesome.CLOCK_O.getHtml() + "  :  --:--" + " / "; // // 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); } } }); }); }