简体   繁体   English

如何在Eclipse中使用GWTBootstrap

[英]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入门

The steps include : 步骤包括:

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,则可以按照以下步骤操作:

  1. Download a version of library from here . 此处下载库的版本。

  2. Add the .jar file to your build path of Eclipse project 将.jar文件添加到Eclipse项目的构建路径中

  3. 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM