Completely unorthodox but extremely productive API wrappers for Vaadin Layouts

A completely unorthodox but extremely productive API wrappers for Vaadin Layouts

Currently, it only supports Horizontal and Vertical Layouts. Ideally, the unorthodoxy way of working may catch up in other layouts too :)

Using the addon for Vertial and Horizontal layouts

import net.hdavid.easylayout.L.*;
// ...
TextField name;
TextField lastName;
Button save;
Button cancel;
// ...
val vl = ve(name, lastName, ho(save, cancel)); 
// that is it!

A more complex full size view

Button newb = new Button("New");
Button modb = new Button("Modify");
Button delb = new Button("Delete");

Grid grid = new Grid(
   new BeanItemContainer(Arrays.asList(
      new PersonDTO("David Hofmann", 
                    new Date(1986, 07, 29), 
                    30),
      new PersonDTO("Vaadin Is Awesome!", 
                    new Date(), 
                    10))));

protected void init(VaadinRequest request) {

VerticalLayout vl = 
ve(_FULL_SIZE, _MARGIN,               // 1
   ho(_FULL_WIDTH,                    // 2
      _EXPANDER,                      // 3
      delb, ValoTheme.BUTTON_DANGER,  // 4
      modb,                           // 5
      newb, ValoTheme.BUTTON_PRIMARY),// 6
   grid, _FULL_SIZE, _EXPAND);        // 7

setContent(vl); // hard :D ?
}
  1. creating a vertical layout with full size and margin
  2. it's first component is a horizontal layout of full width
  3. the first horizontal layout component is an expander component
  4. the second one is the delete button and a css style is added to it
  5. third component is the modify button
  6. forth component is the new button with a css style added to it
  7. second component of the vertical layout is the grid with its full size and expand ratio to 1f

##FAQ

###Are you completely crazy and lost all your human traits and your oath to code hygiene?

Yeap! It will take me more time to explain you how much it helped me, though. But this "guide" will be updated if you don't get it yet :)

###This code is stupid! Are you aware of static evil and that your code is crappy and totally NOT OOP?

Yes! But for this particular case, it is safe, though, and you'll be okay using it "if" you like brevity in your H/V Layouts.

For rule explanations see the github page for more details.

Install

Link to this version
BetaReleased 20 October 2016Apache License 2.0
Framework Support
Vaadin 7.0+
Vaadin 8.0+
Browser Independent
Install with
Release notes - Version 1.0

Initial release to gather feedback