Example usage for com.vaadin.server FontAwesome FILE

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

Introduction

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

Prototype

FontAwesome FILE

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

Click Source Link

Usage

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

License:Apache License

@Override
public void createDocumentMenuBar(final MenuBar menuBar, final String pageId) {
    initApplicationMenuBar(menuBar);//from   w  ww. ja v a  2s . c  o m

    menuBar.addItem(OVERVIEW_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.OVERVIEW, pageId));
    menuBar.addItem(CHARTS_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.CHARTS, pageId));
    menuBar.addItem(INDICATORS_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.INDICATORS, pageId));

    final MenuItem documentItem = menuBar.addItem(DOCUMENT, FontAwesome.FILE, null);

    documentItem.addItem(DOCUMENT_ACTIVITY_TEXT, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTACTIVITY.toString(), pageId));

    documentItem.addItem(PERSON_REFERENCES, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.PERSONREFERENCES.toString(), pageId));

    documentItem.addItem(DOCUMENT_DETAILS, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDETAILS.toString(), pageId));

    documentItem.addItem(DOCUMENT_DATA, FontAwesome.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
            DocumentPageMode.DOCUMENTDATA.toString(), pageId));

    documentItem.addItem(DOCUMENT_REFERENCES, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTREFERENCES.toString(), pageId));

    documentItem.addItem(DOCUMENT_DECISION, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDECISION.toString(), pageId));

    documentItem.addItem(DOCUMENT_ATTACHEMENTS, FontAwesome.FILE, new PageModeMenuCommand(
            UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTATTACHMENTS.toString(), pageId));

    menuBar.addItem(PAGE_VISIT_HISTORY_TEXT, null,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.PAGEVISITHISTORY, pageId));

}

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

License:Apache License

@Override
public void createOverviewPage(final VerticalLayout panelContent, final String pageId) {
    final GridLayout grid = createGridLayout(panelContent);

    createButtonLink(grid, OVERVIEW_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.OVERVIEW, pageId),
            "Default description");
    createButtonLink(grid, CHARTS_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.CHARTS, pageId),
            "Default description");
    createButtonLink(grid, INDICATORS_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, PageMode.INDICATORS, pageId),
            "Default description");

    createButtonLink(grid, DOCUMENT_ACTIVITY_TEXT, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTACTIVITY.toString(),
                    pageId),//  w w  w. j  a  v  a 2  s.c o  m
            "Default description");

    createButtonLink(grid, PERSON_REFERENCES, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.PERSONREFERENCES.toString(),
                    pageId),
            "Default description");

    createButtonLink(grid, DOCUMENT_DETAILS, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDETAILS.toString(),
                    pageId),
            "Default description");

    createButtonLink(grid, DOCUMENT_DATA, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDATA.toString(),
                    pageId),
            "Default description");

    createButtonLink(grid, DOCUMENT_REFERENCES, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
                    DocumentPageMode.DOCUMENTREFERENCES.toString(), pageId),
            "Default description");

    createButtonLink(grid, DOCUMENT_DECISION, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME, DocumentPageMode.DOCUMENTDECISION.toString(),
                    pageId),
            "Default description");

    createButtonLink(grid, DOCUMENT_ATTACHEMENTS, FontAwesome.FILE,
            new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
                    DocumentPageMode.DOCUMENTATTACHMENTS.toString(), pageId),
            "Default description");

}

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  av  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:com.moscaville.ui.CsvVaadinUI.java

