java - 现有 webapp 的 GWT Bootstrap 响应式设计与屏幕

标签 java css twitter-bootstrap gwt gwt-bootstrap

我有一个使用 GWT 开发的可用 Web 应用程序。现在它必须在平板电脑或更小的屏幕上调整大小,我想到了使用 GWT Bootstrap。但是现有的应用程序在war文件夹下只有一个project.html和project.css文件。目前没有使用 UI Binder 。有四个屏幕显示由 d3js 创建的不同图表。

我的问题是是否仍然可以使用 gwt bootstrap 来调整大小?或者仅使用 Bootstrap 并使用没有任何 UI 绑定(bind)器的 css 文件呢?

哪种方法更好?因为我很困惑,花了几个小时搜索和阅读。

最佳答案

如果您计划在您的 GWT 应用程序中与 Bootstrap 组件(即 NavBarCaoursel 等)进行交互,那么我会选择 gwt-bootstrap 因为您不必使用 JSNI 并且您可以获得一些类型安全性。

如果您不需要与这些组件交互,或者您在 GWT 应用程序中主要使用纯 HTML,您也可以使用普通 bootstrap 并添加相应的类。

编辑代码示例:

UiBinder:

<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");
...

关于java - 现有 webapp 的 GWT Bootstrap 响应式设计与屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25312838/

相关文章:

java - $set 和位置运算符在 Java 中不起作用?

java - RecyclerView 与 Firebase 搜索在搜索时显示所有产品

html - 三个 div 的一个总是在中心

css - 在 1 行中 Bootstrap 2 个背景颜色

html - 使用 Bootstrap 平衡图像的文本叠加

Java NIO 选择器.open() IOException

java - 为什么tomcat自带keystore还需要jssecerts文件

css - 带有 CSS 的 Shiny 进度条

html - 每行独立的文本 block

html - Bootstrap 中的中心药丸