[英]How to use GWTBootstrap with Eclipse
I downloaded the Twitter Bootstrap for GWT zip from https://github.com/gwtbootstrap/gwt-bootstrap . 我从https://github.com/gwtbootstrap/gwt-bootstrap下载了适用于GWT的Twitter Bootstrap。 I am new to GWT and I haven't yet found proper documentation or a tutorial on how to use the libraries with Eclipse.
我是GWT的新手,但是还没有找到适当的文档或有关如何在Eclipse中使用库的教程。
As it's created as a maven
project, you need to use m2eclipse
plugin. 由于它是作为
maven
项目创建的,因此您需要使用m2eclipse
插件。 You can start with cloning that outside eclipse and then you can import it into eclipse as an existing maven project. 您可以从克隆外部eclipse开始,然后可以将其作为现有的maven项目导入eclipse中。
m2eclipse
plugin will help you in doing that. m2eclipse
插件将帮助您做到这一点。 For exact steps or tutorial, you can just google. 对于确切的步骤或教程,您可以只谷歌。
If you are using maven build, configure m2eclipse in eclipse and go through Getting Started With GWT Bootstrap 如果您使用的是maven build,请在eclipse中配置m2eclipse并执行GWT Bootstrap入门
STEP 1-A : add gwt-bootstrap
maven dependency in pom.xml
步骤1-A:在
pom.xml
添加gwt-bootstrap
maven依赖项
<!-- gwt-bootstrap dependencies start -->
<dependency>
<groupId>com.github.gwtbootstrap</groupId>
<artifactId>gwt-bootstrap</artifactId>
<version>2.1.0.0-SNAPSHOT</version>
</dependency>
<!-- gwt-bootstrap dependencies end -->
STEP 1-B : add gwt-bootstrap
maven repository in pom.xml
步骤1-B:在
pom.xml
添加gwt-bootstrap
Maven存储库
<repository>
<id>sonatype</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>false</enabled></releases>
</repository>
STEP 2 : Configuring module - inherit the GWT-Bootstrap widget library 步骤2:配置模块 -继承GWT-Bootstrap小部件库
<!-- inherit the GWT-Bootstrap widget library -->
<inherits name="com.github.gwtbootstrap.Bootstrap"/>
<!-- end of inherit the GWT-Bootstrap widget library -->
STEP 3 : using in UiBinder 步骤3:在UiBinder中使用
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:w="urn:import:com.zcode.t.client.ui.widget"
xmlns:c="urn:import:com.google.gwt.user.cellview.client"
xmlns:gwt="urn:import:com.google.gwt.user.cellview.client"
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"
>
<g:HTMLPanel>
<b:Button ui:field="saveBtn"/>
</g:HTMLPanel>
</ui:UiBinder>
If you don't want to use maven, you can follow these steps: 如果您不想使用Maven,则可以按照以下步骤操作:
Add the .jar file to your build path of Eclipse project 将.jar文件添加到Eclipse项目的构建路径中
Add to your Module.gwt.xml
file: 添加到您的
Module.gwt.xml
文件中:
<inherits name ="com.github.gwtbootstrap.Bootstrap"/>
Now you can use gwtbootstrap
with only-Java code or UIBinder 现在,您可以将
gwtbootstrap
与仅Java代码或UIBinder一起使用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.