private void buildTemplateGridHeader() {
    HorizontalLayout templateGridHeaderLayout = new HorizontalLayout();
    templateGridHeaderLayout.setSpacing(true);
    templateGridHeaderLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);

    Button btnNew = new Button("New", FontAwesome.FILE);
    btnNew.setDescription("New template file");
    btnNew.addClickListener((Button.ClickEvent event) -> {
        templateManager.newTemplate();/*from  w  w w  .j a  v  a 2s.  c  o  m*/
    });
    templateGridHeaderLayout.addComponent(btnNew);

    Button btnOpen = new Button("Open", FontAwesome.FILE_O);
    btnOpen.setDescription("Open template file");
    btnOpen.addClickListener((Button.ClickEvent event) -> {
        fileChooser.setFileExtension(FileChooser.FILE_EXTENSION_TEMPLATE);
        addWindow(fileChooser);
    });
    templateGridHeaderLayout.addComponent(btnOpen);

    Button btnSave = new Button("Save", FontAwesome.SAVE);
    tfTemplateFileName = new TextField();
    tfTemplateFileName.setDescription("template file name");
    tfTemplateFileName.setInputPrompt("template file name");
    tfTemplateFileName.setImmediate(true);
    tfTemplateFileName.addValueChangeListener((Property.ValueChangeEvent event) -> {
        btnSave.setEnabled(tfTemplateFileName.getValue() != null && tfTemplateFileName.getValue().length() > 0);
    });
    templateGridHeaderLayout.addComponent(tfTemplateFileName);

    FieldGroup binder = new FieldGroup(templateManager.getTemplateBeanItem());
    binder.setBuffered(false);
    binder.bind(tfTemplateFileName, "templateFileName");

    btnSave.setDescription("Save template file");
    btnSave.setImmediate(true);
    btnSave.setEnabled(false);
    btnSave.addClickListener((Button.ClickEvent event) -> {
        templateManager.saveTemplate();
    });
    templateGridHeaderLayout.addComponent(btnSave);

    Button btnData = new Button("Data", FontAwesome.DATABASE);
    btnData.setDescription("Load data");
    btnData.addClickListener((Button.ClickEvent event) -> {
        fileChooser.setFileExtension(FileChooser.FILE_EXTENSION_CSV);
        addWindow(fileChooser);
    });
    templateGridHeaderLayout.addComponent(btnData);

    Button btnImport = new Button("Import", FontAwesome.DOWNLOAD);

    templateGridHeaderLayout.addComponent(btnImport);
    mainLayout.addComponent(templateGridHeaderLayout);
}

From source file:com.mycollab.mobile.module.project.ui.form.field.ProjectFormAttachmentUploadField.java

License:Open Source License

public ProjectFormAttachmentUploadField() {
    withMargin(false);//w ww. j ava  2s. c o  m
    resourceService = AppContextUtil.getSpringBean(ResourceService.class);
    fileStores = new HashMap<>();

    multiFileUpload = new MultiFileUploadExt();
    multiFileUpload.setWidth("100%");
    this.setStyleName("attachment-field");

    rowWrap = new VerticalLayout();
    rowWrap.setWidth("100%");
    rowWrap.setStyleName("attachment-row-wrap");

    this.addComponent(FormSectionBuilder.build(FontAwesome.FILE, GenericI18Enum.FORM_ATTACHMENTS));
    MCssLayout btnWrap = new MCssLayout(multiFileUpload).withFullWidth();
    this.addComponent(btnWrap);
    this.addComponent(rowWrap);
}

From source file:com.mycollab.mobile.module.project.ui.ProjectAttachmentDisplayComp.java

License:Open Source License

private void constructUI() {
    this.setStyleName("attachment-display-comp");
    this.addComponent(FormSectionBuilder.build(FontAwesome.FILE, GenericI18Enum.FORM_ATTACHMENTS));
    VerticalLayout comp = new VerticalLayout();
    comp.setStyleName("attachment-view-panel");
    comp.setWidth("100%");

    for (final Content attachment : attachments) {
        Component attachmentRow = MobileAttachmentUtils.renderAttachmentRow(attachment);
        comp.addComponent(attachmentRow);
    }//from  w  w  w  .  j  a  va2 s.  c om
    this.addComponent(comp);
}

From source file:main.ProjectwizardUI.java

License:Open Source License

