List of usage examples for com.vaadin.server FontAwesome GRADUATION_CAP
FontAwesome GRADUATION_CAP
To view the source code for com.vaadin.server FontAwesome GRADUATION_CAP.
Click Source Link
From source file:com.ies.schoolos.ui.mobile.info.layout.PersonalLayout.java
private void workGroup() { workGroup = new VerticalComponentGroup(); workGroup.setSizeUndefined();/*www. ja va 2 s . c om*/ addTab(workGroup, "?", FontAwesome.GRADUATION_CAP); jobPosition = new NativeSelect("?", new JobPosition()); //jobPosition.setInputPrompt("??"); jobPosition.setItemCaptionPropertyId("name"); jobPosition.setImmediate(true); jobPosition.setNullSelectionAllowed(false); jobPosition.setRequired(true); jobPosition.setWidth("-1px"); jobPosition.setHeight("-1px"); //jobPosition.setFilteringMode(FilteringMode.CONTAINS); jobPosition.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) { if (autoGenerate.getValue() != null) { String personnelCodeStr = getPersonnelCode(event.getProperty().getValue().toString(), autoGenerate.getValue().toString()); personnelCode.setEnabled(true); personnelCode.setValue(personnelCodeStr + TEMP_TITLE); personnelCode.setEnabled(false); } } } }); workGroup.addComponent(jobPosition); autoGenerate = new OptionGroup("?", new PersonnelCodeGenerateType()); autoGenerate.setItemCaptionPropertyId("name"); autoGenerate.setImmediate(true); autoGenerate.setRequired(true); autoGenerate.setNullSelectionAllowed(false); autoGenerate.setWidth("-1px"); autoGenerate.setHeight("-1px"); //autoGenerate.setValue(1); autoGenerate.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) { if (event.getProperty().getValue().toString().equals("0")) { if (jobPosition.getValue() != null) { String personnelCodeStr = getPersonnelCode(jobPosition.getValue().toString(), event.getProperty().getValue().toString()); personnelCode.setEnabled(true); personnelCode.setValue(personnelCodeStr + TEMP_TITLE); personnelCode.setEnabled(false); } else if (event.getProperty().getValue().equals("0")) Notification.show( "??", Type.WARNING_MESSAGE); } else { personnelCode.setEnabled(true); personnelCode.setValue(getPersonnelCode(null, "1")); } } } }); workGroup.addComponent(autoGenerate); personnelCode = new TextField(""); personnelCode.setInputPrompt(""); personnelCode.setImmediate(false); personnelCode.setRequired(true); personnelCode.setEnabled(false); personnelCode.setWidth("-1px"); personnelCode.setHeight("-1px"); personnelCode.setNullRepresentation(""); workGroup.addComponent(personnelCode); personnelStatus = new NativeSelect("?", new PersonnelStatus()); //personnelStatus.setInputPrompt("??"); personnelStatus.setItemCaptionPropertyId("name"); personnelStatus.setImmediate(true); personnelStatus.setNullSelectionAllowed(false); personnelStatus.setRequired(true); personnelStatus.setWidth("-1px"); personnelStatus.setHeight("-1px"); //personnelStatus.setFilteringMode(FilteringMode.CONTAINS); workGroup.addComponent(personnelStatus); startWorkDate = new PopupDateField(" "); startWorkDate.setInputPrompt("//"); startWorkDate.setImmediate(false); startWorkDate.setRequired(true); startWorkDate.setWidth("-1px"); startWorkDate.setHeight("-1px"); startWorkDate.setDateFormat("dd/MM/yyyy"); startWorkDate.setLocale(new Locale("th", "TH")); workGroup.addComponent(startWorkDate); department = new NativeSelect("??", new Department()); //department.setInputPrompt("??"); department.setItemCaptionPropertyId("name"); department.setImmediate(true); department.setNullSelectionAllowed(false); department.setRequired(true); department.setWidth("-1px"); department.setHeight("-1px"); //department.setFilteringMode(FilteringMode.CONTAINS); workGroup.addComponent(department); employmentType = new NativeSelect("?", new EmploymentType()); //employmentType.setInputPrompt("??"); employmentType.setItemCaptionPropertyId("name"); employmentType.setImmediate(true); employmentType.setNullSelectionAllowed(false); employmentType.setRequired(true); employmentType.setWidth("-1px"); employmentType.setHeight("-1px"); //employmentType.setFilteringMode(FilteringMode.CONTAINS); workGroup.addComponent(employmentType); bankaccountName = new TextField("?"); bankaccountName.setInputPrompt("?"); bankaccountName.setImmediate(false); bankaccountName.setWidth("-1px"); bankaccountName.setHeight("-1px"); bankaccountName.setNullRepresentation(""); workGroup.addComponent(bankaccountName); bankAccountNumber = new TextField("?"); bankAccountNumber.setInputPrompt("?"); bankAccountNumber.setImmediate(false); bankAccountNumber.setWidth("-1px"); bankAccountNumber.setHeight("-1px"); bankAccountNumber.setNullRepresentation(""); workGroup.addComponent(bankAccountNumber); bankAccountType = new NativeSelect("?", new BankAccountType()); //bankAccountType.setInputPrompt("??"); bankAccountType.setItemCaptionPropertyId("name"); bankAccountType.setImmediate(true); bankAccountType.setNullSelectionAllowed(false); bankAccountType.setWidth("-1px"); bankAccountType.setHeight("-1px"); //bankAccountType.setFilteringMode(FilteringMode.CONTAINS); workGroup.addComponent(bankAccountType); bankName = new TextField(""); bankName.setInputPrompt(""); bankName.setImmediate(false); bankName.setWidth("-1px"); bankName.setHeight("-1px"); bankName.setNullRepresentation(""); workGroup.addComponent(bankName); bankaccountBranch = new TextField(""); bankaccountBranch.setInputPrompt(""); bankaccountBranch.setImmediate(false); bankaccountBranch.setWidth("-1px"); bankaccountBranch.setHeight("-1px"); bankaccountBranch.setNullRepresentation(""); workGroup.addComponent(bankaccountBranch); bankProvinceId = new NativeSelect("", new Province()); //bankProvinceId.setInputPrompt("??"); bankProvinceId.setItemCaptionPropertyId("name"); bankProvinceId.setImmediate(true); bankProvinceId.setNullSelectionAllowed(false); bankProvinceId.setWidth("-1px"); bankProvinceId.setHeight("-1px"); //bankProvinceId.setFilteringMode(FilteringMode.CONTAINS); bankProvinceId.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue() != null) currentDistrict.setContainerDataSource( new District(Integer.parseInt(event.getProperty().getValue().toString()))); } }); workGroup.addComponent(bankProvinceId); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setWidth("100%"); buttonLayout.setSpacing(true); workGroup.addComponent(buttonLayout); generalBack = new Button(FontAwesome.ARROW_LEFT); generalBack.setWidth("100%"); generalBack.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { setSelectedTab(generalGroup); } }); buttonLayout.addComponents(generalBack); licenseeNext = new Button(FontAwesome.ARROW_RIGHT); licenseeNext.setWidth("100%"); licenseeNext.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { setSelectedTab(licenseeGroup); } }); buttonLayout.addComponents(licenseeNext); }
From source file:fr.univlorraine.mondossierweb.views.EtatCivilView.java
License:Apache License
/** * Initialise la vue//from w w w. ja va 2 s . co m */ @PostConstruct public void init() { LOG.debug(userController.getCurrentUserName() + " EtatCivilView"); //On vrifie le droit d'accder la vue if (UI.getCurrent() instanceof MainUI && (userController.isEnseignant() || userController.isEtudiant())) { if (MainUI.getCurrent() != null && MainUI.getCurrent().getEtudiant() != null) { LOG.debug(userController.getCurrentUserName() + " init EtatCivilView"); /* Style */ setMargin(true); setSpacing(true); /* Titre */ Label title = new Label(applicationContext.getMessage(NAME + ".title", null, getLocale())); title.addStyleName(ValoTheme.LABEL_H1); addComponent(title); VerticalLayout globalLayout = new VerticalLayout(); globalLayout.setSizeFull(); globalLayout.setSpacing(true); //Layout avec les infos etatcivil et contact CssLayout idLayout = new CssLayout(); idLayout.setSizeFull(); idLayout.setStyleName("flexwrap"); globalLayout.addComponent(idLayout); // Enable Responsive CSS selectors for the layout Responsive.makeResponsive(idLayout); /* Generalites */ FormLayout formGeneralitesLayout = new FormLayout(); formGeneralitesLayout.setSpacing(true); formGeneralitesLayout.setMargin(true); Panel panelGeneralites = new Panel( applicationContext.getMessage(NAME + ".generalites.title", null, getLocale())); String captionNumDossier = applicationContext.getMessage(NAME + ".numdossier.title", null, getLocale()); Label fieldNumDossier = new Label(); formatLabel(fieldNumDossier, captionNumDossier, MainUI.getCurrent().getEtudiant().getCod_etu()); formGeneralitesLayout.addComponent(fieldNumDossier); String captionNNE = applicationContext.getMessage(NAME + ".nne.title", null, getLocale()); Label fieldNNE = new Label(); formatLabel(fieldNNE, captionNNE, MainUI.getCurrent().getEtudiant().getCod_nne()); formGeneralitesLayout.addComponent(fieldNNE); String captionNom = applicationContext.getMessage(NAME + ".nom.title", null, getLocale()); Label fieldNom = new Label(); formatLabel(fieldNom, captionNom, MainUI.getCurrent().getEtudiant().getNom()); formGeneralitesLayout.addComponent(fieldNom); String captionMail = applicationContext.getMessage(NAME + ".mail.title", null, getLocale()); Label mailLabel = new Label(); mailLabel.setCaption(captionMail); String mail = MainUI.getCurrent().getEtudiant().getEmail(); if (StringUtils.hasText(mail)) { mail = "<a href=\"mailto:" + mail + "\">" + mail + "</a>"; mailLabel.setValue(mail); mailLabel.setContentMode(ContentMode.HTML); } mailLabel.setSizeFull(); formGeneralitesLayout.addComponent(mailLabel); String captionNationalite = applicationContext.getMessage(NAME + ".nationalite.title", null, getLocale()); Label fieldNationalite = new Label(); formatLabel(fieldNationalite, captionNationalite, MainUI.getCurrent().getEtudiant().getNationalite()); formGeneralitesLayout.addComponent(fieldNationalite); String captionDateNaissance = applicationContext.getMessage(NAME + ".naissance.title", null, getLocale()); Label fieldDateNaissance = new Label(); formatLabel(fieldDateNaissance, captionDateNaissance, MainUI.getCurrent().getEtudiant().getDatenaissance()); formGeneralitesLayout.addComponent(fieldDateNaissance); String captionLieuNaissance = applicationContext.getMessage(NAME + ".lieunaissance.title", null, getLocale()); Label fieldLieuNaissance = new Label(); formatLabel(fieldLieuNaissance, captionLieuNaissance, MainUI.getCurrent().getEtudiant().getLieunaissance()); formGeneralitesLayout.addComponent(fieldLieuNaissance); String captionDepNaissance = applicationContext.getMessage(NAME + ".depnaissance.title", null, getLocale()); Label fieldDepNaissance = new Label(); formatLabel(fieldDepNaissance, captionDepNaissance, MainUI.getCurrent().getEtudiant().getDepartementnaissance()); formGeneralitesLayout.addComponent(fieldDepNaissance); panelGeneralites.setContent(formGeneralitesLayout); HorizontalLayout generalitesGlobalLayout = new HorizontalLayout(); generalitesGlobalLayout.setSizeUndefined(); generalitesGlobalLayout.setStyleName("firstitembox"); generalitesGlobalLayout.addComponent(panelGeneralites); generalitesGlobalLayout.setExpandRatio(panelGeneralites, 1); idLayout.addComponent(generalitesGlobalLayout); /* Bac */ Panel panelBac = new Panel(applicationContext.getMessage(NAME + ".bac.title", null, getLocale())); //Si plusieurs bac if (MainUI.getCurrent().getEtudiant().getListeBac() != null && MainUI.getCurrent().getEtudiant().getListeBac().size() > 1) { panelBac.setCaption(applicationContext.getMessage(NAME + ".bacs.title", null, getLocale())); TabSheet bacTabSheet = new TabSheet(); VerticalLayout vBacLayout = new VerticalLayout(); vBacLayout.setSizeFull(); bacTabSheet.setSizeFull(); bacTabSheet.addStyleName(ValoTheme.TABSHEET_FRAMED); for (BacEtatCivil bec : MainUI.getCurrent().getEtudiant().getListeBac()) { FormLayout tabBacLayout = new FormLayout(); tabBacLayout.setSizeFull(); tabBacLayout.setMargin(false); ajouterBacToView(tabBacLayout, bec); bacTabSheet.addTab(tabBacLayout, bec.getCod_bac(), FontAwesome.GRADUATION_CAP); } vBacLayout.addComponent(bacTabSheet); panelBac.setContent(vBacLayout); } else { //Si un seul bac FormLayout formBacLayout = new FormLayout(); formBacLayout.setSizeFull(); if (MainUI.getCurrent().getEtudiant().getListeBac() != null && MainUI.getCurrent().getEtudiant().getListeBac().size() == 1) { formBacLayout.setSpacing(true); formBacLayout.setMargin(true); ajouterBacToView(formBacLayout, MainUI.getCurrent().getEtudiant().getListeBac().get(0)); } panelBac.setContent(formBacLayout); } HorizontalLayout bacGlobalLayout = new HorizontalLayout(); bacGlobalLayout.setSizeUndefined(); bacGlobalLayout.setStyleName("itembox"); bacGlobalLayout.addComponent(panelBac); bacGlobalLayout.setExpandRatio(panelBac, 1); idLayout.addComponent(bacGlobalLayout); /* Info de contact */ panelContact = new Panel(applicationContext.getMessage(NAME + ".contact.title", null, getLocale())); renseignerPanelContact(); globalLayout.addComponent(panelContact); addComponent(globalLayout); } else { /* Erreur */ addComponent(new BasicErreurMessageLayout(applicationContext)); } } }
From source file:org.opencms.ui.dialogs.permissions.CmsPermissionView.java
License:Open Source License
/** * Constructor.<p>/*from w ww.j a v a2 s . co m*/ * * @param entry the access control entry * @param editable the editable flag * @param isFolder the is folder flag * @param inheritedFrom the inherited from path * @param changeHandler the change handler */ public CmsPermissionView(CmsAccessControlEntry entry, boolean editable, boolean isFolder, String inheritedFrom, PermissionChangeHandler changeHandler) { m_changeHandler = changeHandler; m_editable = editable; m_entry = entry; CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null); CmsObject cms = A_CmsUI.getCmsObject(); // get name and type of the current entry I_CmsPrincipal principal; try { principal = CmsPrincipal.readPrincipalIncludingHistory(cms, entry.getPrincipal()); } catch (CmsException e) { principal = null; LOG.debug(e.getLocalizedMessage(), e); } m_principalName = (principal != null) ? principal.getName() : entry.getPrincipal().toString(); String ou = null; String displayName; int flags = 0; if ((principal != null) && (principal instanceof CmsHistoryPrincipal)) { // there is a history principal entry, handle it if (principal.isGroup()) { String niceName = OpenCms.getWorkplaceManager().translateGroupName(principal.getName(), false); displayName = CmsVaadinUtils.getMessageText( org.opencms.security.Messages.GUI_ORGUNIT_DISPLAY_NAME_2, ((CmsHistoryPrincipal) principal).getDescription(), niceName); ou = CmsOrganizationalUnit.getParentFqn(m_principalName); flags = CmsAccessControlEntry.ACCESS_FLAGS_GROUP; } else { displayName = ((CmsHistoryPrincipal) principal).getName(); ou = CmsOrganizationalUnit.getParentFqn(m_principalName); flags = CmsAccessControlEntry.ACCESS_FLAGS_USER; } } else if ((principal != null) && principal.isGroup()) { String niceName = OpenCms.getWorkplaceManager().translateGroupName(principal.getName(), false); displayName = CmsVaadinUtils.getMessageText(org.opencms.security.Messages.GUI_ORGUNIT_DISPLAY_NAME_2, ((CmsGroup) principal).getDescription(A_CmsUI.get().getLocale()), niceName); ou = CmsOrganizationalUnit.getParentFqn(m_principalName); flags = CmsAccessControlEntry.ACCESS_FLAGS_GROUP; } else if ((principal != null) && principal.isUser()) { displayName = ((CmsUser) principal).getFullName(); ou = CmsOrganizationalUnit.getParentFqn(m_principalName); flags = CmsAccessControlEntry.ACCESS_FLAGS_USER; } else if ((m_principalName != null) && m_principalName.equals(CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID.toString())) { m_principalName = CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME; displayName = CmsVaadinUtils.getMessageText(Messages.GUI_LABEL_ALLOTHERS_0); m_responsibleCheckbox.setVisible(false); flags = CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS; } else if ((m_principalName != null) && m_principalName.equals(CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID.toString())) { m_principalName = CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME; displayName = CmsVaadinUtils.getMessageText(Messages.GUI_LABEL_OVERWRITEALL_0); flags = CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL; } else { // check if it is the case of a role CmsRole role = CmsRole.valueOfId(entry.getPrincipal()); if (role != null) { displayName = role.getName(A_CmsUI.get().getLocale()); m_principalName = role.getRoleName(); flags = CmsAccessControlEntry.ACCESS_FLAGS_ROLE; } else { displayName = entry.getPrincipal().toString(); } } if ((flags > 0) && ((entry.getFlags() & flags) == 0)) { // the flag is set to the wrong principal type if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.ERR_INVALID_ACE_1, entry.toString())); } entry = new CmsAccessControlEntry(entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), entry.getDeniedPermissions(), (entry.getFlags() | flags)); } else if (entry.getFlags() < CmsAccessControlEntry.ACCESS_FLAGS_USER) { // the flag is set to NO principal type if (LOG.isErrorEnabled()) { LOG.error(Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.ERR_INVALID_ACE_1, entry.toString())); } entry = new CmsAccessControlEntry(entry.getResource(), entry.getPrincipal(), entry.getAllowedPermissions(), entry.getDeniedPermissions(), (entry.getFlags() | CmsAccessControlEntry.ACCESS_FLAGS_GROUP)); } m_principalType = getEntryType(entry.getFlags(), false); if (m_principalName == null) { m_principalName = ""; } FontIcon icon = null; boolean isOverwriteAll = false; switch (flags) { case CmsAccessControlEntry.ACCESS_FLAGS_USER: icon = FontAwesome.USER; break; case CmsAccessControlEntry.ACCESS_FLAGS_GROUP: icon = FontAwesome.GROUP; break; case CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS: icon = FontAwesome.GLOBE; break; case CmsAccessControlEntry.ACCESS_FLAGS_ROLE: icon = FontAwesome.GRADUATION_CAP; break; case CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL: icon = FontAwesome.EXCLAMATION_CIRCLE; isOverwriteAll = true; break; default: icon = FontAwesome.QUESTION_CIRCLE; } m_label.setContentMode(ContentMode.HTML); String ouName = null; if (ou != null) { try { ouName = OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, ou) .getDisplayName(UI.getCurrent().getLocale()); } catch (CmsException e) { LOG.debug("Error reading OU name.", e); } } m_label.setValue(icon.getHtml() + " <b>" + displayName + "</b> " + entry.getPermissions().getPermissionString() + (ouName != null ? ("<br />" + ouName) : "")); m_label.setWidthUndefined(); m_details.setIcon(FontAwesome.PLUS_SQUARE_O); m_details.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { toggleDetails(); } }); m_setButton.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { setPermissions(); } }); m_deleteButton.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; public void buttonClick(ClickEvent event) { deletePermissionSet(); } }); if (inheritedFrom != null) { m_inheritedFrom.setValue(inheritedFrom); } else { m_inheritedFrom.setVisible(false); } if (isOverwriteAll) { setDetailButtonVisible(false); if (m_editable) { addComponent(m_deleteButton, 2); m_deleteButton.addStyleName("o-permissions_delete"); } } else { // get all permissions of the current entry CmsPermissionSet permissions = entry.getPermissions(); IndexedContainer container = getPermissionContainer(permissions); m_permissions.setContainerDataSource(container); m_permissions.setColumnReorderingAllowed(false); m_permissions.setColumnHeader(PROPERTY_LABEL, CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_0)); m_permissions.setColumnHeader(PROPERTY_ALLOWED, CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_ALLOWED_0)); m_permissions.setColumnHeader(PROPERTY_DISPLAY_ALLOWED, CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_ALLOWED_0)); m_permissions.setColumnHeader(PROPERTY_DENIED, CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_DENIED_0)); m_permissions.setColumnHeader(PROPERTY_DISPLAY_DENIED, CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_DENIED_0)); m_permissions.setPageLength(5); m_permissions.setSortEnabled(false); if (m_editable) { toggleDetails(); setDetailButtonVisible(false); m_permissions.setVisibleColumns(PROPERTY_LABEL, PROPERTY_ALLOWED, PROPERTY_DENIED); m_permissions.setTableFieldFactory(FIELD_FACTORY); m_permissions.setEditable(m_editable); m_responsibleCheckbox.setValue(isResponsible(entry.getFlags())); m_overwriteCheckbox.setValue(isOverWritingInherited(entry.getFlags())); m_inheritCheckbox.setVisible(isFolder); m_inheritCheckbox.setValue(Boolean.valueOf(m_entry.isInheriting())); m_buttonBar.setVisible(true); } else { m_permissions.setVisibleColumns(PROPERTY_LABEL, PROPERTY_DISPLAY_ALLOWED, PROPERTY_DISPLAY_DENIED); } } }