summaryrefslogtreecommitdiffstats
path: root/web-gui/logging/source/class/logging/list/List.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-gui/logging/source/class/logging/list/List.js')
-rw-r--r--web-gui/logging/source/class/logging/list/List.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/web-gui/logging/source/class/logging/list/List.js b/web-gui/logging/source/class/logging/list/List.js
new file mode 100644
index 0000000..34560a9
--- /dev/null
+++ b/web-gui/logging/source/class/logging/list/List.js
@@ -0,0 +1,65 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/**
+ * This is the main application class of your custom application "logging"
+ */
+qx.Class.define("logging.list.List",
+{
+extend : qx.ui.container.Scroll,
+
+/*
+*****************************************************************************
+ PROPERTIES
+*****************************************************************************
+*/
+properties: {
+ appearance: {
+ refine: true,
+ init: "list"
+ },
+ maxSize: {
+ init: 200,
+ check: "Integer",
+ apply: "__applyMaxSize"
+ }
+},
+
+construct: function() {
+ this.__list = new qx.ui.container.Composite(new qx.ui.layout.VBox());
+ this.base(arguments, this.__list);
+},
+destruct: function() {
+ this._disposeObjects("__list");
+},
+
+/*
+*****************************************************************************
+ MEMBERS
+*****************************************************************************
+*/
+members :
+{
+ __list: null,
+ __last: false,
+
+ addLine: function(text) {
+ this.__last = !this.__last;
+ var l = new logging.list.Line(text, this.__last);
+ this.__list.add(l);
+ this.__applyMaxSize(this.getMaxSize());
+ },
+ __applyMaxSize: function(val) {
+ while (this.__list.getChildren().length > val)
+ this.__list.removeAt(0);
+ }
+}
+});
+