Q:

Vaadin Upload. How to hande very long file name on view.

Does any body know how to handle very long file names in Vaadin Upload component? 
Code from Vaadin tutorial:
 sample = new Upload(null, lineBreakCounter);
 sample.setImmediate(false);
 sample.setButtonCaption("Upload File");
 sample.addStartedListener(new StartedListener() {

   @Override
     public void uploadStarted(final StartedEvent event) {
     if (uploadInfoWindow.getParent() == null) {
     UI.getCurrent().addWindow(uploadInfoWindow);
     }
     uploadInfoWindow.setClosable(false);
      }
    });
    sample.addFinishedListener(new Upload.FinishedListener() {

    @Override
    public void uploadFinished(final FinishedEvent event) {
    uploadInfoWindow.setClosable(true);
    }
    });
    uploadInfoWindow = new UploadInfoWindow(sample, lineBreakCounter);

What if I want to upload file with very long name. Is there any way to show the user first 5 or 10 characters of the uploaded file name?
Now it works like in the attached file.
 

A:

In your case, either you can set a definite width to the window (uploadInfoWindow) or to the upload component (sample).
sample.setWidth("100px");

OR
uploadInfoWindow.setWidth("100px");

