1. #1
    Ext GWT Premium Member
    Join Date
    Nov 2007
    Posts
    7
    Vote Rating
    0
    oosthuja is on a distinguished road

      0  

    Default Changing default theme

    Changing default theme


    I have looked at sample of how to change the default theme to something else on start up but cannot get it to work.

    The following is in my onModuleLoad ( first 2 lines).

    This is done in a class which implements LayoutContainer.

    ThemeManager.register(Slate.SLATE);
    GXT.setDefaultTheme(Slate.SLATE, true);

    This does not work the theme stays the blue default theme when I launch the app.

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    2
    gslender is on a distinguished road

      0  

    Default


    did you add the custom themes in the module.gwt.xml ???

  3. #3
    Ext GWT Premium Member
    Join Date
    Nov 2007
    Posts
    7
    Vote Rating
    0
    oosthuja is on a distinguished road

      0  

    Default Should I do that for SLATE ?

    Should I do that for SLATE ?


    <inherits name="com.extjs.gxt.themes.Themes"/>

    What should it be for slate ?

  4. #4
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    2
    gslender is on a distinguished road

      0  

    Default


    ok, the problem is that your base class, with the onModuleLoad is extending a GXT widget (maybe layoutcontainer or contentpanel or window etc??)... as such, it extends Component which calls GXT.init before you've set the default theme.

    You need to have a plain class, that just implement EntryPoint

    Like so....

    Code:
    public class Test implements EntryPoint {
    	public void onModuleLoad() {
    
    		 ThemeManager.register(Slate.SLATE);
    		 GXT.setDefaultTheme(Slate.SLATE, true);

  5. #5
    Ext GWT Premium Member
    Join Date
    Nov 2007
    Posts
    7
    Vote Rating
    0
    oosthuja is on a distinguished road

      0  

    Default No luck

    No luck


    I have removed all my code and just have the following but this no luck

    public class LifeCockpit implements com.google.gwt.core.client.EntryPoint{

    final Viewport v = new Viewport();

    public void onModuleLoad() {

    ThemeManager.register(Slate.SLATE);
    GXT.setDefaultTheme(Slate.SLATE, true);


    RootPanel.get().add(new Button("test"));

    MessageBox.alert("test", "test", null);

    }
    }

  6. #6
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    2
    gslender is on a distinguished road

      0  

    Default


    remove the final Viewport v = new Viewport() - this creates an Component class (and calls GXT.init) before you set the default theme... remember as I said before.

    try just this...
    Code:
    public void onModuleLoad() {
    
    ThemeManager.register(Slate.SLATE);
    GXT.setDefaultTheme(Slate.SLATE, true);
    
    
    RootPanel.get().add(new Button("test"));
    
    MessageBox.alert("test", "test", null);
    
    }
    }

  7. #7
    Ext User
    Join Date
    Oct 2008
    Posts
    126
    Vote Rating
    0
    LINEMAN78 is on a distinguished road

      0  

    Default


    If you aren't planning on having the switcher in you UI, you can just put this in your html head tag

    Code:
    <link rel="stylesheet" type="text/css" href="css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="css/xtheme-slate.css" />

  8. #8
    Ext User pedrosousa's Avatar
    Join Date
    Oct 2008
    Location
    Portugal [Aveiro]
    Posts
    17
    Vote Rating
    0
    pedrosousa is on a distinguished road

      0  

    Default


    Hi,

    You need to do something like this:

    Code:
    public class App implements EntryPoint {
        private Viewport viewport;
    
        public Layout() {
        }
    
        public void onModuleLoad() {
            // Themes
            ThemeManager.register(Slate.SLATE);
            GXT.setDefaultTheme(Slate.SLATE, true);
            viewport = new Viewport() {
                @Override
                protected void onRender(Element parent, int pos) {
                    super.onRender(parent, pos);
                }
            };
            RootPanel.get().add(viewport);
        }
    }
    If you extend your class from Viewport the GXT.init() is executed first than GXT.setDefaultTheme(...).

    Regards,
    --
    Pedro Sousa

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar