You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2013/05/31 21:23:26 UTC

git commit: [flex-asjs] [refs/heads/develop] - Added ControlBar.js and modified Label and TextButton to create their elements in their constructors so they can be used in the Panel's controlBar section. This is still incomplete as the ControlBar is not s

Updated Branches:
  refs/heads/develop b8b9e6293 -> d78ed669d


Added ControlBar.js and modified Label and TextButton to create their elements in their constructors so they can be used in the Panel's controlBar section. This is still incomplete as the ControlBar is not settled at the bottom of the Panel container.


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

Branch: refs/heads/develop
Commit: d78ed669da666e946855e01e2ea9ee4cf8fa5be8
Parents: b8b9e62
Author: Peter Ent <pe...@apache.org>
Authored: Fri May 31 15:23:14 2013 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri May 31 15:23:14 2013 -0400

----------------------------------------------------------------------
 .../apache/flex/html/staticControls/ControlBar.js  |   50 +++++++++++++++
 .../org/apache/flex/html/staticControls/Label.js   |    2 +
 .../org/apache/flex/html/staticControls/Panel.js   |   30 +++++++++
 .../apache/flex/html/staticControls/TextButton.js  |    4 +-
 4 files changed, 84 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d78ed669/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
new file mode 100644
index 0000000..e64bb41
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ControlBar.js
@@ -0,0 +1,50 @@
+/**
+ * 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.ControlBar');
+
+goog.require('org.apache.flex.html.staticControls.Container');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.html.staticControls.Container}
+ */
+org.apache.flex.html.staticControls.ControlBar = function() {
+  goog.base(this);
+  
+};
+goog.inherits(org.apache.flex.html.staticControls.ControlBar,
+    org.apache.flex.html.staticControls.Container);
+    
+    
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.ControlBar}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.html.staticControls.ControlBar.prototype.addToParent =
+    function(p) {
+
+  this.element = document.createElement('div');
+  this.element.style.display = "inline";
+  
+  p.internalAddChild(this.element);
+
+  this.positioner = this.element;
+  this.element.flexjs_wrapper = this;
+  
+  this.set_className("ControlBar");
+ }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d78ed669/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js
index 55d1361..c9fb63f 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Label.js
@@ -24,6 +24,8 @@ goog.require('org.apache.flex.core.UIBase');
  */
 org.apache.flex.html.staticControls.Label = function() {
   goog.base(this);
+  
+  this.element = document.createElement('div');
 };
 goog.inherits(org.apache.flex.html.staticControls.Label,
     org.apache.flex.core.UIBase);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d78ed669/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 f67108a..a566736 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
@@ -16,6 +16,7 @@ goog.provide('org.apache.flex.html.staticControls.Panel');
 
 goog.require('org.apache.flex.html.staticControls.Container');
 goog.require('org.apache.flex.html.staticControls.TitleBar');
+goog.require('org.apache.flex.html.staticControls.ControlBar');
 
 
 
@@ -70,4 +71,33 @@ 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);
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.Panel}
+ * @return {Array} The controlBar getter.
+ */
+org.apache.flex.html.staticControls.Panel.prototype.get_controlBar = function() {
+  return this.controlBarChildren;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.Panel}
+ * @param {Array} value The controlBar setter.
+ */
+org.apache.flex.html.staticControls.Panel.prototype.set_controlBar =
+    function(value) {
+  this.controlBarChildren = value;
+  
+  this.controlBar = new org.apache.flex.html.staticControls.ControlBar();
+  this.controlBar.addToParent(this);
+  
+  for(var i=0; i < value.length; i++) {
+  	  var item = value[i];
+  	  item.addToParent(this.controlBar);
+  }
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d78ed669/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
index 1277fb2..87a5fb7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TextButton.js
@@ -24,6 +24,8 @@ goog.require('org.apache.flex.core.UIBase');
  */
 org.apache.flex.html.staticControls.TextButton = function() {
   goog.base(this);
+  this.element = document.createElement('button');
+  this.element.setAttribute('type', 'button');
 };
 goog.inherits(org.apache.flex.html.staticControls.TextButton,
     org.apache.flex.core.UIBase);
@@ -36,8 +38,6 @@ goog.inherits(org.apache.flex.html.staticControls.TextButton,
  */
 org.apache.flex.html.staticControls.TextButton.prototype.addToParent =
     function(p) {
-  this.element = document.createElement('button');
-  this.element.setAttribute('type', 'button');
 
   p.internalAddChild(this.element);