private void initView(final DBManager dbm, final DBVocabularies vocabularies, final String user) {
    tabs.removeAllComponents();//  www  .j  a  v a  2 s.  co  m
    AttachmentConfig attachConfig = new AttachmentConfig(Integer.parseInt(config.getAttachmentMaxSize()),
            config.getAttachmentURI(), config.getAttachmentUser(), config.getAttachmenPassword());
    WizardController c = new WizardController(openbis, dbm, vocabularies, attachConfig);
    c.init(user);
    Wizard w = c.getWizard();
    WizardProgressListener wl = new WizardProgressListener() {

        @Override
        public void activeStepChanged(WizardStepActivationEvent event) {
        }

        @Override
        public void stepSetChanged(WizardStepSetChangedEvent event) {
        }

        @Override
        public void wizardCompleted(WizardCompletedEvent event) {
            vocabularies.setPeople(dbm.fetchPeople());
            vocabularies.setSpaces(openbis.getUserSpaces(user));
            initView(dbm, vocabularies, user);
        }

        @Override
        public void wizardCancelled(WizardCancelledEvent event) {
            vocabularies.setPeople(dbm.fetchPeople());
            vocabularies.setSpaces(openbis.getUserSpaces(user));
            initView(dbm, vocabularies, user);
        }

    };
    w.addListener(wl);
    VerticalLayout wLayout = new VerticalLayout();
    wLayout.addComponent(w);
    wLayout.setMargin(true);

    tabs.addTab(wLayout, "Create Project").setIcon(FontAwesome.FLASK);
    // TODO barcode tab, remove once new portlet is online
    // BarcodeConfig bcConf = new BarcodeConfig(config.getBarcodeScriptsFolder(), tmpFolder,
    // config.getBarcodeResultsFolder(), config.getBarcodePathVariable());
    // SampleFilterGenerator gen = new SampleFilterGenerator();
    // BarcodeController bc = new BarcodeController(openbis, bcConf, dbm);
    // gen.addObserver(bc);
    // final WizardBarcodeView bw = new WizardBarcodeView(vocabularies.getSpaces(), isAdmin, gen);
    // bw.initControl(bc);
    // tabs.addTab(bw, "Create Barcodes").setIcon(FontAwesome.BARCODE);
    // tabs.addSelectedTabChangeListener(new SelectedTabChangeListener() {
    //
    // @Override
    // public void selectedTabChange(SelectedTabChangeEvent event) {
    // bw.resetSpace();
    // }
    // });

    OpenbisCreationController creationController = new OpenbisCreationController(openbis);// will
                                                                                          // not
                                                                                          // work
                                                                                          // when
                                                                                          // openbis
                                                                                          // is down

    ExperimentImportController uc = new ExperimentImportController(creationController, vocabularies, openbis,
            dbm);
    uc.init(user);
    tabs.addTab(uc.getView(), "Import Project").setIcon(FontAwesome.FILE);

    boolean overwriteAllowed = isAdmin || canOverwrite();
    tabs.addTab(new MetadataUploadView(openbis, vocabularies, overwriteAllowed), "Update Metadata")
            .setIcon(FontAwesome.PENCIL);
    ;
    if (isAdmin) {
        logger.info("User is " + user + " and can see admin panel.");
        VerticalLayout padding = new VerticalLayout();
        padding.setMargin(true);
        padding.addComponent(new AdminView(openbis, vocabularies, creationController, user));
        tabs.addTab(padding, "Admin Functions").setIcon(FontAwesome.WRENCH);
    }
    if (overwriteAllowed)
        logger.info("User can overwrite existing metadata for their project.");
}

From source file:org.jumpmind.metl.ui.views.ExploreDirectoryView.java

License:Open Source License

protected Component fileLinkComponent(Table source, Object itemId, Object propertyId) {
    if (itemId instanceof FileInfo) {
        final FileInfo file = (FileInfo) itemId;
        if (!file.isDirectory()) {
            final Button button = new Button(file.getName());
            button.addStyleName(ValoTheme.BUTTON_LINK);
            button.addStyleName(ValoTheme.BUTTON_SMALL);
            button.setIcon(FontAwesome.FILE);
            StreamResource resource = new StreamResource(() -> stream(file), file.getName());
            FileDownloader fileDownloader = new FileDownloader(resource);
            fileDownloader.extend(button);
            return button;
        } else {//from  w w w .  j  av a  2  s . com
            return new Label(file.getName());
        }
    } else {
        return new Label(((DirectoryResource) itemId).getName());

    }
}