List of usage examples for com.vaadin.server FontAwesome THUMBS_UP
FontAwesome THUMBS_UP
To view the source code for com.vaadin.server FontAwesome THUMBS_UP.
Click Source Link
From source file:com.etest.view.notification.NotificationMainUI.java
Table populateNoficationTable() { notificationTable.removeAllItems();/* www.j a v a 2 s.com*/ int i = 0; for (EtestNotification en : ns.getAllNotificationByUser( CommonUtilities.convertStringToInt(VaadinSession.getCurrent().getAttribute("userId").toString()))) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button read = new Button(); read.setWidthUndefined(); read.setCaption((en.getStatus() == 0) ? "unread" : "read"); read.setData(en.getNotificationId()); read.setIcon(FontAwesome.VIDEO_CAMERA); read.addStyleName(ValoTheme.BUTTON_LINK); read.addStyleName(ValoTheme.BUTTON_TINY); read.addStyleName(ValoTheme.BUTTON_QUIET); read.addStyleName("button-container"); read.addClickListener(buttonClickListener); v.addComponent(read); v.setComponentAlignment(read, Alignment.MIDDLE_LEFT); message.setContentMode(ContentMode.HTML); String[] split = en.getNotice().split(" "); int cellCaseId; if (split[0].equals("CellCaseID")) { message.setCaption(en.getRemarks() + en.getNotice()); cellCaseId = CommonUtilities.convertStringToInt(split[1].replace("#", "")); } else { cellCaseId = cis.getCellItemById(CommonUtilities.convertStringToInt(split[1].replace("#", ""))) .getCellCaseId(); message.setCaption(en.getRemarks() + en.getNotice() + " from CellCaseID #" + cellCaseId); } Button approve = new Button("status"); approve.setSizeFull(); approve.addStyleName(ValoTheme.BUTTON_LINK); approve.addStyleName(ValoTheme.BUTTON_TINY); approve.addStyleName(ValoTheme.BUTTON_QUIET); approve.addStyleName("button-container"); v.addComponent(approve); v.setComponentAlignment(approve, Alignment.MIDDLE_LEFT); if (ccs.getCellCaseById(cellCaseId).getApprovalStatus() == 0) { approve.setIcon(FontAwesome.THUMBS_DOWN); } else { approve.setIcon(FontAwesome.THUMBS_UP); } notificationTable.addItem(new Object[] { message.getCaption().toString(), ss.getUsernameById(en.getSenderId()), en.getNoteDate(), v }, i); i++; } notificationTable.setPageLength(0); notificationTable.setHeight("100%"); return notificationTable; }
From source file:com.etest.view.testbank.CellCaseMainUI.java
Table populateDataTable() { table.removeAllItems();/*from www.j av a 2 s .com*/ int i = 0; for (CellCase cc : ccs.getCellCaseByTopic(getSyllabusId())) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button edit = new Button("modify"); edit.setSizeFull(); edit.setData(cc.getCellCaseId()); edit.setIcon(FontAwesome.PENCIL); edit.addStyleName(ValoTheme.BUTTON_LINK); edit.addStyleName(ValoTheme.BUTTON_TINY); edit.addStyleName(ValoTheme.BUTTON_QUIET); edit.addStyleName("button-container"); edit.addClickListener(modifyBtnClickListener); v.addComponent(edit); v.setComponentAlignment(edit, Alignment.MIDDLE_LEFT); Button approve = new Button("status"); approve.setSizeFull(); approve.setData(cc.getCellCaseId()); approve.addStyleName(ValoTheme.BUTTON_LINK); approve.addStyleName(ValoTheme.BUTTON_TINY); approve.addStyleName(ValoTheme.BUTTON_QUIET); approve.addStyleName("button-container"); v.addComponent(approve); v.setComponentAlignment(approve, Alignment.MIDDLE_LEFT); if (cc.getApprovalStatus() == 0) { approve.setIcon(FontAwesome.THUMBS_DOWN); } else { approve.setIcon(FontAwesome.THUMBS_UP); } Button stem = new Button("stems"); stem.setSizeFull(); stem.setData(cc.getCellCaseId()); stem.setIcon(FontAwesome.BRIEFCASE); stem.addStyleName(ValoTheme.BUTTON_LINK); stem.addStyleName(ValoTheme.BUTTON_TINY); stem.addStyleName(ValoTheme.BUTTON_QUIET); stem.addStyleName("button-container"); stem.addClickListener(stemBtnClickListener); v.addComponent(stem); v.setComponentAlignment(stem, Alignment.MIDDLE_LEFT); Label label = new Label(cc.getCaseTopic(), ContentMode.HTML); label.setStyleName("label-padding"); table.addItem(new Object[] { cc.getCellCaseId(), label, cc.getUsername_(), cc.getDateCreated(), v }, i); i++; } table.setPageLength(table.size()); return table; }
From source file:com.etest.view.testbank.CellCaseWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setMargin(true);/*from ww w. ja v a 2 s . c om*/ subject.setCaption("Subject: "); subject.setWidth("50%"); subject.addValueChangeListener((new CurriculumPropertyChangeListener(topic))); form.addComponent(subject); topic.setCaption("Topic: "); topic.setWidth("80%"); topic.setInputPrompt("Select a Topic.."); topic.addStyleName(ValoTheme.COMBOBOX_SMALL); form.addComponent(topic); caseTopic = new TextArea(); caseTopic.setCaption("Case: "); caseTopic.setWidth("100%"); caseTopic.setRows(5); form.addComponent(caseTopic); HorizontalLayout hlayout = new HorizontalLayout(); hlayout.setWidth("100%"); hlayout.setSpacing(true); Button save = new Button("SAVE"); save.setWidth("200px"); save.setIcon(FontAwesome.SAVE); save.addStyleName(ValoTheme.BUTTON_PRIMARY); save.addStyleName(ValoTheme.BUTTON_SMALL); save.addClickListener(buttonClickListener); Button modify = new Button("MODIFY"); modify.setWidth("200px"); modify.setIcon(FontAwesome.EDIT); modify.addStyleName(ValoTheme.BUTTON_PRIMARY); modify.addStyleName(ValoTheme.BUTTON_SMALL); modify.addClickListener(buttonClickListener); Button approve = new Button("APPROVE"); approve.setWidth("200px"); approve.setIcon(FontAwesome.THUMBS_UP); approve.addStyleName(ValoTheme.BUTTON_PRIMARY); approve.addStyleName(ValoTheme.BUTTON_SMALL); approve.setEnabled(UserAccess.approve()); approve.addClickListener(buttonClickListener); Button delete = new Button("DELETE"); delete.setWidth("200px"); delete.setIcon(FontAwesome.TRASH_O); delete.addStyleName(ValoTheme.BUTTON_PRIMARY); delete.addStyleName(ValoTheme.BUTTON_SMALL); delete.setEnabled(UserAccess.delete()); delete.addClickListener(buttonClickListener); if (getCellCaseId() != 0) { CellCase cc = ccs.getCellCaseById(getCellCaseId()); subject.setValue(cc.getCurriculumId()); topic.setValue(cc.getSyllabusId()); caseTopic.setValue(cc.getCaseTopic()); approve.setVisible(cc.getApprovalStatus() == 0); hlayout.addComponent(approve); hlayout.setComponentAlignment(approve, Alignment.MIDDLE_RIGHT); hlayout.addComponent(modify); hlayout.setComponentAlignment(modify, Alignment.MIDDLE_RIGHT); hlayout.addComponent(delete); hlayout.setComponentAlignment(delete, Alignment.MIDDLE_RIGHT); } else { hlayout.addComponent(save); hlayout.setComponentAlignment(save, Alignment.MIDDLE_RIGHT); } form.addComponent(hlayout); form.setComponentAlignment(hlayout, Alignment.MIDDLE_RIGHT); return form; }
From source file:com.etest.view.testbank.cellitem.CellCaseItemWindow.java
Table populateDataTable() { table.removeAllItems();// ww w . ja v a 2 s . c om int i = 0; for (CellItem ci : cis.getCellItemByCase(getCellCaseId())) { VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Button edit = new Button("modify"); edit.setWidth("100%"); edit.setData(ci.getCellItemId()); edit.setIcon(FontAwesome.PENCIL); edit.addStyleName(ValoTheme.BUTTON_LINK); edit.addStyleName(ValoTheme.BUTTON_TINY); edit.addStyleName(ValoTheme.BUTTON_QUIET); edit.addClickListener(modifyBtnClickListener); v.addComponent(edit); v.setComponentAlignment(edit, Alignment.MIDDLE_LEFT); Button approve = new Button("status"); approve.setWidth("100%"); approve.setData(ci.getCellItemId()); approve.addStyleName(ValoTheme.BUTTON_LINK); approve.addStyleName(ValoTheme.BUTTON_TINY); approve.addStyleName(ValoTheme.BUTTON_QUIET); v.addComponent(approve); v.setComponentAlignment(approve, Alignment.MIDDLE_LEFT); Button view = new Button("view"); view.setWidth("100%"); view.setData(ci.getCellItemId()); view.setIcon(FontAwesome.PLAY_CIRCLE); view.addStyleName(ValoTheme.BUTTON_LINK); view.addStyleName(ValoTheme.BUTTON_TINY); view.addStyleName(ValoTheme.BUTTON_QUIET); view.addClickListener(modifyBtnClickListener); v.addComponent(view); v.setComponentAlignment(view, Alignment.MIDDLE_LEFT); if (ci.getApproveItemStatus() == 0) { approve.setIcon(FontAwesome.THUMBS_DOWN); } else { approve.setIcon(FontAwesome.THUMBS_UP); } Label label = new Label(ci.getItem()); label.setStyleName("label-padding"); table.addItem(new Object[] { ci.getCellItemId(), label, v }, i); i++; } table.setPageLength(table.size()); return table; }
From source file:com.etest.view.tq.TQCoverageWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setMargin(true);/*from w w w . j av a2s.c o m*/ int itemNo = 1; Label caseTopic; Label stem; Map<Integer, Map<Integer, Integer>> tqCoverage = tq.getTQCoverage(getTQCoverageId()); for (Map.Entry<Integer, Map<Integer, Integer>> tqCases : tqCoverage.entrySet()) { Integer tqCaseId = tqCases.getKey(); caseTopic = new Label(); caseTopic.setValue(ccs.getCellCaseById(tqCaseId).getCaseTopic()); caseTopic.setContentMode(ContentMode.HTML); form.addComponent(caseTopic); Map<Integer, Integer> value = tqCases.getValue(); for (Map.Entry<Integer, Integer> itemIds : value.entrySet()) { Integer itemId = itemIds.getKey(); Integer itemKeyId = itemIds.getValue(); List<String> keyList = k.getAllItemKey(itemId); if (keyList.isEmpty()) { ShowErrorNotification .error("No Item Key was found for STEM: \n" + cis.getCellItemById(itemId).getItem()); return null; } stem = new Label(); // stem.setValue(itemNo+". "+cis.getCellItemById(itemId).getItem().replace("{key}", keyList.get(0))); stem.setValue(itemNo + ". " + cis.getCellItemById(itemId).getItem().replace("{key}", k.getItemKeyById(itemKeyId))); stem.setContentMode(ContentMode.HTML); form.addComponent(stem); GridLayout glayout = new GridLayout(2, 2); glayout.setWidth("100%"); glayout.setSpacing(true); glayout.addComponent(new Label("A) " + cis.getCellItemById(itemId).getOptionA(), ContentMode.HTML), 0, 0); glayout.addComponent(new Label("C) " + cis.getCellItemById(itemId).getOptionC(), ContentMode.HTML), 0, 1); glayout.addComponent(new Label("B) " + cis.getCellItemById(itemId).getOptionB(), ContentMode.HTML), 1, 0); glayout.addComponent(new Label("D) " + cis.getCellItemById(itemId).getOptionD(), ContentMode.HTML), 1, 1); form.addComponent(glayout); itemNo++; } } HorizontalLayout h = new HorizontalLayout(); h.setWidth("100%"); Button delete = new Button("DELETE"); delete.setWidth("200px"); delete.setIcon(FontAwesome.TRASH_O); delete.addStyleName(ValoTheme.BUTTON_PRIMARY); delete.addStyleName(ValoTheme.BUTTON_SMALL); delete.addClickListener(buttonClickListener); h.addComponent(delete); Button approve = new Button("APPROVE"); approve.setWidth("200px"); approve.setIcon(FontAwesome.THUMBS_UP); approve.addStyleName(ValoTheme.BUTTON_PRIMARY); approve.addStyleName(ValoTheme.BUTTON_SMALL); approve.addClickListener(buttonClickListener); h.addComponent(approve); if (tq.isTQCoverageApproved(getTQCoverageId())) { approve.setVisible(false); } else { approve.setVisible(true); } form.addComponent(h); return form; }
From source file:com.etest.view.tq.TQListUI.java
public Table populateDataTable() { removeAllItems();/* w ww . jav a 2 s . com*/ int i = 0; for (TQCoverage t : tq.getAllTQCoverage()) { VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); Button view = new Button("view"); view.setSizeFull(); view.setData(t.getTqCoverageId()); view.setIcon(FontAwesome.VIDEO_CAMERA); view.addStyleName(ValoTheme.BUTTON_LINK); view.addStyleName(ValoTheme.BUTTON_TINY); view.addStyleName(ValoTheme.BUTTON_QUIET); view.addStyleName("button-container"); view.addClickListener(remarksBtnClickListener); v.addComponent(view); v.setComponentAlignment(view, Alignment.MIDDLE_LEFT); Button approve = new Button("status"); approve.setSizeFull(); approve.setData(t.getTqCoverageId()); approve.addStyleName(ValoTheme.BUTTON_LINK); approve.addStyleName(ValoTheme.BUTTON_TINY); approve.addStyleName(ValoTheme.BUTTON_QUIET); approve.addStyleName("button-container"); v.addComponent(approve); v.setComponentAlignment(approve, Alignment.MIDDLE_LEFT); // Button print = new Button("print"); // print.setSizeFull(); // print.setData(t.getTqCoverageId()); // print.setIcon(FontAwesome.PRINT); // print.addStyleName(ValoTheme.BUTTON_LINK); // print.addStyleName(ValoTheme.BUTTON_TINY); // print.addStyleName(ValoTheme.BUTTON_QUIET); // print.addStyleName("button-container"); // print.addClickListener(remarksBtnClickListener); // v.addComponent(print); // v.setComponentAlignment(print, Alignment.MIDDLE_LEFT); if (t.getStatus() == 0) { approve.setIcon(FontAwesome.THUMBS_DOWN); // print.setVisible(false); } else { approve.setIcon(FontAwesome.THUMBS_UP); // print.setVisible(true); } addItem(new Object[] { t.getExamTitle(), cs.getCurriculumById(t.getCurriculumId()).getSubject(), t.getDateCreated(), t.getTotalHoursCoverage(), t.getTotalItems(), v }, i); i++; } setPageLength(size()); return this; }
From source file:org.opencmsdays.workshop.AppConfiguration.java
License:Open Source License
/** * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getIcon() */ public Resource getIcon() { return FontAwesome.THUMBS_UP; }