public void buildView() { TabSheet tabSheet = new TabSheet(); tabSheet.setSizeFull(); VerticalLayout layoutUtama = new VerticalLayout(); layoutUtama.setSizeFull(); layoutUtama.setMargin(true); // LAYOUT TOP VerticalLayout layoutTop = new VerticalLayout(); layoutTop.setMargin(true); HorizontalLayout layoutTopInner1 = new HorizontalLayout(); HorizontalLayout layoutTopInner2 = new HorizontalLayout(); layoutTop.addComponent(layoutTopInner1); layoutTop.addComponent(layoutTopInner2); // LAYOUT TABLE VerticalLayout layoutTable = new VerticalLayout(); layoutTable.setSizeFull(); layoutTable.addComponent(table); table.setSizeFull(); // LAYOUT BOTTOM VerticalLayout layoutBottom = new VerticalLayout(); HorizontalLayout layoutFooter1 = new HorizontalLayout(); HorizontalLayout layoutFooter2 = new HorizontalLayout(); layoutBottom.addComponent(layoutFooter1); layoutBottom.addComponent(layoutFooter2); // LAYOUT UTAMA layoutUtama.addComponent(layoutTop); layoutUtama.addComponent(layoutTable); layoutUtama.addComponent(layoutBottom); tabSheet.addComponent(layoutUtama); content.addComponent(tabSheet); setCompositionRoot(content); // Extended Konfigurasi Size layoutUtama.setExpandRatio(layoutTable, 1); layoutTopInner1.addComponent(fieldSearchById); layoutTopInner1.setComponentAlignment(fieldSearchById, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(comboSearchByDivision); layoutTopInner1.setComponentAlignment(comboSearchByDivision, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(dateFieldSearchByTransdateFrom); layoutTopInner1.setComponentAlignment(dateFieldSearchByTransdateFrom, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(dateFieldSearchByTransdateTo); layoutTopInner1.setComponentAlignment(dateFieldSearchByTransdateTo, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(btnSearch); layoutTopInner1.setComponentAlignment(btnSearch, Alignment.BOTTOM_CENTER); layoutBottom.addComponent(btnSelect); // init formLayout.setVisible(true); }
private ProfilePreferencesWindow(final User user, final boolean preferencesTabOpen) { addStyleName("profile-window"); setId(ID); Responsive.makeResponsive(this); setModal(true); setCloseShortcut(KeyCode.ESCAPE, null); setResizable(false); setClosable(false); setHeight(90.0f, Unit.PERCENTAGE); setWidth(60.0f, Unit.PERCENTAGE); VerticalLayout content = new VerticalLayout(); content.setSizeFull(); content.setMargin(new MarginInfo(true, false, false, false)); setContent(content); TabSheet detailsWrapper = new TabSheet(); detailsWrapper.setSizeFull(); detailsWrapper.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR); detailsWrapper.addStyleName(ValoTheme.TABSHEET_ICONS_ON_TOP); detailsWrapper.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS); content.addComponent(detailsWrapper); content.setExpandRatio(detailsWrapper, 1f); detailsWrapper.addComponent(buildProfileTab()); detailsWrapper.addComponent(buildPreferencesTab()); if (preferencesTabOpen) { detailsWrapper.setSelectedTab(1); } content.addComponent(buildFooter()); fieldGroup = new BeanFieldGroup<>(User.class); fieldGroup.bindMemberFields(this); fieldGroup.setItemDataSource(user); }