use of com.vaadin.event.MouseEvents.ClickEvent in project Activiti by Activiti.
the class UserDetailsComponent method addUserPicture.
protected void addUserPicture() {
// default icon
Resource pictureResource = Images.USER_32;
if (user != null) {
final Picture userPicture = identityService.getUserPicture(user.getId());
if (userPicture != null) {
pictureResource = new StreamResource(new StreamSource() {
public InputStream getStream() {
return userPicture.getInputStream();
}
}, user.getId(), ExplorerApp.get());
}
}
Embedded picture = new Embedded(null, pictureResource);
picture.setType(Embedded.TYPE_IMAGE);
picture.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_PICTURE);
if (user != null) {
// Only set fixed height and width when user has image, otherwise icon's dimensions will be used
picture.setHeight("32px");
picture.setWidth("32px");
}
addComponent(picture);
// Add profile popup listener
if (user != null) {
picture.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
picture.addListener(new com.vaadin.event.MouseEvents.ClickListener() {
public void click(ClickEvent event) {
viewManager.showProfilePopup(user.getId());
}
});
}
}
Aggregations