Hello,

I have a problem to include a css file into my GWT project. Actually, I put 
my css file 'mycss.css' into the war directory. Then, I added '<stylesheet 
src="mycss.css"/>' in my gwt.xml and finally, in AuthenticationPage.java, I 
added 'headerPanel.addStyleName("headerPan");' and 
username.addStyleName("textb"); but there aren't any changes. 

I always have this warning message : "WARNING: No file found for: 
/gwtmobileexample/war/mycss.css".

I've tried to change in my gwt.xml the relative path to the css file with 
<stylesheet src="mycss.css"/> , <stylesheet src="war/mycss.css"/> , 
<stylesheet src="./war/mycss.css"/> or <stylesheet src="/war/mycss.css" but 
I always have this same warning message.

Below, this is the source code

Thank you

GWTMobileExample.gwt.xml : 

<?xml version="1.0" encoding="UTF-8"?>
<!--
  When updating your version of GWT, you should also update this DTD 
reference,
  so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
  
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd";>
<module rename-to="gwtmobileexample">
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User'/>
  <inherits name="com.googlecode.mgwt.MGWT"/>
  <inherits name='com.googlecode.mgwt.ui.UI'/>
  <inherits name="com.google.gwt.uibinder.UiBinder"/>
  <inherits name='com.googlecode.mgwt.mvp.MVP'/>
  
    <!-- Inherit the default GWT style sheet.  You can change       -->
  <!-- the theme of your GWT application by uncommenting          -->
  <!-- any one of the following lines.                            -->
  <inherits name='com.google.gwt.user.theme.clean.Clean'/>
   <inherits name='com.google.gwt.user.theme.standard.Standard'/> 
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

  <!-- Specify the app entry point class.                         -->
  <entry-point class='example.client.GWTMobileExample'/>

  <stylesheet src="mycss.css"/>

  <source path='client'/>
  <source path='shared'/>
  

</module>

In the war directory, I added a css file named 'mycss.css' : 

.headerPan {
    background-color:#00bfff;
    color:white;
    font-size:3.0 em;
}

.textb{
    
    background-color : black;
}

AuthentificationPage.ui.xml

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent";>
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    xmlns:g="urn:import:com.google.gwt.user.client.ui"
    xmlns:mgwt="urn:import:com.googlecode.mgwt.ui.client.widget">
    
    
    <mgwt:LayoutPanel>
    <mgwt:HeaderPanel ui:field="headerPanel">
            <mgwt:center>
                <g:HTML ui:field="center">Connection</g:HTML>
            </mgwt:center>
        </mgwt:HeaderPanel>
   
        <mgwt:WidgetList>
            <g:Label>Username</g:Label>
            <mgwt:MTextBox ui:field="username"></mgwt:MTextBox>
            <g:Label>Password</g:Label>
            <mgwt:MPasswordTextBox 
ui:field="password">dsdds</mgwt:MPasswordTextBox>
        </mgwt:WidgetList>
    </mgwt:LayoutPanel>
</ui:UiBinder> 
AuthentificationPage.java : 

package example.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;
import com.googlecode.mgwt.ui.client.MGWTSettings;
import com.googlecode.mgwt.ui.client.widget.HeaderPanel;
import com.googlecode.mgwt.ui.client.widget.MTextBox;

public class AuthenticationPage extends Composite implements HasText {

    @UiField
    HeaderPanel headerPanel;
    
    @UiField
    MTextBox username;
    
    @UiField
    MTextBox password;
    
    private static AuthenticationPageUiBinder uiBinder = GWT
            .create(AuthenticationPageUiBinder.class);

    interface AuthenticationPageUiBinder extends
            UiBinder<Widget, AuthenticationPage> {
    }

    public AuthenticationPage() {
        initWidget(uiBinder.createAndBindUi(this));
        
        headerPanel.addStyleName("headerPan");
        
        username.addStyleName("textb");
        
    }


    public AuthenticationPage(String firstName) {
        initWidget(uiBinder.createAndBindUi(this));
        username.setText("sdsqsq");
        headerPanel.addStyleName("headerPan");
        
        username.addStyleName("textb");
    }


    @Override
    public String getText() {
        // TODO Auto-generated method stub
        return null;
    }


    @Override
    public void setText(String text) {
        // TODO Auto-generated method stub
        
    }


}




-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to