com.extjs.gxt.ui.client.util.Theme Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxt Show documentation
Show all versions of gxt Show documentation
Rich Internet Application Framework for GWT
/*
* Sencha GXT 2.3.1a - Sencha for GWT
* Copyright(c) 2007-2013, Sencha, Inc.
* [email protected]
*
* http://www.sencha.com/products/gxt/license/
*/
package com.extjs.gxt.ui.client.util;
import java.util.Map;
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.core.FastMap;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.image.gray.GrayImages;
import com.google.gwt.core.client.GWT;
/**
* A UI theme. Themes should be registered via the @link {@link ThemeManager} as
* soon as the application module is loaded (onModuleLoad).
*
* @see Theme#BLUE
* @see Theme#GRAY
*/
public class Theme extends BaseModelData {
/**
* Default GXT blue theme.
*/
public static Theme BLUE;
/**
* GXT gray theme (default path is 'gxt/css/gxt-gray.css').
*/
public static Theme GRAY;
static {
BLUE = new Theme("blue", GXT.MESSAGES.themeSelector_blueTheme(), "gxt-all.css");
GRAY = new Theme("gray", GXT.MESSAGES.themeSelector_grayTheme(), "gxt/css/gxt-gray.css") {
@Override
public void init() {
super.init();
GXT.IMAGES = GWT.create(GrayImages.class);
}
};
}
protected Theme() {
}
/**
* Creates a new theme.
*
* @param id the theme id
* @param name the theme name
* @param file the CSS file
*/
public Theme(String id, String name, String file) {
set("id", id);
set("name", name);
set("file", file);
}
/**
* Returns the theme id.
*
* @return the theme id
*/
public String getId() {
return this. get("id");
}
/**
* Returns the theme name.
*
* @return the theme name
*/
public String getName() {
return this. get("name");
}
/**
* Returns the theme's CSS file.
*
* @return the file including the path
*/
public String getFile() {
return this. get("file");
}
public Map asMap() {
Map map = new FastMap