• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BeanContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vaadin.data.util.BeanContainer的典型用法代码示例。如果您正苦于以下问题:Java BeanContainer类的具体用法?Java BeanContainer怎么用?Java BeanContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BeanContainer类属于com.vaadin.data.util包,在下文中一共展示了BeanContainer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initChildTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initChildTable() {
    this.childContainer = new BeanContainer<Long, VirtualSystemDto>(VirtualSystemDto.class);
    this.childTable.setContainerDataSource(this.childContainer);
    // Creating table
    this.childTable.setVisibleColumns("name", "virtualizationConnectorName", "virtualizationType", "domainName",
            "markForDeletion");

    this.childTable.addGeneratedColumn("virtualizationConnectorName", new ColumnGenerator() {
        @Override
        public Object generateCell(CustomTable source, Object itemId, Object columnId) {
            VirtualSystemDto vsDto = DistributedApplianceView.this.childContainer.getItem(itemId).getBean();
            return ViewUtil.generateObjectLink(
                    new LockObjectDto(vsDto.getVcId(), vsDto.getVirtualizationConnectorName(),
                            ObjectTypeDto.VIRTUALIZATION_CONNECTOR), DistributedApplianceView.this.server);
        }
    });

    // re-naming table header columns
    this.childTable.setColumnHeader("name", "VSS Name");
    this.childTable.setColumnHeader("virtualizationConnectorName", "Virtualization Connector");
    this.childTable.setColumnHeader("virtualizationType", "Virtualization Type");
    this.childTable.setColumnHeader("domainName", "Domain");
    this.childTable.setColumnHeader("markForDeletion", "Deleted");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:26,代码来源:DistributedApplianceView.java


示例2: initTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
public void initTable() {
    this.tableContainer = new BeanContainer<Long, DeploymentSpecDto>(DeploymentSpecDto.class);
    this.table.setContainerDataSource(this.tableContainer);
    this.table.setVisibleColumns("name", "projectName", "managementNetworkName", "markForDeletion",
            "lastJobStatus");

    // Customizing column header names
    this.table.setColumnHeader("name", "Name");
    this.table.setColumnHeader("projectName", "Project");
    this.table.setColumnHeader("managementNetworkName", "Network");
    this.table.setColumnHeader("markForDeletion", "Deleted");
    this.table.addGeneratedColumn("lastJobStatus", new ColumnGenerator() {
        @Override
        public Object generateCell(CustomTable source, Object itemId, Object columnId) {
            DeploymentSpecDto dsDto = DeploymentSpecSubView.this.tableContainer.getItem(itemId).getBean();
            return ViewUtil.generateJobLink(dsDto.getLastJobStatus(), dsDto.getLastJobState(),
                    dsDto.getLastJobId(), DeploymentSpecSubView.this.server);
        }

    });
    this.table.setColumnHeader("lastJobStatus", "Last Job Status");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:25,代码来源:DeploymentSpecSubView.java


示例3: initParentTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initParentTable() {
    this.parentContainer = new BeanContainer<>(VirtualizationConnectorDto.class);
    this.parentTable.setContainerDataSource(this.parentContainer);
    this.parentTable.setVisibleColumns("name", "type", "controllerIP", "providerIP");

    this.parentTable.addGeneratedColumn("providerIP", (ColumnGenerator) (source, itemId, columnId) -> {
        VirtualizationConnectorDto vcDto = VirtualizationConnectorView.this.parentContainer.getItem(itemId).getBean();

        return ViewUtil.generateMgrLink("http://", vcDto.getProviderIP(), "", "");
    });

    // Customizing header names
    this.parentTable.setColumnHeader("name", "Name");
    this.parentTable.setColumnHeader("type", "Type");
    this.parentTable.setColumnHeader("controllerIP", "Controller IP");
    this.parentTable.setColumnHeader("providerIP", "Provider IP");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:19,代码来源:VirtualizationConnectorView.java


示例4: initChildTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initChildTable() {
    this.childContainer = new BeanContainer<>(SecurityGroupDto.class);
    this.childTable.setContainerDataSource(this.childContainer);
    this.childTable.setVisibleColumns("name", "projectName", "memberDescription", "servicesDescription",
            "markForDeletion", "lastJobStatus");
    this.childTable.addGeneratedColumn("lastJobStatus", (source, itemId, columnId) -> {
        SecurityGroupDto SGDto = VirtualizationConnectorView.this.childContainer.getItem(itemId).getBean();
        return ViewUtil.generateJobLink(SGDto.getLastJobStatus(), SGDto.getLastJobState(),
                SGDto.getLastJobId(), VirtualizationConnectorView.this.server);
    });

    // re-naming table header columns
    this.childTable.setColumnHeader("name", "Name");
    this.childTable.setColumnHeader("projectName", "Project");
    this.childTable.setColumnHeader("memberDescription", "Members");
    this.childTable.setColumnHeader("servicesDescription", "Services");
    this.childTable.setColumnHeader("markForDeletion", "Deleted");
    this.childTable.setColumnHeader("lastJobStatus", "Last Job Status");

}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:22,代码来源:VirtualizationConnectorView.java


示例5: enter

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
	public void enter(ViewChangeEvent event) {
		quotes = new BeanContainer<String, Quote>(Quote.class);
		    
	    // Use the name property as the item ID of the bean
		quotes.setBeanIdProperty(Quote.PROPERTY_SYMBOL_ID);
		
		List<Quote> quotesList = tradingService.getQuotes();
		quotes.addAll(quotesList);
//		quoteSelector.setContainerDataSource(quotes);
//		quoteSelector.setInputPrompt(quotesList.get(0).getName());
		
		for (Quote quote : quotesList) {
			quoteSelector.addItem(quote.getSymbol());
			quoteSelector.setItemCaption(quote.getSymbol(), quote.getName());
		}
		
		chartToolbar.getTimeSteps().getChildren().get(chart.getTimeStep().ordinal()*2).setChecked(true);
		chart.setChartDrawType(LiveChart.ChartDrawType.LINE);
		chartToolbar.getCharts().getChildren().get(LiveChart.ChartDrawType.LINE.ordinal()*2).setChecked(true);
		quoteSelector.select(quotesList.get(0).getSymbol());
		
		
	}
 
开发者ID:xyfreemind,项目名称:trader,代码行数:25,代码来源:TradingAreaView.java


示例6: 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");
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:18,代码来源:MilestoneListSelect.java


示例7: 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());
        }
    });
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:27,代码来源:RoleComboBox.java


