com.github.gwtbootstrap.client.ui.config
Interface Configurator

All Known Implementing Classes:
DefaultConfigurator, ResponsiveConfigurator

public interface Configurator

Using custom CSS/JS resources.

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 file
 
2. 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 to your module xml ( *.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.

Since:
2.0.4.0
Author:
Dominik Mayer, ohashi keisuke, Carlos A Becker
See Also:
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

getResources

Resources getResources()
Get the Bootstrap Resources that should be used for this project.

Returns:
the Bootstrap Resources

hasResponsiveDesign

boolean hasResponsiveDesign()
Determines whether the project uses a responsive design.

If the responsive design is enabled, the interface can adapt to the screen size and show different content on smartphones, tablets and desktop computers.

Returns:
true if the responsive features should be enabled. Default: false
See Also:
IsResponsive, Bootstrap documentation


Copyright © 2012 gwtbootstrap. All Rights Reserved.