Picture picture = identityService.getUserPicture(userName);
if(picture != null) {
Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()),
userName + picture.getMimeType(), ExplorerApp.get());
Embedded image = new Embedded(null, imageResource);
image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
image.setType(Embedded.TYPE_IMAGE);
image.setHeight(30, Embedded.UNITS_PIXELS);
image.setWidth(30, Embedded.UNITS_PIXELS);
image.addListener(new MouseEvents.ClickListener() {
private static final long serialVersionUID = 7341560240277898495L;
public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
viewManager.showProfilePopup(userName);
}
});