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.mycollab.module.project.view.bug.BugListViewImpl.java
License:Open Source License
public BugListViewImpl() { this.withMargin(new MarginInfo(false, true, true, true)); searchPanel = new BugSearchPanel(); MHorizontalLayout groupWrapLayout = new MHorizontalLayout(); groupWrapLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); groupWrapLayout.addComponent(new Label("Sort")); final ComboBox sortCombo = new ValueComboBox(false, AppContext.getMessage(GenericI18Enum.OPT_SORT_DESCENDING), AppContext.getMessage(GenericI18Enum.OPT_SORT_ASCENDING)); sortCombo.addValueChangeListener(valueChangeEvent -> { String sortValue = (String) sortCombo.getValue(); if (AppContext.getMessage(GenericI18Enum.OPT_SORT_ASCENDING).equals(sortValue)) { sortDirection = SearchCriteria.ASC; } else {/*from www . j a v a 2s . c o m*/ sortDirection = SearchCriteria.DESC; } queryAndDisplayBugs(); }); sortDirection = SearchCriteria.DESC; groupWrapLayout.addComponent(sortCombo); groupWrapLayout.addComponent(new Label("Group by")); final ComboBox groupCombo = new ValueComboBox(false, GROUP_DUE_DATE, GROUP_START_DATE, GROUP_CREATED_DATE, PLAIN_LIST, GROUP_USER); groupCombo.addValueChangeListener(valueChangeEvent -> { groupByState = (String) groupCombo.getValue(); queryAndDisplayBugs(); }); groupByState = GROUP_DUE_DATE; groupWrapLayout.addComponent(groupCombo); searchPanel.addHeaderRight(groupWrapLayout); MButton printBtn = new MButton("", clickEvent -> { UI.getCurrent().addWindow(new BugCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return baseCriteria; } })); }).withIcon(FontAwesome.PRINT).withStyleName(UIConstants.BUTTON_OPTION); printBtn.setDescription(AppContext.getMessage(GenericI18Enum.ACTION_EXPORT)); groupWrapLayout.addComponent(printBtn); MButton newBugBtn = new MButton(AppContext.getMessage(BugI18nEnum.NEW), clickEvent -> { SimpleBug bug = new SimpleBug(); bug.setProjectid(CurrentProjectVariables.getProjectId()); bug.setSaccountid(AppContext.getAccountId()); bug.setLogby(AppContext.getUsername()); UI.getCurrent().addWindow(new BugAddWindow(bug)); }).withIcon(FontAwesome.PLUS).withStyleName(UIConstants.BUTTON_ACTION) .withDescription(AppContext.getMessage(BugI18nEnum.NEW)) .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.BUGS)); groupWrapLayout.addComponent(newBugBtn); Button advanceDisplayBtn = new Button("List"); advanceDisplayBtn.setWidth("100px"); advanceDisplayBtn.setIcon(FontAwesome.SITEMAP); advanceDisplayBtn.setDescription("Detail"); MButton kanbanBtn = new MButton("Kanban", clickEvent -> displayKanbanView()).withIcon(FontAwesome.TH) .withWidth("100px"); kanbanBtn.setDescription("Kanban View"); ToggleButtonGroup viewButtons = new ToggleButtonGroup(); viewButtons.addButton(advanceDisplayBtn); viewButtons.addButton(kanbanBtn); viewButtons.withDefaultButton(advanceDisplayBtn); groupWrapLayout.addComponent(viewButtons); MHorizontalLayout mainLayout = new MHorizontalLayout().withFullHeight().withFullWidth(); wrapBody = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, false)); rightColumn = new MVerticalLayout().withWidth("370px").withMargin(new MarginInfo(true, false, true, false)); mainLayout.with(wrapBody, rightColumn).expand(wrapBody); this.with(searchPanel, mainLayout); }
From source file:com.mycollab.module.project.view.milestone.MilestoneListViewImpl.java
License:Open Source License
private HorizontalLayout createHeaderRight() { MHorizontalLayout layout = new MHorizontalLayout(); MButton createBtn = new MButton(UserUIContext.getMessage(MilestoneI18nEnum.NEW), clickEvent -> { SimpleMilestone milestone = new SimpleMilestone(); milestone.setSaccountid(MyCollabUI.getAccountId()); milestone.setProjectid(CurrentProjectVariables.getProjectId()); UI.getCurrent().addWindow(new MilestoneAddWindow(milestone)); }).withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION) .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)); layout.with(createBtn);// w w w . j av a2 s. c o m MButton printBtn = new MButton("", clickEvent -> UI.getCurrent() .addWindow(new MilestoneCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return baseCriteria; } }))).withIcon(FontAwesome.PRINT).withStyleName(WebThemes.BUTTON_OPTION) .withDescription(UserUIContext.getMessage(GenericI18Enum.ACTION_EXPORT)); layout.addComponent(printBtn); MButton boardBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_BOARD)) .withIcon(FontAwesome.SERVER).withWidth("100px"); MButton roadmapBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_LIST), clickEvent -> EventBusFactory.getInstance() .post(new MilestoneEvent.GotoRoadmap(MilestoneListViewImpl.this))) .withIcon(FontAwesome.NAVICON).withWidth("100px"); ToggleButtonGroup viewButtons = new ToggleButtonGroup(); viewButtons.addButton(roadmapBtn); viewButtons.addButton(boardBtn); if (!SiteConfiguration.isCommunityEdition()) { MButton kanbanBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_KANBAN), clickEvent -> EventBusFactory.getInstance() .post(new MilestoneEvent.GotoKanban(MilestoneListViewImpl.this))) .withIcon(FontAwesome.TH).withWidth("100px"); viewButtons.addButton(kanbanBtn); } viewButtons.withDefaultButton(boardBtn); layout.with(viewButtons); return layout; }
From source file:com.mycollab.module.project.view.milestone.MilestoneRoadmapViewImpl.java
License:Open Source License
private HorizontalLayout createHeaderRight() { MButton createBtn = new MButton(UserUIContext.getMessage(MilestoneI18nEnum.NEW), clickEvent -> { SimpleMilestone milestone = new SimpleMilestone(); milestone.setSaccountid(MyCollabUI.getAccountId()); milestone.setProjectid(CurrentProjectVariables.getProjectId()); UI.getCurrent().addWindow(new MilestoneAddWindow(milestone)); }).withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION) .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)); MButton printBtn = new MButton("", clickEvent -> UI.getCurrent() .addWindow(new MilestoneCustomizeReportOutputWindow(new LazyValueInjector() { @Override//from w w w . j a va 2 s .c o m protected Object doEval() { return baseCriteria; } }))).withIcon(FontAwesome.PRINT).withStyleName(WebThemes.BUTTON_OPTION) .withDescription(UserUIContext.getMessage(GenericI18Enum.ACTION_EXPORT)); MButton boardBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_BOARD), clickEvent -> EventBusFactory.getInstance().post(new MilestoneEvent.GotoList(this, null))) .withIcon(FontAwesome.SERVER).withWidth("100px"); MButton roadmapBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_LIST)) .withIcon(FontAwesome.NAVICON).withWidth("100px"); ToggleButtonGroup viewButtons = new ToggleButtonGroup(); viewButtons.addButton(roadmapBtn); viewButtons.addButton(boardBtn); if (!SiteConfiguration.isCommunityEdition()) { MButton kanbanBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_KANBAN), clickEvent -> EventBusFactory.getInstance() .post(new MilestoneEvent.GotoKanban(MilestoneRoadmapViewImpl.this))) .withIcon(FontAwesome.TH).withWidth("100px"); viewButtons.addButton(kanbanBtn); } viewButtons.withDefaultButton(roadmapBtn); return new MHorizontalLayout(createBtn, printBtn, viewButtons); }
From source file:com.mycollab.module.project.view.page.PageListViewImpl.java
License:Open Source License
private void initHeader() { HeaderWithFontAwesome headerText = ComponentUtils.headerH2(ProjectTypeConstants.PAGE, UserUIContext.getMessage(PageI18nEnum.LIST)); headerLayout.with(headerText).alignAll(Alignment.MIDDLE_LEFT).expand(headerText); Label sortLbl = new Label(UserUIContext.getMessage(PageI18nEnum.OPT_SORT_LABEL)); sortLbl.setSizeUndefined();//from w ww .j a v a 2s. c om headerLayout.with(sortLbl).withAlign(sortLbl, Alignment.MIDDLE_RIGHT); ToggleButtonGroup sortGroup = new ToggleButtonGroup(); headerLayout.with(sortGroup).withAlign(sortGroup, Alignment.MIDDLE_RIGHT); SortButton sortDateBtn = new SortButton(UserUIContext.getMessage(PageI18nEnum.OPT_SORT_BY_DATE), clickEvent -> { dateSourceAscend = !dateSourceAscend; if (dateSourceAscend) { Collections.sort(resources, Ordering.from(dateSort)); } else { Collections.sort(resources, Ordering.from(dateSort).reverse()); } displayPages(resources); }); sortGroup.addButton(sortDateBtn); SortButton sortNameBtn = new SortButton(UserUIContext.getMessage(PageI18nEnum.OPT_SORT_BY_NAME), clickEvent -> { nameSortAscend = !nameSortAscend; if (nameSortAscend) { Collections.sort(resources, Ordering.from(nameSort)); } else { Collections.sort(resources, Ordering.from(nameSort).reverse()); } displayPages(resources); }); sortGroup.addButton(sortNameBtn); SortButton sortKindBtn = new SortButton(UserUIContext.getMessage(PageI18nEnum.OPT_SORT_BY_KIND), clickEvent -> { kindSortAscend = !kindSortAscend; if (kindSortAscend) { Collections.sort(resources, Ordering.from(kindSort)); } else { Collections.sort(resources, Ordering.from(kindSort).reverse()); } displayPages(resources); }); sortGroup.addButton(sortKindBtn); sortGroup.withDefaultButton(sortDateBtn); MButton newGroupBtn = new MButton(UserUIContext.getMessage(PageI18nEnum.NEW_GROUP), clickEvent -> UI.getCurrent().addWindow(new GroupPageAddWindow())).withIcon(FontAwesome.PLUS) .withStyleName(WebThemes.BUTTON_ACTION); newGroupBtn.setVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PAGES)); headerLayout.with(newGroupBtn).withAlign(newGroupBtn, Alignment.MIDDLE_RIGHT); MButton newPageBtn = new MButton(UserUIContext.getMessage(PageI18nEnum.NEW), clickEvent -> EventBusFactory.getInstance().post(new PageEvent.GotoAdd(this, null))) .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION); newPageBtn.setVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.PAGES)); headerLayout.with(newPageBtn).withAlign(newPageBtn, Alignment.MIDDLE_RIGHT); }
From source file:com.mycollab.module.project.view.ProjectSearchPanel.java
License:Open Source License
@Override protected Component buildExtraControls() { MButton createBtn = new MButton(UserUIContext.getMessage(ProjectI18nEnum.NEW), clickEvent -> UI.getCurrent() .addWindow(ViewManager.getCacheComponent(AbstractProjectAddWindow.class))) .withStyleName(WebThemes.BUTTON_ACTION).withIcon(FontAwesome.PLUS); createBtn.setVisible(UserUIContext.canBeYes(RolePermissionCollections.CREATE_NEW_PROJECT)); return createBtn; }
From source file:com.mycollab.module.project.view.settings.ComponentSearchPanel.java
License:Open Source License
@Override protected Component buildExtraControls() { return new MButton(UserUIContext.getMessage(ComponentI18nEnum.NEW), clickEvent -> EventBusFactory.getInstance().post(new BugComponentEvent.GotoAdd(this, null))) .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION) .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.COMPONENTS)); }
From source file:com.mycollab.module.project.view.settings.ProjectRoleSearchPanel.java
License:Open Source License
@Override protected Component buildExtraControls() { MButton createBtn = new MButton(UserUIContext.getMessage(ProjectRoleI18nEnum.NEW), clickEvent -> EventBusFactory.getInstance().post(new ProjectRoleEvent.GotoAdd(this, null))) .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION); createBtn.setVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.ROLES)); return createBtn; }
From source file:com.mycollab.module.project.view.settings.VersionSearchPanel.java
License:Open Source License
@Override protected Component buildExtraControls() { MButton createBtn = new MButton(UserUIContext.getMessage(VersionI18nEnum.NEW), clickEvent -> EventBusFactory.getInstance().post(new BugVersionEvent.GotoAdd(this, null))) .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION) .withVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.VERSIONS)); return createBtn; }
From source file:com.mycollab.module.project.view.task.TaskDashboardViewImpl.java
License:Open Source License
public TaskDashboardViewImpl() { this.withMargin(new MarginInfo(false, true, true, true)); taskSearchPanel = new TaskSearchPanel(); MHorizontalLayout groupWrapLayout = new MHorizontalLayout(); groupWrapLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); groupWrapLayout.addComponent(new Label("Sort")); final ComboBox sortCombo = new ValueComboBox(false, AppContext.getMessage(GenericI18Enum.OPT_SORT_DESCENDING), AppContext.getMessage(GenericI18Enum.OPT_SORT_ASCENDING)); sortCombo.addValueChangeListener(new Property.ValueChangeListener() { @Override/*from w w w .j a v a2s . c o m*/ public void valueChange(Property.ValueChangeEvent valueChangeEvent) { String sortValue = (String) sortCombo.getValue(); if (AppContext.getMessage(GenericI18Enum.OPT_SORT_ASCENDING).equals(sortValue)) { sortDirection = SearchCriteria.ASC; } else { sortDirection = SearchCriteria.DESC; } queryAndDisplayTasks(); } }); sortDirection = SearchCriteria.DESC; groupWrapLayout.addComponent(sortCombo); groupWrapLayout.addComponent(new Label("Group by")); final ComboBox groupCombo = new ValueComboBox(false, GROUP_DUE_DATE, GROUP_START_DATE, GROUP_CREATED_DATE, PLAIN_LIST, GROUP_USER); groupCombo.addValueChangeListener(valueChangeEvent -> { groupByState = (String) groupCombo.getValue(); queryAndDisplayTasks(); }); groupByState = GROUP_DUE_DATE; groupWrapLayout.addComponent(groupCombo); taskSearchPanel.addHeaderRight(groupWrapLayout); MButton printBtn = new MButton("", clickEvent -> { UI.getCurrent().addWindow(new TaskCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return baseCriteria; } })); }).withIcon(FontAwesome.PRINT).withStyleName(UIConstants.BUTTON_OPTION) .withDescription(AppContext.getMessage(GenericI18Enum.ACTION_EXPORT)); groupWrapLayout.addComponent(printBtn); MButton newTaskBtn = new MButton(AppContext.getMessage(TaskI18nEnum.NEW), clickEvent -> { if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS)) { SimpleTask newTask = new SimpleTask(); newTask.setProjectid(CurrentProjectVariables.getProjectId()); newTask.setSaccountid(AppContext.getAccountId()); newTask.setLogby(AppContext.getUsername()); UI.getCurrent().addWindow(new TaskAddWindow(newTask)); } }).withIcon(FontAwesome.PLUS).withStyleName(UIConstants.BUTTON_ACTION); newTaskBtn.setVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS)); groupWrapLayout.addComponent(newTaskBtn); Button advanceDisplayBtn = new Button("List"); advanceDisplayBtn.setWidth("100px"); advanceDisplayBtn.setIcon(FontAwesome.SITEMAP); advanceDisplayBtn.setDescription("Advance View"); MButton kanbanBtn = new MButton("Kanban", clickEvent -> displayKanbanView()).withWidth("100px") .withIcon(FontAwesome.TH).withDescription("Kanban view"); ToggleButtonGroup viewButtons = new ToggleButtonGroup(); viewButtons.addButton(advanceDisplayBtn); viewButtons.addButton(kanbanBtn); viewButtons.withDefaultButton(advanceDisplayBtn); groupWrapLayout.addComponent(viewButtons); MHorizontalLayout mainLayout = new MHorizontalLayout().withFullHeight().withFullWidth(); wrapBody = new MVerticalLayout().withMargin(new MarginInfo(false, true, true, false)); rightColumn = new MVerticalLayout().withWidth("370px") .withMargin(new MarginInfo(true, false, false, false)); mainLayout.with(wrapBody, rightColumn).expand(wrapBody); this.with(taskSearchPanel, mainLayout); }
From source file:com.mycollab.module.project.view.task.TaskKanbanBoardViewImpl.java
License:Open Source License
public TaskKanbanBoardViewImpl() { this.setSizeFull(); this.withSpacing(true).withMargin(new MarginInfo(false, true, true, true)); searchPanel = new TaskSearchPanel(); MHorizontalLayout groupWrapLayout = new MHorizontalLayout(); groupWrapLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); searchPanel.addHeaderRight(groupWrapLayout); toggleShowColumnsBtn = new MButton("", clickEvent -> { displayHiddenColumns = !displayHiddenColumns; reload();/*w ww . j a va 2 s .co m*/ toggleShowButton(); }).withStyleName(WebThemes.BUTTON_LINK); groupWrapLayout.addComponent(toggleShowColumnsBtn); toggleShowButton(); if (CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.TASKS)) { MButton addNewColumnBtn = new MButton(UserUIContext.getMessage(TaskI18nEnum.ACTION_NEW_COLUMN), clickEvent -> UI.getCurrent() .addWindow(new AddNewColumnWindow(this, ProjectTypeConstants.TASK, "status"))) .withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION); groupWrapLayout.addComponent(addNewColumnBtn); } MButton deleteColumnBtn = new MButton(UserUIContext.getMessage(TaskI18nEnum.ACTION_DELETE_COLUMNS), clickEvent -> UI.getCurrent().addWindow(new DeleteColumnWindow(this, ProjectTypeConstants.TASK))) .withIcon(FontAwesome.TRASH_O).withStyleName(WebThemes.BUTTON_DANGER); deleteColumnBtn.setVisible(CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.TASKS)); MButton advanceDisplayBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_LIST), clickEvent -> EventBusFactory.getInstance().post(new TicketEvent.GotoDashboard(this, null))) .withIcon(FontAwesome.NAVICON).withWidth("100px"); MButton kanbanBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_KANBAN)) .withIcon(FontAwesome.TH).withWidth("100px"); ToggleButtonGroup viewButtons = new ToggleButtonGroup(); viewButtons.addButton(advanceDisplayBtn); viewButtons.addButton(kanbanBtn); viewButtons.withDefaultButton(kanbanBtn); groupWrapLayout.addComponent(viewButtons); kanbanLayout = new DDHorizontalLayout(); kanbanLayout.setHeight("100%"); kanbanLayout.addStyleName("kanban-layout"); kanbanLayout.setSpacing(true); kanbanLayout.setMargin(new MarginInfo(true, false, true, false)); kanbanLayout.setComponentHorizontalDropRatio(0.3f); kanbanLayout.setDragMode(LayoutDragMode.CLONE_OTHER); // Enable dropping components kanbanLayout.setDropHandler(new DropHandler() { @Override public void drop(DragAndDropEvent event) { LayoutBoundTransferable transferable = (LayoutBoundTransferable) event.getTransferable(); DDHorizontalLayout.HorizontalLayoutTargetDetails details = (DDHorizontalLayout.HorizontalLayoutTargetDetails) event .getTargetDetails(); Component dragComponent = transferable.getComponent(); if (dragComponent instanceof KanbanBlock) { KanbanBlock kanbanItem = (KanbanBlock) dragComponent; int newIndex = details.getOverIndex(); if (details.getDropLocation() == HorizontalDropLocation.RIGHT) { kanbanLayout.addComponent(kanbanItem); } else if (newIndex == -1) { kanbanLayout.addComponent(kanbanItem, 0); } else { kanbanLayout.addComponent(kanbanItem, newIndex); } //Update options index for this project List<Map<String, Integer>> indexMap = new ArrayList<>(); for (int i = 0; i < kanbanLayout.getComponentCount(); i++) { KanbanBlock blockItem = (KanbanBlock) kanbanLayout.getComponent(i); Map<String, Integer> map = new HashMap<>(2); map.put("id", blockItem.optionVal.getId()); map.put("index", i); indexMap.add(map); } if (indexMap.size() > 0) { optionValService.massUpdateOptionIndexes(indexMap, MyCollabUI.getAccountId()); } } } @Override public AcceptCriterion getAcceptCriterion() { return new Not(VerticalLocationIs.MIDDLE); } }); this.with(searchPanel, kanbanLayout).expand(kanbanLayout); }