本文整理汇总了Java中com.vaadin.data.util.BeanContainer.addItem方法的典型用法代码示例。如果您正苦于以下问题:Java BeanContainer.addItem方法的具体用法?Java BeanContainer.addItem怎么用?Java BeanContainer.addItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.util.BeanContainer
的用法示例。
在下文中一共展示了BeanContainer.addItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addUserIntoTable
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void addUserIntoTable(@Observes final MainUIEvent.UserAddedEvent event) {
User user = event.getUser();
BeanContainer<Long, User> container = (BeanContainer<Long, User>) table.getContainerDataSource();
container.removeItem(user.getId());
container.addItem(user.getId(), user);
table.sort();
}
示例2: changeUserGroups
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void changeUserGroups(@Observes final MainUIEvent.UserGroupsChangedEvent event) {
User user = event.getUser();
BeanContainer<Long, User> container = (BeanContainer<Long, User>) table.getContainerDataSource();
container.removeItem(user.getId());
container.addItem(user.getId(), user);
}
示例3: addGroupIntoTable
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
/**
* Make ui changes when new group added
*
* @param event
*/
@Override
@SuppressWarnings("unchecked")
public void addGroupIntoTable(@Observes final MainUIEvent.GroupAddedEvent event) {
Group group = event.getGroup();
if (group != null) {
BeanContainer<Long, Group> container = (BeanContainer<Long, Group>) table.getContainerDataSource();
container.removeItem(group.getId());
container.addItem(group.getId(), group);
table.sort();
}
}
示例4: changeGroupUsers
import com.vaadin.data.util.BeanContainer; //导入方法依赖的package包/类
/**
* Make ui changes when group user changed
*
* @param event
*/
@Override
@SuppressWarnings("unchecked")
public void changeGroupUsers(@Observes final MainUIEvent.GroupUsersChangedEvent event) {
Group group = event.getGroup();
BeanContainer<Long, Group> container = (BeanContainer<Long, Group>) table.getContainerDataSource();
container.removeItem(group.getId());
container.addItem(group.getId(), group);
}