本文整理汇总了Java中com.vaadin.data.util.BeanContainer.setBeanIdProperty方法的典型用法代码示例。如果您正苦于以下问题:Java BeanContainer.setBeanIdProperty方法的具体用法?Java BeanContainer.setBeanIdProperty怎么用?Java BeanContainer.setBeanIdProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.util.BeanContainer
的用法示例。
在下文中一共展示了BeanContainer.setBeanIdProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MilestoneListSelect
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
public MilestoneListSelect() {
this.setItemCaptionMode(ItemCaptionMode.PROPERTY);
MilestoneSearchCriteria criteria = new MilestoneSearchCriteria();
criteria.setProjectIds(new SetSearchField<>(CurrentProjectVariables.getProjectId()));
MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.class);
List<SimpleMilestone> milestones = (List<SimpleMilestone>) milestoneService.findPageableListByCriteria(new BasicSearchRequest<>(criteria));
BeanContainer<String, SimpleMilestone> beanItem = new BeanContainer<>(SimpleMilestone.class);
beanItem.setBeanIdProperty("id");
milestones.forEach(beanItem::addBean);
this.setContainerDataSource(beanItem);
this.setItemCaptionPropertyId("name");
}
示例2: RoleComboBox
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
public RoleComboBox() {
this.setNullSelectionAllowed(false);
this.setItemCaptionMode(ItemCaptionMode.PROPERTY);
RoleSearchCriteria criteria = new RoleSearchCriteria();
RoleService roleService = AppContextUtil.getSpringBean(RoleService.class);
List<SimpleRole> roles = (List<SimpleRole>) roleService.findPageableListByCriteria(new BasicSearchRequest<>(criteria));
BeanContainer<String, SimpleRole> beanItem = new BeanContainer<>(SimpleRole.class);
beanItem.setBeanIdProperty("id");
this.setContainerDataSource(beanItem);
this.setItemCaptionPropertyId("rolename");
SimpleRole ownerRole = new SimpleRole();
ownerRole.setId(-1);
ownerRole.setRolename(UserUIContext.getMessage(RoleI18nEnum.OPT_ACCOUNT_OWNER));
beanItem.addBean(ownerRole);
roles.forEach(role -> {
beanItem.addBean(role);
if (Boolean.TRUE.equals(role.getIsdefault())) {
this.setValue(role.getId());
}
});
}
示例3: createItemContainer
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
private BeanContainer<String, SecurityGroupMemberItemDto> createItemContainer() {
BeanContainer<String, SecurityGroupMemberItemDto> container = new BeanContainer<String, SecurityGroupMemberItemDto>(
SecurityGroupMemberItemDto.class);
container.setBeanIdProperty("openstackId");
container.setItemSorter(ViewUtil.getCaseInsensitiveItemSorter());
return container;
}