List of usage examples for com.vaadin.server FontAwesome PLUS
FontAwesome PLUS
To view the source code for com.vaadin.server FontAwesome PLUS.
Click Source Link
From source file:com.esofthead.mycollab.vaadin.web.ui.BuildCriterionComponent.java
License:Open Source License
private void buildFilterBox(String queryName) { filterBox.removeAllComponents();// ww w . j a v a 2s. c om SavedSearchResultComboBox filterComboBox = new SavedSearchResultComboBox(); filterBox.addComponent(filterComboBox); Button saveSearchBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_NEW_FILTER), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { buildSaveFilterBox(); } }); saveSearchBtn.addStyleName(UIConstants.BUTTON_ACTION); saveSearchBtn.setIcon(FontAwesome.PLUS); filterBox.addComponent(saveSearchBtn); }
From source file:com.esofthead.mycollab.vaadin.web.ui.ProjectPreviewFormControlsGenerator.java
License:Open Source License
public HorizontalLayout createButtonControls(int buttonEnableFlags, String permissionItem) { optionBtn = new PopupButton(); optionBtn.addStyleName(UIConstants.BOX); optionBtn.setIcon(FontAwesome.ELLIPSIS_H); if (permissionItem != null) { boolean canWrite = CurrentProjectVariables.canWrite(permissionItem); boolean canAccess = CurrentProjectVariables.canAccess(permissionItem); boolean canRead = CurrentProjectVariables.canRead(permissionItem); if ((buttonEnableFlags & ASSIGN_BTN_PRESENTED) == ASSIGN_BTN_PRESENTED) { Button assignBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_ASSIGN), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { T item = previewForm.getBean(); previewForm.fireAssignForm(item); }//from w w w.j ava 2 s .c o m }); assignBtn.setIcon(FontAwesome.SHARE); assignBtn.setStyleName(UIConstants.BUTTON_ACTION); editButtons.addComponent(assignBtn); assignBtn.setEnabled(canWrite); } if ((buttonEnableFlags & ADD_BTN_PRESENTED) == ADD_BTN_PRESENTED) { Button addBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_ADD), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { optionBtn.setPopupVisible(false); T item = previewForm.getBean(); previewForm.fireAddForm(item); } }); addBtn.setIcon(FontAwesome.PLUS); addBtn.setStyleName(UIConstants.BUTTON_ACTION); addBtn.setEnabled(canWrite); editButtons.addComponent(addBtn); } if ((buttonEnableFlags & EDIT_BTN_PRESENTED) == EDIT_BTN_PRESENTED) { Button editBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_EDIT), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { optionBtn.setPopupVisible(false); T item = previewForm.getBean(); previewForm.fireEditForm(item); } }); editBtn.setIcon(FontAwesome.EDIT); editBtn.setStyleName(UIConstants.BUTTON_ACTION); editBtn.setEnabled(canWrite); editButtons.addComponent(editBtn); } if ((buttonEnableFlags & DELETE_BTN_PRESENTED) == DELETE_BTN_PRESENTED) { Button deleteBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_DELETE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { T item = previewForm.getBean(); previewForm.fireDeleteForm(item); } }); deleteBtn.setIcon(FontAwesome.TRASH_O); deleteBtn.setStyleName(UIConstants.BUTTON_DANGER); deleteBtn.setEnabled(canAccess); editButtons.addComponent(deleteBtn); } if ((buttonEnableFlags & PRINT_BTN_PRESENTED) == PRINT_BTN_PRESENTED) { final PrintButton printBtn = new PrintButton(); printBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { T item = previewForm.getBean(); previewForm.firePrintForm(printBtn, item); } }); printBtn.setStyleName(UIConstants.BUTTON_OPTION); printBtn.setDescription(AppContext.getMessage(GenericI18Enum.ACTION_PRINT)); printBtn.setEnabled(canRead); editButtons.addComponent(printBtn); } if ((buttonEnableFlags & CLONE_BTN_PRESENTED) == CLONE_BTN_PRESENTED) { Button cloneBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CLONE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { optionBtn.setPopupVisible(false); T item = previewForm.getBean(); previewForm.fireCloneForm(item); } }); cloneBtn.setIcon(FontAwesome.ROAD); cloneBtn.setEnabled(canWrite); popupButtonsControl.addOption(cloneBtn); } layout.with(editButtons); if ((buttonEnableFlags & NAVIGATOR_BTN_PRESENTED) == NAVIGATOR_BTN_PRESENTED) { ButtonGroup navigationBtns = new ButtonGroup(); Button previousItem = new Button(null, new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { T item = previewForm.getBean(); previewForm.fireGotoPrevious(item); } }); previousItem.setIcon(FontAwesome.CHEVRON_LEFT); previousItem.setCaptionAsHtml(true); previousItem.setStyleName(UIConstants.BUTTON_OPTION); previousItem.setDescription(AppContext.getMessage(GenericI18Enum.TOOLTIP_SHOW_PREVIOUS_ITEM)); previousItem.setEnabled(canRead); navigationBtns.addButton(previousItem); Button nextItemBtn = new Button(null, new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { T item = previewForm.getBean(); previewForm.fireGotoNextItem(item); } }); nextItemBtn.setIcon(FontAwesome.CHEVRON_RIGHT); nextItemBtn.setStyleName(UIConstants.BUTTON_OPTION); nextItemBtn.setDescription(AppContext.getMessage(GenericI18Enum.TOOLTIP_SHOW_NEXT_ITEM)); nextItemBtn.setEnabled(canRead); navigationBtns.addButton(nextItemBtn); layout.addComponent(navigationBtns); } if (popupButtonsControl.getComponentCount() > 0) { optionBtn.setContent(popupButtonsControl); layout.addComponent(optionBtn); } } return layout; }
From source file:com.hybridbpm.ui.component.chart.color.GaugeBandLayout.java
License:Apache License
public GaugeBandLayout(final BeanFieldGroup<DiagrammePreference> preferences) { super(preferences); setCaption("Gauge Band Colors"); setSizeFull();/*from w w w . j a v a 2s.c o m*/ setSpacing(true); setMargin(false); addBandButton.setIcon(FontAwesome.PLUS); addBandButton.setStyleName(ValoTheme.BUTTON_BORDERLESS); addBandButton.addStyleName(ValoTheme.BUTTON_SMALL); bandAdditionButtonFrame.setSpacing(true); bandAdditionButtonFrame.addComponent(addBandButton); bandAdditionButtonFrame.setComponentAlignment(addBandButton, Alignment.MIDDLE_RIGHT); addComponent(bandAdditionButtonFrame); addBandButton.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { addBand(); } }); colorTable.setHeight("100%"); colorTable.setWidth("100%"); colorTable.addStyleName(ValoTheme.TABLE_COMPACT); colorTable.addStyleName(ValoTheme.TABLE_SMALL); colorTable.addStyleName("color-table"); colorTable.addContainerProperty(Translate.getMessage("colour"), ColorPicker.class, null); colorTable.addContainerProperty(Translate.getMessage("start"), TextField.class, null); colorTable.addContainerProperty(Translate.getMessage("end"), TextField.class, null); colorTable.addContainerProperty("remove", Button.class, null); // COLOR COLUMN colorTable.addGeneratedColumn(Translate.getMessage("colour"), new Table.ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { final Property<String> colorProp = tableContainer.getItem(itemId).getItemProperty("color"); int[] col = ColourUtil.decode(colorProp.getValue()); ColorPicker picker = new ColorPicker(); picker.addStyleName("diagramme"); picker.setPosition(Page.getCurrent().getBrowserWindowWidth() / 2 - 246 / 2, Page.getCurrent().getBrowserWindowHeight() / 2 - 507 / 2); picker.setColor(new com.vaadin.shared.ui.colorpicker.Color(col[0], col[1], col[2])); picker.addColorChangeListener(new ColorChangeListener() { @Override public void colorChanged(ColorChangeEvent event) { colorProp.setValue(event.getColor().getCSS()); updateDiagramme(); } }); picker.setWidth("25px"); return picker; } }); // BAND START COLUMN colorTable.addGeneratedColumn(Translate.getMessage("start"), new Table.ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { final Property<Double> startProp = tableContainer.getContainerProperty(itemId, "startValue"); final ObjectProperty<Double> startValue = new ObjectProperty<Double>(0.0); TextField startField = new TextField(startValue); //startField.setWidth("60px"); startField.setSizeFull(); startField.setNullRepresentation("0"); startField.addStyleName("tfwb"); startField.setConvertedValue(startProp.getValue()); startField.setImmediate(true); startValue.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { startProp.setValue((Double) event.getProperty().getValue()); updateDiagramme(); } }); return startField; } }); // BAND END COLUMN colorTable.addGeneratedColumn(Translate.getMessage("end"), new Table.ColumnGenerator() { @Override public Object generateCell(Table source, Object itemId, Object columnId) { final Property<Double> endProp = tableContainer.getContainerProperty(itemId, "endValue"); final ObjectProperty<Double> endValue = new ObjectProperty<Double>(0.0); TextField endField = new TextField(endValue); //endField.setWidth("60px"); endField.setSizeFull(); endField.setNullRepresentation("0"); endField.addStyleName("tfwb"); endField.setConvertedValue(endProp.getValue()); endField.setImmediate(true); endValue.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { endProp.setValue((Double) valueChangeEvent.getProperty().getValue()); updateDiagramme(); } }); return endField; } }); // DELETE BAND COLUMN colorTable.addGeneratedColumn("remove", new Table.ColumnGenerator() { @Override public Object generateCell(Table source, final Object itemId, Object columnId) { Button delete = new Button(FontAwesome.TIMES); delete.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { removeBand(itemId); } }); delete.setWidth("43px"); return delete; } }); colorTable.setColumnWidth(Translate.getMessage("colour"), 33); colorTable.setColumnWidth("remove", 48); colorTable.setColumnExpandRatio(Translate.getMessage("start"), 0.5f); colorTable.setColumnExpandRatio(Translate.getMessage("end"), 0.5f); colorTable.setSortEnabled(false); colorTable.setPageLength(0); colorTable.setEditable(true); colorTable.setImmediate(true); addComponent(colorTable); setExpandRatio(colorTable, 1f); setComponentAlignment(colorTable, Alignment.TOP_LEFT); }
From source file:com.hybridbpm.ui.component.document.DocumentLayout.java
License:Apache License
public DocumentLayout(String documentId) { this.documentId = documentId; tabSheet.getTab(documentFormLayout).setCaption(Translate.getMessage("documentFormCaption")); tabSheet.getTab(documentHistoryLayout).setCaption(Translate.getMessage("documentHistoryCaption")); tabSheet.getTab(documentAccessLayout).setCaption(Translate.getMessage("documentAccessCaption")); btnAddPermission.setCaption(Translate.getMessage("btnAddPermission")); btnSave.setCaption(Translate.getMessage("btnSave")); document = HybridbpmUI.getDocumentAPI().getDocumentById(documentId, false); setCaption(document.getName());/*from w w w . j ava 2 s . c om*/ Design.read(this); documentFormLayout.initUI(document); documentHistoryLayout.setDocument(document); documentHistoryLayout.refreshTable(); Responsive.makeResponsive(this); btnSave.setIcon(FontAwesome.SAVE); btnSave.addClickListener(this); btnAddPermission.setIcon(FontAwesome.PLUS); btnAddPermission.addClickListener(this); btnAddPermission.setVisible(false); tabSheet.addSelectedTabChangeListener(this); if (Objects.equals(Document.TYPE.FOLDER, document.getType())) { tabSheet.getTab(documentFormLayout).setCaption("Folder"); tabSheet.getTab(documentHistoryLayout).setVisible(false); } else if (Objects.equals(Document.TYPE.FILE, document.getType())) { tabSheet.getTab(documentFormLayout).setCaption("File"); tabSheet.getTab(documentHistoryLayout).setVisible(true); } if (HybridbpmUI.getDocumentAPI().getMyDocumentPermissions(document) .contains(Permission.PERMISSION.PERMISSIONS)) { documentAccessLayout.setDocument(document); documentAccessLayout.refreshTable(); tabSheet.getTab(documentAccessLayout).setVisible(true); } else { tabSheet.getTab(documentAccessLayout).setVisible(false); } }
From source file:com.mycollab.mobile.module.project.view.message.MessageListViewImpl.java
License:Open Source License
@Override protected Component buildRightComponent() { SearchNavigationButton searchBtn = new SearchNavigationButton() { @Override//from w ww. j a v a 2 s.c om protected SearchInputView getSearchInputView() { return new MessageSearchInputView(); } }; MButton newMessageBtn = new MButton("", clickEvent -> EventBusFactory.getInstance().post(new MessageEvent.GotoAdd(this, null))) .withIcon(FontAwesome.PLUS).withStyleName(UIConstants.CIRCLE_BOX) .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MESSAGES)); return new MHorizontalLayout(searchBtn, newMessageBtn).alignAll(Alignment.TOP_RIGHT); }
From source file:com.mycollab.mobile.module.project.view.milestone.MilestoneListViewImpl.java
License:Open Source License
@Override protected Component buildRightComponent() { SearchNavigationButton searchBtn = new SearchNavigationButton() { @Override//from w ww .ja v a2 s . com protected SearchInputView getSearchInputView() { return new MilestoneSearchInputView(); } }; MButton newMilestoneBtn = new MButton("", clickEvent -> EventBusFactory.getInstance() .post(new MilestoneEvent.GotoAdd(MilestoneListViewImpl.this, null))) .withIcon(FontAwesome.PLUS).withStyleName(UIConstants.CIRCLE_BOX) .withVisible(CurrentProjectVariables .canWrite(ProjectRolePermissionCollections.MILESTONES)); return new MHorizontalLayout(searchBtn, newMilestoneBtn).alignAll(Alignment.TOP_RIGHT); }
From source file:com.mycollab.mobile.module.project.view.settings.ProjectMemberListViewImpl.java
License:Open Source License
@Override protected Component buildRightComponent() { if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS)) { return new MButton("", clickEvent -> EventBusFactory.getInstance() .post(new ProjectMemberEvent.GotoInviteMembers(this, null))).withIcon(FontAwesome.PLUS) .withStyleName(UIConstants.CIRCLE_BOX); }//ww w . j ava 2 s . c o m return null; }
From source file:com.mycollab.mobile.module.project.view.UserProjectListViewImpl.java
License:Open Source License
@Override protected Component buildRightComponent() { return new MButton("", clickEvent -> EventBusFactory.getInstance().post(new ProjectEvent.GotoAdd(this, null))) .withIcon(FontAwesome.PLUS).withStyleName(UIConstants.CIRCLE_BOX); }
From source file:com.mycollab.module.crm.ui.components.CrmPreviewFormControlsGenerator.java
License:Open Source License
public HorizontalLayout createButtonControls(int buttonEnableFlags, String permissionItem) { boolean canRead = false; boolean canWrite = false; boolean canAccess = false; if (permissionItem != null) { canRead = UserUIContext.canRead(permissionItem); canWrite = UserUIContext.canWrite(permissionItem); canAccess = UserUIContext.canAccess(permissionItem); }/*from ww w . j a v a 2 s.c om*/ MHorizontalLayout editBtns = new MHorizontalLayout(); layout.addComponent(editBtns); OptionPopupContent popupButtonsControl = new OptionPopupContent(); if ((buttonEnableFlags & ADD_BTN_PRESENTED) == ADD_BTN_PRESENTED) { MButton addBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADD), clickEvent -> { optionBtn.setPopupVisible(false); T item = previewForm.getBean(); previewForm.fireAddForm(item); }).withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION).withVisible(canWrite); editBtns.addComponent(addBtn); } if ((buttonEnableFlags & EDIT_BTN_PRESENTED) == EDIT_BTN_PRESENTED) { MButton editBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_EDIT), clickEvent -> { optionBtn.setPopupVisible(false); T item = previewForm.getBean(); previewForm.fireEditForm(item); }).withIcon(FontAwesome.EDIT).withStyleName(WebThemes.BUTTON_ACTION).withVisible(canWrite); editBtns.addComponent(editBtn); } if ((buttonEnableFlags & DELETE_BTN_PRESENTED) == DELETE_BTN_PRESENTED) { MButton deleteBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_DELETE), clickEvent -> { T item = previewForm.getBean(); previewForm.fireDeleteForm(item); }).withIcon(FontAwesome.TRASH_O).withStyleName(WebThemes.BUTTON_DANGER).withVisible(canAccess); editBtns.addComponent(deleteBtn); } if ((buttonEnableFlags & PRINT_BTN_PRESENTED) == PRINT_BTN_PRESENTED) { final PrintButton printBtn = new PrintButton(); printBtn.withListener(clickEvent -> { T item = previewForm.getBean(); previewForm.firePrintForm(printBtn, item); }).withStyleName(WebThemes.BUTTON_OPTION).withVisible(canRead); editBtns.addComponent(printBtn); } if ((buttonEnableFlags & CLONE_BTN_PRESENTED) == CLONE_BTN_PRESENTED) { MButton cloneBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLONE), clickEvent -> { optionBtn.setPopupVisible(false); T item = previewForm.getBean(); previewForm.fireCloneForm(item); }).withIcon(FontAwesome.ROAD).withVisible(canWrite); popupButtonsControl.addOption(cloneBtn); } optionBtn.setContent(popupButtonsControl); ButtonGroup navigationBtns = new ButtonGroup(); navigationBtns.setStyleName("navigation-btns"); if ((buttonEnableFlags & NAVIGATOR_BTN_PRESENTED) == NAVIGATOR_BTN_PRESENTED) { MButton previousItem = new MButton("", clickEvent -> { T item = previewForm.getBean(); previewForm.fireGotoPrevious(item); }).withIcon(FontAwesome.CHEVRON_LEFT).withStyleName(WebThemes.BUTTON_OPTION) .withDescription(UserUIContext.getMessage(GenericI18Enum.TOOLTIP_SHOW_PREVIOUS_ITEM)) .withVisible(canRead); navigationBtns.addButton(previousItem); MButton nextItemBtn = new MButton("", clickEvent -> { T item = previewForm.getBean(); previewForm.fireGotoNextItem(item); }).withIcon(FontAwesome.CHEVRON_RIGHT).withStyleName(WebThemes.BUTTON_OPTION) .withDescription(UserUIContext.getMessage(GenericI18Enum.TOOLTIP_SHOW_NEXT_ITEM)) .withVisible(canRead); navigationBtns.addButton(nextItemBtn); } layout.addComponent(navigationBtns); if (popupButtonsControl.getComponentCount() > 0) { optionBtn.setContent(popupButtonsControl); layout.addComponent(optionBtn); } return layout; }
From source file:com.mycollab.module.crm.view.account.AccountCaseListComp.java
License:Open Source License
@Override protected Component generateTopControls() { MHorizontalLayout controlsBtnWrap = new MHorizontalLayout().withFullWidth(); MHorizontalLayout notesWrap = new MHorizontalLayout().withFullWidth(); Label noteLbl = new Label(UserUIContext.getMessage(GenericI18Enum.OPT_NOTE)); noteLbl.setSizeUndefined();/* w w w .j a v a2 s . c om*/ noteLbl.setStyleName("list-note-lbl"); notesWrap.addComponent(noteLbl); CssLayout noteBlock = new CssLayout(); noteBlock.setWidth("100%"); noteBlock.setStyleName("list-note-block"); for (CaseStatus status : CrmDataTypeFactory.getCasesStatusList()) { ELabel note = new ELabel(UserUIContext.getMessage(status)) .withStyleName("note-label", colorsMap.get(status.name())).withWidthUndefined(); noteBlock.addComponent(note); } notesWrap.with(noteBlock).expand(noteBlock); controlsBtnWrap.addComponent(notesWrap); if (UserUIContext.canWrite(RolePermissionCollections.CRM_CASE)) { MButton createBtn = new MButton(UserUIContext.getMessage(CaseI18nEnum.NEW), clickEvent -> fireNewRelatedItem("")).withIcon(FontAwesome.PLUS) .withStyleName(WebThemes.BUTTON_ACTION); controlsBtnWrap.with(createBtn).withAlign(createBtn, Alignment.TOP_RIGHT); } return controlsBtnWrap; }