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


Java BeanContainer类代码示例

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


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


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