List of usage examples for com.vaadin.server FontAwesome PRINT
FontAwesome PRINT
To view the source code for com.vaadin.server FontAwesome PRINT.
Click Source Link
From source file:com.esofthead.mycollab.module.project.view.milestone.MilestoneRoadmapViewImpl.java
License:Open Source License
private HorizontalLayout createHeaderRight() { MHorizontalLayout layout = new MHorizontalLayout(); createBtn = new Button(AppContext.getMessage(MilestoneI18nEnum.NEW), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override//from w ww . j a v a2 s . c o m public void buttonClick(final Button.ClickEvent event) { SimpleMilestone milestone = new SimpleMilestone(); milestone.setSaccountid(AppContext.getAccountId()); milestone.setProjectid(CurrentProjectVariables.getProjectId()); UI.getCurrent().addWindow(new MilestoneAddWindow(milestone)); } }); createBtn.setIcon(FontAwesome.PLUS); createBtn.setStyleName(UIConstants.BUTTON_ACTION); createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)); layout.with(createBtn); Button printBtn = new Button("", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { UI.getCurrent().addWindow(new MilestoneCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return baseCriteria; } })); } }); printBtn.setIcon(FontAwesome.PRINT); printBtn.addStyleName(UIConstants.BUTTON_OPTION); printBtn.setDescription(AppContext.getMessage(GenericI18Enum.ACTION_EXPORT)); layout.addComponent(printBtn); Button kanbanBtn = new Button("Board", new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { EventBusFactory.getInstance() .post(new MilestoneEvent.GotoList(MilestoneRoadmapViewImpl.this, null)); } }); kanbanBtn.setDescription("Board View"); kanbanBtn.setIcon(FontAwesome.TH); Button roadmapBtn = new Button("List"); roadmapBtn.setDescription("Roadmap"); roadmapBtn.setIcon(VaadinIcons.CUBE); ToggleButtonGroup viewButtons = new ToggleButtonGroup(); viewButtons.addButton(roadmapBtn); viewButtons.addButton(kanbanBtn); viewButtons.withDefaultButton(roadmapBtn); layout.with(viewButtons); return layout; }
From source file:com.esofthead.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/* w w w . j a v a 2s.co 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(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { groupByState = (String) groupCombo.getValue(); queryAndDisplayTasks(); } }); groupByState = GROUP_DUE_DATE; groupWrapLayout.addComponent(groupCombo); taskSearchPanel.addHeaderRight(groupWrapLayout); Button printBtn = new Button("", new Button.ClickListener() { @Override public void buttonClick(ClickEvent clickEvent) { UI.getCurrent().addWindow(new TaskCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return baseCriteria; } })); } }); printBtn.setIcon(FontAwesome.PRINT); printBtn.addStyleName(UIConstants.BUTTON_OPTION); printBtn.setDescription(AppContext.getMessage(GenericI18Enum.ACTION_EXPORT)); groupWrapLayout.addComponent(printBtn); Button newTaskBtn = new Button(AppContext.getMessage(TaskI18nEnum.NEW), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { 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)); } } }); newTaskBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS)); newTaskBtn.setIcon(FontAwesome.PLUS); newTaskBtn.setStyleName(UIConstants.BUTTON_ACTION); groupWrapLayout.addComponent(newTaskBtn); Button advanceDisplayBtn = new Button("List"); advanceDisplayBtn.setWidth("100px"); advanceDisplayBtn.setIcon(FontAwesome.SITEMAP); advanceDisplayBtn.setDescription("Advance View"); Button kanbanBtn = new Button("Kanban", new Button.ClickListener() { @Override public void buttonClick(ClickEvent clickEvent) { displayKanbanView(); } }); kanbanBtn.setWidth("100px"); kanbanBtn.setDescription("Kanban View"); kanbanBtn.setIcon(FontAwesome.TH); 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.esofthead.mycollab.reporting.PrintButton.java
License:Open Source License
public PrintButton() { setIcon(FontAwesome.PRINT); formReportStreamSource = new FormReportStreamSource(new FormReportTemplateExecutor("")); printWindowOpener = new BrowserWindowOpener( new StreamResource(formReportStreamSource, UUID.randomUUID().toString() + ".pdf")); printWindowOpener.extend(this); }
From source file:com.ies.schoolos.ui.mobile.info.layout.PersonalLayout.java
private void spouseGroup() { spouseGroup = new VerticalComponentGroup(); spouseGroup.setSizeUndefined();// w w w.java 2 s .c om addTab(spouseGroup, "", FontAwesome.USER); sPeopleIdType = new OptionGroup("", new PeopleIdType()); sPeopleIdType.setItemCaptionPropertyId("name"); sPeopleIdType.setImmediate(true); sPeopleIdType.setNullSelectionAllowed(false); sPeopleIdType.setWidth("-1px"); sPeopleIdType.setHeight("-1px"); spouseGroup.addComponent(sPeopleIdType); sPeopleid = new TextField(""); sPeopleid.setInputPrompt(""); sPeopleid.setImmediate(false); sPeopleid.setWidth("-1px"); sPeopleid.setHeight("-1px"); sPeopleid.setNullRepresentation(""); //sPeopleid.addValidator(new StringLengthValidator("?", 13, 20, true)); sPeopleid.addTextChangeListener(new TextChangeListener() { private static final long serialVersionUID = 1L; @Override public void textChange(TextChangeEvent event) { if (event.getText() != null) { if (event.getText().length() >= 13) { fSqlContainer.addContainerFilter(new Equal(FamilySchema.PEOPLE_ID, event.getText())); if (fSqlContainer.size() > 0) { Item item = fSqlContainer.getItem(fSqlContainer.getIdByIndex(0)); spouseBinder.setItemDataSource(item); pkStore[2] = item.getItemProperty(FamilySchema.FAMILY_ID).getValue(); spouseBinder.setEnabled(false); isDuplicateSpouse = true; } fSqlContainer.removeAllContainerFilters(); } } } }); spouseGroup.addComponent(sPeopleid); sPrename = new NativeSelect("", new Prename()); //sPrename.setInputPrompt("??"); sPrename.setItemCaptionPropertyId("name"); sPrename.setImmediate(true); sPrename.setNullSelectionAllowed(false); sPrename.setRequired(true); sPrename.setWidth("-1px"); sPrename.setHeight("-1px"); //sPrename.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sPrename); sFirstname = new TextField(""); sFirstname.setInputPrompt(""); sFirstname.setImmediate(false); sFirstname.setRequired(true); sFirstname.setWidth("-1px"); sFirstname.setHeight("-1px"); sFirstname.setNullRepresentation(""); spouseGroup.addComponent(sFirstname); sLastname = new TextField("?"); sLastname.setInputPrompt("?"); sLastname.setImmediate(false); sLastname.setRequired(true); sLastname.setWidth("-1px"); sLastname.setHeight("-1px"); sLastname.setNullRepresentation(""); spouseGroup.addComponent(sLastname); sFirstnameNd = new TextField("?"); sFirstnameNd.setInputPrompt("?"); sFirstnameNd.setImmediate(false); sFirstnameNd.setWidth("-1px"); sFirstnameNd.setHeight("-1px"); sFirstnameNd.setNullRepresentation(""); spouseGroup.addComponent(sFirstnameNd); sLastnameNd = new TextField("??"); sLastnameNd.setInputPrompt("??"); sLastnameNd.setImmediate(false); sLastnameNd.setWidth("-1px"); sLastnameNd.setHeight("-1px"); sLastnameNd.setNullRepresentation(""); spouseGroup.addComponent(sLastnameNd); sGender = new OptionGroup("", new Gender()); sGender.setItemCaptionPropertyId("name"); sGender.setImmediate(true); sGender.setNullSelectionAllowed(false); sGender.setRequired(true); sGender.setWidth("-1px"); sGender.setHeight("-1px"); spouseGroup.addComponent(sGender); sReligion = new NativeSelect("", new Religion()); //sReligion.setInputPrompt("??"); sReligion.setItemCaptionPropertyId("name"); sReligion.setImmediate(true); sReligion.setNullSelectionAllowed(false); sReligion.setRequired(true); sReligion.setWidth("-1px"); sReligion.setHeight("-1px"); //sReligion.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sReligion); sRace = new NativeSelect("", new Race()); //sRace.setInputPrompt("??"); sRace.setItemCaptionPropertyId("name"); sRace.setImmediate(true); sRace.setNullSelectionAllowed(false); sRace.setRequired(true); sRace.setWidth("-1px"); sRace.setHeight("-1px"); //sRace.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sRace); sNationality = new NativeSelect("?", new Nationality()); //sNationality.setInputPrompt("??"); sNationality.setItemCaptionPropertyId("name"); sNationality.setImmediate(true); sNationality.setNullSelectionAllowed(false); sNationality.setRequired(true); sNationality.setWidth("-1px"); sNationality.setHeight("-1px"); //sNationality.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sNationality); sBirthDate = new PopupDateField(" ?"); sBirthDate.setInputPrompt("//"); sBirthDate.setImmediate(false); sBirthDate.setWidth("-1px"); sBirthDate.setHeight("-1px"); sBirthDate.setDateFormat("dd/MM/yyyy"); sBirthDate.setLocale(new Locale("th", "TH")); spouseGroup.addComponent(sBirthDate); sTel = new TextField(""); sTel.setInputPrompt(""); sTel.setImmediate(false); sTel.setWidth("-1px"); sTel.setHeight("-1px"); sTel.setNullRepresentation(""); spouseGroup.addComponent(sTel); sMobile = new TextField(""); sMobile.setInputPrompt(""); sMobile.setImmediate(false); sMobile.setWidth("-1px"); sMobile.setHeight("-1px"); sMobile.setNullRepresentation(""); spouseGroup.addComponent(sMobile); sEmail = new TextField(""); sEmail.setInputPrompt(""); sEmail.setImmediate(false); sEmail.setWidth("-1px"); sEmail.setHeight("-1px"); sEmail.setNullRepresentation(""); sEmail.addValidator(new EmailValidator("?")); spouseGroup.addComponent(sEmail); sSalary = new NumberField(""); sSalary.setInputPrompt(""); sSalary.setImmediate(false); sSalary.setWidth("-1px"); sSalary.setHeight("-1px"); sSalary.setNullRepresentation(""); spouseGroup.addComponent(sSalary); sAliveStatus = new NativeSelect("", new AliveStatus()); //sAliveStatus.setInputPrompt("??"); sAliveStatus.setItemCaptionPropertyId("name"); sAliveStatus.setImmediate(true); sAliveStatus.setNullSelectionAllowed(false); sAliveStatus.setRequired(true); sAliveStatus.setWidth("-1px"); sAliveStatus.setHeight("-1px"); //sAliveStatus.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sAliveStatus); sOccupation = new NativeSelect("", new Occupation()); //sOccupation.setInputPrompt("??"); sOccupation.setItemCaptionPropertyId("name"); sOccupation.setImmediate(true); sOccupation.setNullSelectionAllowed(false); sOccupation.setRequired(true); sOccupation.setWidth("-1px"); sOccupation.setHeight("-1px"); //sOccupation.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sOccupation); sJobAddress = new TextArea(""); sJobAddress.setInputPrompt(" "); sJobAddress.setImmediate(false); sJobAddress.setWidth("-1px"); sJobAddress.setHeight("-1px"); sJobAddress.setNullRepresentation(""); spouseGroup.addComponent(sJobAddress); sCurrentAddress = new TextArea(""); sCurrentAddress.setInputPrompt(" "); sCurrentAddress.setImmediate(false); sCurrentAddress.setWidth("-1px"); sCurrentAddress.setHeight("-1px"); sCurrentAddress.setNullRepresentation(""); spouseGroup.addComponent(sCurrentAddress); sCurrentProvinceId = new NativeSelect("", new Province()); //sCurrentProvinceId.setInputPrompt("??"); sCurrentProvinceId.setItemCaptionPropertyId("name"); sCurrentProvinceId.setImmediate(true); sCurrentProvinceId.setNullSelectionAllowed(false); sCurrentProvinceId.setWidth("-1px"); sCurrentProvinceId.setHeight("-1px"); //sCurrentProvinceId.setFilteringMode(FilteringMode.CONTAINS); sCurrentProvinceId.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) sCurrentDistrict.setContainerDataSource( new District(Integer.parseInt(event.getProperty().getValue().toString()))); } }); spouseGroup.addComponent(sCurrentProvinceId); sCurrentDistrict = new NativeSelect("", new Blood()); //sCurrentDistrict.setInputPrompt("??"); sCurrentDistrict.setItemCaptionPropertyId("name"); sCurrentDistrict.setImmediate(true); sCurrentDistrict.setNullSelectionAllowed(false); sCurrentDistrict.setWidth("-1px"); sCurrentDistrict.setHeight("-1px"); //sCurrentDistrict.setFilteringMode(FilteringMode.CONTAINS); sCurrentDistrict.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) { sCurrentCity.setContainerDataSource( new City(Integer.parseInt(event.getProperty().getValue().toString()))); sCurrentPostcode.setContainerDataSource( new Postcode(Integer.parseInt(event.getProperty().getValue().toString()))); } } }); spouseGroup.addComponent(sCurrentDistrict); sCurrentCity = new NativeSelect(""); //sCurrentCity.setInputPrompt("??"); sCurrentCity.setItemCaptionPropertyId("name"); sCurrentCity.setImmediate(true); sCurrentCity.setNullSelectionAllowed(false); sCurrentCity.setWidth("-1px"); sCurrentCity.setHeight("-1px"); //sCurrentCity.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sCurrentCity); sCurrentPostcode = new NativeSelect(""); //sCurrentPostcode.setInputPrompt("??"); sCurrentPostcode.setItemCaptionPropertyId("name"); sCurrentPostcode.setImmediate(true); sCurrentPostcode.setNullSelectionAllowed(false); sCurrentPostcode.setWidth("-1px"); sCurrentPostcode.setHeight("-1px"); //sCurrentPostcode.setFilteringMode(FilteringMode.CONTAINS); spouseGroup.addComponent(sCurrentPostcode); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); buttonLayout.setWidth("100%"); spouseGroup.addComponent(buttonLayout); motherBack = new Button(FontAwesome.ARROW_LEFT); motherBack.setWidth("100%"); motherBack.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { setSelectedTab(motherGroup); } }); buttonLayout.addComponents(motherBack); finish = new Button("?", FontAwesome.SAVE); finish.setWidth("100%"); buttonLayout.addComponents(finish); print = new Button("", FontAwesome.PRINT); print.setVisible(false); print.setWidth("100%"); buttonLayout.addComponents(print); }
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 w w w .j a v a 2 s. com 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);//from w w w . j av a2s . 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/*ww w .j av a2 s . co 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.settings.ProjectMemberListViewImpl.java
License:Open Source License
public ProjectMemberListViewImpl() { super();//from w w w .ja v a 2s .c om this.setMargin(new MarginInfo(false, true, true, true)); MHorizontalLayout viewHeader = new MHorizontalLayout().withMargin(new MarginInfo(true, false, true, false)) .withFullWidth(); viewHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); headerText = ComponentUtils.headerH2(ProjectTypeConstants.MEMBER, UserUIContext.getMessage(ProjectMemberI18nEnum.LIST)); viewHeader.with(headerText).expand(headerText); final MButton sortBtn = new MButton().withIcon(FontAwesome.SORT_ALPHA_ASC) .withStyleName(WebThemes.BUTTON_ICON_ONLY); sortBtn.addClickListener(clickEvent -> { sortAsc = !sortAsc; if (sortAsc) { sortBtn.setIcon(FontAwesome.SORT_ALPHA_ASC); displayMembers(); } else { sortBtn.setIcon(FontAwesome.SORT_ALPHA_DESC); displayMembers(); } }); viewHeader.addComponent(sortBtn); final SearchTextField searchTextField = new SearchTextField() { @Override public void doSearch(String value) { searchCriteria.setMemberFullName(StringSearchField.and(value)); displayMembers(); } @Override public void emptySearch() { searchCriteria.setMemberFullName(null); displayMembers(); } }; searchTextField.addStyleName(ValoTheme.TEXTFIELD_SMALL); viewHeader.addComponent(searchTextField); MButton printBtn = new MButton("", clickEvent -> { UI.getCurrent().addWindow(new ProjectMemberCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return searchCriteria; } })); }).withIcon(FontAwesome.PRINT).withStyleName(WebThemes.BUTTON_OPTION) .withDescription(UserUIContext.getMessage(GenericI18Enum.ACTION_EXPORT)); viewHeader.addComponent(printBtn); MButton createBtn = new MButton(UserUIContext.getMessage(ProjectMemberI18nEnum.BUTTON_NEW_INVITEES), clickEvent -> EventBusFactory.getInstance() .post(new ProjectMemberEvent.GotoInviteMembers(this, null))) .withStyleName(WebThemes.BUTTON_ACTION).withIcon(FontAwesome.SEND); createBtn.setVisible(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.USERS)); viewHeader.addComponent(createBtn); addComponent(viewHeader); contentLayout = new CssLayout(); contentLayout.setWidth("100%"); addComponent(contentLayout); }
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 av a 2s . co 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.ticket.TicketDashboardViewImpl.java
License:Open Source License
public TicketDashboardViewImpl() { this.withMargin(new MarginInfo(false, true, true, true)); ticketSearchPanel = new TicketSearchPanel(); MHorizontalLayout groupWrapLayout = new MHorizontalLayout(); groupWrapLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); groupWrapLayout.addComponent(new ELabel(UserUIContext.getMessage(GenericI18Enum.ACTION_SORT))); final ComboBox sortCombo = new ValueComboBox(false, UserUIContext.getMessage(GenericI18Enum.OPT_SORT_DESCENDING), UserUIContext.getMessage(GenericI18Enum.OPT_SORT_ASCENDING)); sortCombo.addValueChangeListener(valueChangeEvent -> { String sortValue = (String) sortCombo.getValue(); if (UserUIContext.getMessage(GenericI18Enum.OPT_SORT_ASCENDING).equals(sortValue)) { sortDirection = SearchCriteria.ASC; } else {//from w w w . j a v a 2 s. c o m sortDirection = SearchCriteria.DESC; } queryAndDisplayTickets(); }); sortDirection = SearchCriteria.DESC; groupWrapLayout.addComponent(sortCombo); groupWrapLayout.addComponent(new ELabel(UserUIContext.getMessage(GenericI18Enum.OPT_GROUP))); final ComboBox groupCombo = new ValueComboBox(false, UserUIContext.getMessage(GenericI18Enum.FORM_DUE_DATE), UserUIContext.getMessage(GenericI18Enum.FORM_START_DATE), UserUIContext.getMessage(GenericI18Enum.FORM_CREATED_TIME), UserUIContext.getMessage(GenericI18Enum.OPT_PLAIN), UserUIContext.getMessage(GenericI18Enum.OPT_USER), UserUIContext.getMessage(MilestoneI18nEnum.SINGLE)); groupByState = UserUIContext.getMessage(MilestoneI18nEnum.SINGLE); groupCombo.setValue(UserUIContext.getMessage(MilestoneI18nEnum.SINGLE)); groupCombo.addValueChangeListener(valueChangeEvent -> { groupByState = (String) groupCombo.getValue(); queryAndDisplayTickets(); }); groupWrapLayout.addComponent(groupCombo); ticketSearchPanel.addHeaderRight(groupWrapLayout); MButton printBtn = new MButton("", clickEvent -> UI.getCurrent() .addWindow(new TicketCustomizeReportOutputWindow(new LazyValueInjector() { @Override protected Object doEval() { return baseCriteria; } }))).withIcon(FontAwesome.PRINT).withStyleName(WebThemes.BUTTON_OPTION) .withDescription(UserUIContext.getMessage(GenericI18Enum.ACTION_EXPORT)); groupWrapLayout.addComponent(printBtn); MButton newTicketBtn = new MButton(UserUIContext.getMessage(TicketI18nEnum.NEW), clickEvent -> { UI.getCurrent().addWindow(AppContextUtil.getSpringBean(TicketComponentFactory.class) .createNewTicketWindow(null, CurrentProjectVariables.getProjectId(), null, false)); }).withIcon(FontAwesome.PLUS).withStyleName(WebThemes.BUTTON_ACTION) .withVisible(CurrentProjectVariables.canWriteTicket()); groupWrapLayout.addComponent(newTicketBtn); MButton advanceDisplayBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_LIST)) .withIcon(FontAwesome.NAVICON).withWidth("100px"); MButton kanbanBtn = new MButton(UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_KANBAN), clickEvent -> displayKanbanView()).withWidth("100px").withIcon(FontAwesome.TH); 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(ticketSearchPanel, mainLayout); }