当前位置: 首页>>代码示例>>Java>>正文


Java Embedded.addListener方法代码示例

本文整理汇总了Java中com.vaadin.ui.Embedded.addListener方法的典型用法代码示例。如果您正苦于以下问题:Java Embedded.addListener方法的具体用法?Java Embedded.addListener怎么用?Java Embedded.addListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Embedded的用法示例。


在下文中一共展示了Embedded.addListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initPicture

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
  if(renderPicture) {
    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);
        }
      });
      
      addComponent(image);
      setComponentAlignment(image, Alignment.MIDDLE_LEFT);
    } else {
     // TODO: what when no image is available?
    }
  }
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:27,代码来源:UserProfileLink.java

示例2: GroupItem

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public GroupItem(final Group group) {
  Button idButton = new Button(group.getId());
  idButton.addStyleName(Reindeer.BUTTON_LINK);
  idButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      ExplorerApp.get().getViewManager().showGroupPage(group.getId());
    }
  });
  addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class));
  
  if (group.getName() != null) {
    addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class));
  }
  if (group.getType() != null) {
    addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class));
  }
  
  Embedded deleteIcon = new Embedded(null, Images.DELETE);
  deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
  deleteIcon.addListener(new DeleteMembershipListener(identityService, userId, group.getId(), userDetailPanel));
  addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class));
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:23,代码来源:GroupsForUserQuery.java

示例3: addAttachmentsToTable

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
protected void addAttachmentsToTable(List<Attachment> attachments) {
  for (Attachment attachment : attachments) {
    AttachmentRenderer renderer = attachmentRendererManager.getRenderer(attachment);
    Item attachmentItem = table.addItem(attachment.getId());
    attachmentItem.getItemProperty("name").setValue(renderer.getOverviewComponent(attachment, this));
    attachmentItem.getItemProperty("type").setValue(new Embedded(null, renderer.getImage(attachment)));
    
    Embedded deleteButton = new Embedded(null, Images.DELETE);
    deleteButton.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    deleteButton.addListener((ClickListener) new DeleteClickedListener(attachment));
    attachmentItem.getItemProperty("delete").setValue(deleteButton);
  }
  
  if(table.getItemIds().size() > 0) {
    table.setVisible(true);
  }
  table.setPageLength(table.size());
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:19,代码来源:TaskRelatedContentComponent.java

示例4: GroupMemberItem

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public GroupMemberItem(final User user) {
  // id
  Button idButton = new Button(user.getId());
  idButton.addStyleName(Reindeer.BUTTON_LINK);
  idButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      ExplorerApp.get().getViewManager().showUserPage(user.getId());
    }
  });
  addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class));
  
  // name
  if (user.getFirstName() != null) {
    addItemProperty("firstName", new ObjectProperty<String>(user.getFirstName(), String.class));
  }
  if (user.getLastName() != null) {
    addItemProperty("lastName", new ObjectProperty<String>(user.getLastName(), String.class));
  }
  
  // email
  if (user.getEmail() != null) {
    addItemProperty("email", new ObjectProperty<String>(user.getEmail(), String.class));
  }
  
  // Delete
  Embedded deleteIcon = new Embedded(null, Images.DELETE);
  deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
  deleteIcon.addListener(new DeleteMembershipListener(identityService, user.getId(), groupId, memberShipChangeListener));
  addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class));
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:31,代码来源:GroupMembersQuery.java

示例5: generateCell

import com.vaadin.ui.Embedded; //导入方法依赖的package包/类
public Component generateCell(Table source, Object itemId, Object columnId) {
  Embedded embedded = new Embedded(null, image);
  
  if (clickListener != null) {
    embedded.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    embedded.setData(itemId);
    embedded.addListener(clickListener);
  }
  
  return embedded;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:12,代码来源:ThemeImageColumnGenerator.java


注:本文中的com.vaadin.ui.Embedded.addListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。