Advertisement
Gigi95

the second part

Apr 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.58 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.library.librarytest;
  7.  
  8. import com.vaadin.annotations.Theme;
  9. import com.vaadin.ui.HorizontalLayout;
  10. import com.vaadin.ui.Label;
  11. import com.vaadin.ui.VerticalLayout;
  12. /**
  13.  *
  14.  * @author gee
  15.  */
  16. @Theme("mytheme")
  17.  
  18. public class HelloWorld extends VerticalLayout {
  19.    
  20.     private final VerticalLayout upperSection = new VerticalLayout();
  21.     private final HorizontalLayout lowerSection = new HorizontalLayout();
  22.     private final VerticalLayout menuLayout = new VerticalLayout();
  23.     private final VerticalLayout contentLayout = new VerticalLayout();
  24.        
  25.     public HelloWorld() {
  26.     upperSection.addComponent(new Label("Header"));
  27.     menuLayout.addComponent(new Label("Menu"));
  28.     contentLayout.addComponent(new Label("Content"));
  29.     lowerSection.addComponent(menuLayout);
  30.     upperSection.addComponent(contentLayout);
  31.     addComponent(upperSection);
  32.     addComponent(lowerSection);
  33.    
  34.     setSizeFull();
  35.     lowerSection.setSizeFull();
  36.     menuLayout.setSizeFull();
  37.     contentLayout.setSizeFull();
  38.    
  39.     setExpandRatio(lowerSection, 1);
  40.    
  41.     showBorders();
  42.    
  43.     }
  44.     private void showBorders() {
  45.     String style = "v-ddwrapper-over";
  46.     setStyleName(style);
  47.     upperSection.setStyleName(style);
  48.     lowerSection.setStyleName(style);
  49.     menuLayout.setStyleName(style);
  50.     contentLayout.setStyleName(style);
  51.     }
  52.    
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement