summaryrefslogtreecommitdiff
path: root/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type
diff options
context:
space:
mode:
Diffstat (limited to 'webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type')
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Range.js87
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Selection.js120
-rw-r--r--webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/StringBuilder.js146
-rwxr-xr-xwebapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Version.js118
4 files changed, 471 insertions, 0 deletions
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Range.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Range.js
new file mode 100644
index 0000000000..848550b7ae
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Range.js
@@ -0,0 +1,87 @@
+/* ************************************************************************
+
+ 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)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+
+************************************************************************ */
+
+/**
+ * This manager is used by all objects which needs ranges like qx.ui.form.Spinner, ...
+ *
+ * @event change {qx.event.type.Event}
+ */
+qx.OO.defineClass("qx.type.Range", qx.core.Target,
+function() {
+ qx.core.Target.call(this);
+});
+
+/** current value of the Range object */
+qx.OO.addProperty({ name : "value", type : "number", defaultValue : 0 });
+
+/** minimal value of the Range object */
+qx.OO.addProperty({ name : "min", type : "number", defaultValue : 0 });
+
+/** maximal value of the Range object */
+qx.OO.addProperty({ name : "max", type : "number", defaultValue : 100 });
+
+/** Step size for increments/decrements of the value property */
+qx.OO.addProperty({ name : "step", type : "number", defaultValue : 1 });
+
+qx.Proto._checkValue = function(propValue) {
+ return Math.max(this.getMin(), Math.min(this.getMax(), Math.floor(propValue)));
+}
+
+qx.Proto._modifyValue = function(propValue, propOldValue, propData)
+{
+ if (this.hasEventListeners("change")) {
+ this.dispatchEvent(new qx.event.type.Event("change"), true);
+ }
+
+ return true;
+}
+
+qx.Proto._checkMax = function(propValue) {
+ return Math.floor(propValue);
+}
+
+qx.Proto._modifyMax = function(propValue, propOldValue, propData)
+{
+ this.setValue(Math.min(this.getValue(), propValue));
+
+ if (this.hasEventListeners("change")) {
+ this.dispatchEvent(new qx.event.type.Event("change"), true);
+ }
+
+ return true;
+}
+
+qx.Proto._checkMin = function(propValue) {
+ return Math.floor(propValue);
+}
+
+qx.Proto._modifyMin = function(propValue, propOldValue, propData)
+{
+ this.setValue(Math.max(this.getValue(), propValue));
+
+ if (this.hasEventListeners("change")) {
+ this.dispatchEvent(new qx.event.type.Event("change"), true);
+ }
+
+ return true;
+}
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Selection.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Selection.js
new file mode 100644
index 0000000000..61f0be7ef1
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Selection.js
@@ -0,0 +1,120 @@
+/* ************************************************************************
+
+ 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)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+
+
+************************************************************************ */
+
+/*!
+ Helper for qx.manager.selection.SelectionManager, contains data for selections
+*/
+qx.OO.defineClass("qx.type.Selection", qx.core.Object,
+function(vManager)
+{
+ qx.core.Object.call(this);
+
+ this._manager = vManager;
+ this.removeAll();
+});
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ USER METHODS
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.add = function(oItem) {
+ this._storage[this.getItemHashCode(oItem)] = oItem;
+}
+
+qx.Proto.remove = function(oItem) {
+ delete this._storage[this.getItemHashCode(oItem)];
+}
+
+qx.Proto.removeAll = function() {
+ this._storage = {};
+}
+
+qx.Proto.contains = function(oItem) {
+ return this.getItemHashCode(oItem) in this._storage;
+}
+
+qx.Proto.toArray = function()
+{
+ var res = [];
+
+ for (var key in this._storage) {
+ res.push(this._storage[key]);
+ }
+
+ return res;
+}
+
+qx.Proto.getFirst = function()
+{
+ for (var key in this._storage) {
+ return this._storage[key];
+ }
+}
+
+qx.Proto.getChangeValue = function()
+{
+ var sb = [];
+
+ for (var hc in this._storage) {
+ sb.push(hc);
+ }
+
+ sb.sort();
+ return sb.join(";");
+}
+
+qx.Proto.getItemHashCode = function(oItem) {
+ return this._manager.getItemHashCode(oItem);
+}
+
+qx.Proto.isEmpty = function() {
+ return qx.lang.Object.isEmpty(this._storage);
+}
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DISPOSER
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.dispose = function()
+{
+ if (this.getDisposed()) {
+ return;
+ }
+
+ this._storage = null;
+ this._manager = null;
+
+ qx.core.Object.prototype.dispose.call(this);
+} \ No newline at end of file
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/StringBuilder.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/StringBuilder.js
new file mode 100644
index 0000000000..c31102c8b1
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/StringBuilder.js
@@ -0,0 +1,146 @@
+/* ************************************************************************
+
+ 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)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#require(qx.sys.Client)
+
+************************************************************************ */
+
+/**
+ * A string builder class
+ * <p>
+ * += operator is faster in Firefox and Opera.
+ * Array push/join is faster in Internet Explorer
+ * </p><p>
+ * Even with this wrapper, which costs some time, this is
+ * faster in Firefox than the alternative Array concat in
+ * all browsers (which is in relation to IE's performance issues
+ * only marginal). The IE performance loss caused by this
+ * wrapper is not relevant.
+ * </p><p>
+ * So this class seems to be the best compromise to handle
+ * string concatination.</p>
+ */
+qx.OO.defineClass("qx.type.StringBuilder", qx.core.Object,
+function()
+{
+ qx.core.Object.call(this);
+
+ this.init();
+ this.add.apply(this, arguments);
+});
+
+
+/**
+ * Resets the contents of the Stringbuilder
+ * equivalent to <pre>str = ""; </pre>
+ */
+qx.Proto.clear = function() {}
+
+/**
+ * Returns the contents of the concatenated string
+ *
+ * @return (string) string content
+ */
+qx.Proto.get = function() {}
+
+/**
+ * Append a variable number of string arguments
+ *
+ * @param varargs (string) variable number os strings to be added
+ */
+qx.Proto.add = function(varargs) {}
+
+/**
+ * Initializes the contents of the Stringbuilder
+ * equivalent to <pre>str = ""; </pre>
+ */
+qx.Proto.init = function() {}
+
+/** Destructor */
+qx.Proto.dispose = function() {}
+
+/**
+ * Returns the contents of the concatenated string
+ *
+ * @return (string) string content
+ */
+qx.Proto.toString = function() {}
+
+
+if (qx.sys.Client.getInstance().isMshtml())
+{
+ qx.Proto.clear = function() {
+ this._array = [];
+ }
+
+ qx.Proto.get = function() {
+ return this._array.join("");
+ }
+
+ qx.Proto.add = function() {
+ this._array.push.apply(this._array, arguments);
+ }
+
+ qx.Proto.init = function() {
+ this._array = [];
+ }
+
+ qx.Proto.dispose = function()
+ {
+ if (this.getDisposed()) {
+ return;
+ }
+
+ this._array = null;
+
+ qx.core.Object.prototype.dispose.call(this);
+ }
+}
+else
+{
+ qx.Proto.clear = function() {
+ this._string = "";
+ }
+
+ qx.Proto.get = function() {
+ return this._string;
+ }
+
+ qx.Proto.add = function() {
+ this._string += Array.prototype.join.call(arguments, "");
+ }
+
+ qx.Proto.init = function() {
+ this._string = "";
+ }
+
+ qx.Proto.dispose = function()
+ {
+ if (this.getDisposed()) {
+ return;
+ }
+
+ this._string = null;
+
+ qx.core.Object.prototype.dispose.call(this);
+ }
+}
+
+qx.Proto.toString = qx.Proto.get;
diff --git a/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Version.js b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Version.js
new file mode 100755
index 0000000000..e0ce4ec53a
--- /dev/null
+++ b/webapps/qooxdoo-0.6.3-sdk/frontend/framework/source/class/qx/type/Version.js
@@ -0,0 +1,118 @@
+/* ************************************************************************
+
+ 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)
+
+************************************************************************ */
+
+/* ************************************************************************
+
+
+************************************************************************ */
+
+/*!
+ This class contains a version string and can extract
+ major, minor and revision flags from this string. It can also
+ compare a incoming version object with the stored version string
+ and checks if this version is smaller or identical than the stored
+ one.
+
+ Flash detection and embed (http://blog.deconcept.com/flashobject) (non qooxdoo Version by Geoff Stearns)
+ Copyright 2005 Geoff Stearns. Released under the MIT License (http://www.opensource.org/licenses/mit-license.php).
+
+ Modified for qooxdoo by Sebastian Werner. Based on version 1.2.3. Relicensed under LGPL in assent of Geoff Stearns.
+*/
+
+qx.OO.defineClass("qx.type.Version", qx.core.Object,
+function(arrVersion)
+{
+ qx.core.Object.call(this);
+
+ if (typeof arrVersion === "string") {
+ arrVersion = arrVersion.split(".");
+ }
+
+ this._major = parseInt(arrVersion[0]) || 0;
+ this._minor = parseInt(arrVersion[1]) || 0;
+ this._rev = parseInt(arrVersion[2]) || 0;
+});
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DATA FIELDS
+---------------------------------------------------------------------------
+*/
+
+qx.Proto._major = 0;
+qx.Proto._minor = 0;
+qx.Proto._rev = 0;
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ USER VERSION ACCESS
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.versionIsValid = function(fv)
+{
+ if (this.getMajor() < fv.getMajor()) return false;
+ if (this.getMajor() > fv.getMajor()) return true;
+
+ if (this.getMinor() < fv.getMinor()) return false;
+ if (this.getMinor() > fv.getMinor()) return true;
+
+ if (this.getRev() < fv.getRev()) return false;
+
+ return true;
+}
+
+qx.Proto.getMajor = function() {
+ return this._major;
+}
+
+qx.Proto.getMinor = function() {
+ return this._minor;
+}
+
+qx.Proto.getRev = function() {
+ return this._rev;
+}
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DISPOSER
+---------------------------------------------------------------------------
+*/
+
+qx.Proto.dispose = function()
+{
+ if (this.getDisposed()) {
+ return;
+ }
+
+ this._major = this._minor = this._rev = null;
+
+ qx.core.Object.prototype.dispose.call(this);
+}