|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Configurator
If you need to adapt resources, create your resource package, add your files and implement this interface, then add a
replace-with tag and public tag to your module xml. Example:
1. Create your Resources package and add css,js directory to that (under your module xml package) and add your resources to adove css,
js directory. (Bootstarp's css filename should be bootstrap.min.css and Bootstrap's js filename should be bootstrap.min.js)
src/main/java/com/example |-- client |-- resources | |-- css | | `-- bootstrap.min.css < your custom css | | `-- bootstrap-responsive.min.css < your custom css | |-- js | | `-- bootstrap.min.js < your custom js | |-- ExampleConfigurator.java < your custom Configurator class | `-- ExampleResources.java < your custom Resources interface |-- server |-- shared `-- Example.gwt.xml < your module xml file2. Create a Resources Interface (extending
Resources) override the
getters of the files you want to replace.
public interface MyResources extends Resources {
@Source("css/bootstrap.min.css")
TextResource bootstrapCss();
@Source("css/bootstrap-responsive.min.css")
TextResource bootstrapResponsiveCss();
}
3. Create a Configurator.
public MyConfigurator implements Configurator {
public Resources getResources() {
return GWT.create(MyResources.class);
}
}
4. Add a replace-with tag, source and public*.gwt.xml):
<source path='resources'/>
<replace-with class="com.example.resources.ExampleConfigurator">
<when-type-is class="com.github.gwtbootstrap.client.ui.config.Configurator"/>
</replace-with>
<public path="resources">
<exclude name="** /*.java"/>
<exclude name="** /*.class"/>
</public>
A more detailed tutorial and a full working example can be found here.
Resources,
DefaultConfigurator| Method Summary | |
|---|---|
Resources |
getResources()
Get the Bootstrap Resources that should be used for this project. |
boolean |
hasResponsiveDesign()
Determines whether the project uses a responsive design. |
| Method Detail |
|---|
Resources getResources()
boolean hasResponsiveDesign()
If the responsive design is enabled, the interface can adapt to the screen size and show different content on smartphones, tablets and desktop computers.
true if the responsive features should be enabled.
Default: falseIsResponsive,
Bootstrap documentation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||