diff options
Diffstat (limited to 'webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/ui/form/ListItem.js')
-rw-r--r-- | webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/ui/form/ListItem.js | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/ui/form/ListItem.js b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/ui/form/ListItem.js new file mode 100644 index 0000000000..4d8bc34977 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/source/class/qx/ui/form/ListItem.js @@ -0,0 +1,117 @@ +/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2004-2007 1&1 Internet AG, Germany, http://www.1and1.org + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Sebastian Werner (wpbasti) + * Andreas Ecker (ecker) + +************************************************************************ */ + +/* ************************************************************************ + +#module(ui_form) + +************************************************************************ */ + +/** + * @event action {qx.event.type.Event} (Fired by {@link qx.ui.form.List}) + */ +qx.OO.defineClass("qx.ui.form.ListItem", qx.ui.basic.Atom, +function(vText, vIcon, vValue) +{ + qx.ui.basic.Atom.call(this, vText, vIcon); + + if (vValue != null) { + this.setValue(vValue); + } + + + // ************************************************************************ + // EVENT LISTENER + // ************************************************************************ + this.addEventListener("dblclick", this._ondblclick); +}); + +qx.OO.changeProperty({ name : "appearance", type : "string", defaultValue : "list-item" }); +qx.OO.addProperty({ name : "value" }); + + + + + +/* +--------------------------------------------------------------------------- + STATE +--------------------------------------------------------------------------- +*/ + +qx.Proto.handleStateChange = function() +{ + if (this.hasState("lead")) + { + this.setStyleProperty("MozOutline", "1px dotted invert"); + this.setStyleProperty("outline", "1px dotted invert"); + } + else + { + this.removeStyleProperty("MozOutline"); + this.setStyleProperty("outline", "0px none"); + } +} + +// Remove default outline focus border +qx.Proto._applyStateStyleFocus = function(vStates) {}; + + + + +/* +--------------------------------------------------------------------------- + UTILITIES +--------------------------------------------------------------------------- +*/ + +qx.Proto.matchesString = function(vText) { + return vText != "" && this.getLabel().toLowerCase().indexOf(vText.toLowerCase()) == 0; +} + +qx.Proto.matchesStringExact = function(vText) { + return vText != "" && this.getLabel().toLowerCase() == String(vText).toLowerCase(); +} + +qx.Proto.matchesValue = function(vText) { + return vText != "" && this.getValue().toLowerCase().indexOf(vText.toLowerCase()) == 0; +} + +qx.Proto.matchesValueExact = function(vText) { + return vText != "" && this.getValue().toLowerCase() == String(vText).toLowerCase(); +} + + + + + +/* +--------------------------------------------------------------------------- + EVENT HANDLER +--------------------------------------------------------------------------- +*/ + +qx.Proto._ondblclick = function(e) +{ + var vCommand = this.getCommand(); + if (vCommand) { + vCommand.execute(); + } +} |