Example usage for com.vaadin.server FontAwesome FILE_TEXT

List of usage examples for com.vaadin.server FontAwesome FILE_TEXT

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome FILE_TEXT.

Prototype

FontAwesome FILE_TEXT

To view the source code for com.vaadin.server FontAwesome FILE_TEXT.

Click Source Link

Usage

From source file:com.hack23.cia.web.impl.ui.application.views.common.menufactory.impl.AbstractMenuItemFactoryImpl.java

License:Apache License

/**
 * Creates the admin menu.//ww  w . j  av  a 2 s. co  m
 *
 * @param mainViewItem
 *            the main view item
 */
private static void createAdminMenu(final MenuItem mainViewItem) {
    if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN)) {
        final MenuItem adminMenuItem = mainViewItem.addItem(ADMIN_TEXT, FontAwesome.SERVER, null);

        final MenuItem configurationMenuItem = adminMenuItem.addItem(CONFIGURATION, FontAwesome.GEARS, null);
        configurationMenuItem.addItem(APPLICATION_CONFIGURATION, FontAwesome.GEARS, COMMAND6);

        configurationMenuItem.addItem(AGENCY, FontAwesome.SERVER, COMMAND7);
        configurationMenuItem.addItem(PORTAL, FontAwesome.SITEMAP, COMMAND8);
        configurationMenuItem.addItem(COUNTRY, FontAwesome.FLAG, COMMAND9);
        configurationMenuItem.addItem(LANGUAGE, FontAwesome.LANGUAGE, COMMAND10);
        configurationMenuItem.addItem(LANGUAGE_CONTENT, FontAwesome.FILE_TEXT, COMMAND11);

        final MenuItem managementMenuItem = adminMenuItem.addItem(MANAGEMENT, FontAwesome.SERVER, null);

        managementMenuItem.addItem(AGENT_OPERATIONS_TEXT, FontAwesome.USER_SECRET, COMMAND12);

        managementMenuItem.addItem(DATA_SUMMARY_TEXT, FontAwesome.DATABASE, COMMAND13);

        managementMenuItem.addItem("Email", FontAwesome.MAIL_FORWARD, COMMAND19);

        managementMenuItem.addItem(SYSTEM_PERFORMANCE, FontAwesome.DASHBOARD, COMMAND14);

        final MenuItem userActivityMenuItem = adminMenuItem.addItem(USER_ACTIVITY, FontAwesome.DATABASE, null);
        userActivityMenuItem.addItem(APPLICATION_SESSION, FontAwesome.LAPTOP, COMMAND15);
        userActivityMenuItem.addItem(APPLICATION_EVENT, FontAwesome.ARROWS, COMMAND16);
        userActivityMenuItem.addItem(APPLICATION_EVENT_CHARTS, FontAwesome.ARROWS, COMMAND20);

        userActivityMenuItem.addItem(USERACCOUNT, FontAwesome.GROUP, COMMAND17);

    }
}

From source file:de.kaiserpfalzEdv.vaadin.about.AboutViewImpl.java

License:Apache License

private void initializeLicense() {
    licenseLayout = createVerticalLayout("about.license.caption", "about.license.description",
            FontAwesome.FILE_TEXT);

    Label text = new Label(licenseText, ContentMode.HTML);
    text.setWidth(100f, PERCENTAGE);//  w w  w . j av a2  s.  c o  m

    Panel panel = new Panel(text);
    panel.setWidth(100f, PERCENTAGE);
    panel.setHeight(300f, PIXELS);

    licenseLayout.addComponent(panel);
}

From source file:fr.univlorraine.mondossierweb.MainUI.java

License:Apache License

/**
 * Construction du menu tudiant//from  www .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:fr.univlorraine.mondossierweb.views.AssistanceView.java

License:Apache License

/**
 * Initialise la vue/*from  w ww.jav  a2 s . c o  m*/
 */
