flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Renamed TextPromptController to TextPromptBead and re-packaged it. Added PanelView, TitleBarModel, and PanelModel to JavaScript framework.
Date Thu, 01 Aug 2013 19:08:27 GMT
Updated Branches:
  refs/heads/develop 3f7a2ff7b -> 9619b7072


Renamed TextPromptController to TextPromptBead and re-packaged it. Added PanelView, TitleBarModel,
and PanelModel to JavaScript framework.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9619b707
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9619b707
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9619b707

Branch: refs/heads/develop
Commit: 9619b70725b146cdb58e9a1bdef20442c147b953
Parents: 3f7a2ff
Author: Peter Ent <pent@apache.org>
Authored: Thu Aug 1 15:08:13 2013 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Thu Aug 1 15:08:13 2013 -0400

----------------------------------------------------------------------
 frameworks/as/basic-manifest.xml                |   2 +-
 frameworks/as/src/FlexJSUIClasses.as            |   2 +-
 .../html/staticControls/beads/TextPromptBead.as |  91 ++++++++++++++
 .../beads/controllers/TextPromptController.as   |  91 --------------
 .../FlexJS/src/org/apache/flex/core/UIBase.js   |  56 +++++++++
 .../flex/html/staticControls/ControlBar.js      |   3 +-
 .../flex/html/staticControls/NumericStepper.js  |   4 +-
 .../apache/flex/html/staticControls/Panel.js    |  91 ++++++++++++--
 .../apache/flex/html/staticControls/Slider.js   |  17 ++-
 .../apache/flex/html/staticControls/TitleBar.js |  55 +++++++--
 .../flex/html/staticControls/beads/PanelView.js |  59 ++++++++++
 .../html/staticControls/beads/TextPromptBead.js |  38 ++++++
 .../staticControls/beads/models/PanelModel.js   | 118 +++++++++++++++++++
 .../beads/models/TitleBarModel.js               | 118 +++++++++++++++++++
 14 files changed, 617 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/as/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/basic-manifest.xml b/frameworks/as/basic-manifest.xml
index 1fe3bbc..776673c 100644
--- a/frameworks/as/basic-manifest.xml
+++ b/frameworks/as/basic-manifest.xml
@@ -59,6 +59,6 @@
     <component id="NumericStepper" class="org.apache.flex.html.staticControls.NumericStepper"
/>
     <component id="TextFieldItemRenderer" class="org.apache.flex.html.staticControls.supportClasses.TextFieldItemRenderer"/>
     <component id="ScrollBar" class="org.apache.flex.html.staticControls.supportClasses.ScrollBar"/>
-    <component id="TextPromptController" class="org.apache.flex.html.staticControls.beads.controllers.TextPromptController"
/>
+    <component id="TextPromptBead" class="org.apache.flex.html.staticControls.beads.TextPromptBead"
/>
 
 </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/as/src/FlexJSUIClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/FlexJSUIClasses.as b/frameworks/as/src/FlexJSUIClasses.as
index 8549274..44f748d 100644
--- a/frameworks/as/src/FlexJSUIClasses.as
+++ b/frameworks/as/src/FlexJSUIClasses.as
@@ -51,6 +51,7 @@ internal class FlexJSUIClasses
     import org.apache.flex.html.staticControls.beads.TextFieldView; TextFieldView;
     import org.apache.flex.html.staticControls.beads.TextInputView; TextInputView;
     import org.apache.flex.html.staticControls.beads.TextInputWithBorderView; TextInputWithBorderView;
+	import org.apache.flex.html.staticControls.beads.TextPromptBead; TextPromptBead;
     import org.apache.flex.html.staticControls.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;
     import org.apache.flex.html.staticControls.beads.models.AlertModel; AlertModel;
     import org.apache.flex.html.staticControls.beads.models.ArraySelectionModel; ArraySelectionModel;
@@ -67,7 +68,6 @@ internal class FlexJSUIClasses
     import org.apache.flex.html.staticControls.beads.controllers.ListSingleSelectionMouseController;
ListSingleSelectionMouseController;
 	import org.apache.flex.html.staticControls.beads.controllers.SliderMouseController; SliderMouseController;
 	import org.apache.flex.html.staticControls.beads.controllers.SpinnerMouseController; SpinnerMouseController;
