public VerticalTabsheet(boolean isLeft) { CssLayout contentLayout = new CssLayout(); new Restrain(contentLayout).setMinHeight("100%"); navigatorWrapper = new CssLayout(); navigatorWrapper.setStyleName("navigator-wrap"); navigatorContainer = new VerticalLayout(); navigatorWrapper.addComponent(navigatorContainer); contentWrapper = new VerticalLayout(); contentWrapper.setStyleName("container-wrap"); contentWrapper.setWidth("100%"); tabContainer = new CssLayout(); tabContainer.setWidth("100%"); contentWrapper.addComponent(tabContainer); if (isLeft) { contentLayout.addComponent(navigatorWrapper); contentLayout.addComponent(contentWrapper); } else { contentLayout.addComponent(contentWrapper); contentLayout.addComponent(navigatorWrapper); } this.setCompositionRoot(contentLayout); this.setStyleName(TABSHEET_STYLENAME); }
public WindowTimtheobomon() { setCaption("Tìm theo bộ môn "); // Constants.USER_CAPTION) ; HorizontalLayout mainLayout = new HorizontalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth(Constants.WIDTH_MAX, Sizeable.UNITS_PIXELS); mainLayout.setMargin(false); mainLayout.setSpacing(true); mainLayout.addComponent(new leftSide()); rContent = new VerticalLayout(); rContent.setWidth("100%"); mainLayout.addComponent(rContent); mainLayout.setExpandRatio(rContent, 1.0f); VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setStyleName("bl-mainContent"); v.addComponent(mainLayout); v.setComponentAlignment(mainLayout, Alignment.MIDDLE_CENTER); addComponent(new topLogin()); addComponent(new topPanel()); addComponent(new mainMenu()); addComponent(v); addComponent(new bottom()); // --------------------bl Label title = new Label("<center><h1>Tìm theo bộ môn<h1></center>", Label.CONTENT_XHTML); final BeanItemContainer<ResearchingBean> beans = new BeanItemContainer<ResearchingBean>(ResearchingBean.class); Table table = new Table("Tìm kiếm", beans); table.setWidth("100%"); table.setPageLength(10); rContent.addComponent(title); rContent.addComponent(table); }
private void init() { VerticalLayout root = new VerticalLayout(); header = new HorizontalLayout(); tituloLbl.setStyleName("titlePanel"); header.addComponent(tituloLbl); headerLayout = new HorizontalLayout(); header.addComponent(headerLayout); header.setComponentAlignment(headerLayout, Alignment.MIDDLE_RIGHT); header.setStyleName("headerPanel"); header.setWidth("100%"); header.setHeight("50px"); body = new VerticalLayout(); body.setStyleName("bodyPanel"); body.setWidth("100%"); footer = new HorizontalLayout(); footer.setStyleName("footerPanel"); footerLayout = new HorizontalLayout(); footer.addComponent(footerLayout); footer.setComponentAlignment(footerLayout, Alignment.MIDDLE_CENTER); footer.setWidth("100%"); footer.setHeight("60px"); root.addComponent(header); root.addComponent(body); root.addComponent(footer); root.setWidth("100%"); setCompositionRoot(root); }
public WindowManagerTeacher() { setCaption("quan ly bo mon "); // Constants.USER_CAPTION) ; mainLayout = new HorizontalLayout(); mainLayout.setImmediate(false); mainLayout.setWidth(Constants.WIDTH_MAX, Sizeable.UNITS_PIXELS); mainLayout.setMargin(false); mainLayout.setSpacing(true); mainLayout.addComponent(new leftSide()); rContentList = new VerticalLayout(); rContentList.setWidth("100%"); mainLayout.addComponent(rContentList); mainLayout.setExpandRatio(rContentList, 1.0f); rContentModify = new rightContentAddNewTeacher(1); rContentModify.setWidth("100%"); VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setStyleName("bl-mainContent"); v.addComponent(mainLayout); v.setComponentAlignment(mainLayout, Alignment.MIDDLE_CENTER); addComponent(new topLogin()); addComponent(new topPanel()); addComponent(new mainMenu()); addComponent(v); addComponent(new bottom()); // --------------------bl Label title = new Label("<center><h1>Danh sách giang vien<h1></center>", Label.CONTENT_XHTML); table = new Table(); table.setWidth("100%"); table.setPageLength(20); rContentList.addComponent(title); rContentList.addComponent(table); Connection conn = null; Statement stmt = null; try { JDBCConnectionPool pool = new SimpleJDBCConnectionPool( JDBC_DRIVER, DB_URL + QlgiangvienApplication.DB_DBNAME, QlgiangvienApplication.DB_USER, QlgiangvienApplication.DB_PASS); String mysql = "SELECT * from GiangVien"; TableQuery query = new TableQuery("GiangVien", pool); query.setVersionColumn("OPTLOCK"); SQLContainer container = new SQLContainer(query); container.setAutoCommit(true); // container.re table.setContainerDataSource(container); // FreeformQuery query = new FreeformQuery(mysql, pool, "MaGV") ; // container = new SQLContainer(query); // table.setContainerDataSource(container) ; table.addGeneratedColumn( "Chinh Sua", new Table.ColumnGenerator() { public Component generateCell(Table source, Object itemId, Object columnId) { final Item item = table.getItem(itemId); Button btnModify = new Button( "Chinh Sua", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { // rContentList.setVisible(false); // rContentModify.setVisible(true); System.out.println(item.toString()); rContentModify.setUpdateData( item.getItemProperty("MaGV").getValue().toString()); mainLayout.removeComponent(rContentList); mainLayout.addComponent(rContentModify); mainLayout.setExpandRatio(rContentModify, 1.0f); } }); return btnModify; } }); confirmDelete(); table.addGeneratedColumn( "Xoa", new Table.ColumnGenerator() { public Component generateCell(Table source, Object itemId, Object columnId) { // Item item = table.getItem(itemId); Button btnModify = new Button( "Xoa", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { if (subwindow.getParent() == null) { getWindow().addWindow(subwindow); } } }); return btnModify; } }); } catch (Exception e) { System.out.println("in right COntent: " + e.toString()); } } // end of container
public void setNavigatorStyleName(String styleName) { navigatorContainer.setStyleName(styleName); }
public OptionPopupContent() { VerticalLayout root = new VerticalLayout(); root.setStyleName(UIConstants.OPTION_POPUP_CONTENT); root.setWidth("200px"); this.setCompositionRoot(root); }