Example usage for com.vaadin.server FileResource getFilename

List of usage examples for com.vaadin.server FileResource getFilename

Introduction

In this page you can find the example usage for com.vaadin.server FileResource getFilename.

Prototype

@Override
    public String getFilename() 

Source Link

Usage

From source file:net.sourceforge.javydreamercsw.validation.manager.web.file.ImageDisplay.java

License:Apache License

@Override
public Window getViewer(File f) {
    w = new VMWindow(f.getName());
    boolean found = false;
    for (FileResource fr : images) {
        if (fr.getFilename().equals(f.getName())) {
            found = true;/* w ww . j  a v a  2 s.c  o  m*/
            break;
        }
    }
    if (!found) {
        images.add(new FileResource(f));
    }
    imageViewer.setImages(images);
    w.setContent(imageViewer);
    w.setHeight(80, Sizeable.Unit.PERCENTAGE);
    w.setWidth(80, Sizeable.Unit.PERCENTAGE);
    imageViewer.setCenterImageIndex(0);
    imageViewer.focus();
    return w;
}