@PostConstruct
public void init() {

    //On vrifie le droit d'accder  la vue
    if (userController.isEnseignant()) {
        // Style 
        setMargin(true);
        setSpacing(true);

        // Rcupration de la configuration pour cette vue
        String docUrl = configController.getAssistanceDocUrl();
        String helpdeskUrl = configController.getAssistanceHelpdeskUrl();
        String mailContact = configController.getAssistanceContactMail();

        // Titre 
        Label title = new Label(applicationContext.getMessage(NAME + ".title", null, getLocale()));
        title.addStyleName(ValoTheme.LABEL_H1);
        addComponent(title);

        // Texte
        if (StringUtils.hasText(applicationContext.getMessage(NAME + ".text", null, getLocale()))) {
            addComponent(new Label(applicationContext.getMessage(NAME + ".text", null, getLocale()),
                    ContentMode.HTML));
        }

        // Afficher la pop-up de dmarrage 
        Button popupBtn = new Button(applicationContext.getMessage(NAME + ".btnPopUp", null, getLocale()),
                FontAwesome.INFO);
        popupBtn.addStyleName(ValoTheme.BUTTON_LINK);
        popupBtn.addClickListener(e -> MainUI.getCurrent().afficherMessageIntroEnseignants(true, false));
        addComponent(popupBtn);

        // Accs  la documentation 
        if (StringUtils.hasText(docUrl)) {
            Button docBtn = new Button(applicationContext.getMessage(NAME + ".btnDoc", null, getLocale()),
                    FontAwesome.FILE_TEXT);
            docBtn.addStyleName(ValoTheme.BUTTON_LINK);
            BrowserWindowOpener docBwo = new BrowserWindowOpener(docUrl);
            docBwo.extend(docBtn);
            addComponent(docBtn);
        }

        // Envoyer un ticket 
        if (StringUtils.hasText(helpdeskUrl)) {
            Button helpDeskBtn = new Button(
                    applicationContext.getMessage(NAME + ".btnHelpdesk", null, getLocale()),
                    FontAwesome.AMBULANCE);
            helpDeskBtn.addStyleName(ValoTheme.BUTTON_LINK);
            BrowserWindowOpener helpDeskBwo = new BrowserWindowOpener(helpdeskUrl);
            helpDeskBwo.extend(helpDeskBtn);
            addComponent(helpDeskBtn);
        }

        // Envoyer un mail 
        if (StringUtils.hasText(mailContact)) {
            Button contactBtn = new Button(applicationContext.getMessage(NAME + ".btnContact",
                    new Object[] { mailContact }, getLocale()), FontAwesome.ENVELOPE);
            contactBtn.addStyleName(ValoTheme.BUTTON_LINK);
            BrowserWindowOpener contactBwo = new BrowserWindowOpener("mailto:" + mailContact);
            contactBwo.extend(contactBtn);
            addComponent(contactBtn);
        }

        /* Deconnexion */
        //Voir si on peut accder  l'appli hors ENT, le dtecter, et afficher le bouton dconnexion
        if (configController.isLogoutCasPropose()) {
            Button decoBtn = new Button("Dconnexion", FontAwesome.SIGN_OUT);
            decoBtn.addStyleName(ValoTheme.BUTTON_LINK);
            decoBtn.addClickListener(e -> {
                getUI().getPage().setLocation("j_spring_security_logout");
            });
            addComponent(decoBtn);
        }
    }
}

From source file:ui.button.AddCoverLetterButton.java

License:Apache License

public AddCoverLetterButton(Integer userId, String language) {
    super("Add Cover Letter", FontAwesome.FILE_TEXT);
    this.userId = userId;
    this.language = language;
    addClickListener(this);
}

From source file:views.MetadataUploadView.java

License:Open Source License

protected void createConditionWindow(ComboBox selectionBox) {
    String val = (String) selectionBox.getValue();

    // val.equals("[Experimental Condition]")
    String header = " Experimental Condition Name";
    String prefix = "Condition";
    Resource icon = FontAwesome.FLASK;

    if (val.equals("[Other Property]")) {
        header = " Property Name";
        prefix = "Property";
        icon = FontAwesome.FILE_TEXT;
    }//from  ww  w  .  j  a v  a2  s .  co  m
    final String category = prefix;

    Window subWindow = new Window(header);
    subWindow.setWidth("300px");

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    TextField label = new TextField();
    label.setRequired(true);
    label.setStyleName(Styles.fieldTheme);
    RegexpValidator factorLabelValidator = new RegexpValidator("([a-z]+_?[a-z]*)+([a-z]|[0-9]*)",
            "Name must start with a lower case letter and contain only lower case letter words, which can be connected by underscores ('_'). It can end with one or more numbers.");
    label.addValidator(factorLabelValidator);
    label.setValidationVisible(true);
    label.setImmediate(true);

    ComboBox unitSelect = new ComboBox("Unit");
    unitSelect.setNullSelectionAllowed(false);
    unitSelect.addItems(properties.Unit.values());
    String nullItem = "[None]";
    unitSelect.addItem(nullItem);
    unitSelect.select(nullItem);
    unitSelect.setStyleName(Styles.boxTheme);
    unitSelect.setImmediate(true);

    Button send = new Button("Ok");
    send.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (label.isValid()) {
                String unit = "";
                if (!unitSelect.getValue().equals(nullItem))
                    unit = " [" + unitSelect.getValue() + "]";
                String name = category + ": " + label.getValue() + unit;
                selectionBox.addItem(name);
                selectionBox.select(name);
                subWindow.close();
            } else {
                String error = "Please input a name for this " + category + ".";
                if (!label.isEmpty())
                    error = factorLabelValidator.getErrorMessage();
                Styles.notification("Missing Input", error, NotificationType.DEFAULT);
            }
        }
    });
    layout.addComponent(label);
    layout.addComponent(unitSelect);
    layout.addComponent(send);

    subWindow.setContent(layout);
    // Center it in the browser window
    subWindow.center();
    subWindow.setModal(true);
    subWindow.setIcon(icon);
    subWindow.setResizable(false);
    ProjectwizardUI ui = (ProjectwizardUI) UI.getCurrent();
    ui.addWindow(subWindow);
}