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/09/09 20:36:45 UTC
git commit: [flex-asjs] [refs/heads/develop] - Added SimpleList
component (on JavaScript, this is a
Updated Branches:
refs/heads/develop 7c9e6a1c9 -> a39ab2298
Added SimpleList component (on JavaScript, this is a <select> element with <option> items).
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a39ab229
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a39ab229
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a39ab229
Branch: refs/heads/develop
Commit: a39ab22985ff515be7fe0f9a23ad380ab8030873
Parents: 7c9e6a1
Author: Peter Ent <pe...@apache.org>
Authored: Mon Sep 9 14:36:33 2013 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Mon Sep 9 14:36:33 2013 -0400
----------------------------------------------------------------------
frameworks/as/basic-manifest.xml | 1 +
.../flex/html/staticControls/SimpleList.as | 28 ++++
.../flex/html/staticControls/SimpleList.js | 128 +++++++++++++++++++
3 files changed, 157 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a39ab229/frameworks/as/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/basic-manifest.xml b/frameworks/as/basic-manifest.xml
index b92ef99..337ba4f 100644
--- a/frameworks/as/basic-manifest.xml
+++ b/frameworks/as/basic-manifest.xml
@@ -35,6 +35,7 @@
<component id="TextInput" class="org.apache.flex.html.staticControls.TextInput"/>
<component id="TextArea" class="org.apache.flex.html.staticControls.TextArea"/>
<component id="List" class="org.apache.flex.html.staticControls.List"/>
+ <component id="SimpleList" class="org.apache.flex.html.staticControls.SimpleList"/>
<component id="CheckBox" class="org.apache.flex.html.staticControls.CheckBox"/>
<component id="RadioButton" class="org.apache.flex.html.staticControls.RadioButton"/>
<component id="ComboBox" class="org.apache.flex.html.staticControls.ComboBox"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a39ab229/frameworks/as/src/org/apache/flex/html/staticControls/SimpleList.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleList.as b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleList.as
new file mode 100644
index 0000000..9f19a72
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleList.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ public class SimpleList extends List
+ {
+ public function SimpleList()
+ {
+ super();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a39ab229/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/SimpleList.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/SimpleList.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/SimpleList.js
new file mode 100644
index 0000000..c04c47f
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/SimpleList.js
@@ -0,0 +1,128 @@
+/**
+ * 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.SimpleList');
+
+goog.require('org.apache.flex.core.ListBase');
+goog.require('org.apache.flex.html.staticControls.beads.models.ArraySelectionModel');
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.ListBase}
+ */
+org.apache.flex.html.staticControls.SimpleList = function() {
+ this.model =
+ new org.apache.flex.html.staticControls.beads.models.ArraySelectionModel();
+ goog.base(this);
+};
+goog.inherits(org.apache.flex.html.staticControls.SimpleList,
+ org.apache.flex.core.ListBase);
+
+
+/**
+ * @override
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+createElement = function() {
+ this.element = document.createElement('select');
+ this.element.size = 5;
+ goog.events.listen(this.element, 'change',
+ goog.bind(this.changeHandler, this));
+ this.positioner = this.element;
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ * @return {Object} Returns the dataProvider.
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+get_dataProvider = function() {
+ return this.model.get_dataProvider();
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ * @param {Object} value The new dataProvider.
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+set_dataProvider = function(value) {
+ var dp, i, n, opt;
+
+ this.model.set_dataProvider(value);
+
+ dp = this.element.options;
+ n = dp.length;
+ for (i = 0; i < n; i++) {
+ dp.remove(0);
+ }
+
+ n = value.length;
+ for (i = 0; i < n; i++) {
+ opt = document.createElement('option');
+ opt.text = value[i];
+ dp.add(opt);
+ }
+
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ * @return {Object} Returns the selected index.
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+get_selectedIndex = function() {
+ return this.model.get_selectedIndex();
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ * @param {Number} value The new selected index.
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+set_selectedIndex = function(value) {
+ this.model.set_selectedIndex(value);
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ * @return {Object} Returns the selectedItem.
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+get_selectedItem = function() {
+ return this.model.get_selectedItem();
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.SimpleList}
+ * @param {Object} value The new selected item.
+ */
+org.apache.flex.html.staticControls.SimpleList.prototype.
+set_selectedItem = function(value) {
+ this.model.set_selectedItem(value);
+};
+