@AutoGenerated private HorizontalSplitPanel buildProductSearchSplit() { // common part: create layout productSearchSplit = new HorizontalSplitPanel(); productSearchSplit.setStyleName("productSearchSplit"); productSearchSplit.setImmediate(false); productSearchSplit.setWidth("90%"); productSearchSplit.setHeight("90%"); productSearchSplit.setSplitPosition(70); productSearchSplit.addComponent(buildProductTable()); return productSearchSplit; }
// 构造函数 public ComplainTypeListView(ComplainTypeManager complainTypeManager) { // ------------------------------------------加载dao this.complainTypeManager = complainTypeManager; // -------------------------------------------标题部分 HorizontalLayout navBar = new HorizontalLayout(); navBar.setStyleName(Reindeer.LAYOUT_BLACK); navBar.setWidth(100, Unit.PERCENTAGE); navBar.setHeight(29, Unit.PIXELS); Label lblNav = new Label("CRM系统 / 诉求类别"); Button btnAdd = new Button("新增"); // 增加 按钮 btnAdd.setIcon(new ThemeResource("icons/16/add.png")); btnAdd.setDescription("增加类别"); btnAdd.addClickListener( new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { createWindow(null); } }); navBar.addComponent(lblNav); navBar.addComponent(btnAdd); navBar.setComponentAlignment(btnAdd, Alignment.TOP_RIGHT); // 定义位置 // -------------------------------------------正文部分 conentHSplit = new HorizontalSplitPanel(); conentHSplit.setStyleName(Reindeer.LAYOUT_WHITE); // 右侧样式 conentHSplit.setHeight(Constants.PAGE_HEIGHT, Unit.PIXELS); // -----------------------------------------左边 tree initTree(); conentHSplit.setFirstComponent(leftTree); conentHSplit.setSecondComponent(rightTable); conentHSplit.setSplitPosition(15F); // -----------------------------------------右边 table 使用 container = new BeanItemContainer<ComplainTypeDtilBean>(ComplainTypeDtilBean.class); initRightTable(rightTable, container); this.addComponent(navBar); this.addComponent(conentHSplit); }