List of usage examples for com.vaadin.ui VerticalLayout addComponent
@Override public void addComponent(Component c)
From source file:ch.bfh.ti.soed.hs16.srs.white.controller.ApplicationController.java
License:Open Source License
private void updateBody(Component newBody) { VerticalLayout body = uniqueApplicationController.getBody(); body.removeAllComponents();//from w ww .ja v a 2 s . com body.addComponent(newBody); }
From source file:cirad.cgh.vcf2fasta.Vcf2fastaUI.java
License:Open Source License
@Override protected void init(VaadinRequest request) { config = initConfig();/*from w ww . ja v a 2 s .c o m*/ Panel mainPanel = new Panel("Vcf2fasta"); VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); mainPanel.setContent(layout); vcf2fastaForm = new Vcf2fastaForm(this, config); vcf2fastaForm.setFormSubmitHandler(getSubmitClickListener(this)); layout.addComponent(vcf2fastaForm); setTheme("tests-valo-reindeer"); //setTheme("tests-valo-facebook"); //setTheme("tests-valo-metro"); setContent(mainPanel); }
From source file:com.aaron.mbpet.views.users.UserEditor.java
License:Apache License
public UserEditor(Item personItem, String lableText, boolean mode) { this.editMode = mode; // this.setModal(true); center();/*from ww w .j ava2 s . co m*/ setResizable(true); setClosable(true); setModal(true); // setSizeUndefined(); setWidth(25, Unit.EM); this.currsessionuser = ((MbpetUI) UI.getCurrent()).getSessionUser(); VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); this.personItem = personItem; editorForm = new Form(); editorForm.setFormFieldFactory(this); editorForm.setBuffered(true); editorForm.setImmediate(true); editorForm.setItemDataSource(personItem, Arrays.asList("firstname", "lastname", "email", "username", "password", "organization")); //buttons saveButton = new Button("Save", this); saveButton.setClickShortcut(KeyCode.ENTER); cancelButton = new Button("Cancel", this); saveButton.addStyleName(ValoTheme.BUTTON_PRIMARY); HorizontalLayout buttons = new HorizontalLayout(); buttons.setWidth("100%"); buttons.addComponents(saveButton, cancelButton); buttons.setComponentAlignment(saveButton, Alignment.BOTTOM_LEFT); buttons.setComponentAlignment(cancelButton, Alignment.BOTTOM_RIGHT); // editorForm.getFooter().addComponent(buttons); // editorForm.getFooter().addComponent(cancelButton); layout.addComponent(new Label("<h3>" + lableText + "</h3>", ContentMode.HTML)); layout.addComponent(editorForm); layout.setComponentAlignment(editorForm, Alignment.MIDDLE_CENTER); layout.addComponent(buttons); setContent(layout); //editorForm setCaption(buildCaption()); }
From source file:com.abien.vaadin.helloapp.HelloApp.java
License:Apache License
@Override public void init() { VerticalLayout layout = new VerticalLayout(); layout.setMargin(true);//from w w w . ja va 2s. c o m Label header = new Label("Vaadin on Java EE"); header.setStyleName("h1"); layout.addComponent(header); final TextField nameField = new TextField("Input something:"); final Label greetingLbl = new Label(); layout.addComponent(nameField); layout.addComponent( new Button("Say slow Hello, clicking this shouldn't stall other users", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { try { Thread.sleep(20 * 1000); } catch (InterruptedException ex) { Logger.getLogger(HelloApp.class.getName()).log(Level.SEVERE, null, ex); } getMainWindow().showNotification("Hello!"); } })); layout.addComponent(new Button("Say Hello", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { greetingLbl.setCaption(greetingService.sayHello(nameField.getValue().toString())); buttonEvents.fire(event); } })); layout.addComponent(greetingLbl); Window mainWindow = new Window("Vaadin 6.8 - Java EE Integration", layout); setMainWindow(mainWindow); }
From source file:com.anothernode.ballkontrolle.BallkontrolleUI.java
License:Open Source License
@Override protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true);//from w w w . j a va 2s .c o m setContent(layout); Label team1Player1 = new Label(""); Label team1Player2 = new Label(""); Label team2Player1 = new Label(""); Label team2Player2 = new Label(""); final Button button = new Button("Draw Teams"); button.addClickListener(event -> { final Drawing drawing = new Drawing(Data.summonPlayers()); team1Player1.setValue(drawing.getTeam1().getPlayer1().toString()); team1Player2.setValue(drawing.getTeam1().getPlayer2().toString()); team2Player1.setValue(drawing.getTeam2().getPlayer1().toString()); team2Player2.setValue(drawing.getTeam2().getPlayer2().toString()); }); layout.addComponent(button); layout.addComponent(new Label("Team 1:")); layout.addComponent(team1Player1); layout.addComponent(team1Player2); layout.addComponent(new Label("Team 2:")); layout.addComponent(team2Player1); layout.addComponent(team2Player2); }
From source file:com.antonjohansson.managementcenter.core.web.welcome.WelcomeView.java
License:Apache License
private Component buildConnectForm() { final VerticalLayout panel = new VerticalLayout(); panel.setSizeUndefined();//from ww w . j a v a 2 s. com panel.setSpacing(true); panel.addComponent(getHeader()); panel.addComponent(getExistingConnectionLayout()); panel.addComponent(getNewConnectionLayout()); return panel; }
From source file:com.arcusys.liferay.vaadinplugin.ControlPanelUI.java
License:Apache License
private VerticalLayout createIncludeAddonsListLayout(OptionGroup includeAddonsOptionGroup) { VerticalLayout addonsListHolder = new VerticalLayout(); addonsListHolder.setCaption("Select Add-ons"); addonsListHolder.addComponent(includeAddonsOptionGroup); return addonsListHolder; }
From source file:com.arcusys.liferay.vaadinplugin.ui.AdditionalDependenciesWindow.java
License:Apache License
public AdditionalDependenciesWindow(List<File> files, List<File> includedDependencies) { setCaption("Additional dependencies (WEB-INF/lib)"); setWidth("350px"); setHeight("350px"); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull();//w ww. ja va 2 s . c om layout.setMargin(true); layout.setSpacing(true); setContent(layout); dependencyContainer.addContainerProperty("caption", String.class, null); filterTextField = createFilterTextField(); layout.addComponent(filterTextField); dependenciesSelector = createDependenciesSelector(); populateSelector(files, includedDependencies); layout.addComponent(dependenciesSelector); layout.setExpandRatio(dependenciesSelector, 1); layout.addComponent(createCloseButton()); }
From source file:com.arcusys.liferay.vaadinplugin.ui.DetailsWindow.java
License:Apache License
private Layout createVaadinDetails() { Layout vaadinDetailLayout = new VerticalLayout(); vaadinDetailLayout.setWidth("900px"); VerticalLayout vaadinDetails = new VerticalLayout(); vaadinDetails.setMargin(new MarginInfo(true, true, false, true)); Version currentVersion = ControlPanelPortletUtil.getPortalVaadinVersion(); VaadinVersion currentVaadinInfo = VaadinVersion.getVaadinVersion(currentVersion); Collection<VaadinFileInfo> fileInfos = currentVaadinInfo.getVaadinFilesInfo(); Collections.sort((List<VaadinFileInfo>) fileInfos, new Comparator<VaadinFileInfo>() { @Override/*www.j a v a2 s . c o m*/ public int compare(VaadinFileInfo o1, VaadinFileInfo o2) { if (o1 == null) return -1; if (o2 == null) return 1; return o1.getOrderPriority().compareTo(o2.getOrderPriority()); } }); for (VaadinFileInfo info : fileInfos) { VerticalLayout infoLayout = new VerticalLayout(); infoLayout.setCaption(info.getName()); infoLayout.setMargin(new MarginInfo(false, true, true, false)); Layout versionLayout = new HorizontalLayout(); versionLayout.setSizeUndefined(); versionLayout.addComponent(new Label("Version: ")); String vaadinJarVersion; try { vaadinJarVersion = ControlPanelPortletUtil.getPortalVaadinJarVersion( info.getPlace() + ControlPanelPortletUtil.FileSeparator + info.getName()); } catch (Exception ex) { vaadinJarVersion = ""; log.warn("Version for " + vaadinJarVersion + " couldn't be read.", ex); } versionLayout.addComponent(new Label(vaadinJarVersion)); infoLayout.addComponent(versionLayout); Layout pathLayout = new HorizontalLayout(); pathLayout.setSizeUndefined(); pathLayout.addComponent(new Label("Path: ")); String path = info.getPlace(); pathLayout.addComponent(new Label(path)); infoLayout.addComponent(pathLayout); vaadinDetails.addComponent(infoLayout); } vaadinDetailLayout.addComponent(vaadinDetails); return vaadinDetailLayout; }
From source file:com.arcusys.liferay.vaadinplugin.ui.OutputConsole.java
License:Apache License
public OutputConsole(String caption) { Panel panel = new Panel(); panel.setCaption(caption);// w ww. j av a2 s. c o m panel.setSizeFull(); setCompositionRoot(panel); VerticalLayout layout = new VerticalLayout(); layout.setSizeUndefined(); panel.setContent(layout); VerticalLayout outputLabelLayout = new VerticalLayout(); outputLabelLayout.setSizeUndefined(); outputLabelLayout.setMargin(true); layout.addComponent(outputLabelLayout); outputLabel.setSizeUndefined(); outputLabelLayout.addComponent(outputLabel); scrollToLabel.setWidth("0px"); scrollToLabel.setHeight("0px"); layout.addComponent(scrollToLabel); }