List of usage examples for com.vaadin.ui Upload setWidth
@Override public void setWidth(float width, Unit unit)
From source file:dhbw.ka.mwi.businesshorizon2.ui.initialscreen.InitialScreenViewImpl.java
License:Open Source License
public void createImportButton() { importButton = new VerticalLayout(); importButton.setWidth(150, com.vaadin.terminal.Sizeable.UNITS_PIXELS); importButton.setHeight(80, com.vaadin.terminal.Sizeable.UNITS_PIXELS); importButton.setStyleName("topBarButtonContainer"); UploadReceiver receiver = new UploadReceiver(eventBus); Upload upload = new Upload(null, receiver); upload.setButtonCaption(""); upload.setImmediate(true);/*from w w w . j av a 2s .c om*/ upload.addListener(receiver); upload.setStyleName("importButton"); upload.setWidth(30, com.vaadin.terminal.Sizeable.UNITS_PIXELS); upload.setHeight(30, com.vaadin.terminal.Sizeable.UNITS_PIXELS); Label gap = new Label(); gap.setHeight("5px"); Label label = new Label("Projekte"); label.setStyleName("topBarButtonLabel"); label.setSizeUndefined(); Label label2 = new Label("importieren"); label2.setStyleName("topBarButtonLabel"); label2.setSizeUndefined(); VerticalLayout labelLayout = new VerticalLayout(); labelLayout.setHeight(45, com.vaadin.terminal.Sizeable.UNITS_PIXELS); labelLayout.setWidth(100, UNITS_PERCENTAGE); importButton.addComponent(upload); labelLayout.addComponent(label); labelLayout.addComponent(label2); importButton.addComponent(gap); importButton.addComponent(labelLayout); importButton.setComponentAlignment(upload, Alignment.TOP_CENTER); labelLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); labelLayout.setComponentAlignment(label2, Alignment.MIDDLE_CENTER); }