List of usage examples for com.vaadin.ui VerticalLayout setSizeFull
@Override public void setSizeFull()
From source file:org.ikasan.dashboard.ui.dashboard.panel.DashboardPanel.java
License:BSD License
protected void init() { this.setWidth("100%"); this.setHeight("100%"); GridLayout gridLayout = new GridLayout(3, 2); gridLayout.setWidth("100%"); gridLayout.setHeight("100%"); gridLayout.setMargin(true);//from ww w . j ava 2s . c o m VerticalLayout layout = new VerticalLayout(); // Initialize the container as required by the container type container.addContainerProperty("Alert", String.class, null); container.addContainerProperty("Module", String.class, null); container.addContainerProperty("Details", PopupView.class, null); table.setContainerDataSource(container); table.setImmediate(true); table.addItemClickListener(new SearchResultTableItemClickListener()); table.setHeight("100%"); table.setWidth("100%"); layout.setSizeFull(); layout.addComponent(table); Panel p1 = new Panel("Alerts"); p1.setStyleName("dashboard"); p1.setWidth("90%"); p1.setHeight("90%"); p1.setContent(layout); gridLayout.addComponent(p1, 0, 0); Panel p2 = new Panel("Errors"); p2.setStyleName("dashboard"); p2.setWidth("90%"); p2.setHeight("90%"); gridLayout.addComponent(p2, 1, 0); VerticalLayout healthLayout = new VerticalLayout(); // Initialize the container as required by the container type healthContainer.addContainerProperty("Health Alert", String.class, null); healthContainer.addContainerProperty("Module", String.class, null); healthTable.setContainerDataSource(healthContainer); healthTable.setImmediate(true); healthTable.setHeight("100%"); healthTable.setWidth("100%"); healthLayout.addComponent(healthTable); Panel p3 = new Panel("Health"); p3.setStyleName("dashboard"); p3.setWidth("90%"); p3.setHeight("90%"); p3.setContent(healthLayout); gridLayout.addComponent(p3, 2, 0); Panel p4 = new Panel("Topology"); p4.setStyleName("dashboard"); p4.setWidth("90%"); p4.setHeight("90%"); gridLayout.addComponent(p4, 0, 1); Panel p5 = new Panel("Dashboard Item 5"); p5.setStyleName("dashboard"); p5.setWidth("90%"); p5.setHeight("90%"); gridLayout.addComponent(p5, 1, 1); Panel p6 = new Panel("Dashboard Item 6"); p6.setStyleName("dashboard"); p6.setWidth("90%"); p6.setHeight("90%"); gridLayout.addComponent(p6, 2, 1); this.setContent(gridLayout); // Broadcaster.register(this); }
From source file:org.ikasan.dashboard.ui.framework.panel.ProfilePanel.java
License:BSD License
@SuppressWarnings("deprecation") protected void init() { this.setWidth("100%"); this.setHeight("100%"); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); Panel securityAdministrationPanel = new Panel(); securityAdministrationPanel.addStyleName(ValoTheme.PANEL_BORDERLESS); securityAdministrationPanel.setHeight("100%"); securityAdministrationPanel.setWidth("100%"); GridLayout gridLayout = new GridLayout(2, 6); gridLayout.setMargin(true);/* w w w. j av a 2s . c o m*/ gridLayout.setSpacing(true); gridLayout.setSizeFull(); Label mappingConfigurationLabel = new Label("User Profile"); mappingConfigurationLabel.setStyleName(ValoTheme.LABEL_HUGE); gridLayout.addComponent(mappingConfigurationLabel, 0, 0, 1, 0); Label usernameLabel = new Label("Username:"); usernameField.setWidth("65%"); firstName = new TextField(); firstName.setWidth("65%"); firstName.setNullRepresentation(""); surname = new TextField(); surname.setWidth("65%"); surname.setNullRepresentation(""); department.setWidth("65%"); department.setNullRepresentation(""); email.setWidth("65%"); email.setNullRepresentation(""); roleTable.addContainerProperty("Role", String.class, null); roleTable.addStyleName("ikasan"); roleTable.addStyleName(ValoTheme.TABLE_SMALL); roleTable.setCellStyleGenerator(new IkasanSmallCellStyleGenerator()); roleTable.setHeight("520px"); roleTable.setWidth("250px"); GridLayout formLayout = new GridLayout(2, 5); formLayout.setSpacing(true); formLayout.setWidth("100%"); formLayout.setColumnExpandRatio(0, .1f); formLayout.setColumnExpandRatio(1, .8f); usernameLabel.setSizeUndefined(); formLayout.addComponent(usernameLabel, 0, 0); formLayout.setComponentAlignment(usernameLabel, Alignment.MIDDLE_RIGHT); formLayout.addComponent(usernameField, 1, 0); Label firstNameLabel = new Label("First name:"); firstNameLabel.setSizeUndefined(); formLayout.addComponent(firstNameLabel, 0, 1); formLayout.setComponentAlignment(firstNameLabel, Alignment.MIDDLE_RIGHT); formLayout.addComponent(firstName, 1, 1); Label surnameLabel = new Label("Surname:"); surnameLabel.setSizeUndefined(); formLayout.addComponent(surnameLabel, 0, 2); formLayout.setComponentAlignment(surnameLabel, Alignment.MIDDLE_RIGHT); formLayout.addComponent(surname, 1, 2); Label departmentLabel = new Label("Department:"); departmentLabel.setSizeUndefined(); formLayout.addComponent(departmentLabel, 0, 3); formLayout.setComponentAlignment(departmentLabel, Alignment.MIDDLE_RIGHT); formLayout.addComponent(department, 1, 3); Label emailLabel = new Label("Email address:"); emailLabel.setSizeUndefined(); formLayout.addComponent(emailLabel, 0, 4); formLayout.setComponentAlignment(emailLabel, Alignment.MIDDLE_RIGHT); formLayout.addComponent(email, 1, 4); gridLayout.addComponent(formLayout, 0, 2, 1, 2); Label rolesAndGroupsHintLabel1 = new Label(); rolesAndGroupsHintLabel1.setCaptionAsHtml(true); rolesAndGroupsHintLabel1.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " The Roles table below displays the Ikasan roles that the user has."); rolesAndGroupsHintLabel1.addStyleName(ValoTheme.LABEL_TINY); rolesAndGroupsHintLabel1.addStyleName(ValoTheme.LABEL_LIGHT); rolesAndGroupsHintLabel1.setWidth(300, Unit.PIXELS); gridLayout.addComponent(rolesAndGroupsHintLabel1, 0, 3, 1, 3); Label rolesAndGroupsHintLabel2 = new Label(); rolesAndGroupsHintLabel2.setCaptionAsHtml(true); rolesAndGroupsHintLabel2.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " The Groups table below displays all the LDAP groups that the user is a member of."); rolesAndGroupsHintLabel2.addStyleName(ValoTheme.LABEL_TINY); rolesAndGroupsHintLabel2.addStyleName(ValoTheme.LABEL_LIGHT); rolesAndGroupsHintLabel2.setWidth(300, Unit.PIXELS); gridLayout.addComponent(rolesAndGroupsHintLabel2, 0, 4, 1, 4); dashboadActivityTable.addContainerProperty("Action", String.class, null); dashboadActivityTable.addContainerProperty("Date/Time", String.class, null); dashboadActivityTable.addStyleName("ikasan"); dashboadActivityTable.addStyleName(ValoTheme.TABLE_SMALL); dashboadActivityTable.setCellStyleGenerator(new IkasanSmallCellStyleGenerator()); dashboadActivityTable.setHeight("350px"); dashboadActivityTable.setWidth("300px"); this.permissionChangeTable.addContainerProperty("Action", String.class, null); this.permissionChangeTable.addContainerProperty("Date/Time", String.class, null); this.permissionChangeTable.addStyleName("ikasan"); this.permissionChangeTable.addStyleName(ValoTheme.TABLE_SMALL); this.permissionChangeTable.setCellStyleGenerator(new IkasanSmallCellStyleGenerator()); this.permissionChangeTable.setHeight("350px"); this.permissionChangeTable.setWidth("300px"); gridLayout.addComponent(roleTable, 0, 5); this.associatedPrincipalsTable.addContainerProperty("Groups", String.class, null); this.associatedPrincipalsTable.addItemClickListener(this.associatedPrincipalItemClickListener); this.associatedPrincipalsTable.addStyleName("ikasan"); this.associatedPrincipalsTable.addStyleName(ValoTheme.TABLE_SMALL); this.associatedPrincipalsTable.setCellStyleGenerator(new IkasanSmallCellStyleGenerator()); associatedPrincipalsTable.setHeight("520px"); associatedPrincipalsTable.setWidth("400px"); gridLayout.addComponent(this.associatedPrincipalsTable, 1, 5); Panel roleMemberPanel = new Panel(); roleMemberPanel.addStyleName(ValoTheme.PANEL_BORDERLESS); roleMemberPanel.setHeight("100%"); roleMemberPanel.setWidth("100%"); GridLayout roleMemberLayout = new GridLayout(); roleMemberLayout.setSpacing(true); roleMemberLayout.setWidth("100%"); Label dashboardActivityLabel = new Label("Dashboard Activity"); dashboardActivityLabel.setStyleName(ValoTheme.LABEL_HUGE); roleMemberLayout.addComponent(dashboardActivityLabel); roleMemberLayout.addComponent(this.dashboadActivityTable); Label permissionChangeLabel = new Label("User Security Changes"); permissionChangeLabel.setStyleName(ValoTheme.LABEL_HUGE); roleMemberLayout.addComponent(permissionChangeLabel); roleMemberLayout.addComponent(this.permissionChangeTable); roleMemberPanel.setContent(roleMemberLayout); securityAdministrationPanel.setContent(gridLayout); layout.addComponent(securityAdministrationPanel); VerticalLayout roleMemberPanelLayout = new VerticalLayout(); roleMemberPanelLayout.setWidth("100%"); roleMemberPanelLayout.setHeight("100%"); roleMemberPanelLayout.setMargin(true); roleMemberPanelLayout.addComponent(roleMemberPanel); roleMemberPanelLayout.setSizeFull(); HorizontalSplitPanel hsplit = new HorizontalSplitPanel(); hsplit.setFirstComponent(layout); hsplit.setSecondComponent(roleMemberPanelLayout); // Set the position of the splitter as percentage hsplit.setSplitPosition(65, Unit.PERCENTAGE); hsplit.setLocked(true); this.setContent(hsplit); }
From source file:org.ikasan.dashboard.ui.topology.panel.TopologyViewPanel.java
License:BSD License
protected void createTabSheet() { tabsheet = new TabSheet(); tabsheet.setSizeFull();// w ww . j a va 2s . co m final IkasanAuthentication authentication = (IkasanAuthentication) VaadinService.getCurrentRequest() .getWrappedSession().getAttribute(DashboardSessionValueConstants.USER); if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_BUSINESS_STREAM_AUTHORITY))) { VerticalLayout tab1 = new VerticalLayout(); tab1.setSizeFull(); BusinessStreamTab businessStreamTab = new BusinessStreamTab(this.topologyService, this.businessStreamCombo); tab1.addComponent(businessStreamTab.createBusinessStreamLayout()); tabsheet.addTab(tab1, "Business Stream"); } if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_WIRETAP_AUTHORITY))) { VerticalLayout tab2 = new VerticalLayout(); tab2.setSizeFull(); WiretapTab wiretapTab = new WiretapTab(this.wiretapDao, this.treeViewBusinessStreamCombo); tab2.addComponent(wiretapTab.createWiretapLayout()); tabsheet.addTab(tab2, "Wiretaps"); } if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_ERRORS_AUTHORITY))) { VerticalLayout tab3 = new VerticalLayout(); tab3.setSizeFull(); ErrorOccurrenceTab errorOccurrenceTab = new ErrorOccurrenceTab(this.errorReportingService, this.treeViewBusinessStreamCombo); tab3.addComponent(errorOccurrenceTab.createCategorisedErrorLayout()); tabsheet.addTab(tab3, "Errors"); } if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_EXCLUSION_AUTHORITY))) { final VerticalLayout tab4 = new VerticalLayout(); tab4.setSizeFull(); final ExclusionsTab actionedExclusionsTab = new ExclusionsTab(this.errorReportingService, this.exclusionManagementService, this.hospitalManagementService, this.topologyService, this.serialiserFactory, this.treeViewBusinessStreamCombo); tab4.addComponent(actionedExclusionsTab.createLayout()); tabsheet.addTab(tab4, "Exclusions"); } if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_ACTIONED_EXCLUSIONS_AUTHORITY))) { final VerticalLayout tab5 = new VerticalLayout(); tab5.setSizeFull(); ActionedExclusionTab actionedExclusionTab = new ActionedExclusionTab(this.exclusionManagementService, this.hospitalManagementService, this.errorReportingService, this.topologyService, this.serialiserFactory, this.treeViewBusinessStreamCombo); tab5.addComponent(actionedExclusionTab.createLayout()); tabsheet.addTab(tab5, "Actioned Exclusions"); } if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_ACTIONED_EXCLUSIONS_AUTHORITY))) { final VerticalLayout tab6 = new VerticalLayout(); tab6.setSizeFull(); tab6.addComponent(this.createSystemEventPanel()); tabsheet.addTab(tab6, "System Events"); } if (authentication != null && (authentication.hasGrantedAuthority(SecurityConstants.ALL_AUTHORITY) || authentication.hasGrantedAuthority(SecurityConstants.VIEW_CATEGORISED_ERRORS_AUTHORITY))) { final VerticalLayout tab8 = new VerticalLayout(); tab8.setSizeFull(); CategorisedErrorTab categorisedErrorTab = new CategorisedErrorTab(this.errorCategorisationService, this.treeViewBusinessStreamCombo, this.serialiserFactory); tab8.addComponent(categorisedErrorTab.createCategorisedErrorLayout()); tabsheet.addTab(tab8, "Categorised Errors"); } this.tabsheetPanel.setContent(tabsheet); }
From source file:org.ikasan.dashboard.ui.topology.window.WiretapPayloadViewWindow.java
License:BSD License
public void init() { this.setModal(true); this.setResizable(false); this.setHeight("90%"); this.setWidth("90%"); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setMargin(true);// w ww. j a v a 2 s.co m layout.addComponent(createWiretapDetailsPanel()); this.setContent(layout); }
From source file:org.jdal.vaadin.ui.FormUtils.java
License:Apache License
/** * Show a YES/NO confirm dialog/*from w ww . jav a2s. c om*/ * @param window Window to attach the dialog * @param msg the msg */ public static void showConfirmDialog(UI ui, final Command command, String msg) { final Window dlg = new Window("Please Confirm"); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull(); vl.setSpacing(true); vl.setMargin(true); Label label = new Label(msg, Label.CONTENT_XHTML); vl.addComponent(label); HorizontalLayout hl = new HorizontalLayout(); hl.setSpacing(true); Button ok = new Button(StaticMessageSource.getMessage("yes")); ok.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { command.execute(null); closeWindow(dlg); } }); Button cancel = new Button(StaticMessageSource.getMessage("no")); cancel.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { closeWindow(dlg); } }); hl.setSpacing(true); hl.addComponent(ok); hl.addComponent(cancel); hl.setSizeFull(); vl.addComponent(hl); vl.setComponentAlignment(hl, Alignment.TOP_CENTER); dlg.setContent(vl); dlg.setModal(true); vl.setSizeUndefined(); ui.addWindow(dlg); }
From source file:org.jpos.qi.eeuser.UsersView.java
License:Open Source License
private Panel createPasswordPanel() { passwordPanel = new Panel(getApp().getMessage("changePassword")); passwordPanel.setIcon(VaadinIcons.LOCK); passwordPanel.addStyleName("color1"); passwordPanel.addStyleName("margin-top-panel"); VerticalLayout panelContent = new VerticalLayout(); panelContent.setSizeFull(); panelContent.setMargin(true);/* w w w . ja va2 s. c om*/ panelContent.setSpacing(true); FormLayout form = new FormLayout(); form.setSizeFull(); panelContent.addComponent(form); panelContent.setExpandRatio(form, 1f); passwordBinder = new Binder<>(); passwordBinder.setReadOnly(true); binderIsReadOnly = true; if (selectedU.getId() != null) { currentPasswordField = new PasswordField(getApp().getMessage("passwordForm.currentPassword")); currentPasswordField.setWidth("80%"); passwordBinder.forField(currentPasswordField) .asRequired(getApp().getMessage("errorMessage.req", currentPasswordField.getCaption())) .withValidator(((UsersHelper) getHelper()).getCurrentPasswordMatchValidator()) .bind(string -> string, null); form.addComponent(currentPasswordField); } PasswordField newPasswordField = new PasswordField(getApp().getMessage("passwordForm.newPassword")); newPasswordField.setWidth("80%"); passwordBinder.forField(newPasswordField) .asRequired(getApp().getMessage("errorMessage.req", newPasswordField.getCaption())) .withValidator(((UsersHelper) getHelper()).getNewPasswordNotUsedValidator()) .bind(string -> string, null); form.addComponent(newPasswordField); repeatPasswordField = new PasswordField(getApp().getMessage("passwordForm.confirmPassword")); repeatPasswordField.setWidth("80%"); passwordBinder.forField(repeatPasswordField) .asRequired(getApp().getMessage("errorMessage.req", repeatPasswordField.getCaption())) .withValidator(((UsersHelper) getHelper()).getPasswordsMatchValidator(newPasswordField)) .bind(string -> string, null); form.addComponent(repeatPasswordField); passwordPanel.setVisible(forcePasswordChange); passwordPanel.setContent(panelContent); return passwordPanel; }
From source file:org.jumpmind.metl.ui.init.AppUI.java
License:Open Source License
@Override public void login(User user) { WebApplicationContext ctx = getWebApplicationContext(); VerticalLayout root = new VerticalLayout(); root.setSizeFull(); setContent(root);//from ww w. ja v a 2s . c o m VerticalLayout contentArea = new VerticalLayout(); contentArea.setSizeFull(); ApplicationContext appCtx = ctx.getBean(ApplicationContext.class); appCtx.setUser(user); List<ProjectVersion> openProjects = appCtx.getOpenProjects(); openProjects.clear(); List<String> projectIds = user.getList(UserSetting.SETTING_CURRENT_PROJECT_ID_LIST); for (String projectId : projectIds) { ProjectVersion projectVersion = appCtx.getConfigurationService().findProjectVersion(projectId); if (projectVersion != null) { openProjects.add(projectVersion); } } viewManager = ctx.getBean(ViewManager.class); viewManager.init(this, contentArea); TopBar menu = new TopBar(viewManager, appCtx); // HorizontalLayout bottom = new HorizontalLayout(); // bottom.setWidth(100, Unit.PERCENTAGE); // bottom.setMargin(false); // Embedded right = new Embedded(null, new ThemeResource( // "../apptheme/images/powered-by-jumpmind.png")); // bottom.addComponents(right); // bottom.setComponentAlignment(right, Alignment.BOTTOM_RIGHT); root.addComponents(menu, contentArea); root.setExpandRatio(contentArea, 1); }
From source file:org.jumpmind.metl.ui.mapping.EditMappingPanel.java
License:Open Source License
protected void buildUI() { if (!readOnly) { ButtonBar buttonBar = new ButtonBar(); addComponent(buttonBar);//from w w w .j a va 2 s . c om Button autoMapButton = buttonBar.addButton("Auto Map", FontAwesome.FLASH); removeButton = buttonBar.addButton("Remove", FontAwesome.TRASH_O); removeButton.setEnabled(false); autoMapButton.addClickListener(new AutoMapListener()); removeButton.addClickListener(new RemoveListener()); } HorizontalLayout titleHeader = new HorizontalLayout(); titleHeader.setSpacing(true); titleHeader.setMargin(new MarginInfo(false, true, false, true)); titleHeader.setWidth(100f, Unit.PERCENTAGE); titleHeader.addComponent(new Label( "<b>Input Model:</b> " + (component.getInputModel() != null ? component.getInputModel().getName() : "?"), ContentMode.HTML)); titleHeader.addComponent(new Label( "<b>Output Model:</b> " + (component.getOutputModel() != null ? component.getOutputModel().getName() : "?"), ContentMode.HTML)); addComponent(titleHeader); HorizontalLayout filterHeader = new HorizontalLayout(); filterHeader.setSpacing(true); filterHeader.setMargin(new MarginInfo(true, true, true, true)); filterHeader.setWidth(100f, Unit.PERCENTAGE); HorizontalLayout srcFilterHeader = new HorizontalLayout(); srcFilterHeader.setSpacing(true); srcFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); filterHeader.addComponent(srcFilterHeader); HorizontalLayout dstFilterHeader = new HorizontalLayout(); dstFilterHeader.setSpacing(true); dstFilterHeader.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); filterHeader.addComponent(dstFilterHeader); addComponent(filterHeader); srcTextFilter = new TextField(); srcTextFilter.setInputPrompt("Filter"); srcTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); srcTextFilter.setIcon(FontAwesome.SEARCH); srcTextFilter.setImmediate(true); srcTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY); srcTextFilter.setTextChangeTimeout(200); srcTextFilter.addTextChangeListener(new FilterInputTextListener()); srcFilterHeader.addComponent(srcTextFilter); srcMapFilter = new CheckBox("Mapped Only"); srcMapFilter.addValueChangeListener(new FilterSrcMapListener()); srcFilterHeader.addComponent(srcMapFilter); dstTextFilter = new TextField(); dstTextFilter.setInputPrompt("Filter"); dstTextFilter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); dstTextFilter.setIcon(FontAwesome.SEARCH); dstTextFilter.setImmediate(true); dstTextFilter.setTextChangeEventMode(TextChangeEventMode.LAZY); dstTextFilter.setTextChangeTimeout(200); dstTextFilter.addTextChangeListener(new FilterOutputTextListener()); dstFilterHeader.addComponent(dstTextFilter); dstMapFilter = new CheckBox("Mapped Only"); dstMapFilter.addValueChangeListener(new FilterDstMapListener()); dstFilterHeader.addComponent(dstMapFilter); Panel panel = new Panel(); VerticalLayout vlay = new VerticalLayout(); vlay.setSizeFull(); diagram = new MappingDiagram(context, component, readOnly); diagram.setSizeFull(); vlay.addComponent(diagram); panel.setContent(vlay); panel.setSizeFull(); addComponent(panel); setExpandRatio(panel, 1.0f); diagram.addListener(new EventListener()); }
From source file:org.jumpmind.metl.ui.views.AdminView.java
License:Open Source License
@PostConstruct protected void init() { setSizeFull();/*from w w w . j a v a2 s . co m*/ tabbedPanel = new TabbedPanel(); HorizontalSplitPanel leftSplit = new HorizontalSplitPanel(); leftSplit.setSizeFull(); leftSplit.setSplitPosition(AppConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS); VerticalLayout container = new VerticalLayout(); container.setSizeFull(); container.addComponent(tabbedPanel); leftSplit.setSecondComponent(container); table = new TreeTable(); table.addStyleName(ValoTheme.TREETABLE_NO_HORIZONTAL_LINES); table.addStyleName(ValoTheme.TREETABLE_NO_STRIPES); table.addStyleName(ValoTheme.TREETABLE_NO_VERTICAL_LINES); table.addStyleName(ValoTheme.TREETABLE_BORDERLESS); table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN); table.setSizeFull(); table.setCacheRate(100); table.setPageLength(100); table.setImmediate(true); table.setSelectable(true); table.addItemClickListener(this); table.addStyleName("noselect"); table.addContainerProperty("id", String.class, null); table.setVisibleColumns(new Object[] { "id" }); table.setColumnExpandRatio("id", 1); addItem("Users", Icons.USER); addItem("Groups", Icons.GROUP); addItem("REST", Icons.REST); addItem("General Settings", Icons.SETTINGS); addItem("Mail Server", Icons.EMAIL); addItem("Notifications", Icons.NOTIFICATION); addItem("Logging", Icons.LOGGING); addItem("About", FontAwesome.QUESTION); VerticalLayout navigator = new VerticalLayout(); navigator.addStyleName(ValoTheme.MENU_ROOT); navigator.setSizeFull(); leftSplit.setFirstComponent(navigator); MenuBar leftMenuBar = new MenuBar(); leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS); leftMenuBar.setWidth(100, Unit.PERCENTAGE); navigator.addComponent(leftMenuBar); navigator.addComponent(table); navigator.setExpandRatio(table, 1); addComponent(leftSplit); }
From source file:org.jumpmind.metl.ui.views.deploy.FlowSelectWindow.java
License:Open Source License
@SuppressWarnings({ "serial" }) public FlowSelectWindow(ApplicationContext context, String caption, String introText, boolean includeTestFlows) { super(caption); this.context = context; tree.setMultiSelect(true);/*from www . j a va 2 s . c o m*/ tree.addContainerProperty("name", String.class, ""); tree.setItemCaptionPropertyId("name"); tree.setItemCaptionMode(ItemCaptionMode.PROPERTY); tree.addExpandListener(new ExpandListener() { public void nodeExpand(ExpandEvent event) { Object itemId = event.getItemId(); if (itemId instanceof ProjectVersion) { addFlowsToVersion((ProjectVersion) itemId, includeTestFlows); } } }); addProjects(); setWidth(600.0f, Unit.PIXELS); setHeight(600.0f, Unit.PIXELS); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(new Label(introText)); Panel scrollable = new Panel(); scrollable.addStyleName(ValoTheme.PANEL_BORDERLESS); scrollable.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR); scrollable.setSizeFull(); scrollable.setContent(tree); layout.addComponent(scrollable); layout.setExpandRatio(scrollable, 1.0f); addComponent(layout, 1); Button cancelButton = new Button("Cancel"); Button selectButton = new Button("Select"); addComponent(buildButtonFooter(cancelButton, selectButton)); cancelButton.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { close(); } }); selectButton.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { Collection<FlowName> flowCollection = getFlowCollection(includeTestFlows); listener.selected(flowCollection); close(); } }); }