How to use GWTBootstrap with Eclipse

5.6k Views Asked by At

I downloaded the Twitter Bootstrap for GWT zip from https://github.com/gwtbootstrap/gwt-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.

3

There are 3 best solutions below

1
On

As it's created as a maven project, you need to use m2eclipse plugin. You can start with cloning that outside eclipse and then you can import it into eclipse as an existing maven project. m2eclipse plugin will help you in doing that. For exact steps or tutorial, you can just google.

0
On

If you don't want to use maven, you can follow these steps:

  1. Download a version of library from here.

  2. Add the .jar file to your build path of Eclipse project

  3. Add to your Module.gwt.xml file:

<inherits name ="com.github.gwtbootstrap.Bootstrap"/>

Now you can use gwtbootstrap with only-Java code or UIBinder

0
On

If you are using maven build, configure m2eclipse in eclipse and go through Getting Started With GWT Bootstrap

The steps include :

STEP 1-A : add gwt-bootstrap maven dependency in pom.xml

 <!-- 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

 <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

<!--  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

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