Example usage for com.vaadin.server FontAwesome FILE_IMAGE_O

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

Introduction

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

Prototype

FontAwesome FILE_IMAGE_O

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

Click Source Link

Usage

From source file:com.esofthead.mycollab.vaadin.resources.file.FileAssetsUtil.java

License:Open Source License

public static FontAwesome getFileIconResource(String fileName) {
    String mimeType = MimeTypesUtil.detectMimeType(fileName);
    if (MimeTypesUtil.isImage(mimeType)) {
        return FontAwesome.FILE_IMAGE_O;
    } else if (MimeTypesUtil.isAudio(mimeType)) {
        return FontAwesome.FILE_AUDIO_O;
    } else if (MimeTypesUtil.isVideo(mimeType)) {
        return FontAwesome.FILE_VIDEO_O;
    } else if (MimeTypesUtil.isText(mimeType)) {
        return FontAwesome.FILE_TEXT_O;
    }/*from w  w  w .jav a 2s .  c o  m*/
    FontAwesome icon = extraIconMap.get(mimeType);
    return (icon == null) ? FontAwesome.FILE_O : icon;
}

From source file:com.esofthead.mycollab.vaadin.ui.AttachmentPanel.java

License:Open Source License

private static FontAwesome getFileIconResource(String fileName) {
    String mimeType = MimeTypesUtil.detectMimeType(fileName);
    if (MimeTypesUtil.isImage(mimeType)) {
        return FontAwesome.FILE_IMAGE_O;
    } else if (MimeTypesUtil.isAudio(mimeType)) {
        return FontAwesome.FILE_AUDIO_O;
    } else if (MimeTypesUtil.isVideo(mimeType)) {
        return FontAwesome.FILE_VIDEO_O;
    } else if (MimeTypesUtil.isText(mimeType)) {
        return FontAwesome.FILE_TEXT_O;
    }/*from   w ww  .j a  v  a2s .com*/

    return FontAwesome.FILE_O;
}

From source file:me.uni.emuseo.view.exhibits.ExhibitTable.java

License:Open Source License

public ExhibitTable() {

    setSortEnabled(false);/*from w  w  w.  j a v  a2s .co  m*/
    addActionHandler(new Handler() {

        private static final long serialVersionUID = -1458601748782504737L;

        @Override
        public void handleAction(Action action, Object sender, Object target) {
            if (target == null) {
                return;
            }
            switch (action.getCaption()) {
            case "Edytuj":
                onEdit((ExhibitDTO) target);
                break;
            case "Usu":
                onDelete((ExhibitDTO) target);
                break;
            case EDIT_IMAGE_CAPTION:
                onImageEdit((ExhibitDTO) target);
                break;
            case SHOW_CAPTION:
                onShow((ExhibitDTO) target);
                break;
            default:
                break;
            }
        }

        @Override
        public Action[] getActions(Object target, Object sender) {

            Action actionEdit = new Action("Edytuj", FontAwesome.EDIT);
            Action actionDelete = new Action("Usu", FontAwesome.TRASH_O);
            Action actionEditImage = new Action(EDIT_IMAGE_CAPTION, FontAwesome.FILE_IMAGE_O);
            Action actionShow = new Action(SHOW_CAPTION, FontAwesome.EYE);
            return new Action[] { actionEdit, actionDelete, actionEditImage, actionShow };
        }
    });
    setItemDescriptionGenerator(new ExhibitDescriptionGenerator());

    beans = new BeanItemContainer<ExhibitDTO>(ExhibitDTO.class);
    setContainerDataSource(beans);
    beans.addNestedContainerBean("exhibitCategory");
    setVisibleColumns(new Object[] { "exhibitName", "exhibitNo", "genericYear", "exhibitCategory.name",
            "exhibitLocation" });
    setColumnHeaders("Nazwa", "Numer kat.", "Wiek w latach", "Kategoria", "Lokalizacja");

}