-	import org.apache.flex.html.staticControls.beads.controllers.TextPromptController; TextPromptController;
     import org.apache.flex.html.staticControls.beads.controllers.VScrollBarMouseController;
VScrollBarMouseController;
     import org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalScrollingLayout;
NonVirtualVerticalScrollingLayout;    
     import org.apache.flex.html.staticControls.beads.layouts.VScrollBarLayout; VScrollBarLayout;
   

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextPromptBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextPromptBead.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextPromptBead.as
new file mode 100644
index 0000000..0b74209
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextPromptBead.as
@@ -0,0 +1,91 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.staticControls.beads
+{
+	import flash.text.TextFieldType;
+	
+	import org.apache.flex.core.CSSTextField;
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	
+	public class TextPromptBead implements IBead
+	{
+		public function TextPromptBead()
+		{
+		}
+		
+		private var _prompt:String;
+		public function get prompt():String
+		{
+			return _prompt;
+		}
+		public function set prompt(value:String):void
+		{
+			_prompt = value;
+		}
+		
+		private var _strand:IStrand;
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			// listen for changes in text to hide or show the prompt
+			var model:Object = UIBase(_strand).model;
+			if (!model.hasOwnProperty("text")) {
+				throw new Error("Model requires a text property when used with TextPromptBead");
+			}
+			IEventDispatcher(model).addEventListener("textChange",handleTextChange);
+			
+			// create a TextField that displays the prompt - it shows
+			// and hides based on the model's content
+			promptField = new CSSTextField();
+			promptField.selectable = false;
+			promptField.type = TextFieldType.DYNAMIC;
+			promptField.mouseEnabled = false;
+			promptField.multiline = false;
+			promptField.wordWrap = false;
+			
+			// trigger the event handler to display if needed
+			handleTextChange(null);
+		}
+		
+		private var promptField:CSSTextField;
+		private var promptAdded:Boolean;
+		
+		private function handleTextChange( event:Event ):void
+		{	
+			// see what the model currently has to determine if the prompt should be
+			// displayed or not.
+			var model:Object = UIBase(_strand).model;
+			
+			if (model.text != null && model.text.length > 0 ) {
+				if (promptAdded) UIBase(_strand).removeChild(promptField);
+				promptAdded = false;
+			}
+			else {
+				if (!promptAdded) UIBase(_strand).addChild(promptField);
+				promptField.text = prompt;
+				promptAdded = true;
+			}
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/TextPromptController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/TextPromptController.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/TextPromptController.as
deleted file mode 100644
index 78dc4b5..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/TextPromptController.as
+++ /dev/null
@@ -1,91 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
-{
-	import flash.text.TextFieldType;
-	
-	import org.apache.flex.core.CSSTextField;
-	import org.apache.flex.core.IBead;
-	import org.apache.flex.core.IStrand;
-	import org.apache.flex.core.UIBase;
-	import org.apache.flex.events.Event;
-	import org.apache.flex.events.IEventDispatcher;
-	
-	public class TextPromptController implements IBead
-	{
-		public function TextPromptController()
-		{
-		}
-		
-		private var _prompt:String;
-		public function get prompt():String
-		{
-			return _prompt;
-		}
-		public function set prompt(value:String):void
-		{
-			_prompt = value;
-		}
-		
-		private var _strand:IStrand;
-		public function set strand(value:IStrand):void
-		{
-			_strand = value;
-			
-			// listen for changes in text to hide or show the prompt
-			var model:Object = UIBase(_strand).model;
-			if (!model.hasOwnProperty("text")) {
-				throw new Error("Model requires a text property when used with TextPromptController");
-			}
-			IEventDispatcher(model).addEventListener("textChange",handleTextChange);
-			
-			// create a TextField that displays the prompt - it shows
-			// and hides based on the model's content
-			promptField = new CSSTextField();
-			promptField.selectable = false;
-			promptField.type = TextFieldType.DYNAMIC;
-			promptField.mouseEnabled = false;
-			promptField.multiline = false;
-			promptField.wordWrap = false;
-			
-			// trigger the event handler to display if needed
-			handleTextChange(null);
-		}
-		
-		private var promptField:CSSTextField;
-		private var promptAdded:Boolean;
-		
-		private function handleTextChange( event:Event ):void
-		{	
-			// see what the model currently has to determine if the prompt should be
-			// displayed or not.
-			var model:Object = UIBase(_strand).model;
-			
-			if (model.text != null && model.text.length > 0 ) {
-				if (promptAdded) UIBase(_strand).removeChild(promptField);
-				promptAdded = false;
-			}
-			else {
-				if (!promptAdded) UIBase(_strand).addChild(promptField);
-				promptField.text = prompt;
-				promptAdded = true;
-			}
-		}
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
index a269909..f8e212d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -69,6 +69,7 @@ org.apache.flex.core.UIBase.prototype.createElement = function() {
  */
 org.apache.flex.core.UIBase.prototype.addElement = function(c) {
   this.element.appendChild(c.element);
+  c.addedToParent();
 };
 
 /**
@@ -84,6 +85,7 @@ org.apache.flex.core.UIBase.prototype.addElementAt = function(c, index)
{
   {
     this.element.insertBefore(c.element,
             this.getChildAt(index));
+    c.addedToParent();
   }
 };
 
@@ -111,6 +113,60 @@ org.apache.flex.core.UIBase.prototype.removeElement = function(c) {
   this.element.removeChild(c.element);
 };
 
+/**
+ * @this {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.core.UIBase.prototype.addedToParent = function() {
+  
+};
+
+
+/**
+ * @this {org.apache.flex.core.UIBase}
+ * @param {Object} bead The bead to be added.
+ */
+org.apache.flex.core.UIBase.prototype.addBead = function(bead) {
+  if (!this.beads_) {
+    this.beads_ = new Array();
+  }
+  this.beads_.push(bead);
+  bead.strand = this;
+};
+
+
+/**
+ * @this {org.apache.flex.core.UIBase}
+ * @param {Class} classOrInterface A type or interface.
+ * @return {Object} The bead of the given type or null.
+ */
+org.apache.flex.core.UIBase.prototype.getBeadByType = 
+function(classOrInterface) {
+  for (var i=0; i < beads_.length; i++) {
+      var bead = beads_[i];
+      if (bead instanceof classOrInterface) {
+        return bead;
+      }
+  }
+  return null;
+};
+
+
+/**
+ * @this {org.apache.flex.core.UIBase}
+ * @param {Object} value The bead to be removed.
+ * @return {Object} The bead that was removed.
+ */
+org.apache.flex.core.UIBase.prototype.removeBead =
+function(value) {
+  var n = beads_.length;
+  for (var i=0; i < n; i++) {
+    var bead = beads_[i];
+    if (bead == value) {
+      beads_.splice(i,1);
+      return bead;
+    }
+  }
+};
 
 /**
  * @expose

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ControlBar.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ControlBar.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ControlBar.js
index cf6cfc4..b5badd7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ControlBar.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ControlBar.js
@@ -38,10 +38,9 @@ org.apache.flex.html.staticControls.ControlBar.prototype.createElement
=
     function(p) {
 
   this.element = document.createElement('div');
+  this.element.className = 'ControlBar';
   this.element.style.display = 'inline';
 
   this.positioner = this.element;
   this.element.flexjs_wrapper = this;
-
-  this.set_className('ControlBar');
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js
index 7153e97..39d302d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js
@@ -47,11 +47,11 @@ org.apache.flex.html.staticControls.NumericStepper.prototype.createElement
=
   this.positioner = this.element;
 
   this.input = new org.apache.flex.html.staticControls.TextInput();
-  this.addElement(input);
+  this.addElement(this.input);
   this.input.positioner.style.display = 'inline-block';
 
   this.spinner = new org.apache.flex.html.staticControls.Spinner();
-  this.addElement(spinner);
+  this.addElement(this.spinner);
   this.spinner.positioner.style.display = 'inline-block';
   goog.events.listen(this.spinner, 'valueChanged',
                 goog.bind(this.handleSpinnerChange, this));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
index 3935488..8a14d6e 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
@@ -17,6 +17,8 @@ goog.provide('org.apache.flex.html.staticControls.Panel');
 goog.require('org.apache.flex.html.staticControls.Container');
 goog.require('org.apache.flex.html.staticControls.ControlBar');
 goog.require('org.apache.flex.html.staticControls.TitleBar');
+goog.require('org.apache.flex.html.staticControls.beads.PanelView');
+goog.require('org.apache.flex.html.staticControls.beads.models.PanelModel');
 
 
 
@@ -25,11 +27,73 @@ goog.require('org.apache.flex.html.staticControls.TitleBar');
  * @extends {org.apache.flex.html.staticControls.Container}
  */
 org.apache.flex.html.staticControls.Panel = function() {
+  this.model_ = new org.apache.flex.html.staticControls.beads.models.PanelModel();
   goog.base(this);
 };
 goog.inherits(org.apache.flex.html.staticControls.Panel,
     org.apache.flex.html.staticControls.Container);
 
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Panel}
+ * @param {Object} c Element being added.
+ */
+org.apache.flex.html.staticControls.Panel.prototype.addElement = function(c) {
+  if (c == this.titleBar) {
+    this.element.insertBefore(this.titleBar.element,this.contentArea);
+  }
+  else if (c == this.controlBar) {
+     this.element.appendChild(c.element);
+  }
+  else {
+  	this.contentArea.appendChild(c.element);
+  }
+  c.addedToParent();
+};
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Panel}
+ * @param {Object} c The child element.
+ * @param {number} index The index.
+ */
+org.apache.flex.html.staticControls.Panel.prototype.addElementAt = function(c, index) {
+  var children = this.internalChildren();
+  if (index >= children.length)
+    this.addElement(c);
+  else
+  {
+    this.contentArea.insertBefore(c.element,
+            this.getChildAt(index));
+    c.addedToParent();
+  }
+};
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Panel}
+ * @param {Object} c The child element.
+ * @return {number} The index in parent.
+ */
+org.apache.flex.html.staticControls.Panel.prototype.getElementIndex = function(c) {
+  var children = this.internalChildren();
+  var n = children.length;
+  for (i = 0; i < n; i++)
+  {
+     if (children[i] == c.element)
+        return i;
+  }
+  return -1;
+};
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Panel}
+ * @param {Object} c The child element.
+ */
+org.apache.flex.html.staticControls.Panel.prototype.removeElement = function(c) {
+  this.contentArea.removeChild(c.element);
+};
 
 /**
  * @override
@@ -37,15 +101,15 @@ goog.inherits(org.apache.flex.html.staticControls.Panel,
  */
 org.apache.flex.html.staticControls.Panel.prototype.createElement =
     function() {
-  var cb;
 
   this.element = document.createElement('div');
   this.element.className = 'Panel';
 
-  this.titleBar = new org.apache.flex.html.staticControls.TitleBar();
-  this.addElement(titleBar);
-  this.titleBar.element.id = 'titleBar';
-  this.titleBar.title = 'Sample Panel';
+  this.contentArea = document.createElement('div');
+  this.element.appendChild(this.contentArea);
+
+  this.panelView = new org.apache.flex.html.staticControls.beads.PanelView();
+  this.panelView.set_strand(this);
 
   this.positioner = this.element;
   this.element.flexjs_wrapper = this;
@@ -53,12 +117,22 @@ org.apache.flex.html.staticControls.Panel.prototype.createElement =
 
 
 /**
+ * @override
+ * @this {org.apache.flex.html.staticControls.Panel}
+ */
+org.apache.flex.html.staticControls.Panel.prototype.addedToParent =
+    function() {
+    
+};
+
+
+/**
  * @expose
  * @this {org.apache.flex.html.staticControls.Panel}
  * @return {string} The title getter.
  */
 org.apache.flex.html.staticControls.Panel.prototype.get_title = function() {
-  return this.titleBar.get_title();
+  return this.model_.get_title();
 };
 
 
@@ -69,7 +143,7 @@ org.apache.flex.html.staticControls.Panel.prototype.get_title = function()
{
  */
 org.apache.flex.html.staticControls.Panel.prototype.set_title =
     function(value) {
-  this.titleBar.set_title(value);
+   this.model_.set_title(value);
 };
 
 
@@ -93,9 +167,6 @@ org.apache.flex.html.staticControls.Panel.prototype.set_controlBar =
     function(value) {
   this.controlBarChildren = value;
 
-  this.controlBar = new org.apache.flex.html.staticControls.ControlBar();
-  this.addElement(controlBar);
-
   for (var i = 0; i < value.length; i++) {
     var item = value[i];
     this.controlBar.addElement(item);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js
index 53b3608..d946c6d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js
@@ -36,17 +36,14 @@ goog.inherits(org.apache.flex.html.staticControls.Slider,
 /**
  * @override
  * @this {org.apache.flex.html.staticControls.Slider}
- * @param {Object} p The parent element.
  */
-org.apache.flex.html.staticControls.Slider.prototype.addToParent =
-function(p) {
-  goog.base(this, 'addToParent', p);
+org.apache.flex.html.staticControls.Slider.prototype.createElement =
+function() {
 
   this.element = document.createElement('div');
   this.element.className = 'Slider';
   this.element.style.width = '200px';
   this.element.style.height = '30px';
-  this.positioner = this.element;
 
   this.track = document.createElement('div');
   this.track.className = 'SliderTrack';
@@ -55,7 +52,7 @@ function(p) {
   this.track.style.height = '10px';
   this.track.style.width = '200px';
   this.track.style.border = 'thin solid #C4C4C4';
-  this.track.style.position = 'absolute';
+  this.track.style.position = 'relative';
   this.track.style.left = '0px';
   this.track.style.top = '10px';
   this.track.style.zIndex = '1';
@@ -68,20 +65,20 @@ function(p) {
   this.thumb.id = 'thumb';
   this.thumb.style.backgroundColor = '#949494';
   this.thumb.style.border = 'thin solid #747474';
-  this.thumb.style.position = 'absolute';
+  this.thumb.style.position = 'relative';
   this.thumb.style.height = '30px';
   this.thumb.style.width = '10px';
   this.thumb.style.zIndex = '2';
-  this.thumb.style.top = '0px';
+  this.thumb.style.top = '-10px';
   this.thumb.style.left = '20px';
   this.element.appendChild(this.thumb);
   goog.events.listen(this.thumb, goog.events.EventType.MOUSEDOWN,
                      this.handleThumbDown, false, this);
 
-  p.internalAddChild(this.element);
-
+  this.positioner = this.element;
   this.element.flexjs_wrapper = this;
 
+  this.set_className('Slider');
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
index 6f84f3a..5023551 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
@@ -17,6 +17,7 @@ goog.provide('org.apache.flex.html.staticControls.TitleBar');
 goog.require('org.apache.flex.html.staticControls.Container');
 goog.require('org.apache.flex.html.staticControls.Label');
 goog.require('org.apache.flex.html.staticControls.TextButton');
+goog.require('org.apache.flex.html.staticControls.beads.models.TitleBarModel');
 
 
 
@@ -25,10 +26,10 @@ goog.require('org.apache.flex.html.staticControls.TextButton');
  * @extends {org.apache.flex.html.staticControls.Container}
  */
 org.apache.flex.html.staticControls.TitleBar = function() {
-  goog.base(this);
 
-  this._showCloseButton = false;
+  this.model_ = new org.apache.flex.html.staticControls.beads.models.TitleBarModel();
 
+  goog.base(this);
 };
 goog.inherits(org.apache.flex.html.staticControls.TitleBar,
     org.apache.flex.html.staticControls.Container);
@@ -44,17 +45,15 @@ org.apache.flex.html.staticControls.TitleBar.prototype.createElement =
   this.element = document.createElement('div');
 
   this.titleLabel = new org.apache.flex.html.staticControls.Label();
-  this.addElement(titleLabel);
+  this.addElement(this.titleLabel);
   this.titleLabel.element.id = 'title';
   this.titleLabel.positioner.style.display = 'inline-block';
   this.titleLabel.set_className('TitleBarLabel');
 
   this.titleButton = new org.apache.flex.html.staticControls.TextButton();
-  this.addElement(titleButton);
+  this.addElement(this.titleButton);
   this.titleButton.element.id = 'closeButton';
   this.titleButton.text = 'Close';
-  this.titleButton.positioner.style.display = this._showCloseButton ?
-            'inline-block' : 'none';
   this.titleButton.positioner.style.position = 'absolute';
   this.titleButton.positioner.style.right = '0px';
 
@@ -62,6 +61,41 @@ org.apache.flex.html.staticControls.TitleBar.prototype.createElement =
   this.element.flexjs_wrapper = this;
 
   this.set_className('TitleBar');
+
+  // listen for changes to the model so items can be changed in the view
+  this.model_.addEventListener('titleChange',goog.bind(this.changeHandler, this));
+};
+
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.TitleBar}
+ */
+org.apache.flex.html.staticControls.TitleBar.prototype.addedToParent =
+  function() {
+  
+  this.titleLabel.set_text(this.model_.get_title());
+
+  if (this.model_.showCloseButton) {
+    this.titleButton.positioner.style.display = 'inline-block';
+  } else {
+    this.titleButton.positioner.style.display = 'none';
+  }
+};
+
+/**
+ * @private
+ * @this {org.apache.flex.html.staticControls.TitleBar}
+ * @param {Object} event The event that triggered this handler.
+ */
+org.apache.flex.html.staticControls.TitleBar.prototype.changeHandler =
+  function(event) {
+    if (event.type == 'titleChange') {
+      this.titleLabel.set_text(this.model_.get_title());
+    }
+    else if (event.type == 'htmlTitleChange') {
+      this.titleLabel.set_text(this.model.get_htmlTitle());
+    }
 };
 
 
@@ -72,7 +106,7 @@ org.apache.flex.html.staticControls.TitleBar.prototype.createElement =
  */
 org.apache.flex.html.staticControls.TitleBar.prototype.get_title =
     function() {
-  return this.titleLabel.get_text();
+  return this.model_.get_title();
 };
 
 
@@ -83,7 +117,7 @@ org.apache.flex.html.staticControls.TitleBar.prototype.get_title =
  */
 org.apache.flex.html.staticControls.TitleBar.prototype.set_title =
     function(value) {
-  this.titleLabel.set_text(value);
+  this.model_.set_title(value);
 };
 
 
@@ -94,7 +128,7 @@ org.apache.flex.html.staticControls.TitleBar.prototype.set_title =
  */
 org.apache.flex.html.staticControls.TitleBar.prototype.get_showCloseButton =
     function() {
-  return this._showCloseButton;
+  return this.model_.get_showCloseButton();
 };
 
 
@@ -105,6 +139,5 @@ org.apache.flex.html.staticControls.TitleBar.prototype.get_showCloseButton
=
  */
 org.apache.flex.html.staticControls.TitleBar.prototype.set_showCloseButton =
     function(value) {
-  this._showCloseButton = value;
-  this.titleButton.positioner.style.display = value ? 'inline-block' : 'none';
+  this.model_.set_showCloseButton(value);
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js
new file mode 100644
index 0000000..05534e1
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js
@@ -0,0 +1,59 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.PanelView');
+
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.html.staticControls.beads.PanelView = function() {
+  
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.PanelView}
+ * @param {Object} value The new host.
+ */
+org.apache.flex.html.staticControls.beads.PanelView.prototype.set_strand =
+    function(value) {
+
+  this.strand_ = value;
+
+  this.strand_.titleBar = new org.apache.flex.html.staticControls.TitleBar();
+  this.strand_.titleBar.addedToParent();
+  this.strand_.titleBar.element.id = 'titleBar';
+  this.strand_.addElement(this.strand_.titleBar);
+
+  this.strand_.controlBar = new org.apache.flex.html.staticControls.ControlBar();
+  this.strand_.addElement(this.strand_.controlBar);
+
+  // listen for changes to the strand's model so items can be changed in the view
+  this.strand_.model_.addEventListener('titleChange',goog.bind(this.changeHandler, this));
+
+};
+
+/**
+ * @private
+ * @this {org.apache.flex.html.staticControls.beads.PanelView}
+ * @param {Object} event The event that triggered this handler.
+ */
+org.apache.flex.html.staticControls.beads.PanelView.prototype.changeHandler =
+  function(event) {
+    if (event.type == 'titleChange') {
+      this.strand_.titleBar.set_title(this.strand_.model_.get_title());
+    }
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/TextPromptBead.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/TextPromptBead.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/TextPromptBead.js
new file mode 100644
index 0000000..ea695d8
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/TextPromptBead.js
@@ -0,0 +1,38 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.TextPromptBead');
+
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.html.staticControls.beads.TextPromptBead = function() {
+  
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.TextPromptBead}
+ * @param {Object} value The new host.
+ */
+org.apache.flex.html.staticControls.beads.TextPromptBead.prototype.set_strand =
+    function(value) {
+  if (this.strand_ !== value) {
+    this.strand_ = value;
+    //this.strand_.addEventListener('childrenAdded',
+    //    goog.bind(this.changeHandler, this));
+  }
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js
new file mode 100644
index 0000000..cd3f4d0
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js
@@ -0,0 +1,118 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.models.PanelModel');
+
+goog.require('org.apache.flex.events.EventDispatcher');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.events.EventDispatcher}
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel = function() {
+  goog.base(this);
+  
+  this.title_ = '';
+  this.htmlTitle = '';
+  this.showCloseButton_ = false;
+};
+goog.inherits(org.apache.flex.html.staticControls.beads.models.PanelModel,
+    org.apache.flex.events.EventDispatcher);
+
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @param {Object} value The strand.
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_strand =
+  function(value) {
+  this.strand_ = value;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @returns {String} The title.
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_title =
+  function() {
+  return this.title_;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @param {String} value The title to set.
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_title =
+  function(value) {
+  if (this.title_ != value) {
+      this.title_ = value;
+      this.dispatchEvent('titleChange');
+  }
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @returns {String} The HTML title.
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_htmlTitle =
+  function() {
+  return this.htmlTitle_;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @param {String} value The new HTML title.
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_htmlTitle =
+  function(value) {
+  if (this.htmlTitle_ != value) {
+    this.htmlTitle_ = value;
+    this.dispatchEvent('htmlTitleChange');
+  }
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @returns {Boolean} Returns true if the close button should appear in the TitleBar.
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_showCloseButton
=
+  function() {
+  return this.showCloseButton_;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.PanelModel}
+ * @param {Boolean} value Determines if the close button shows (true) or not (false).
+ */
+org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_showCloseButton
=
+  function(value) {
+  if (this.showCloseButton_ != value) {
+    this.showCloseButton_ = value;
+    this.dispatchEvent('showCloseButtonChange');
+  }
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9619b707/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js
b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js
new file mode 100644
index 0000000..6987074
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js
@@ -0,0 +1,118 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.models.TitleBarModel');
+
+goog.require('org.apache.flex.events.EventDispatcher');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.events.EventDispatcher}
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel = function() {
+  goog.base(this);
+  
+  this.title_ = '';
+  this.htmlTitle = '';
+  this.showCloseButton_ = false;
+};
+goog.inherits(org.apache.flex.html.staticControls.beads.models.TitleBarModel,
+    org.apache.flex.events.EventDispatcher);
+
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @param {Object} value The strand.
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_strand =
+  function(value) {
+  this.strand_ = value;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @returns {String} The title.
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_title =
+  function() {
+  return this.title_;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @param {String} value The title to set.
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_title =
+  function(value) {
+  if (this.title_ != value) {
+      this.title_ = value;
+      this.dispatchEvent('titleChange');
+  }
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @returns {String} The HTML title.
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_htmlTitle =
+  function() {
+  return this.htmlTitle_;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @param {String} value The new HTML title.
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_htmlTitle =
+  function(value) {
+  if (this.htmlTitle_ != value) {
+    this.htmlTitle_ = value;
+    this.dispatchEvent('htmlTitleChange');
+  }
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @returns {Boolean} Returns true if the close button should appear in the TitleBar.
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_showCloseButton
=
+  function() {
+  return this.showCloseButton_;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel}
+ * @param {Boolean} value Determines if the close button shows (true) or not (false).
+ */
+org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_showCloseButton
=
+  function(value) {
+  if (this.showCloseButton_ != value) {
+    this.showCloseButton_ = value;
+    this.dispatchEvent('showCloseButtonChange');
+  }
+};


Mime
View raw message