From 626bb8efb0c825f332c937ffaaadc9b402079539 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Wed, 3 Jan 2007 20:17:37 +0000 Subject: r20517: re-add cleaned-up webapps (This used to be commit 5a3d6ad0b7cf0ecf8b57b4088b19f7d4291c990b) --- .../class/qx/renderer/theme/AppearanceTheme.js | 164 +++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/renderer/theme/AppearanceTheme.js (limited to 'webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/renderer/theme/AppearanceTheme.js') diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/renderer/theme/AppearanceTheme.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/renderer/theme/AppearanceTheme.js new file mode 100644 index 0000000000..57cb643fb7 --- /dev/null +++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/renderer/theme/AppearanceTheme.js @@ -0,0 +1,164 @@ +/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2004-2006 by 1&1 Internet AG, Germany, http://www.1and1.org + + License: + LGPL 2.1: http://www.gnu.org/licenses/lgpl.html + + Authors: + * Sebastian Werner (wpbasti) + * Andreas Ecker (ecker) + +************************************************************************ */ + +/* ************************************************************************ + +#module(ui_core) + +************************************************************************ */ + +qx.OO.defineClass("qx.renderer.theme.AppearanceTheme", qx.core.Object, +function(vTitle) +{ + qx.core.Object.call(this); + + this.setTitle(vTitle); +}); + + + + +/* +--------------------------------------------------------------------------- + PROPERTIES +--------------------------------------------------------------------------- +*/ + +qx.OO.addProperty({ name : "title", type : "string", allowNull : false, defaultValue : "" }); + + + + + +/* +--------------------------------------------------------------------------- + DATA +--------------------------------------------------------------------------- +*/ + +qx.Proto._appearances = {}; + + + + + +/* +--------------------------------------------------------------------------- + CORE METHODS +--------------------------------------------------------------------------- +*/ + +qx.Proto.registerAppearance = function(vId, vData) { + this._appearances[vId] = vData; +} + +qx.Proto.getAppearance = function(vId) { + return this._appearances[vId]; +} + +qx.Proto.setupAppearance = function(vAppearance) +{ + if (!vAppearance._setupDone) + { + if (vAppearance.setup) { + vAppearance.setup(this); + } + + vAppearance._setupDone = true; + } +} + + + + + + + + +/* +--------------------------------------------------------------------------- + WIDGET METHODS +--------------------------------------------------------------------------- +*/ + +qx.Proto.initialFrom = function(vId) +{ + var vAppearance = this.getAppearance(vId); + if (vAppearance) + { + this.setupAppearance(vAppearance); + + try + { + return vAppearance.initial ? vAppearance.initial(this) : {} + } + catch(ex) + { + this.error("Couldn't apply initial appearance", ex); + } + } + else + { + return this.error("Missing appearance: " + vId); + } +} + +qx.Proto.stateFrom = function(vId, vStates) +{ + var vAppearance = this.getAppearance(vId); + if (vAppearance) + { + this.setupAppearance(vAppearance); + + try + { + return vAppearance.state ? vAppearance.state(this, vStates) : {} + } + catch(ex) + { + this.error("Couldn't apply state appearance", ex); + } + } + else + { + return this.error("Missing appearance: " + vId); + } +} + + + + + + + +/* +--------------------------------------------------------------------------- + DISPOSER +--------------------------------------------------------------------------- +*/ + +qx.Proto.dispose = function() +{ + if (this.getDisposed()) { + return; + } + + this._appearances = null; + + return qx.core.Object.prototype.dispose.call(this); +} -- cgit