Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's possible, but somewhat complex to do something with a Linker in GWT. The high-level idea would be:</p> <ol> <li>Put all your GWT components in a &lt;div id="gwt">...&lt;/div></li> <li>Add a linker to the GWT Module file that will process CSS files.</li> <li>In the linker, transform the GWT CSS (e.g., standard.css) to insert a #gwt before each selector rule.</li> </ol> <p>The first part is easy, just add an id to your root element.</p> <p>The second part is also easy, simply add code that looks like this to your Module.gwt.xml file:</p> <pre><code>&lt;define-linker name="cssLinker" class="com.you.bootstrap.linker.CssRenamingLinker" /&gt; &lt;add-linker name="cssLinker"/&gt; </code></pre> <p>The hard part is implementing the Linker. It's possible to do parse it by hand, but you might find it easier to use something like <a href="http://www.w3.org/Style/CSS/SAC/" rel="nofollow">SAC</a>.</p> <p>Using the Linker, you can transform your CSS by inserting a #gwt before each selector. Using SAC, you might do that by overriding all the DocumentHandler methods to simply emit each of their arguments to an OutputStream. In DocumentHandler.startSelector() you would first emit "#gwt " before each selector.</p> <p>[Edit] This assumes that GWT's standard.css defines styles that override the bootstrap styles. If not, you might have to 'enhance' the GWT CSS with defaults. There's a list of W3C recommended defaults <a href="http://www.w3.org/TR/CSS2/sample.html" rel="nofollow">here</a>.</p> <p>The benefit is that this is future-resistant - if GWT styles change or if bootstrap styles change, this should be robust.</p> <p>Hope that helps,</p> <p>Adam</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload