List of usage examples for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel
public HorizontalSplitPanel()
From source file:net.sourceforge.javydreamercsw.validation.manager.web.admin.AdminScreenProvider.java
License:Apache License
private Component getUserManagementTab() { VerticalLayout vl = new VerticalLayout(); HorizontalSplitPanel split = new HorizontalSplitPanel(); vl.addComponent(split);/*from www.j a v a 2 s . com*/ //Create left side Tree users = new Tree(); //Menu VerticalLayout main = new VerticalLayout(); main.addComponent(users); HorizontalLayout hl = new HorizontalLayout(); Button addUser = new Button(TRANSLATOR.translate("add.user")); addUser.addClickListener(listener -> { VMUserServer user = new VMUserServer(new VmUser()); split.setSecondComponent(new UserComponent(user, true)); }); hl.addComponent(addUser); main.addComponent(hl); split.setFirstComponent(main); VMUserServer.getVMUsers().forEach(user -> { if (!Objects.equals(user.getId(), ((VMUI) UI.getCurrent()).getUser().getId())) { users.addItem(user.getEntity()); users.setItemCaption(user.getEntity(), user.toString()); users.setItemIcon(user.getEntity(), VaadinIcons.USER); users.setChildrenAllowed(user.getEntity(), false); } }); users.addValueChangeListener((Property.ValueChangeEvent event) -> { VmUser user = (VmUser) users.getValue(); split.setSecondComponent(new UserComponent(new VMUserServer(user), true)); }); vl.setSizeFull(); return vl; }
From source file:net.sourceforge.javydreamercsw.validation.manager.web.ValidationManagerUI.java
License:Apache License
private Component getContentComponent() { HorizontalSplitPanel hsplit = new HorizontalSplitPanel(); hsplit.setLocked(true);/*from ww w . j ava 2 s. c o m*/ if (left != null) { if (!(left instanceof Panel)) { left = new Panel(left); } if (user != null) { hsplit.setFirstComponent(left); } } tabSheet.removeAllComponents(); //Build the right component main = tabSheet.addTab(new VerticalLayout(), TRANSLATOR.translate("general.main")); Lookup.getDefault().lookupAll(IMainContentProvider.class).forEach((provider) -> { Iterator<Component> it = tabSheet.iterator(); Component me = findMainProvider(provider.getComponentCaption()); if (me == null) { if (provider.shouldDisplay()) { LOG.log(Level.FINE, "Loading: {0}", TRANSLATOR.translate(provider.getComponentCaption())); tabSheet.addTab(provider.getContent(), TRANSLATOR.translate(provider.getComponentCaption())); } } else { provider.update(); } //Hide if needed if (me != null && !provider.shouldDisplay()) { tabSheet.removeComponent(me); } }); hsplit.setSecondComponent(tabSheet); //This is a tabbed pane. Enable/Disable the panes based on role if (getUser() != null) { roles.clear(); user.update();//Get any recent changes user.getRoleList().forEach((r) -> { roles.add(r.getRoleName()); }); } hsplit.setSplitPosition(25, Unit.PERCENTAGE); return hsplit; }
From source file:nl.amc.biolab.nsg.display.component.MainUI.java
License:Open Source License
private HorizontalSplitPanel buildMainSplitPanel() { // common part: create layout mainSplitPanel = new HorizontalSplitPanel(); mainSplitPanel.setImmediate(false);//from w w w . j a va 2 s .c om mainSplitPanel.setWidth("100.0%"); mainSplitPanel.setHeight("100.0%"); mainSplitPanel.setMargin(true); mainSplitPanel.setSplitPosition(60); // itemList mainSplitPanel.addComponent(new Table()); // editor editor = new Form(); editor.setImmediate(false); editor.setWidth("100.0%"); editor.setHeight("100.0%"); mainSplitPanel.addComponent(editor); return mainSplitPanel; }
From source file:org.activiti.kickstart.KickStartApplication.java
License:Apache License
protected void initSplitPanel() { splitPanel = new HorizontalSplitPanel(); splitPanel.setSplitPosition(170, HorizontalSplitPanel.UNITS_PIXELS); splitPanel.setStyleName(Reindeer.LAYOUT_WHITE); splitPanel.setSizeFull();//from www. j a v a2 s . c o m mainLayout.addComponent(splitPanel, CONTENT_LOCATION); }
From source file:org.adho.dhconvalidator.ui.ConverterPanel.java
/** Setup GUI. */ private void initComponents() { setMargin(true);/*www .j a v a 2 s .c o m*/ setSizeFull(); setSpacing(true); HeaderPanel headerPanel = new HeaderPanel(null); addComponent(headerPanel); Label title = new Label(Messages.getString("ConverterPanel.title")); title.addStyleName("title-caption"); addComponent(title); setComponentAlignment(title, Alignment.TOP_LEFT); Label info = new Label(Messages.getString("ConverterPanel.info"), ContentMode.HTML); addComponent(info); HorizontalLayout inputPanel = new HorizontalLayout(); inputPanel.setSpacing(true); addComponent(inputPanel); upload = new Upload(Messages.getString("ConverterPanel.uploadCaption"), new Receiver() { @Override public OutputStream receiveUpload(String filename, String mimeType) { // we store the uploaded content in the panel instance ConverterPanel.this.filename = filename; ConverterPanel.this.uploadContent = new ByteArrayOutputStream(); return ConverterPanel.this.uploadContent; } }); inputPanel.addComponent(upload); progressBar = new ProgressBar(); progressBar.setIndeterminate(true); progressBar.setVisible(false); inputPanel.addComponent(progressBar); inputPanel.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER); progressBar.addStyleName("converterpanel-progressbar"); resultCaption = new Label(Messages.getString("ConverterPanel.previewTitle2")); resultCaption.setWidth("100%"); resultCaption.addStyleName("converterpanel-resultcaption"); addComponent(resultCaption); setComponentAlignment(resultCaption, Alignment.MIDDLE_CENTER); resultPanel = new HorizontalSplitPanel(); addComponent(resultPanel); resultPanel.setSizeFull(); setExpandRatio(resultPanel, 1.0f); preview = new Label("", ContentMode.HTML); preview.addStyleName("tei-preview"); resultPanel.addComponent(preview); VerticalLayout rightPanel = new VerticalLayout(); rightPanel.setMargin(new MarginInfo(false, false, true, true)); rightPanel.setSpacing(true); resultPanel.addComponent(rightPanel); logArea = new Label("", ContentMode.HTML); logArea.setSizeFull(); logArea.setReadOnly(true); rightPanel.addComponent(logArea); downloadInfo = new Label(Messages.getString("ConverterPanel.downloadMsg")); rightPanel.addComponent(downloadInfo); downloadInfo.setVisible(false); btDownloadResult = new Button(Messages.getString("ConverterPanel.downloadBtCaption")); btDownloadResult.setVisible(false); rightPanel.addComponent(btDownloadResult); rightPanel.setComponentAlignment(btDownloadResult, Alignment.BOTTOM_CENTER); btDownloadResult.setHeight("50px"); rightPanel.addComponent(new Label(Messages.getString("ConverterPanel.exampleMsg"))); Button btExample = new Button(Messages.getString("ConverterPanel.exampleButtonCaption")); btExample.setStyleName(BaseTheme.BUTTON_LINK); btExample.addStyleName("plain-link"); rightPanel.addComponent(btExample); confToolLabel = new Label( Messages.getString("ConverterPanel.gotoConfToolMsg", PropertyKey.conftool_login_url.getValue()), ContentMode.HTML); confToolLabel.setVisible(false); confToolLabel.addStyleName("postDownloadInfoRedAndBold"); rightPanel.addComponent(confToolLabel); new BrowserWindowOpener(DHConvalidatorExample.class).extend(btExample); }
From source file:org.apache.openaz.xacml.admin.components.PolicyWorkspace.java
License:Apache License
@AutoGenerated private HorizontalSplitPanel buildHorizontalSplitPanel() { // common part: create layout horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setImmediate(false); horizontalSplitPanel.setWidth("100.0%"); horizontalSplitPanel.setHeight("100.0%"); // verticalLayoutLeftPanel verticalLayoutLeftPanel = buildVerticalLayoutLeftPanel(); horizontalSplitPanel.addComponent(verticalLayoutLeftPanel); // verticalLayoutRightPanel verticalLayoutRightPanel = buildVerticalLayoutRightPanel(); horizontalSplitPanel.addComponent(verticalLayoutRightPanel); return horizontalSplitPanel; }
From source file:org.apache.usergrid.chop.webapp.view.user.GroupSubwindow.java
License:Apache License
private void initLayout() { /* Root of the user interface component tree is set */ HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); setContent(splitPanel);//w w w . j a va 2 s. c om /* Build the component tree */ VerticalLayout leftLayout = new VerticalLayout(); splitPanel.addComponent(leftLayout); splitPanel.addComponent(editorLayout); leftLayout.addComponent(groupList); HorizontalLayout bottomLeftLayout = new HorizontalLayout(); leftLayout.addComponent(bottomLeftLayout); bottomLeftLayout.addComponent(searchField); bottomLeftLayout.addComponent(addNewGroupButton); bottomLeftLayout.addComponent(saveButton); bottomLeftLayout.addComponent(cancelButton); /* Set the contents in the left of the split panel to use all the space */ leftLayout.setSizeFull(); /* * On the left side, expand the size of the userList so that it uses * all the space left after from bottomLeftLayout */ leftLayout.setExpandRatio(groupList, 1); groupList.setSizeFull(); /* * In the bottomLeftLayout, searchField takes all the width there is * after adding addNewUserButton. The height of the layout is defined * by the tallest component. */ bottomLeftLayout.setWidth("100%"); searchField.setWidth("100%"); bottomLeftLayout.setExpandRatio(searchField, 1); /* Put a little margin around the fields in the right side editor */ editorLayout.setMargin(true); editorLayout.setVisible(false); }
From source file:org.apache.usergrid.chop.webapp.view.user.UserSubwindow.java
License:Apache License
private void initLayout() { // Root of the user interface component tree is set HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); setContent(splitPanel);/* ww w . j a v a2s .co m*/ // Build the component tree VerticalLayout leftLayout = new VerticalLayout(); splitPanel.addComponent(leftLayout); splitPanel.addComponent(userEditLayout); leftLayout.addComponent(userList); HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.addComponent(addNewUserButton); buttonsLayout.addComponent(saveButton); buttonsLayout.addComponent(closeButton); leftLayout.addComponent(buttonsLayout); // Set the contents in the left of the split panel to use all the space leftLayout.setSizeFull(); // On the left side, expand the size of userList so that it uses all the space left after from bottomLeftLayout leftLayout.setExpandRatio(userList, 1); userList.setSizeFull(); // Put a little margin around the fields in the right side editor userEditLayout.setMargin(true); userEditLayout.setVisible(false); }
From source file:org.bull.examples.vaadin.osgi.portal.PortalOSGiApplication.java
License:Open Source License
@Override public void init(VaadinRequest request) { HorizontalSplitPanel split = new HorizontalSplitPanel(); split.setSizeFull();//from ww w .j av a 2 s. c o m split.setSplitPosition(250, Unit.PIXELS); tree = new Tree(); for (PortalModule module : getPortalModuleService().getModules()) { tree.addItem(module.getId()); tree.setItemCaption(module.getId(), module.getName()); } tree.addItemClickListener(new ItemClickListener() { @Override public void itemClick(ItemClickEvent event) { PortalModule module = getPortalModuleService().getModule((String) event.getItemId()); Iterator<Component> it = tabs.iterator(); Component found = null; while (it.hasNext()) { Component c = it.next(); if (tabs.getTab(c).getCaption().equals(module.getName())) { found = c; break; } } if (found == null) { Tab addTab = tabs.addTab(module.createComponent(eventBus), module.getName()); addTab.setClosable(true); } else { tabs.setSelectedTab(found); } } }); tabs = new TabSheet(); tabs.setSizeFull(); split.setFirstComponent(tree); split.setSecondComponent(tabs); setContent(split); getPortalModuleService().addListener(this); }
From source file:org.escidoc.browser.layout.SimpleLayout.java
License:Open Source License
private HorizontalSplitPanel buildContainer() throws EscidocClientException, UnsupportedOperationException, URISyntaxException { // common part: create layout container = new HorizontalSplitPanel(); container.setStyleName(Runo.SPLITPANEL_SMALL); container.setImmediate(false);//from w ww . j ava 2 s . c om container.setMargin(false); container.setSplitPosition(20, Sizeable.UNITS_PERCENTAGE); container.setSizeFull(); container.setLocked(false); // navigationPanel NavigationSimpleLayout navigationLayout = new NavigationSimpleLayout(this, navigationPanel, vlNavigationPanel); navigationPanel = navigationLayout.buildNavigationPanel(); container.addComponent(navigationPanel); this.treeDataSource = navigationLayout.getTreeDataSource(); // TabContainer cssContent = new CssLayout(); cssContent.setSizeFull(); cssContent.setMargin(false); mainContentTabs = buildTabContainer(); cssContent.addComponent(mainContentTabs); container.addComponent(cssContent); return container; }