List of usage examples for com.vaadin.ui VerticalLayout setSizeFull
@Override public void setSizeFull()
From source file:com.save.area.DeleteAreaWindow.java
VerticalLayout getLayout() { VerticalLayout vlayout = new VerticalLayout(); vlayout.setSizeFull(); vlayout.setMargin(true);/*from w w w. j a va 2 s . c o m*/ vlayout.setSpacing(true); vlayout.addComponent(area); Button deleteBtn = new Button("DELETE", this); deleteBtn.setWidth("100%"); vlayout.addComponent(deleteBtn); return vlayout; }
From source file:com.save.area.EditAreaWindow.java
VerticalLayout getVlayout() { VerticalLayout vlayout = new VerticalLayout(); vlayout.setSizeFull(); vlayout.setMargin(true);/*from w w w . j ava 2 s .c o m*/ vlayout.setSpacing(true); area.setInputPrompt("Select Area.."); area.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { areaField.setValue(area.getItemCaption(event.getProperty().getValue())); } }); vlayout.addComponent(area); areaField.setWidth("100%"); vlayout.addComponent(areaField); editAreaBtn.setWidth("100%"); editAreaBtn.addClickListener(editBtnListener); vlayout.addComponent(editAreaBtn); return vlayout; }
From source file:com.save.client.RemoveAccountWindow.java
VerticalLayout getVLayout() { VerticalLayout vlayout = new VerticalLayout(); vlayout.setSpacing(true);//from w ww. j a v a 2s . c om vlayout.setMargin(true); vlayout.setSizeFull(); final TextArea remarks = new TextArea("Remarks: "); remarks.setRows(2); remarks.setWidth("100%"); vlayout.addComponent(remarks); Button removeBtn = new Button("REMOVE ACCOUNT?"); removeBtn.setWidth("100%"); removeBtn.addClickListener((Button.ClickEvent event) -> { if (remarks.getValue() == null || remarks.getValue().trim().isEmpty()) { Notification.show("Add Remarks!", Notification.Type.ERROR_MESSAGE); return; } boolean result = clientService.removeAccount(getClientId(), remarks.getValue().trim().toLowerCase()); if (result) { close(); } }); vlayout.addComponent(removeBtn); return vlayout; }
From source file:com.save.clients.AcknowledgementPromoForm.java
VerticalLayout acknowledgementFormContent() { VerticalLayout content = new VerticalLayout(); content.setSizeFull(); content.setMargin(true);//from w w w. j av a2 s . c om content.setSpacing(true); GridLayout glayout = new GridLayout(4, 5); glayout.setWidth("100%"); glayout.setSpacing(true); entryDate = new DateField("Date: "); entryDate.setWidth("100%"); glayout.addComponent(entryDate, 0, 0); promoItem = new TextField("Promo Items: "); promoItem.setWidth("100%"); glayout.addComponent(promoItem, 1, 0, 3, 0); promoAmount = new TextField("Amount: "); promoAmount.setWidth("100%"); promoAmount.setStyleName("align-right"); glayout.addComponent(promoAmount, 0, 1); quantity = new TextField("Quantity: "); quantity.setWidth("100%"); quantity.setStyleName("align-right"); glayout.addComponent(quantity, 1, 1); productItems = CommonComboBox.productItems(); productItems.setWidth("100%"); glayout.addComponent(productItems, 2, 1, 3, 1); startDate = new DateField("From: "); startDate.setWidth("100%"); glayout.addComponent(startDate, 0, 2); endDate = new DateField("To: "); endDate.setWidth("100%"); glayout.addComponent(endDate, 1, 2); salesRep.setWidth("100%"); glayout.addComponent(salesRep, 2, 2, 3, 2); areaSales.setWidth("100%"); glayout.addComponent(areaSales, 2, 3, 3, 3); remarks = new TextArea("Remarks: "); remarks.setWidth("100%"); remarks.setRows(4); glayout.addComponent(remarks, 0, 3, 1, 4); Button submitBtn = new Button(); submitBtn.setCaption("SAVE"); submitBtn.setWidth("100%"); submitBtn.addClickListener(this); glayout.addComponent(submitBtn, 2, 4, 3, 4); glayout.setComponentAlignment(submitBtn, Alignment.BOTTOM_CENTER); if (getPromoId() != 0) { PromoDeals pd = pds.getPromoDealById(getPromoId()); submitBtn.setCaption("UPDATE"); entryDate.setValue(pd.getEntryDate()); startDate.setValue(pd.getStartDate()); endDate.setValue(pd.getEndDate()); promoItem.setValue(pd.getPromoItem()); promoAmount.setValue(String.valueOf(pd.getPromoAmount())); quantity.setValue(String.valueOf(pd.getQuantity())); productItems.setValue(pd.getProductId()); areaSales.setValue(pd.getAreaSalesId()); salesRep.setValue(pd.getSalesRepId()); remarks.setValue(pd.getRemarks()); } content.addComponent(glayout); return content; }
From source file:com.save.employee.RemoveAccountWindow.java
VerticalLayout getVLayout() { VerticalLayout vlayout = new VerticalLayout(); vlayout.setSpacing(true);//w ww .j av a 2s . c om vlayout.setMargin(true); vlayout.setSizeFull(); final TextArea remarks = new TextArea("Remarks: "); remarks.setRows(2); remarks.setWidth("100%"); vlayout.addComponent(remarks); Button removeBtn = new Button("REMOVE ACCOUNT?"); removeBtn.setWidth("100%"); removeBtn.addClickListener((Button.ClickEvent event) -> { if (remarks.getValue() == null || remarks.getValue().trim().isEmpty()) { Notification.show("Add Remarks!", Notification.Type.ERROR_MESSAGE); return; } boolean result = employeeService.removeAccount(getEmployeeId(), remarks.getValue().trim().toLowerCase()); if (result) { close(); } }); vlayout.addComponent(removeBtn); return vlayout; }
From source file:com.save.global.ErrorLoggedNotification.java
public static void showWarningLoggedOnWindow(String warning, String className) { VerticalLayout v = new VerticalLayout(); v.setSizeFull(); v.setMargin(true);/*from w w w . j a v a2s . c o m*/ Window sub = new Window("WARNING MESSAGE!"); sub.setWidth("500px"); if (sub.getParent() == null) { UI.getCurrent().addWindow(sub); } sub.setModal(true); Panel panel = new Panel(); panel.setSizeFull(); panel.addStyleName(ValoTheme.PANEL_BORDERLESS); panel.setContent(new Label(warning + " on \n" + className, ContentMode.HTML)); panel.getContent().setHeightUndefined(); v.addComponent(panel); sub.setContent(v); sub.getContent().setHeightUndefined(); }
From source file:com.save.reports.maintenance.MaintenanceReportUI.java
Window exportLargeData() { Window sub = new Window("EXPORT LARGE DATA"); sub.setWidth("300px"); sub.setModal(true);//w w w .j a v a 2 s. c o m sub.center(); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); v.setMargin(true); v.setSpacing(true); Label status = new Label("Exporting large amount of data will take longer and will eat a lot of memory.", ContentMode.HTML); status.setContentMode(ContentMode.HTML); v.addComponent(status); Button b = new CommonButton("PROCEED TO EXPORT?"); b.addClickListener((Button.ClickEvent e) -> { sub.close(); processExportDataToExcel(); }); v.addComponent(b); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.save.reports.PromoDealAcknowledgementReport.java
public PromoDealAcknowledgementReport(int promoId) { this.promoId = promoId; setCaption("Acknowledgement Report"); setWidth("800px"); setHeight("600px"); center();//from ww w . ja v a 2 s . co m Connection conn = DBConnection.connect(); HashMap hm = new HashMap(); hm.put("PROMO_ID", getPromoId()); InputStream template = this.getClass() .getResourceAsStream("/reports/PromoDealAcknowledgementFormReport.jasper"); try { JasperPrint print = JasperFillManager.fillReport(template, hm, conn); file = File.createTempFile("output", ".pdf"); JasperExportManager.exportReportToPdfFile(print, file.getPath()); } catch (JRException | IOException ex) { Logger.getLogger(PromoDealAcknowledgementReport.class.getName()).log(Level.SEVERE, null, ex); } StreamResource.StreamSource source = () -> { try { FileInputStream fis = new FileInputStream(file); return fis; } catch (Exception e) { e.getMessage(); return null; } }; StreamResource resource = new StreamResource(source, "PromoDealAcknowledgementForm.pdf"); resource.setMIMEType("application/pdf"); VerticalLayout v = new VerticalLayout(); v.setSizeFull(); Embedded e = new Embedded(); e.setSource(resource); e.setSizeFull(); e.setType(Embedded.TYPE_BROWSER); v.addComponent(e); setContent(v); }
From source file:com.scipionyx.butterflyeffect.frontend.core.ui.MainUI.java
License:Apache License
/** * /* w ww . j a v a 2 s . co m*/ */ @Override protected void init(VaadinRequest request) { // Top Menu final VerticalLayout root = new VerticalLayout(); root.setSizeFull(); root.setMargin(new MarginInfo(false, false, false, false)); root.setSpacing(false); root.addComponent(topFactory.instance()); setContent(root); viewContainer = new Panel(); viewContainer.setStyleName(ValoTheme.PANEL_BORDERLESS); viewContainer.setSizeFull(); root.addComponent(viewContainer); root.setExpandRatio(viewContainer, 1.0f); // Define the access denied view viewProvider.setAccessDeniedViewClass(AccessDeniedView.class); }
From source file:com.selzlein.lojavirtual.vaadin.page.SettingsView.java
License:Open Source License
private void createView() { ui = (LspsUI) getUI();//from ww w . j a va2s. c om user = ui.getUser().getPerson(); userRights = user.getRights(); setTitle(ui.getMessage(TITLE)); Panel panel = new Panel(); panel.addStyleName("l-border-none"); setContent(panel); VerticalLayout layout = new VerticalLayout(); layout.addStyleName("l-settings"); layout.setSizeFull(); layout.setSpacing(true); layout.setMargin(true); panel.setContent(layout); //user data and settings will be laid out next to each other HorizontalLayout topSection = new HorizontalLayout(); topSection.setSpacing(true); topSection.setWidth("100%"); layout.addComponent(topSection); VerticalLayout userData = createUserDataSection(ui, user); topSection.addComponent(userData); topSection.setExpandRatio(userData, 1); Label spacer = new Label(); spacer.setWidth("20px"); topSection.addComponent(spacer); VerticalLayout settings = createSettingsSection(ui); topSection.addComponent(settings); topSection.setExpandRatio(settings, 1); //substitution section VerticalLayout substitution = createSubstitutionSection(); layout.addComponent(substitution); layout.setExpandRatio(substitution, 2); //buttons HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true); Button saveButton = new Button(ui.getMessage("action.save"), new ClickListener() { @Override public void buttonClick(ClickEvent event) { if (save()) { if (requestReload) { JavaScript.getCurrent().execute("window.location.reload()"); } else { close(); } } } }); saveButton.setData(BUTTON_TYPE_SAVE); buttons.addComponent(saveButton); Button cancelButton = new Button(ui.getMessage("action.cancel"), new ClickListener() { @Override public void buttonClick(ClickEvent event) { close(); } }); buttons.addComponent(cancelButton); layout.addComponent(buttons); }