示例8: buildQuerySelectComponent

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
private void buildQuerySelectComponent() {
    SaveSearchResultCriteria searchCriteria = new SaveSearchResultCriteria();
    searchCriteria.setType(StringSearchField.and(searchCategory));
    searchCriteria.setCreateUser(StringSearchField.and(UserUIContext.getUsername()));
    searchCriteria.setSaccountid(new NumberSearchField(AppUI.getAccountId()));

    SaveSearchResultService saveSearchResultService = AppContextUtil.getSpringBean(SaveSearchResultService.class);
    List<SaveSearchResult> result = (List<SaveSearchResult>) saveSearchResultService.findPageableListByCriteria(new BasicSearchRequest<>(searchCriteria));
    beanItem = new BeanContainer<>(SaveSearchResult.class);
    beanItem.setBeanIdProperty("id");

    for (SaveSearchResult searchResult : result) {
        beanItem.addBean(searchResult);
    }
    this.setContainerDataSource(beanItem);
    this.setItemCaptionPropertyId("queryname");
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:18,代码来源:BuildCriterionComponent.java


示例9: EntityTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public EntityTable(final Class<T> type, Collection<T> set, EmbeddedCrudComponent<T> crudComponent) {
	this.type = type;
	this.set = set;
	this.crudComponent = crudComponent;
	
	container = (BeanContainer<Long, T>) crudComponent.getContainer();
	container.setBeanIdProperty("id");
	container.addAll(set);
	
	if(set == null) {
		this.set = new HashSet<T>();
	}
	
	crudComponent.getTable().setPageLength(0);
	crudComponent.getTable().setColumnCollapsed("id", true);
	crudComponent.getTable().setValidationVisible(false);
	crudComponent.getTableLayout().setMargin(false);
}
 
开发者ID:alejandro-du,项目名称:enterprise-app,代码行数:20,代码来源:EntityTable.java


示例10: initChildTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initChildTable() {
    this.childContainer = new BeanContainer<Long, PolicyDto>(PolicyDto.class);
    this.childTable.setContainerDataSource(this.childContainer);
    this.childTable.setVisibleColumns("policyName", "mgrDomainName");

    this.childTable.setColumnHeader("policyName", "Name");
    this.childTable.setColumnHeader("mgrDomainName", "Domain");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:10,代码来源:ManagerConnectorView.java


示例11: initParentTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initParentTable() {
    this.parentContainer = new BeanContainer<Long, ApplianceDto>(ApplianceDto.class);
    this.parentTable.setContainerDataSource(this.parentContainer);
    this.parentTable.setVisibleColumns("model", "managerType", "managerVersion");

    // renaming column header
    this.parentTable.setColumnHeader("model", "Model");
    this.parentTable.setColumnHeader("managerType", "Manager Type");
    this.parentTable.setColumnHeader("managerVersion", "Manager Software Version");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:12,代码来源:ApplianceView.java


示例12: initChildTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initChildTable() {
    this.childContainer = new BeanContainer<Long, ApplianceSoftwareVersionDto>(ApplianceSoftwareVersionDto.class);
    this.childTable.setContainerDataSource(this.childContainer);
    this.childTable.setVisibleColumns("swVersion", "virtualizationType", "imageUrl");

    // re-naming table header columns
    this.childTable.setColumnHeader("swVersion", "Software");
    this.childTable.setColumnHeader("virtualizationType", "Virtualization Type");
    this.childTable.setColumnHeader("imageUrl", "Image Name");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:12,代码来源:ApplianceView.java


示例13: initParentTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initParentTable() {
    this.parentContainer = new BeanContainer<Long, AlarmDto>(AlarmDto.class);
    this.parentTable.setContainerDataSource(this.parentContainer);
    this.parentTable.setVisibleColumns("name", "enabledAlarm", "eventType", "severity", "alarmAction");

    // Customizing header names
    this.parentTable.setColumnHeader("name", "Name");
    this.parentTable.setColumnHeader("enabledAlarm", "Enabled");
    this.parentTable.setColumnHeader("eventType", "Event Type");
    this.parentTable.setColumnHeader("severity", "Severity");
    this.parentTable.setColumnHeader("alarmAction", "Action");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:14,代码来源:AlarmView.java


示例14: initParentTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@Override
public void initParentTable() {
    this.parentContainer = new BeanContainer<Long, UserDto>(UserDto.class);
    this.parentTable.setContainerDataSource(this.parentContainer);
    this.parentTable.setVisibleColumns("loginName", "firstName", "lastName", "role", "email");

    // Customizing header names
    this.parentTable.setColumnHeader("loginName", "User Name");
    this.parentTable.setColumnHeader("firstName", "First");
    this.parentTable.setColumnHeader("lastName", "Last");
    this.parentTable.setColumnHeader("role", "Role");
    this.parentTable.setColumnHeader("email", "Email");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:14,代码来源:UserView.java


示例15: updateTableContainer

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
/**
 * @param container
 *            BeanContainer of the table which needs to be updated
 * @param dto
 *            BeanItem(DTO)
 * @param table
 *            Table this dto belongs to
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void updateTableContainer(BeanContainer container, BaseDto dto, FilterTable table) {
    int indexOfItem = container.indexOfId(dto.getId());
    boolean wasSelected = table.isSelected(dto.getId());
    container.removeItem(dto.getId());
    container.addItemAt(indexOfItem, dto.getId(), dto);
    if (wasSelected) {
        table.select(dto.getId());
    }
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:19,代码来源:ViewUtil.java


示例16: initParentTable

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
public void initParentTable() {
    this.parentContainer = new BeanContainer<Long, AlertDto>(AlertDto.class);

    this.parentTable.setContainerDataSource(this.parentContainer);
    this.parentTable.setVisibleColumns(ALERT_ID_COLUMN, ALERT_NAME_COLUMN_ID, ALERT_OBJECTS_COLUMN_ID,
            ALERT_SEVERITY_COLUMN_ID, ALERT_MESSAGE_COLUMN, ALERT_TIME_CREATED_COLUMN_ID, ALERT_STATUS_COLUMN_ID,
            ALERT_TIME_ACKNOWLEDGED_COLUMN_ID, ALERT_USER_ACKNOWLEDGED_COLUMN_ID);

    this.parentTable.addGeneratedColumn(ALERT_OBJECTS_COLUMN_ID, new ColumnGenerator() {
        @Override
        public Object generateCell(CustomTable source, Object itemId, Object columnId) {
            AlertDto alertDto = AlertView.this.parentContainer.getItem(itemId).getBean();
            if (alertDto.getObject() != null) {
                return ViewUtil.generateObjectLink(alertDto.getObject(), AlertView.this.server);
            }
            return null;
        }
    });

    this.parentTable.setColumnHeader(ALERT_ID_COLUMN, "Id");
    this.parentTable.setColumnHeader(ALERT_NAME_COLUMN_ID, "Name");
    this.parentTable.setColumnHeader(ALERT_OBJECTS_COLUMN_ID, "Objects");
    this.parentTable.setColumnHeader(ALERT_SEVERITY_COLUMN_ID, "Severity");
    this.parentTable.setColumnHeader(ALERT_MESSAGE_COLUMN, "Message");
    this.parentTable.setColumnHeader(ALERT_TIME_CREATED_COLUMN_ID, "Created");
    this.parentTable.setColumnHeader(ALERT_STATUS_COLUMN_ID, "Status");
    this.parentTable.setColumnHeader(ALERT_TIME_ACKNOWLEDGED_COLUMN_ID, "Acknowledged");
    this.parentTable.setColumnHeader(ALERT_USER_ACKNOWLEDGED_COLUMN_ID, "Acknowledged By");
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:32,代码来源:AlertView.java


示例17: moveItems

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void moveItems(CustomTable fromTable, CustomTable toTable) {
    if (fromTable.equals(toTable)) {
        return;
    }
    BeanContainer<String, SecurityGroupMemberItemDto> fromContainer = (BeanContainer<String, SecurityGroupMemberItemDto>) fromTable
            .getContainerDataSource();
    BeanContainer<String, SecurityGroupMemberItemDto> toContainer = (BeanContainer<String, SecurityGroupMemberItemDto>) toTable
            .getContainerDataSource();

    boolean isMovingToSelectedItemList = toTable == this.selectedItemsTable;

    String memberType = (String) this.protectionEntityType.getValue();
    Set<String> itemIdsSelected = (Set<String>) fromTable.getValue();
    for (String itemId : itemIdsSelected) {
        if (fromContainer.getItem(itemId) != null) {
            SecurityGroupMemberItemDto memberItem = fromContainer.getItem(itemId).getBean();
            // Add the item to the 'to' container, if the 'to' container is the selected items table
            if (isMovingToSelectedItemList) {
                toContainer.addBean(memberItem);
                handleProtectExternal(toTable, itemId, memberItem);
            } else if (memberItem.getType().equals(memberType)) {
                // If the 'to' container is not the selected list, we need to check the current selected type
                // from the UI and add the member only if it matches the selected type
                toContainer.addBean(memberItem);
            }
        }
        fromContainer.removeItem(itemId);
        fromTable.removeItem(itemId);
    }

    toTable.setValue(itemIdsSelected);
    updateCountFooter(fromTable, fromTable.getItemIds().size());
    updateCountFooter(toTable, toTable.getItemIds().size());

    toTable.sort(new Object[] { toTable.getSortContainerPropertyId() }, new boolean[] { toTable.isSortAscending() });
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:38,代码来源:BaseSecurityGroupWindow.java


示例18: 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;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:8,代码来源:BaseSecurityGroupWindow.java


示例19: SimpleGraphContainer

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
public SimpleGraphContainer() {
	m_vertexContainer = new VertexContainer();
	m_edgeContainer = new BeanContainer<String, SimpleEdge>(SimpleEdge.class);
	m_edgeContainer.setBeanIdProperty("id");
	m_zoomLevelProperty = new MethodProperty<Integer>(Integer.class, this, "getSemanticZoomLevel", "setSemanticZoomLevel");
	m_scaleProperty = new MethodProperty<Double>(Double.class, this, "getScale", "setScale");
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:8,代码来源:SimpleGraphContainer.java


示例20: getBeans

import com.vaadin.data.util.BeanContainer; //导入依赖的package包/类
private <T> List<T> getBeans(BeanContainer<?, T> container) {
	Collection<?> itemIds = container.getItemIds();
	List<T> beans = new ArrayList<T>(itemIds.size());
	
	for(Object itemId : itemIds) {
		beans.add(container.getItem(itemId).getBean());
	}
	
	return beans;
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:11,代码来源:SimpleGraphContainer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PacketListener类代码示例发布时间:2022-05-22
下一篇:
Java IFormatReader类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap