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.module.crm.view.opportunity.OpportunityContactListComp.java
License:Open Source License
@Override protected Component generateTopControls() { HorizontalLayout controlsBtnWrap = new HorizontalLayout(); controlsBtnWrap.setWidth("100%"); HorizontalLayout notesWrap = new HorizontalLayout(); notesWrap.setWidth("100%"); notesWrap.setSpacing(true);/* w w w.j a v a 2s. co m*/ Label noteLbl = new Label("Note: "); noteLbl.setSizeUndefined(); noteLbl.setStyleName("list-note-lbl"); notesWrap.addComponent(noteLbl); CssLayout noteBlock = new CssLayout(); noteBlock.setWidth("100%"); noteBlock.setStyleName("list-note-block"); for (int i = 0; i < CrmDataTypeFactory.getOpportunityContactRoleList().length; i++) { Label note = new Label(CrmDataTypeFactory.getOpportunityContactRoleList()[i]); note.setStyleName("note-label"); note.addStyleName(colormap.get(CrmDataTypeFactory.getOpportunityContactRoleList()[i])); note.setSizeUndefined(); noteBlock.addComponent(note); } notesWrap.addComponent(noteBlock); notesWrap.setExpandRatio(noteBlock, 1.0f); controlsBtnWrap.addComponent(notesWrap); final SplitButton controlsBtn = new SplitButton(); controlsBtn.setSizeUndefined(); controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_CONTACT)); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setCaption("Add/Edit Contacts' Role"); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() { private static final long serialVersionUID = 1L; @Override public void splitButtonClick(final SplitButton.SplitButtonClickEvent event) { EventBusFactory.getInstance().post(new OpportunityEvent.GotoContactRoleEdit(this, opportunity)); } }); final Button selectBtn = new Button("Select from existing contacts", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final OpportunityContactSelectionWindow contactsWindow = new OpportunityContactSelectionWindow( OpportunityContactListComp.this); final ContactSearchCriteria criteria = new ContactSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); UI.getCurrent().addWindow(contactsWindow); contactsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); } }); selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select)); selectBtn.setStyleName("link"); VerticalLayout buttonControlLayout = new VerticalLayout(); buttonControlLayout.addComponent(selectBtn); controlsBtn.setContent(buttonControlLayout); controlsBtnWrap.addComponent(controlsBtn); controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); return controlsBtnWrap; }
From source file:com.esofthead.mycollab.module.crm.view.opportunity.OpportunityLeadListComp.java
License:Open Source License
@Override protected Component generateTopControls() { VerticalLayout controlsBtnWrap = new VerticalLayout(); controlsBtnWrap.setWidth("100%"); final SplitButton controlsBtn = new SplitButton(); controlsBtn.setSizeUndefined();//from w w w . java2 s . com controlsBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_LEAD)); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setCaption(AppContext.getMessage(LeadI18nEnum.BUTTON_NEW_LEAD)); controlsBtn.setIcon(FontAwesome.PLUS); controlsBtn.addClickListener(new SplitButton.SplitButtonClickListener() { private static final long serialVersionUID = 1L; @Override public void splitButtonClick(final SplitButton.SplitButtonClickEvent event) { fireNewRelatedItem(""); } }); final Button selectBtn = new Button("Select from existing leads", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { final OpportunityLeadSelectionWindow leadsWindow = new OpportunityLeadSelectionWindow( OpportunityLeadListComp.this); final LeadSearchCriteria criteria = new LeadSearchCriteria(); criteria.setSaccountid(new NumberSearchField(AppContext.getAccountId())); UI.getCurrent().addWindow(leadsWindow); leadsWindow.setSearchCriteria(criteria); controlsBtn.setPopupVisible(false); } }); selectBtn.setIcon(MyCollabResource.newResource(WebResourceIds._16_select)); selectBtn.setStyleName("link"); VerticalLayout buttonControlLayout = new VerticalLayout(); buttonControlLayout.addComponent(selectBtn); controlsBtn.setContent(buttonControlLayout); controlsBtnWrap.addComponent(controlsBtn); controlsBtnWrap.setComponentAlignment(controlsBtn, Alignment.MIDDLE_RIGHT); return controlsBtnWrap; }
From source file:com.esofthead.mycollab.module.crm.view.opportunity.OpportunitySearchPanel.java
License:Open Source License
private HorizontalLayout createSearchTopPanel() { final MHorizontalLayout layout = new MHorizontalLayout().withWidth("100%").withSpacing(true) .withMargin(new MarginInfo(true, false, true, false)).withStyleName(UIConstants.HEADER_VIEW); final Label searchtitle = new CrmViewHeader(CrmTypeConstants.OPPORTUNITY, AppContext.getMessage(OpportunityI18nEnum.VIEW_LIST_TITLE)); searchtitle.setStyleName(UIConstants.HEADER_TEXT); layout.with(searchtitle).expand(searchtitle).withAlign(searchtitle, Alignment.MIDDLE_LEFT); final Button createAccountBtn = new Button( AppContext.getMessage(OpportunityI18nEnum.BUTTON_NEW_OPPORTUNITY), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override//from w w w . j a v a2 s . co m public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance() .post(new OpportunityEvent.GotoAdd(OpportunitySearchPanel.this, null)); } }); createAccountBtn.setIcon(FontAwesome.PLUS); createAccountBtn.setStyleName(UIConstants.THEME_GREEN_LINK); createAccountBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.CRM_OPPORTUNITY)); layout.with(createAccountBtn).withAlign(createAccountBtn, Alignment.MIDDLE_RIGHT); return layout; }
From source file:com.esofthead.mycollab.module.file.view.components.ResourcesDisplayComponent.java
License:Open Source License
public ResourcesDisplayComponent(final String rootPath, final Folder rootFolder) { this.setSpacing(true); this.baseFolder = rootFolder; this.rootPath = rootPath; externalResourceService = ApplicationContextUtil.getSpringBean(ExternalResourceService.class); externalDriveService = ApplicationContextUtil.getSpringBean(ExternalDriveService.class); resourceService = ApplicationContextUtil.getSpringBean(ResourceService.class); VerticalLayout mainBodyLayout = new VerticalLayout(); mainBodyLayout.setSpacing(true);// w w w . j a v a 2s .co m mainBodyLayout.addStyleName("box-no-border-left"); // file breadcrum --------------------- HorizontalLayout breadcrumbContainer = new HorizontalLayout(); breadcrumbContainer.setMargin(false); fileBreadCrumb = new FileBreadcrumb(rootPath); breadcrumbContainer.addComponent(fileBreadCrumb); mainBodyLayout.addComponent(breadcrumbContainer); // Construct controllGroupBtn controllGroupBtn = new MHorizontalLayout().withMargin(new MarginInfo(false, false, false, true)); final Button selectAllBtn = new Button(); selectAllBtn.addStyleName(UIConstants.THEME_BROWN_LINK); selectAllBtn.setIcon(FontAwesome.SQUARE_O); selectAllBtn.setData(false); selectAllBtn.setImmediate(true); selectAllBtn.setDescription("Select all"); selectAllBtn.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { if (!(Boolean) selectAllBtn.getData()) { selectAllBtn.setIcon(FontAwesome.CHECK_SQUARE_O); selectAllBtn.setData(true); resourcesContainer.setAllValues(true); } else { selectAllBtn.setData(false); selectAllBtn.setIcon(FontAwesome.SQUARE_O); resourcesContainer.setAllValues(false); } } }); controllGroupBtn.with(selectAllBtn).withAlign(selectAllBtn, Alignment.MIDDLE_LEFT); Button goUpBtn = new Button("Up"); goUpBtn.setIcon(FontAwesome.ARROW_UP); goUpBtn.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { Folder parentFolder; if (baseFolder instanceof ExternalFolder) { if (baseFolder.getPath().equals("/")) { parentFolder = baseFolder; } else { parentFolder = externalResourceService.getParentResourceFolder( ((ExternalFolder) baseFolder).getExternalDrive(), baseFolder.getPath()); } } else if (!baseFolder.getPath().equals(rootPath)) { parentFolder = resourceService.getParentFolder(baseFolder.getPath()); } else { parentFolder = baseFolder; } resourcesContainer.constructBody(parentFolder); baseFolder = parentFolder; fileBreadCrumb.gotoFolder(baseFolder); } }); goUpBtn.setDescription("Back to parent folder"); goUpBtn.setStyleName(UIConstants.THEME_BROWN_LINK); goUpBtn.setDescription("Go up"); controllGroupBtn.with(goUpBtn).withAlign(goUpBtn, Alignment.MIDDLE_LEFT); ButtonGroup navButton = new ButtonGroup(); navButton.addStyleName(UIConstants.THEME_BROWN_LINK); Button createBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CREATE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { AddNewFolderWindow addnewFolderWindow = new AddNewFolderWindow(); UI.getCurrent().addWindow(addnewFolderWindow); } }); createBtn.setIcon(FontAwesome.PLUS); createBtn.addStyleName(UIConstants.THEME_BROWN_LINK); createBtn.setDescription("Create new folder"); createBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS)); navButton.addButton(createBtn); Button uploadBtn = new Button("Upload", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { MultiUploadContentWindow multiUploadWindow = new MultiUploadContentWindow(); UI.getCurrent().addWindow(multiUploadWindow); } }); uploadBtn.setIcon(FontAwesome.UPLOAD); uploadBtn.addStyleName(UIConstants.THEME_BROWN_LINK); uploadBtn.setDescription("Upload"); uploadBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS)); navButton.addButton(uploadBtn); Button downloadBtn = new Button("Download"); LazyStreamSource streamSource = new LazyStreamSource() { private static final long serialVersionUID = 1L; @Override protected StreamSource buildStreamSource() { Collection<Resource> selectedResources = getSelectedResources(); return StreamDownloadResourceUtil.getStreamSourceSupportExtDrive(selectedResources); } @Override public String getFilename() { Collection<Resource> selectedResources = getSelectedResources(); return StreamDownloadResourceUtil.getDownloadFileName(selectedResources); } }; OnDemandFileDownloader downloaderExt = new OnDemandFileDownloader(streamSource); downloaderExt.extend(downloadBtn); downloadBtn.setIcon(FontAwesome.DOWNLOAD); downloadBtn.addStyleName(UIConstants.THEME_BROWN_LINK); downloadBtn.setDescription("Download"); downloadBtn.setEnabled(AppContext.canRead(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS)); navButton.addButton(downloadBtn); Button moveToBtn = new Button("Move", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { Collection<Resource> selectedResources = getSelectedResources(); if (CollectionUtils.isNotEmpty(selectedResources)) { MoveResourceWindow moveResourceWindow = new MoveResourceWindow(selectedResources); UI.getCurrent().addWindow(moveResourceWindow); } else { NotificationUtil.showWarningNotification("Please select at least one item to move"); } } }); moveToBtn.setIcon(FontAwesome.ARROWS); moveToBtn.addStyleName(UIConstants.THEME_BROWN_LINK); moveToBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS)); moveToBtn.setDescription("Move to"); navButton.addButton(moveToBtn); Button deleteBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_DELETE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { Collection<Resource> selectedResources = getSelectedResources(); if (CollectionUtils.isEmpty(selectedResources)) { NotificationUtil.showWarningNotification("Please select at least one item to delete"); } else { deleteResourceAction(); } } }); deleteBtn.setIcon(FontAwesome.TRASH_O); deleteBtn.addStyleName(UIConstants.THEME_RED_LINK); deleteBtn.setDescription("Delete resource"); deleteBtn.setEnabled(AppContext.canAccess(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS)); navButton.addButton(deleteBtn); controllGroupBtn.addComponent(navButton); mainBodyLayout.addComponent(controllGroupBtn); resourcesContainer = new ResourcesContainer(baseFolder); mainBodyLayout.addComponent(resourcesContainer); this.addComponent(mainBodyLayout); }
From source file:com.esofthead.mycollab.module.project.ui.components.TimeLogEditWindow.java
License:Open Source License
private void constructSpentTimeEntryPanel() { VerticalLayout spentTimePanel = new VerticalLayout(); spentTimePanel.setSpacing(true);//from w w w . ja v a 2 s . c o m headerPanel.addComponent(spentTimePanel); final VerticalLayout totalLayout = new VerticalLayout(); totalLayout.setMargin(true); totalLayout.addStyleName("boxTotal"); totalLayout.setWidth("100%"); spentTimePanel.addComponent(totalLayout); final Label lbTimeInstructTotal = new Label( AppContext.getMessage(TimeTrackingI18nEnum.OPT_TOTAL_SPENT_HOURS)); totalLayout.addComponent(lbTimeInstructTotal); this.totalSpentTimeLbl = new Label("_"); this.totalSpentTimeLbl.addStyleName("numberTotal"); totalLayout.addComponent(this.totalSpentTimeLbl); final MHorizontalLayout addLayout = new MHorizontalLayout(); addLayout.setSizeUndefined(); addLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); spentTimePanel.addComponent(addLayout); this.newTimeInputField = new NumericTextField(); this.newTimeInputField.setWidth("80px"); this.forDateField = new DateFieldExt(); this.forDateField.setValue(new GregorianCalendar().getTime()); this.isBillableField = new CheckBox(AppContext.getMessage(TimeTrackingI18nEnum.FORM_IS_BILLABLE), true); btnAdd = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_ADD), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { double d = 0; try { d = Double.parseDouble(newTimeInputField.getValue()); } catch (NumberFormatException e) { NotificationUtil.showWarningNotification("You must enter a positive number value"); } if (d > 0) { saveTimeInvest(); loadTimeValue(); newTimeInputField.setValue("0.0"); } } }); btnAdd.setEnabled(TimeLogEditWindow.this.isEnableAdd()); btnAdd.setStyleName(UIConstants.THEME_GREEN_LINK); btnAdd.setIcon(FontAwesome.PLUS); addLayout.with(this.newTimeInputField, this.forDateField, this.isBillableField, btnAdd); }
From source file:com.esofthead.mycollab.module.project.view.bug.BugDashboardViewImpl.java
License:Open Source License
private void initHeader() { final Label title = new ProjectViewHeader(ProjectTypeConstants.BUG, AppContext.getMessage(BugI18nEnum.VIEW_BUG_DASHBOARD_TITLE)); header.with(title).withAlign(title, Alignment.MIDDLE_LEFT).expand(title); final Button createBugBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_BUG), new Button.ClickListener() { @Override//from w w w. j a v a 2s . c om public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance().post(new BugEvent.GotoAdd(this, null)); } }); createBugBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.BUGS)); createBugBtn.setIcon(FontAwesome.PLUS); final SplitButton controlsBtn = new SplitButton(createBugBtn); controlsBtn.addStyleName(UIConstants.THEME_GREEN_LINK); controlsBtn.setWidthUndefined(); final VerticalLayout btnControlsLayout = new VerticalLayout(); final Button createComponentBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_COMPONENT), new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { controlsBtn.setPopupVisible(false); EventBusFactory.getInstance().post(new BugComponentEvent.GotoAdd(this, null)); } }); createComponentBtn.setStyleName("link"); createComponentBtn .setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.COMPONENTS)); btnControlsLayout.addComponent(createComponentBtn); final Button createVersionBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_VERSION), new Button.ClickListener() { @Override public void buttonClick(final ClickEvent event) { controlsBtn.setPopupVisible(false); EventBusFactory.getInstance().post(new BugVersionEvent.GotoAdd(this, null)); } }); createVersionBtn.setStyleName("link"); createVersionBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.VERSIONS)); btnControlsLayout.addComponent(createVersionBtn); controlsBtn.setContent(btnControlsLayout); header.addComponent(controlsBtn); }
From source file:com.esofthead.mycollab.module.project.view.bug.BugSearchPanel.java
License:Open Source License
private ComponentContainer constructHeader() { Label headerText = new ProjectViewHeader(ProjectTypeConstants.BUG, AppContext.getMessage(BugI18nEnum.VIEW_LIST_TITLE)); final Button createBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_BUG), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override/*from w w w .j a va 2 s . co m*/ public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance().post(new BugEvent.GotoAdd(this, null)); } }); createBtn.setStyleName(UIConstants.THEME_GREEN_LINK); createBtn.setIcon(FontAwesome.PLUS); createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.BUGS)); headerText.setStyleName(UIConstants.HEADER_TEXT); rightComponent = new MHorizontalLayout(); MHorizontalLayout header = new MHorizontalLayout().withStyleName(UIConstants.HEADER_VIEW).withWidth("100%") .withSpacing(true).withMargin(new MarginInfo(true, false, true, false)); header.with(headerText, createBtn, rightComponent).withAlign(headerText, Alignment.MIDDLE_LEFT) .withAlign(createBtn, Alignment.MIDDLE_RIGHT).withAlign(rightComponent, Alignment.MIDDLE_RIGHT) .expand(headerText); return header; }
From source file:com.esofthead.mycollab.module.project.view.bug.ComponentSearchPanel.java
License:Open Source License
private HorizontalLayout createSearchTopPanel() { final MHorizontalLayout layout = new MHorizontalLayout().withWidth("100%").withSpacing(true) .withStyleName(UIConstants.HEADER_VIEW).withMargin(new MarginInfo(true, false, true, false)); final Label componenttitle = new ProjectViewHeader(ProjectTypeConstants.BUG_COMPONENT, AppContext.getMessage(ComponentI18nEnum.VIEW_LIST_TITLE)); componenttitle.setStyleName(UIConstants.HEADER_TEXT); layout.with(componenttitle).withAlign(componenttitle, Alignment.MIDDLE_LEFT).expand(componenttitle); final Button createBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_COMPONENT), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override/*www . j a v a2s .c o m*/ public void buttonClick(final Button.ClickEvent event) { EventBusFactory.getInstance().post(new BugComponentEvent.GotoAdd(this, null)); } }); createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.COMPONENTS)); createBtn.setStyleName(UIConstants.THEME_GREEN_LINK); createBtn.setIcon(FontAwesome.PLUS); layout.with(createBtn).withAlign(createBtn, Alignment.MIDDLE_RIGHT); return layout; }
From source file:com.esofthead.mycollab.module.project.view.bug.VersionSearchPanel.java
License:Open Source License
private HorizontalLayout createSearchTopPanel() { final MHorizontalLayout layout = new MHorizontalLayout().withStyleName(UIConstants.HEADER_VIEW) .withWidth("100%").withSpacing(true).withMargin(new MarginInfo(true, false, true, false)); final Label versionTitle = new ProjectViewHeader(ProjectTypeConstants.BUG_VERSION, AppContext.getMessage(VersionI18nEnum.VIEW_LIST_TITLE)); versionTitle.setStyleName(UIConstants.HEADER_TEXT); layout.with(versionTitle).withAlign(versionTitle, Alignment.MIDDLE_LEFT).expand(versionTitle); final Button createBtn = new Button(AppContext.getMessage(BugI18nEnum.BUTTON_NEW_VERSION), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override//from w w w. j a va 2 s. co m public void buttonClick(final Button.ClickEvent event) { EventBusFactory.getInstance().post(new BugVersionEvent.GotoAdd(this, null)); } }); createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.VERSIONS)); createBtn.setStyleName(UIConstants.THEME_GREEN_LINK); createBtn.setIcon(FontAwesome.PLUS); layout.with(createBtn).withAlign(createBtn, Alignment.MIDDLE_LEFT); return layout; }
From source file:com.esofthead.mycollab.module.project.view.milestone.MilestoneListViewImpl.java
License:Open Source License
private HorizontalLayout createHeaderRight() { final HorizontalLayout layout = new HorizontalLayout(); this.createBtn = new Button(AppContext.getMessage(MilestoneI18nEnum.BUTTON_NEW_PHASE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override//w w w .ja v a2 s. c o m public void buttonClick(final ClickEvent event) { EventBusFactory.getInstance() .post(new MilestoneEvent.GotoAdd(MilestoneListViewImpl.this, null)); } }); this.createBtn.setIcon(FontAwesome.PLUS); this.createBtn.setStyleName(UIConstants.THEME_GREEN_LINK); this.createBtn.setEnabled(CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)); layout.addComponent(this.createBtn); layout.setComponentAlignment(this.createBtn, Alignment.MIDDLE_RIGHT); return layout; }