Example usage for com.vaadin.server FontAwesome DESKTOP

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

Introduction

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

Prototype

FontAwesome DESKTOP

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

Click Source Link

Usage

From source file:com.javalego.store.environment.BaseEnvironment.java

@Override
public synchronized Collection<RepositoryIcons<Icon>> getRepositoriesIcons() throws LocalizedException {

    if (repositories != null) {
        return repositories;
    }//from  w  w w  . j a v  a  2  s . c  o  m

    repositories = new ArrayList<RepositoryIcons<Icon>>();

    // Iconos de redes sociales usando FonAwesome icons.
    FontAwesomeIcons fa = FontAwesomeIcons.getCurrent();
    fa.addIcon(MenuIcons2.BOOK, FontAwesome.BOOK);
    fa.addIcon(MenuIcons2.MONITOR, FontAwesome.DESKTOP);
    fa.addIcon(MenuIcons2.SOURCECODE, FontAwesome.CODE);
    fa.addIcon(MenuIcons2.GITHUB, FontAwesome.GITHUB);
    fa.addIcon(MenuIcons2.METRICS, FontAwesome.BAR_CHART_O);
    fa.addIcon(MenuIcons2.WEB, FontAwesome.GLOBE);
    fa.addIcon(MenuIcons2.TWITTER, FontAwesome.TWITTER);
    fa.addIcon(MenuIcons2.FORUM, FontAwesome.USERS);
    fa.addIcon(MenuIcons2.BLOG, FontAwesome.WORDPRESS);
    fa.addIcon(MenuIcons2.LINKEDIN, FontAwesome.LINKEDIN);
    fa.addIcon(MenuIcons2.FACEBOOK, FontAwesome.FACEBOOK);
    fa.addIcon(MenuIcons2.GOOGLEPLUS, FontAwesome.GOOGLE_PLUS);
    fa.addIcon(MenuIcons2.EMAIL, FontAwesome.ENVELOPE);
    fa.addIcon(MenuIcons2.TOOLS, FontAwesome.COGS);
    fa.addIcon(MenuIcons2.LICENSE, FontAwesome.FILE);

    // Resto de iconos
    ResourceIconsVaadin rep = ResourceIconsVaadin.getCurrent();
    //rep.setLocale(Locale.US);
    rep.load(MenuIcons.class, "/menu_icons");
    rep.load(MenuIcons2.class, "/menu_icons2");
    rep.load(ProviderIcons.class, "/provider_icons");
    rep.load(IconEditor.class, "/icons_editor");

    repositories.add(fa);
    repositories.add(rep);

    return repositories;
}

From source file:local.ikram.assesment.web.SimpleFormComponent.java

private void initForm() {

    employeeId = new TextField("Employee Id: ");
    employeeId.setIcon(FontAwesome.FILE_PICTURE_O);
    employeeId.setRequired(true);/* ww w  .  j av a 2s.co  m*/
    employeeId.addValidator(new StringLengthValidator("Must be btw 7 and 9 characters", 7, 9, false));

    firstName = new TextField("First Name: ");
    firstName.setIcon(FontAwesome.USER);
    firstName.setRequired(true);
    firstName.addValidator(new NullValidator("Cannot be empty", false));

    lastName = new TextField("Last Name: ");
    lastName.setIcon(FontAwesome.USER);
    lastName.setRequired(true);
    lastName.addValidator(new NullValidator("Cannot be empty", false));

    phoneNumber = new TextField("Phone Number: ");
    phoneNumber.setIcon(FontAwesome.PHONE_SQUARE);
    phoneNumber.setRequired(true);
    phoneNumber.addValidator(new NullValidator("Cannot be empty", false));

    department = new TextField("Department: ");
    department.setIcon(FontAwesome.DESKTOP);
    department.setRequired(true);
    department.addValidator(new NullValidator("Cannot be empty", false));

    saveBtn = new Button("Save", FontAwesome.SAVE);
    saveBtn.addStyleName("save-btn");
    saveBtn.addClickListener((Button.ClickEvent e) -> {
        try {
            employeeId.validate();
            firstName.validate();
            lastName.validate();
            phoneNumber.validate();
            department.validate();
            update(getEmployee());
        } catch (Validator.InvalidValueException ex) {
            Logger.getLogger(SimpleFormComponent.class.getName()).log(Level.SEVERE, ex.getLocalizedMessage(),
                    ex);
        }
    });
    deleteBtn = new Button("Delete", FontAwesome.RECYCLE);
    deleteBtn.addStyleName("delete-btn");
    deleteBtn.addClickListener((Button.ClickEvent e) -> {
        delete(getEmployee());
    });
    addBtn = new Button("Add Employee", FontAwesome.PLUS_SQUARE);
    addBtn.addStyleName("add-btn");
    addBtn.addClickListener((Button.ClickEvent e) -> {
        clear();
    });

    final HorizontalLayout buttonLayout = new HorizontalLayout(saveBtn, deleteBtn);
    buttonLayout.setSpacing(true);

    final FormLayout formLayout = new FormLayout();
    formLayout.setSizeUndefined();
    formLayout.setMargin(true);
    formLayout.setData(this);
    formLayout.addComponents(employeeId, firstName, lastName, phoneNumber, department, buttonLayout);
    setCompositionRoot(formLayout);

    setEmployee(new Employee());
    BeanFieldGroup.bindFieldsUnbuffered(employee, this);
}

From source file:org.eclipse.hawkbit.ui.login.LoginView.java

License:Open Source License

private Component buildLinks() {

    final HorizontalLayout links = new HorizontalLayout();
    links.setSpacing(true);/*from w w w .  ja  v a 2s  . c  o  m*/
    links.addStyleName("links");
    final String linkStyle = "v-link";

    if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
        final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
                i18n.getMessage("link.documentation.name"),
                uiProperties.getLinks().getDocumentation().getRoot(), FontAwesome.QUESTION_CIRCLE, "_blank",
                linkStyle);
        links.addComponent(docuLink);
        docuLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getDemo().getUser().isEmpty()) {
        final Link demoLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DEMO,
                i18n.getMessage("link.demo.name"), "?demo", FontAwesome.DESKTOP, "_top", linkStyle);
        links.addComponent(demoLink);
        demoLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
        final Link requestAccountLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_REQUESTACCOUNT,
                i18n.getMessage("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
                FontAwesome.SHOPPING_CART, "", linkStyle);
        links.addComponent(requestAccountLink);
        requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
        final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
                i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
                FontAwesome.USERS, "_blank", linkStyle);
        links.addComponent(userManagementLink);
        userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
    }

    return links;
}