It’s me again with a new Community Friday project!
This one’s been under work for quite some time now (well over nine months), but the result is now ready for public scrutiny.
Without further ado, I present
DashLayout
Available as an add-on in the Directory
DashLayout has two different layouts: VerDashLayout and HorDashLayout, former corresponding to VerticalLayout and latter to HorizontalLayout.
DashLayout has the exact same API as Vertical and Horizontal layouts, since it fulfills the same tasks. The only exception to default Vaadin layouts is that DashLayout does not provide caption support (at least not yet).
These layouts are designed mainly for application level component positioning, not so much for Form type layouts, so missing captions shouldn’t be too bad.
Differences to normal Vertical and Horizontal layouts
- Only one DIV element per layout. No extra container elements per child component. This means that the layouts are much leaner for the browser to render.
- You can use arbitrary margin/border/padding values for the layout element, even if 100% size is used.
- You can use arbitrary margin values for the contained child components, even if 100% sizes are used.
Demo
You can view a
demo
on GAE, it contains the CSS for your viewing also.
As you can see in the demo, you can easily create pretty complex combinations, like overlapping child components (which is impossible with current Vertical and Horizontal layouts).
Get It!
Download the add-on from the Directory
Source code is hosted at GitHub:
http://github.com/jounikoivuviita/DashLayout/
And as I said, API is the same as with Vertical/HorizontalLayout, so you should get started easily.
Lastly, I’d be more than happy to hear your opinions and experiences with this layout, so take it for a spin. Disclaimer: beta software, probable bugs ahead
UPDATE, v.0.1.5-beta
- Added min/max-width/height support (only pixel values supported). See
readme.txt
for usage example - Added LayoutClickListener support. Works the same way as with other layouts