如果您打算在您的GWT应用程序中与引导组件(即NavBar,Caoursel等)进行交互,那么我会选择使用,gwt-bootstrap因为您不必使用JSNI并且可以获得一些类型安全性。
如果您不需要与这些组件交互,或者您HTML在 GWT 应用程序中主要使用 pure,您也可以使用 plainbootstrap并添加相应的类。
编辑代码示例:
绑定器:
<b:NavPills>
<b:AnchorListItem active="true">Item 1</b:AnchorListItem>
<b:AnchorListItem>Item 2</b:AnchorListItem>
<b:AnchorListItem>Item 3</b:AnchorListItem>
<b:AnchorListItem enabled="false">Item 4</b:AnchorListItem>
<b:AnchorListItem pull="RIGHT">Pulled right</b:AnchorListItem>
</b:NavPills>
代码:
NavPills pills = new NavPills();
AnchorListItem item1 = new AnchorListItem("Item 1");
item1.setActive(true);
pills.add(item1);
pills.add(new AnchorListItem("Item 2");
pills.add(new AnchorListItem("Item 3");
...