List of usage examples for com.vaadin.server FontAwesome EXCLAMATION_CIRCLE
FontAwesome EXCLAMATION_CIRCLE
To view the source code for com.vaadin.server FontAwesome EXCLAMATION_CIRCLE.
Click Source Link
From source file:com.esofthead.mycollab.shell.view.components.NoSubDomainExistedWindow.java
License:Open Source License
public NoSubDomainExistedWindow(final String domain) { this.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); final Label titleIcon = new ELabel(FontAwesome.EXCLAMATION_CIRCLE.getHtml(), ContentMode.HTML) .withWidthUndefined();/* w w w.j a va2s . co m*/ titleIcon.setStyleName("warning-icon"); titleIcon.addStyleName(ValoTheme.LABEL_NO_MARGIN); Label warningMsg = new ELabel(AppContext.getMessage(ShellI18nEnum.ERROR_NO_SUB_DOMAIN, domain)) .withWidthUndefined(); Button backToHome = new Button(AppContext.getMessage(ShellI18nEnum.BUTTON_BACK_TO_HOME_PAGE), new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { getUI().getPage().setLocation("https://www.mycollab.com"); } }); backToHome.addStyleName(UIConstants.BUTTON_ACTION); this.with(titleIcon, warningMsg, backToHome); }
From source file:com.esofthead.mycollab.vaadin.mvp.view.NotPresentedView.java
License:Open Source License
public NotPresentedView() { this.withSpacing(true).withFullWidth(); this.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); final Label titleIcon = new Label(FontAwesome.EXCLAMATION_CIRCLE.getHtml(), ContentMode.HTML); titleIcon.setStyleName("warning-icon"); titleIcon.addStyleName(ValoTheme.LABEL_NO_MARGIN); titleIcon.setWidthUndefined();/* ww w.j a v a 2 s. c o m*/ this.with(titleIcon); Label label = ELabel.h2(AppContext.getMessage(GenericI18Enum.NOTIFICATION_FEATURE_NOT_AVAILABLE_IN_VERSION)) .withWidthUndefined(); this.with(label).withAlign(label, Alignment.MIDDLE_CENTER); RestTemplate restTemplate = new RestTemplate(); try { String result = restTemplate.getForObject("https://api.mycollab.com/api/storeweb", String.class); Label webPage = new Label(result, ContentMode.HTML); webPage.setHeight("480px"); this.with(new MVerticalLayout(webPage).withMargin(false).withAlign(webPage, Alignment.TOP_CENTER)); } catch (Exception e) { Div informDiv = new Div() .appendText("Can not load the store page. You can check the online edition at ") .appendChild(new A("https://www.mycollab.com/pricing/download/", "_blank").appendText("here")); ELabel webPage = new ELabel(informDiv.write(), ContentMode.HTML).withWidthUndefined(); this.with(new MVerticalLayout(webPage).withAlign(webPage, Alignment.TOP_CENTER)); } }
From source file:com.esofthead.mycollab.vaadin.ui.NotPresentedView.java
License:Open Source License
public NotPresentedView() { this.setHeight("370px"); this.setWidth("100%"); VerticalLayout layoutWapper = new VerticalLayout(); layoutWapper.setWidth("100%"); VerticalLayout layout = new VerticalLayout(); final Label titleIcon = new Label(FontAwesome.EXCLAMATION_CIRCLE.getHtml(), ContentMode.HTML); titleIcon.setStyleName("warning-icon"); titleIcon.setSizeUndefined();//from www . java 2 s .c o m layout.addComponent(titleIcon); layout.setComponentAlignment(titleIcon, Alignment.MIDDLE_CENTER); Label label = new Label("The feature is not presented for this edition"); label.setStyleName("h2_community"); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); layoutWapper.addComponent(layout); layoutWapper.setComponentAlignment(layout, Alignment.MIDDLE_CENTER); this.addComponent(layoutWapper); this.setComponentAlignment(layoutWapper, Alignment.MIDDLE_CENTER); }
From source file:com.hris.payroll.alphalist.AlphaListMainUI.java
private Button exportToExcelButton() { ExportDataGridToExcel exportGrid = new ExportDataGridToExcel(grid); exportToExcelButton.setEnabled(false); exportToExcelButton.setWidth("200px"); exportToExcelButton.setIcon(FontAwesome.EXCLAMATION_CIRCLE); exportToExcelButton.addStyleName(ValoTheme.BUTTON_PRIMARY); exportToExcelButton.addStyleName(ValoTheme.BUTTON_SMALL); exportToExcelButton.addClickListener((Button.ClickEvent e) -> { exportGrid.workSheet();/*w w w .j a v a 2 s .com*/ StreamResource.StreamSource source = () -> { try { File f = new File(exportGrid.getFilePath()); FileInputStream fis = new FileInputStream(f); return fis; } catch (Exception e1) { e1.getMessage(); return null; } }; Date date = new Date(); String branchName = cs.getBranchById(getBranchId()); int tradeId = cs.getTradeIdByBranchId(getBranchId()); String tradeName = cs.getTradeById(tradeId); int corporateId = cs.getCorporateIdByTradeId(tradeId); String corporateName = cs.getCorporateById(corporateId); StreamResource resource = new StreamResource(source, "AlphaList-" + corporateName + "-" + tradeName + "-" + branchName + "-" + date.getTime() + ".xls"); resource.setMIMEType("application/vnd.ms-office"); Page.getCurrent().open(resource, null, false); }); return exportToExcelButton; }
From source file:com.hris.payroll.reports.ReportUI.java
private Button viewReportBtn() { viewReport.setWidth("200px"); viewReport.setIcon(FontAwesome.EXCLAMATION_CIRCLE); viewReport.addStyleName(ValoTheme.BUTTON_PRIMARY); viewReport.addStyleName(ValoTheme.BUTTON_SMALL); viewReport.addClickListener((Button.ClickEvent e) -> { if (getBranchId() == 0) { Notification.show("Select a Branch!!!", Notification.Type.WARNING_MESSAGE); return; }//from w w w . jav a 2 s.c om if (getPayrollDate() == null) { Notification.show("Select a Payroll Date!!!", Notification.Type.WARNING_MESSAGE); return; } Window sub = new ReportViewer(reportType.getValue().toString(), getBranchId(), payrollDate.getValue()); if (sub.getParent() == null) { UI.getCurrent().addWindow(sub); } // switch(reportType.getValue().toString()){ // case "Payslip" : { // if(sub.getParent() == null){ // UI.getCurrent().addWindow(sub); // } // break; // } // // case "Advances Summary" : { // // } // // default: { // if(sub.getParent() == null){ // UI.getCurrent().addWindow(sub); // grid.setContainerDataSource( // new PayrollAdvancesContainer( // getBranchId(), // payrollDate.getValue(), // reportType.getValue().toString())); // removeComponent(grid); // addComponent(grid); // setExpandRatio(grid, 2); // } // } // } }); return viewReport; }
From source file:com.hris.payroll.thirteenthmonth.ThirteenthMonth.java
private Button exportToExcelButton() { exportToExcelButton.setWidth("200px"); exportToExcelButton.setIcon(FontAwesome.EXCLAMATION_CIRCLE); exportToExcelButton.addStyleName(ValoTheme.BUTTON_PRIMARY); exportToExcelButton.addStyleName(ValoTheme.BUTTON_SMALL); exportToExcelButton.addClickListener((Button.ClickEvent e) -> { ExportDataGridToExcel exportGrid = new ExportDataGridToExcel(grid); exportGrid.workSheet();// w ww . j a v a2s.co m StreamResource.StreamSource source = () -> { try { File f = new File(exportGrid.getFilePath()); FileInputStream fis = new FileInputStream(f); return fis; } catch (Exception e1) { e1.getMessage(); return null; } }; Date date = new Date(); String branchName = cs.getBranchById(getBranchId()); int tradeId = cs.getTradeIdByBranchId(getBranchId()); String tradeName = cs.getTradeById(tradeId); int corporateId = cs.getCorporateIdByTradeId(tradeId); String corporateName = cs.getCorporateById(corporateId); StreamResource resource = new StreamResource(source, "ThirteenthMonth-" + corporateName + "-" + tradeName + "-" + branchName + "-" + date.getTime() + ".xls"); resource.setMIMEType("application/vnd.ms-office"); Page.getCurrent().open(resource, null, false); }); return exportToExcelButton; }
From source file:com.mycollab.shell.view.components.NoSubDomainExistedWindow.java
License:Open Source License
public NoSubDomainExistedWindow(final String domain) { this.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); final Label titleIcon = ELabel.fontIcon(FontAwesome.EXCLAMATION_CIRCLE) .withStyleName("warning-icon", ValoTheme.LABEL_NO_MARGIN).withWidthUndefined(); Label warningMsg = new ELabel(UserUIContext.getMessage(ShellI18nEnum.ERROR_NO_SUB_DOMAIN, domain)) .withWidthUndefined();/*from ww w. ja v a 2 s. c o m*/ Button backToHome = new Button(UserUIContext.getMessage(ShellI18nEnum.BUTTON_BACK_TO_HOME_PAGE), clickEvent -> getUI().getPage().setLocation("https://www.mycollab.com")); backToHome.addStyleName(WebThemes.BUTTON_ACTION); this.with(titleIcon, warningMsg, backToHome); }
From source file:com.mycollab.vaadin.mvp.view.NotPresentedView.java
License:Open Source License
public NotPresentedView() { MVerticalLayout bodyLayout = new MVerticalLayout().withMargin(false); setContent(bodyLayout);/*from w w w . j a v a 2 s . co m*/ bodyLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); final ELabel titleIcon = ELabel.fontIcon(FontAwesome.EXCLAMATION_CIRCLE).withStyleName("warning-icon", ValoTheme.LABEL_NO_MARGIN); titleIcon.setWidthUndefined(); bodyLayout.with(titleIcon); Label label = ELabel .h2(UserUIContext.getMessage(GenericI18Enum.NOTIFICATION_FEATURE_NOT_AVAILABLE_IN_VERSION)) .withWidthUndefined(); bodyLayout.with(label).withAlign(label, Alignment.MIDDLE_CENTER); RestTemplate restTemplate = new RestTemplate(); try { String result = restTemplate.getForObject(SiteConfiguration.getApiUrl("storeweb"), String.class); ELabel webPage = ELabel.html(result); webPage.setHeight("480px"); bodyLayout .with(new MVerticalLayout(webPage).withMargin(false).withAlign(webPage, Alignment.TOP_CENTER)); } catch (Exception e) { Div informDiv = new Div() .appendText("Can not load the store page. You can check the online edition at ") .appendChild(new A("https://www.mycollab.com/pricing/download/", "_blank").appendText("here")); ELabel webPage = ELabel.html(informDiv.write()).withWidthUndefined(); bodyLayout.with(new MVerticalLayout(webPage).withAlign(webPage, Alignment.TOP_CENTER)); } }
From source file:fr.univlorraine.mondossierweb.MainUI.java
License:Apache License
/** * Construction du menu tudiant//from w w w . j a v a 2 s .co m */ private void buildMainMenuEtudiant() { //Si l'tudiant dont on affiche le dossier est renseign if (etudiant != null) { //Ajout du style au menu mainMenu.setPrimaryStyleName(ValoTheme.MENU_PART); //On fixe la largeur du menu mainMenu.setWidth("233px"); //Si on a une url pour la photo de l'tudiant if (etudiant.getPhoto() != null) { //Layout contenant la photo HorizontalLayout photoLayout = new HorizontalLayout(); //Ajout du style au layout photoLayout.addStyleName(ValoTheme.MENU_SUBTITLE); //On fixe la largeur du layout photoLayout.setWidth(213, Unit.PIXELS); //La layout a des marges photoLayout.setMargin(true); //Bouton qui indique, en fonction de l'icone, si l'tudiant est inscrit pour l'anne en cours. Par dfaut, icone indiquant que l'tudiant est inscrit Button etuInscritBtn = new Button("", FontAwesome.CHECK_CIRCLE); //Ajout du style au bouton etuInscritBtn.setPrimaryStyleName(ValoTheme.BUTTON_BORDERLESS); //Si l'tudiant est inscrit pour l'anne en cours if (etudiant.isInscritPourAnneeEnCours()) { //On fixe la description du bouton etuInscritBtn.setDescription("Inscrit pour l'anne universitaire " + Utils.getAnneeUniversitaireEnCours(etudiantController.getAnneeUnivEnCours(this))); } else { //On change l'icone du bouton pour indiquer que l'tudiant n'est pas inscrit etuInscritBtn.setIcon(FontAwesome.EXCLAMATION_CIRCLE); //On fixe la description du bouton etuInscritBtn.setDescription("Non Inscrit pour l'anne universitaire " + Utils.getAnneeUniversitaireEnCours(etudiantController.getAnneeUnivEnCours(this))); } //Ajout d'un lment vide dans le layout photoLayout.addComponent(new HorizontalLayout()); //Cration de l'image contenant la photo Image fotoEtudiant = new Image(null, new ExternalResource(etudiant.getPhoto())); fotoEtudiant.setWidth("120px"); //Ajout de la photo au layout photoLayout.addComponent(fotoEtudiant); //Alignement de la photo photoLayout.setComponentAlignment(fotoEtudiant, Alignment.MIDDLE_CENTER); //La photo prend toute la place disponible dans son layout photoLayout.setExpandRatio(fotoEtudiant, 1); //Ajout au layout du bouton, qui indique, en fonction de l'icone, si l'tudiant est inscrit pour l'anne en cours photoLayout.addComponent(etuInscritBtn); //Ajout du layout de la photo au menu mainMenu.addComponent(photoLayout); } //Ajout du Prnom/Nom et codetu de l'tudiant dans le menu Label usernameLabel = new Label(etudiant.getNom() + "<br />" + etudiant.getCod_etu(), ContentMode.HTML); usernameLabel.addStyleName(ValoTheme.MENU_SUBTITLE); usernameLabel.addStyleName("retourALaLigneAutomatique"); usernameLabel.setSizeUndefined(); mainMenu.addComponent(usernameLabel); /* Etat Civil */ addItemMenu("Etat-civil", EtatCivilView.NAME, FontAwesome.USER); //info annuelles visibles que si tudiant inscrit pour l'anne en cours if (etudiant.isInscritPourAnneeEnCours()) { addItemMenu("Informations annuelles", InformationsAnnuellesView.NAME, FontAwesome.INFO_CIRCLE); } /* Adresses */ addItemMenu(applicationContext.getMessage(AdressesView.NAME + ".title", null, getLocale()), AdressesView.NAME, FontAwesome.HOME); /* Inscriptions */ addItemMenu("Inscriptions", InscriptionsView.NAME, FontAwesome.FILE_TEXT); /* Calendrier */ addItemMenu("Calendrier des preuves", CalendrierView.NAME, FontAwesome.CALENDAR); /* Notes et Rsultats */ addItemMenu(applicationContext.getMessage(NotesView.NAME + ".title", null, getLocale()), NotesView.NAME, FontAwesome.LIST); /* Sparation avant Bouton "Aide" */ CssLayout bottomMainMenu1 = new CssLayout(); bottomMainMenu1.setStyleName(ValoTheme.MENU_SUBTITLE); bottomMainMenu1.setSizeUndefined(); mainMenu.addComponent(bottomMainMenu1); /* Aide */ Button helpBtn = new Button(applicationContext.getMessage("helpWindow.defaultTitle", null, getLocale()), FontAwesome.SUPPORT); helpBtn.setPrimaryStyleName(ValoTheme.MENU_ITEM); helpBtn.addClickListener(e -> { UI.getCurrent() .addWindow(new HelpBasicWindow( applicationContext.getMessage("helpWindow.text.etudiant", null, getLocale()), applicationContext.getMessage("helpWindow.defaultTitle", null, getLocale()), true)); }); mainMenu.addComponent(helpBtn); /* Deconnexion */ //Voir si on peut accder l'appli hors ENT, le dtecter, et afficher le bouton dconnexion if (configController.isLogoutCasPropose() && userController.isEtudiant()) { Button decoBtn = new Button("Dconnexion", FontAwesome.SIGN_OUT); decoBtn.setPrimaryStyleName(ValoTheme.MENU_ITEM); decoBtn.addClickListener(e -> { getUI().getPage().setLocation("j_spring_security_logout"); }); mainMenu.addComponent(decoBtn); } /* Sparation */ CssLayout bottomMainMenu = new CssLayout(); bottomMainMenu.setStyleName(ValoTheme.MENU_SUBTITLE); bottomMainMenu.setSizeUndefined(); mainMenu.addComponent(bottomMainMenu); } }
From source file:org.eclipse.hawkbit.simulator.ui.SimulatorView.java
License:Open Source License
@SuppressWarnings("unchecked") @Override/* ww w . ja va 2s .c o m*/ public void enter(final ViewChangeEvent event) { eventbus.register(this); setSizeFull(); // caption caption.addStyleName("h2"); // toolbar createToolbar(); beanContainer = new BeanContainer<>(AbstractSimulatedDevice.class); beanContainer.setBeanIdProperty(ID_COL); grid.setSizeFull(); grid.setCellStyleGenerator(new CellStyleGenerator() { private static final long serialVersionUID = 1L; @Override public String getStyle(final CellReference cellReference) { return cellReference.getPropertyId().equals(STATUS_COL) ? "centeralign" : null; } }); grid.setSelectionMode(SelectionMode.NONE); grid.setContainerDataSource(beanContainer); grid.appendHeaderRow().getCell(RESPONSE_STATUS_COL).setComponent(responseComboBox); grid.setColumnOrder(ID_COL, STATUS_COL, SWVERSION_COL, PROGRESS_COL, TENANT_COL, PROTOCOL_COL, RESPONSE_STATUS_COL, NEXT_POLL_COUNTER_SEC_COL); // header widths grid.getColumn(STATUS_COL).setMaximumWidth(80); grid.getColumn(PROTOCOL_COL).setMaximumWidth(180); grid.getColumn(RESPONSE_STATUS_COL).setMaximumWidth(240); grid.getColumn(NEXT_POLL_COUNTER_SEC_COL).setMaximumWidth(210); grid.getColumn(NEXT_POLL_COUNTER_SEC_COL).setHeaderCaption("Next Poll in (sec)"); grid.getColumn(SWVERSION_COL).setHeaderCaption("SW Version"); grid.getColumn(RESPONSE_STATUS_COL).setHeaderCaption("Response Update Status"); grid.getColumn(PROGRESS_COL).setRenderer(new ProgressBarRenderer()); grid.getColumn(PROTOCOL_COL).setConverter(createProtocolConverter()); grid.getColumn(STATUS_COL).setRenderer(new HtmlRenderer(), createStatusConverter()); grid.removeColumn(TENANT_COL); // grid combobox responseComboBox.setItemIcon(ResponseStatus.SUCCESSFUL, FontAwesome.CHECK_CIRCLE); responseComboBox.setItemIcon(ResponseStatus.ERROR, FontAwesome.EXCLAMATION_CIRCLE); responseComboBox.setNullSelectionAllowed(false); responseComboBox.setValue(ResponseStatus.SUCCESSFUL); responseComboBox.addValueChangeListener( valueChangeEvent -> beanContainer.getItemIds().forEach(itemId -> beanContainer.getItem(itemId) .getItemProperty(RESPONSE_STATUS_COL).setValue(valueChangeEvent.getProperty().getValue()))); // add all components addComponent(caption); addComponent(toolbar); addComponent(grid); setExpandRatio(grid, 1.0F); // load beans repository.getAll().forEach(beanContainer::addBean); }