项目作者: bekce

项目描述 :
Bootstrap for Vaadin
高级语言: Java
项目地址: git://github.com/bekce/vaadstrap.git
创建时间: 2015-12-08T09:39:13Z
项目社区:https://github.com/bekce/vaadstrap

开源协议:MIT License

下载


vaadstrap

Bootstrap for Vaadin.

Designed to use bootstrap’s grid system in Vaadin applications to enable mobile-ready views without writing a single line of css.

The library is ready to be used by any Vaadin project and requires no widgetset compilation.

  1. <dependency>
  2. <groupId>com.sebworks</groupId>
  3. <artifactId>vaadstrap</artifactId>
  4. <version>0.2.1</version>
  5. </dependency>
  6. <repository>
  7. <id>vaadin-addons</id>
  8. <url>http://maven.vaadin.com/vaadin-addons</url>
  9. </repository>
Branch Version Compatible With
master 0.2.1 Vaadin 8.x
vaadin7 0.1.2 Vaadin 7.x

Usage example:

  1. @Viewport("width=device-width, initial-scale=1") // this is necessary
  2. public class BootstrapUI extends UI {
  3. @Override
  4. protected void init(VaadinRequest request) {
  5. setSizeFull();
  6. Container container = new Container();
  7. Row row = container.addRow();
  8. Col col1 = row.addCol(ColMod.SM_6, ColMod.MD_4);
  9. Col col2 = row.addCol(ColMod.SM_6, ColMod.MD_4, VisibilityMod.HIDDEN_XS);
  10. col1.addComponent(new TextArea());
  11. col1.addComponent(new TextArea());
  12. col2.addComponent(new HorizontalLayout(new Button("Button 1"), new Button("Button 2")));
  13. setContent(container);
  14. }
  15. }

Container has Row(s).
Row has Col(s).

col-*-*, col-*-offset-*, visible-*, hidden-* styles are available as enum constants.

In the future the library may be extended to support more bootstrap features and components through AbstractJavaScriptComponent. PR’s are welcome.