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/10/09 16:10:52 UTC
[2/2] git commit: [flex-asjs] [refs/heads/features/dynamicControls] -
Separated controls into common and dynamicControls from staticControls as an
experiment to see if we can maintain a set of simple (static) components that
would translate easily into b
Separated controls into common and dynamicControls from staticControls as an experiment to see if we can maintain a set of simple (static) components that would translate easily into basic HTML elements.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/90dd3842
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/90dd3842
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/90dd3842
Branch: refs/heads/features/dynamicControls
Commit: 90dd384281a601c6fb14f35841a42b6027bba2a5
Parents: 6036d5d
Author: Peter Ent <pe...@apache.org>
Authored: Wed Oct 9 08:55:46 2013 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Oct 9 08:55:46 2013 -0400
----------------------------------------------------------------------
frameworks/as/basic-manifest.xml | 1 -
frameworks/as/compile-config.xml | 5 +
frameworks/as/defaults.css | 83 ++++++---
frameworks/as/dynamic-manifest.xml | 31 ++++
frameworks/as/flex-config.xml | 6 +
frameworks/as/src/FlexJSUIClasses.as | 39 ++--
.../src/org/apache/flex/core/IComboBoxView.as | 35 ++++
.../src/org/apache/flex/core/ILayoutParent.as | 2 +-
.../src/org/apache/flex/core/ITextFieldView.as | 26 +++
.../html/common/beads/SingleLineBorderBead.as | 75 ++++++++
.../common/beads/TextButtonMeasurementBead.as | 51 +++++
.../common/beads/controllers/AlertController.as | 52 ++++++
.../beads/controllers/ComboBoxController.as | 71 +++++++
.../EditableTextKeyboardController.as | 55 ++++++
.../flex/html/common/beads/models/AlertModel.as | 163 ++++++++++++++++
.../html/common/beads/models/ComboBoxModel.as | 62 +++++++
.../beads/models/SingleLineBorderModel.as | 49 +++++
.../flex/html/common/beads/models/TextModel.as | 70 +++++++
.../flex/html/common/supportClasses/Border.as | 31 ++++
.../apache/flex/html/dynamicControls/Alert.as | 85 +++++++++
.../apache/flex/html/dynamicControls/Button.as | 35 ++++
.../flex/html/dynamicControls/ComboBox.as | 60 ++++++
.../apache/flex/html/dynamicControls/Label.as | 63 +++++++
.../flex/html/dynamicControls/TextButton.as | 50 +++++
.../flex/html/dynamicControls/TextInput.as | 49 +++++
.../beads/AlertMeasurementBead.as | 46 +++++
.../html/dynamicControls/beads/AlertView.as | 180 ++++++++++++++++++
.../html/dynamicControls/beads/ComboBoxView.as | 176 ++++++++++++++++++
.../beads/TextFieldLabelMeasurementBead.as | 51 +++++
.../html/dynamicControls/beads/TextFieldView.as | 34 ++++
.../dynamicControls/beads/TextFieldViewBase.as | 112 +++++++++++
.../html/dynamicControls/beads/TextInputView.as | 65 +++++++
.../beads/TextInputWithBorderView.as | 69 +++++++
.../apache/flex/html/staticControls/Alert.as | 55 ++----
.../flex/html/staticControls/SimpleAlert.as | 70 -------
.../accessories/NumericOnlyTextInputBead.as | 2 +-
.../accessories/PasswordInputBead.as | 2 +-
.../beads/AlertMeasurementBead.as | 46 -----
.../flex/html/staticControls/beads/AlertView.as | 178 ------------------
.../html/staticControls/beads/ComboBoxView.as | 5 +-
.../html/staticControls/beads/ContainerView.as | 2 +-
.../html/staticControls/beads/IComboBoxView.as | 37 ----
.../flex/html/staticControls/beads/IListView.as | 2 +-
.../html/staticControls/beads/ITextFieldView.as | 27 ---
.../flex/html/staticControls/beads/ListView.as | 5 +-
.../staticControls/beads/NumericStepperView.as | 2 +-
.../beads/SingleLineBorderBead.as | 73 --------
.../html/staticControls/beads/TextAreaView.as | 5 +-
.../beads/TextButtonMeasurementBead.as | 50 -----
.../staticControls/beads/TextFieldViewBase.as | 1 +
.../beads/TextInputWithBorderView.as | 5 +-
.../beads/controllers/AlertController.as | 52 ------
.../beads/controllers/ComboBoxController.as | 71 -------
.../EditableTextKeyboardController.as | 55 ------
.../NonVirtualHorizontalScrollingLayout.as | 2 +-
.../NonVirtualVerticalScrollingLayout.as | 2 +-
.../staticControls/beads/models/AlertModel.as | 163 ----------------
.../beads/models/ComboBoxModel.as | 61 ------
.../beads/models/SingleLineBorderModel.as | 49 -----
.../staticControls/beads/models/TextModel.as | 70 -------
.../staticControls/supportClasses/Border.as | 31 ----
.../apache/flex/html/staticControls/ComboBox.js | 145 ++-------------
.../html/staticControls/beads/ComboBoxView.js | 186 +++++++++++++++++++
63 files changed, 2183 insertions(+), 1253 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/basic-manifest.xml b/frameworks/as/basic-manifest.xml
index 2fe364b..85253c7 100644
--- a/frameworks/as/basic-manifest.xml
+++ b/frameworks/as/basic-manifest.xml
@@ -54,7 +54,6 @@
<component id="TitleBarModel" class="org.apache.flex.html.staticControls.beads.models.TitleBarModel"/>
<component id="NonVirtualVerticalLayout" class="org.apache.flex.html.staticControls.beads.layouts.NonVirtualVerticalLayout"/>
<component id="NonVirtualHorizontalLayout" class="org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout"/>
- <component id="SimpleAlert" class="org.apache.flex.html.staticControls.SimpleAlert"/>
<component id="Alert" class="org.apache.flex.html.staticControls.Alert"/>
<component id="Spinner" class="org.apache.flex.html.staticControls.Spinner"/>
<component id="Slider" class="org.apache.flex.html.staticControls.Slider"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/compile-config.xml b/frameworks/as/compile-config.xml
index aa41d8e..8b010b0 100644
--- a/frameworks/as/compile-config.xml
+++ b/frameworks/as/compile-config.xml
@@ -35,6 +35,10 @@
<manifest>basic-manifest.xml</manifest>
</namespace>
<namespace>
+ <uri>library://ns.apache.org/flexjs/dynamic</uri>
+ <manifest>dynamic-manifest.xml</manifest>
+ </namespace>
+ <namespace>
<uri>library://ns.adobe.com/flex/mx</uri>
<manifest>mx-manifest.xml</manifest>
</namespace>
@@ -70,6 +74,7 @@
<include-namespaces>
<uri>library://ns.apache.org/flexjs/basic</uri>
+ <uri>library://ns.apache.org/flexjs/dynamic</uri>
<uri>library://ns.adobe.com/flex/mx</uri>
<uri>library://ns.apache.org/flexjs/html5</uri>
<uri>library://ns.apache.org/flexjs/jquery</uri>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index a220dc7..2b3305e 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -18,6 +18,7 @@
*/
@namespace "library://ns.apache.org/flexjs/basic";
+@namespace dyn "library://ns.apache.org/flexjs/dynamic";
@namespace h5 "library://ns.apache.org/flexjs/html5";
@namespace jq "library://ns.apache.org/flexjs/jquery";
@namespace createjs "library://ns.apache.org/flexjs/createjs";
@@ -59,13 +60,13 @@ global
IStatesImpl: ClassReference("org.apache.flex.core.SimpleStatesImpl");
}
-Alert
+dyn|Alert
{
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.AlertModel");
- IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.AlertView");
- IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.AlertController");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.AlertModel");
+ IBeadView: ClassReference("org.apache.flex.html.dynamicControls.beads.AlertView");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.AlertController");
iBackgroundBead: ClassReference("org.apache.flex.html.staticControls.beads.SolidBackgroundBead");
- iBorderBead: ClassReference("org.apache.flex.html.staticControls.beads.SingleLineBorderBead");
+ iBorderBead: ClassReference("org.apache.flex.html.common.beads.SingleLineBorderBead");
background-color: #FFFFFF;
border-style: solid;
@@ -100,13 +101,24 @@ CheckBox
ComboBox
{
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.ComboBoxModel");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.ComboBoxModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.ComboBoxView");
- IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.ComboBoxController");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.ComboBoxController");
IPopUp: ClassReference("org.apache.flex.html.staticControls.supportClasses.DropDownListList");
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.staticControls.beads.TextItemRendererFactoryForArrayData");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.staticControls.supportClasses.StringItemRenderer");
+/* IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.staticControls.supportClasses.StringItemRenderer"); */
+}
+
+dyn|ComboBox
+{
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.ComboBoxModel");
+ IBeadView: ClassReference("org.apache.flex.html.dynamicControls.beads.ComboBoxView");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.ComboBoxController");
+ IPopUp: ClassReference("org.apache.flex.html.staticControls.supportClasses.DropDownListList");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.staticControls.beads.TextItemRendererFactoryForArrayData");
+/* IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.staticControls.supportClasses.StringItemRenderer"); */
}
Container
@@ -119,7 +131,7 @@ ControlBar
IBeadLayout: ClassReference("org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout");
iMeasurementBead: ClassReference("org.apache.flex.html.staticControls.beads.ControlBarMeasurementBead");
iBackgroundBead: ClassReference("org.apache.flex.html.staticControls.beads.SolidBackgroundBead");
- iBorderBead: ClassReference("org.apache.flex.html.staticControls.beads.SingleLineBorderBead");
+ iBorderBead: ClassReference("org.apache.flex.html.common.beads.SingleLineBorderBead");
background-color: #CECECE;
border-style: solid;
@@ -155,11 +167,20 @@ Label
{
width: 95;
height: 18;
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.TextModel");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.TextFieldView");
iMeasurementBead: ClassReference("org.apache.flex.html.staticControls.beads.TextFieldLabelMeasurementBead");
}
+dyn|Label
+{
+ width: 95;
+ height: 18;
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.dynamicControls.beads.TextFieldView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.dynamicControls.beads.TextFieldLabelMeasurementBead");
+}
+
List
{
IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.ArraySelectionModel");
@@ -181,7 +202,7 @@ NumericStepper
border-color: #000000;
border-thickness: 1;
background-color: #FFFFFF;
- iBorderBead: ClassReference('org.apache.flex.html.staticControls.beads.SingleLineBorderBead');
+ iBorderBead: ClassReference('org.apache.flex.html.common.beads.SingleLineBorderBead');
iBackgroundBead: ClassReference('org.apache.flex.html.staticControls.beads.SolidBackgroundBead');
}
@@ -189,7 +210,7 @@ Panel
{
IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.PanelModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.PanelView");
- iBorderBead: ClassReference("org.apache.flex.html.staticControls.beads.SingleLineBorderBead");
+ iBorderBead: ClassReference("org.apache.flex.html.common.beads.SingleLineBorderBead");
iBackgroundBead: ClassReference("org.apache.flex.html.staticControls.beads.SolidBackgroundBead");
background-color: #FFFFFF;
@@ -212,12 +233,12 @@ ScrollBar
IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.VScrollBarMouseController");
}
-SimpleAlert
+Alert
{
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.AlertModel");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.AlertModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.SimpleAlertView");
- IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.AlertController");
- iBorderBead: ClassReference("org.apache.flex.html.staticControls.beads.SingleLineBorderBead");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.AlertController");
+ iBorderBead: ClassReference("org.apache.flex.html.common.beads.SingleLineBorderBead");
iBackgroundBead: ClassReference("org.apache.flex.html.staticControls.beads.SolidBackgroundBead");
background-color: #FFFFFF;
@@ -261,18 +282,25 @@ StringItemRenderer
TextArea
{
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.TextModel");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.TextAreaView");
- IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.EditableTextKeyboardController");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.EditableTextKeyboardController");
width: 135;
height: 20;
}
TextButton
{
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.TextModel");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.CSSTextButtonView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.common.beads.TextButtonMeasurementBead");
+}
+
+dyn|TextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.CSSTextButtonView");
- iMeasurementBead: ClassReference("org.apache.flex.html.staticControls.beads.TextButtonMeasurementBead");
+ iMeasurementBead: ClassReference("org.apache.flex.html.common.beads.TextButtonMeasurementBead");
}
TextFieldItemRenderer
@@ -283,9 +311,18 @@ TextFieldItemRenderer
TextInput
{
- IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.TextModel");
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.TextInputWithBorderView");
- IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.EditableTextKeyboardController");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.EditableTextKeyboardController");
+ width: 135;
+ height: 20;
+}
+
+dyn|TextInput
+{
+ IBeadModel: ClassReference("org.apache.flex.html.common.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.dynamicControls.beads.TextInputWithBorderView");
+ IBeadController: ClassReference("org.apache.flex.html.common.beads.controllers.EditableTextKeyboardController");
width: 135;
height: 20;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/dynamic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/dynamic-manifest.xml b/frameworks/as/dynamic-manifest.xml
new file mode 100644
index 0000000..3af5935
--- /dev/null
+++ b/frameworks/as/dynamic-manifest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.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.
+
+-->
+
+
+<componentPackage>
+
+ <component id="Alert" class="org.apache.flex.html.dynamicControls.Alert"/>
+ <component id="Button" class="org.apache.flex.html.dynamicControls.Button"/>
+ <component id="ComboBox" class="org.apache.flex.html.dynamicControls.ComboBox"/>
+ <component id="Label" class="org.apache.flex.html.dynamicControls.Label"/>
+ <component id="TextButton" class="org.apache.flex.html.dynamicControls.TextButton"/>
+ <component id="TextInput" class="org.apache.flex.html.dynamicControls.TextInput"/>
+
+</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/flex-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/flex-config.xml b/frameworks/as/flex-config.xml
index e91d830..65e4859 100644
--- a/frameworks/as/flex-config.xml
+++ b/frameworks/as/flex-config.xml
@@ -93,6 +93,12 @@
</namespace>
<namespace>
+ <uri>library://ns.apache.org/flexjs/dynamic</uri>
+
+ <manifest>dynamic-manifest.xml</manifest>
+
+ </namespace>
+ <namespace>
<uri>library://ns.apache.org/flexjs/html5</uri>
<manifest>html5-manifest.xml</manifest>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/FlexJSUIClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/FlexJSUIClasses.as b/frameworks/as/src/FlexJSUIClasses.as
index 9b94af9..ddd816d 100644
--- a/frameworks/as/src/FlexJSUIClasses.as
+++ b/frameworks/as/src/FlexJSUIClasses.as
@@ -27,12 +27,26 @@ package
*/
internal class FlexJSUIClasses
{
+ import org.apache.flex.html.common.beads.TextButtonMeasurementBead; TextButtonMeasurementBead;
+ import org.apache.flex.html.common.beads.models.AlertModel; AlertModel;
+ import org.apache.flex.html.common.beads.models.ComboBoxModel; ComboBoxModel;
+ import org.apache.flex.html.common.beads.models.TextModel; TextModel;
+ import org.apache.flex.html.common.beads.controllers.AlertController; AlertController;
+ import org.apache.flex.html.common.beads.controllers.ComboBoxController; ComboBoxController;
+ import org.apache.flex.html.common.beads.controllers.EditableTextKeyboardController; EditableTextKeyboardController;
+
+ import org.apache.flex.html.dynamicControls.beads.AlertView; AlertView;
+ import org.apache.flex.html.dynamicControls.beads.ComboBoxView; org.apache.flex.html.dynamicControls.beads.ComboBoxView;
+ import org.apache.flex.html.dynamicControls.beads.TextFieldLabelMeasurementBead; org.apache.flex.html.dynamicControls.beads.TextFieldLabelMeasurementBead;
+ import org.apache.flex.html.dynamicControls.beads.TextFieldView; org.apache.flex.html.dynamicControls.beads.TextFieldView;
+ import org.apache.flex.html.dynamicControls.beads.TextInputView; org.apache.flex.html.dynamicControls.beads.TextInputView;
+ import org.apache.flex.html.dynamicControls.beads.TextInputWithBorderView; org.apache.flex.html.dynamicControls.beads.TextInputWithBorderView;
+
import org.apache.flex.html.staticControls.accessories.NumericOnlyTextInputBead; NumericOnlyTextInputBead;
import org.apache.flex.html.staticControls.accessories.PasswordInputBead; PasswordInputBead;
import org.apache.flex.html.staticControls.accessories.TextPromptBead; TextPromptBead;
- import org.apache.flex.html.staticControls.beads.AlertView; AlertView;
import org.apache.flex.html.staticControls.beads.CheckBoxView; CheckBoxView;
- import org.apache.flex.html.staticControls.beads.ComboBoxView; ComboBoxView;
+ import org.apache.flex.html.staticControls.beads.ComboBoxView; org.apache.flex.html.staticControls.beads.ComboBoxView;
import org.apache.flex.html.staticControls.beads.ContainerView; ContainerView;
import org.apache.flex.html.staticControls.beads.ControlBarMeasurementBead; ControlBarMeasurementBead;
import org.apache.flex.html.staticControls.beads.CSSTextButtonView; CSSTextButtonView;
@@ -48,27 +62,20 @@ internal class FlexJSUIClasses
import org.apache.flex.html.staticControls.beads.SliderThumbView; SliderThumbView;
import org.apache.flex.html.staticControls.beads.SliderTrackView; SliderTrackView;
import org.apache.flex.html.staticControls.beads.SpinnerView; SpinnerView;
- import org.apache.flex.html.staticControls.beads.TextButtonMeasurementBead; TextButtonMeasurementBead;
- import org.apache.flex.html.staticControls.beads.TextFieldLabelMeasurementBead; TextFieldLabelMeasurementBead;
+ import org.apache.flex.html.staticControls.beads.TextFieldLabelMeasurementBead; org.apache.flex.html.staticControls.beads.TextFieldLabelMeasurementBead;
import org.apache.flex.html.staticControls.beads.TextAreaView; TextAreaView;
import org.apache.flex.html.staticControls.beads.TextButtonView; TextButtonView;
- 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.TextFieldView; org.apache.flex.html.staticControls.beads.TextFieldView;
+ import org.apache.flex.html.staticControls.beads.TextInputView; org.apache.flex.html.staticControls.beads.TextInputView;
+ import org.apache.flex.html.staticControls.beads.TextInputWithBorderView; org.apache.flex.html.staticControls.beads.TextInputWithBorderView;
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;
- import org.apache.flex.html.staticControls.beads.models.ComboBoxModel; ComboBoxModel;
import org.apache.flex.html.staticControls.beads.models.ImageModel; ImageModel;
import org.apache.flex.html.staticControls.beads.models.PanelModel; PanelModel;
- import org.apache.flex.html.staticControls.beads.models.TextModel; TextModel;
import org.apache.flex.html.staticControls.beads.models.TitleBarModel; TitleBarModel;
import org.apache.flex.html.staticControls.beads.models.ToggleButtonModel; ToggleButtonModel;
import org.apache.flex.html.staticControls.beads.models.ValueToggleButtonModel; ValueToggleButtonModel;
- import org.apache.flex.html.staticControls.beads.controllers.AlertController; AlertController;
- import org.apache.flex.html.staticControls.beads.controllers.ComboBoxController; ComboBoxController;
import org.apache.flex.html.staticControls.beads.controllers.DropDownListController; DropDownListController;
- import org.apache.flex.html.staticControls.beads.controllers.EditableTextKeyboardController; EditableTextKeyboardController;
import org.apache.flex.html.staticControls.beads.controllers.ItemRendererMouseController; ItemRendererMouseController;
import org.apache.flex.html.staticControls.beads.controllers.ListSingleSelectionMouseController; ListSingleSelectionMouseController;
import org.apache.flex.html.staticControls.beads.controllers.SliderMouseController; SliderMouseController;
@@ -79,11 +86,13 @@ internal class FlexJSUIClasses
import org.apache.flex.html.staticControls.beads.layouts.VScrollBarLayout; VScrollBarLayout;
import org.apache.flex.html.staticControls.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
import org.apache.flex.html.staticControls.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
- import org.apache.flex.core.ItemRendererClassFactory; ItemRendererClassFactory;
+
+ import org.apache.flex.core.ItemRendererClassFactory; ItemRendererClassFactory;
+ import org.apache.flex.core.SimpleStatesImpl; SimpleStatesImpl;
+
import org.apache.flex.events.CustomEvent; CustomEvent;
import org.apache.flex.events.Event; Event;
import org.apache.flex.utils.Timer; Timer;
- import org.apache.flex.core.SimpleStatesImpl; SimpleStatesImpl;
import mx.states.AddItems; AddItems;
import mx.states.SetProperty; SetProperty;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/core/IComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/IComboBoxView.as b/frameworks/as/src/org/apache/flex/core/IComboBoxView.as
new file mode 100644
index 0000000..a4fb8d8
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/core/IComboBoxView.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+ public interface IComboBoxView extends IBeadView
+ {
+ function get text():String;
+ function set text(value:String):void;
+
+ function get html():String;
+ function set html(value:String):void;
+
+ function get popUp():IStrand;
+
+ function get popUpVisible():Boolean;
+ function set popUpVisible(value:Boolean):void;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/core/ILayoutParent.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/ILayoutParent.as b/frameworks/as/src/org/apache/flex/core/ILayoutParent.as
index 3604b37..8cf4d39 100644
--- a/frameworks/as/src/org/apache/flex/core/ILayoutParent.as
+++ b/frameworks/as/src/org/apache/flex/core/ILayoutParent.as
@@ -21,7 +21,7 @@ package org.apache.flex.core
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
- import org.apache.flex.html.staticControls.supportClasses.Border;
+ import org.apache.flex.html.common.supportClasses.Border;
import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
public interface ILayoutParent
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/core/ITextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/ITextFieldView.as b/frameworks/as/src/org/apache/flex/core/ITextFieldView.as
new file mode 100644
index 0000000..154c7dd
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/core/ITextFieldView.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+ public interface ITextFieldView
+ {
+ function get textField():CSSTextField;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as b/frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as
new file mode 100644
index 0000000..0eeb022
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as
@@ -0,0 +1,75 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads
+{
+ import flash.display.Graphics;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.staticControls.beads.IBorderBead;
+ import org.apache.flex.html.staticControls.beads.IGraphicsDrawing;
+
+ public class SingleLineBorderBead implements IBead, IBorderBead, IGraphicsDrawing
+ {
+ public function SingleLineBorderBead()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ public function get strand():IStrand
+ {
+ return _strand;
+ }
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
+ IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var styleObject:* = ValuesManager.valuesImpl.getValue(_strand,"border-color");
+ var borderColor:Number = Number(styleObject);
+ if( isNaN(borderColor) ) borderColor = 0x000000;
+ styleObject = ValuesManager.valuesImpl.getValue(_strand,"border-thickness");
+ var borderThickness:Number = Number(styleObject);
+ if( isNaN(borderThickness) ) borderThickness = 1;
+
+ var host:UIBase = UIBase(_strand);
+ var g:Graphics = host.graphics;
+ var w:Number = host.width;
+ var h:Number = host.height;
+
+ var gd:IGraphicsDrawing = strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
+ if( this == gd ) g.clear();
+
+ g.lineStyle();
+ g.beginFill(borderColor);
+ g.drawRect(0, 0, w, h);
+ g.drawRect(borderThickness, borderThickness, w-2*borderThickness, h-2*borderThickness);
+ g.endFill();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as
new file mode 100644
index 0000000..ed0b066
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads
+{
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.html.staticControls.beads.TextButtonView;
+
+ public class TextButtonMeasurementBead implements IMeasurementBead
+ {
+ public function TextButtonMeasurementBead()
+ {
+ }
+
+ public function get measuredWidth():Number
+ {
+ var view:TextButtonView = _strand.getBeadByType(TextButtonView) as TextButtonView;
+ if( view ) return Math.max(view.upTextField.textWidth,view.downTextField.textWidth,view.overTextField.textWidth);
+ else return 0;
+ }
+
+ public function get measuredHeight():Number
+ {
+ var view:TextButtonView = _strand.getBeadByType(TextButtonView) as TextButtonView;
+ if( view ) return Math.max(view.upTextField.textHeight,view.downTextField.textHeight,view.overTextField.textHeight);
+ else return 0;
+ }
+
+ private var _strand:IStrand;
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as
new file mode 100644
index 0000000..30447c9
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.controllers
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ public class AlertController implements IBeadController
+ {
+ public function AlertController()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ public function get strand():IStrand
+ {
+ return _strand;
+ }
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ IEventDispatcher(value).addEventListener("close",handleAlertClose);
+ }
+
+ private function handleAlertClose(event:Event):void
+ {
+ DisplayObject(_strand).parent.removeChild(DisplayObject(_strand));
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as
new file mode 100644
index 0000000..4b7b4de
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.controllers
+{
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.core.IComboBoxView;
+
+ public class ComboBoxController implements IBeadController
+ {
+ public function ComboBoxController()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ IEventDispatcher(value).addEventListener(MouseEvent.CLICK, clickHandler);
+ }
+
+ private function clickHandler(event:MouseEvent):void
+ {
+ var viewBead:IComboBoxView = _strand.getBeadByType(IComboBoxView) as IComboBoxView;
+ viewBead.popUpVisible = true;
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
+ popUpModel.dataProvider = selectionModel.dataProvider;
+ popUpModel.selectedIndex = selectionModel.selectedIndex;
+ DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
+ DisplayObject(viewBead.popUp).height = 200;
+ DisplayObject(viewBead.popUp).x = DisplayObject(_strand).x;
+ DisplayObject(viewBead.popUp).y = DisplayObject(_strand).y;
+ IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var viewBead:IComboBoxView = _strand.getBeadByType(IComboBoxView) as IComboBoxView;
+ viewBead.popUpVisible = false;
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.selectedIndex = popUpModel.selectedIndex;
+ IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as
new file mode 100644
index 0000000..a5e9583
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.controllers
+{
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ITextFieldView;
+
+ public class EditableTextKeyboardController implements IBead, IBeadController
+ {
+ public function EditableTextKeyboardController()
+ {
+ }
+
+ private var model:ITextModel;
+ private var textField:CSSTextField;
+
+ private var _strand:IStrand;
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ model = UIBase(_strand).model as ITextModel;
+
+ var viewBead:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
+ textField = viewBead.textField;
+ textField.addEventListener("change", inputChangeHandler);
+ }
+
+ private function inputChangeHandler( event:Object ) : void
+ {
+ model.text = textField.text;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as
new file mode 100644
index 0000000..68b2528
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as
@@ -0,0 +1,163 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.models
+{
+ import org.apache.flex.core.IAlertModel;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ public class AlertModel extends EventDispatcher implements IAlertModel, IBead
+ {
+ public function AlertModel()
+ {
+ super();
+ }
+
+ private var _strand:IStrand;
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+
+ private var _title:String;
+ public function get title():String
+ {
+ return _title;
+ }
+ public function set title(value:String):void
+ {
+ if( value != _title ) {
+ _title = value;
+ dispatchEvent( new Event("titleChange") );
+ }
+ }
+
+ private var _htmlTitle:String;
+ public function get htmlTitle():String
+ {
+ return _htmlTitle;
+ }
+ public function set htmlTitle(value:String):void
+ {
+ if( value != _htmlTitle ) {
+ _htmlTitle = value;
+ dispatchEvent( new Event("htmlTitleChange") );
+ }
+ }
+
+ private var _message:String;
+ public function get message():String
+ {
+ return _message;
+ }
+ public function set message(value:String):void
+ {
+ if( value != _message ) {
+ _message = value;
+ dispatchEvent( new Event("messageChange") );
+ }
+ }
+
+ private var _htmlMessage:String;
+ public function get htmlMessage():String
+ {
+ return _htmlMessage;
+ }
+ public function set htmlMessage(value:String):void
+ {
+ if( value != _htmlMessage )
+ {
+ _htmlMessage = value;
+ dispatchEvent( new Event("htmlMessageChange") );
+ }
+ }
+
+ private var _flags:uint;
+ public function get flags():uint
+ {
+ return _flags;
+ }
+ public function set flags(value:uint):void
+ {
+ if( value != _flags )
+ {
+ _flags = value;
+ dispatchEvent( new Event("flagsChange") );
+ }
+ }
+
+ private var _okLabel:String = "OK";
+ public function get okLabel():String
+ {
+ return _okLabel;
+ }
+ public function set okLabel(value:String):void
+ {
+ if( value != _okLabel )
+ {
+ _okLabel = value;
+ dispatchEvent( new Event("okLabelChange") );
+ }
+ }
+
+ private var _cancelLabel:String = "Cancel";
+ public function get cancelLabel():String
+ {
+ return _cancelLabel;
+ }
+ public function set cancelLabel(value:String):void
+ {
+ if( value != _cancelLabel )
+ {
+ _cancelLabel = value;
+ dispatchEvent( new Event("cancelLabelChange") );
+ }
+ }
+
+ private var _yesLabel:String = "YES";
+ public function get yesLabel():String
+ {
+ return _yesLabel;
+ }
+ public function set yesLabel(value:String):void
+ {
+ if( value != _yesLabel )
+ {
+ _yesLabel = value;
+ dispatchEvent( new Event("yesLabelChange") );
+ }
+ }
+
+ private var _noLabel:String = "NO";
+ public function get noLabel():String
+ {
+ return _noLabel;
+ }
+ public function set noLabel(value:String):void
+ {
+ if( value != _noLabel )
+ {
+ _noLabel = value;
+ dispatchEvent( new Event("noLabelChange") );
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as
new file mode 100644
index 0000000..fbc5a61
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.staticControls.beads.models.ArraySelectionModel;
+
+ public class ComboBoxModel extends ArraySelectionModel implements IBead, IComboBoxModel
+ {
+ public function ComboBoxModel()
+ {
+ }
+
+ private var _text:String;
+ public function get text():String
+ {
+ return _text;
+ }
+
+ public function set text(value:String):void
+ {
+ if (value != _text)
+ {
+ _text = value;
+ dispatchEvent(new Event("textChange"));
+ }
+ }
+
+ private var _html:String;
+ public function get html():String
+ {
+ return _html;
+ }
+
+ public function set html(value:String):void
+ {
+ if (value != _html)
+ {
+ _html = value;
+ dispatchEvent(new Event("htmlChange"));
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as
new file mode 100644
index 0000000..6c699f6
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.models
+{
+ import flash.geom.Rectangle;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBorderModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.EventDispatcher;
+
+ public class SingleLineBorderModel extends EventDispatcher implements IBead, IBorderModel
+ {
+ public function SingleLineBorderModel()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+
+ static private var rect:Rectangle = new Rectangle(1, 1, 1, 1);
+
+ public function get offsets():Rectangle
+ {
+ return rect;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as
new file mode 100644
index 0000000..1cfacba
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.beads.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ public class TextModel extends EventDispatcher implements IBead, ITextModel
+ {
+ public function TextModel()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+
+ private var _text:String;
+ public function get text():String
+ {
+ return _text;
+ }
+
+ public function set text(value:String):void
+ {
+ if (value != _text)
+ {
+ _text = value;
+ dispatchEvent(new Event("textChange"));
+ }
+ }
+
+ private var _html:String;
+ public function get html():String
+ {
+ return _html;
+ }
+
+ public function set html(value:String):void
+ {
+ if (value != _html)
+ {
+ _html = value;
+ dispatchEvent(new Event("htmlChange"));
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as b/frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as
new file mode 100644
index 0000000..15e95af
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.common.supportClasses
+{
+ import org.apache.flex.core.UIBase;
+
+ public class Border extends UIBase
+ {
+ public function Border()
+ {
+ super();
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/Alert.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/Alert.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/Alert.as
new file mode 100644
index 0000000..d12ad51
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/Alert.as
@@ -0,0 +1,85 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls
+{
+ import org.apache.flex.core.IAlertModel;
+ import org.apache.flex.core.IPopUp;
+ import org.apache.flex.core.UIBase;
+
+ public class Alert extends UIBase implements IPopUp
+ {
+ public static const YES:uint = 0x000001;
+ public static const NO:uint = 0x000002;
+ public static const OK:uint = 0x000004;
+ public static const CANCEL:uint = 0x000008;
+
+ public function Alert()
+ {
+ super();
+
+ className = "Alert";
+ }
+
+ // note: only passing parent to this function as I don't see a way to identify
+ // the 'application' or top level view without supplying a place to start to
+ // look for it.
+ static public function show( text:String, parent:Object, title:String="", flags:uint=Alert.OK ) : void
+ {
+ var alert:Alert = new Alert();
+ alert.message = text;
+ alert.title = title;
+ alert.flags = flags;
+
+ alert.show(parent);
+ }
+
+ public function show(parent:Object) : void
+ {
+ parent.addElement(this);
+ }
+
+ public function get title():String
+ {
+ return IAlertModel(model).title;
+ }
+ public function set title(value:String):void
+ {
+ IAlertModel(model).title = value;
+ }
+
+ public function get message():String
+ {
+ return IAlertModel(model).message;
+ }
+ public function set message(value:String):void
+ {
+ IAlertModel(model).message = value;
+ }
+
+ public function get flags():uint
+ {
+ return IAlertModel(model).flags;
+ }
+ public function set flags(value:uint):void
+ {
+ IAlertModel(model).flags = value;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as
new file mode 100644
index 0000000..ff3858c
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.UIButtonBase;
+ import org.apache.flex.events.IEventDispatcher;
+
+ public class Button extends UIButtonBase implements IStrand, IEventDispatcher, IUIBase
+ {
+ public function Button(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)
+ {
+ super(upState, overState, downState, hitTestState);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/ComboBox.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/ComboBox.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/ComboBox.as
new file mode 100644
index 0000000..17273c5
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/ComboBox.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls
+{
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.core.UIBase;
+
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ public class ComboBox extends UIBase
+ {
+ public function ComboBox()
+ {
+ super();
+ }
+
+ public function get dataProvider():Object
+ {
+ return IComboBoxModel(model).dataProvider;
+ }
+ public function set dataProvider(value:Object):void
+ {
+ IComboBoxModel(model).dataProvider = value;
+ }
+
+ public function get selectedIndex():int
+ {
+ return IComboBoxModel(model).selectedIndex;
+ }
+ public function set selectedIndex(value:int):void
+ {
+ IComboBoxModel(model).selectedIndex = value;
+ }
+
+ public function get selectedItem():Object
+ {
+ return IComboBoxModel(model).selectedItem;
+ }
+ public function set selectedItem(value:Object):void
+ {
+ IComboBoxModel(model).selectedItem = value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as
new file mode 100644
index 0000000..b0e1cda
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ public class Label extends UIBase
+ {
+ public function Label()
+ {
+ super();
+ }
+
+ public function get text():String
+ {
+ return ITextModel(model).text;
+ }
+ public function set text(value:String):void
+ {
+ ITextModel(model).text = value;
+ }
+
+ public function get html():String
+ {
+ return ITextModel(model).html;
+ }
+ public function set html(value:String):void
+ {
+ ITextModel(model).html = value;
+ }
+
+ override public function set width(value:Number):void
+ {
+ super.width = value;
+ IEventDispatcher(model).dispatchEvent( new Event("widthChanged") );
+ }
+
+ override public function set height(value:Number):void
+ {
+ super.height = value;
+ IEventDispatcher(model).dispatchEvent( new Event("heightChanged") );
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as
new file mode 100644
index 0000000..620aede
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.ITextModel;
+
+ public class TextButton extends Button
+ {
+ public function TextButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)
+ {
+ super(upState, overState, downState, hitTestState);
+ }
+
+ public function get text():String
+ {
+ return ITextModel(model).text;
+ }
+ public function set text(value:String):void
+ {
+ ITextModel(model).text = value;
+ }
+
+ public function get html():String
+ {
+ return ITextModel(model).html;
+ }
+ public function set html(value:String):void
+ {
+ ITextModel(model).html = value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as
new file mode 100644
index 0000000..fc87ba6
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+
+ public class TextInput extends UIBase
+ {
+ public function TextInput()
+ {
+ super();
+ }
+
+ public function get text():String
+ {
+ return ITextModel(model).text;
+ }
+ public function set text(value:String):void
+ {
+ ITextModel(model).text = value;
+ }
+
+ public function get html():String
+ {
+ return ITextModel(model).html;
+ }
+ public function set html(value:String):void
+ {
+ ITextModel(model).html = value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as
new file mode 100644
index 0000000..ff91119
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls.beads
+{
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IStrand;
+
+ public class AlertMeasurementBead implements IMeasurementBead
+ {
+ public function AlertMeasurementBead()
+ {
+ }
+
+ public function get measuredWidth():Number
+ {
+ return 0;
+ }
+
+ public function get measuredHeight():Number
+ {
+ return 0;
+ }
+
+ private var _strand:IStrand;
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as
new file mode 100644
index 0000000..b917e12
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as
@@ -0,0 +1,180 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls.beads
+{
+ import org.apache.flex.core.IAlertModel;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.UIMetrics;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.createjs.staticControls.Label;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.dynamicControls.Alert;
+ import org.apache.flex.html.staticControls.ControlBar;
+ import org.apache.flex.html.staticControls.TextButton;
+ import org.apache.flex.html.staticControls.TitleBar;
+ import org.apache.flex.utils.BeadMetrics;
+ import org.apache.flex.html.staticControls.beads.IBackgroundBead;
+ import org.apache.flex.html.staticControls.beads.IBorderBead;
+
+ public class AlertView implements IBeadView
+ {
+ public function AlertView()
+ {
+ }
+
+ private var _titleBar:TitleBar;
+ private var _controlBar:ControlBar;
+ private var _label:Label;
+ private var _okButton:TextButton;
+ private var _cancelButton:TextButton;
+ private var _yesButton:TextButton;
+ private var _noButton:TextButton;
+
+ private var _strand:IStrand;
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
+ if (backgroundColor != null || backgroundImage != null)
+ {
+ if (value.getBeadByType(IBackgroundBead) == null)
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
+ }
+
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
+ if (borderStyles is Array)
+ {
+ borderStyle = borderStyles[1];
+ }
+ if (borderStyle == null)
+ {
+ borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
+ }
+ if (borderStyle != null && borderStyle != "none")
+ {
+ if (value.getBeadByType(IBorderBead) == null)
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
+ }
+
+ var flags:uint = IAlertModel(UIBase(_strand).model).flags;
+ if( flags & Alert.OK ) {
+ _okButton = new TextButton();
+ _okButton.text = IAlertModel(UIBase(_strand).model).okLabel;
+ _okButton.addEventListener("click",handleOK);
+ }
+ if( flags & Alert.CANCEL ) {
+ _cancelButton = new TextButton();
+ _cancelButton.text = IAlertModel(UIBase(_strand).model).cancelLabel;
+ _cancelButton.addEventListener("click",handleCancel);
+ }
+ if( flags & Alert.YES ) {
+ _yesButton = new TextButton();
+ _yesButton.text = IAlertModel(UIBase(_strand).model).yesLabel;
+ _yesButton.addEventListener("click",handleYes);
+ }
+ if( flags & Alert.NO ) {
+ _noButton = new TextButton();
+ _noButton.text = IAlertModel(UIBase(_strand).model).noLabel;
+ _noButton.addEventListener("click",handleNo);
+ }
+
+ _titleBar = new TitleBar();
+ _titleBar.title = IAlertModel(UIBase(_strand).model).title;
+
+ _label = new Label();
+ _label.text = IAlertModel(UIBase(_strand).model).message;
+
+ _controlBar = new ControlBar();
+ if( _okButton ) _controlBar.addElement(_okButton);
+ if( _cancelButton ) _controlBar.addElement(_cancelButton);
+ if( _yesButton ) _controlBar.addElement(_yesButton);
+ if( _noButton ) _controlBar.addElement(_noButton);
+
+ IParent(_strand).addElement(_titleBar);
+ IParent(_strand).addElement(_controlBar);
+ IParent(_strand).addElement(_label);
+
+ sizeHandler(null);
+ }
+
+ private function sizeHandler(event:Event):void
+ {
+ var labelMeasure:IMeasurementBead = _label.measurementBead;
+ var titleMeasure:IMeasurementBead = _titleBar.measurementBead;
+ var ctrlMeasure:IMeasurementBead = _controlBar.measurementBead;
+ var maxWidth:Number = Math.max(titleMeasure.measuredWidth, ctrlMeasure.measuredWidth, labelMeasure.measuredWidth);
+
+ var metrics:UIMetrics = BeadMetrics.getMetrics(_strand);
+
+ _titleBar.x = metrics.left;
+ _titleBar.y = metrics.top;
+ _titleBar.width = maxWidth;
+
+ // content placement here
+ _label.x = metrics.left;
+ _label.y = _titleBar.y + _titleBar.height + 2;
+ _label.width = maxWidth;
+
+ _controlBar.x = metrics.left;
+ _controlBar.y = _label.y + _label.height + 2;
+ _controlBar.width = maxWidth;
+
+ UIBase(_strand).width = maxWidth + metrics.left + metrics.right;
+ UIBase(_strand).height = _controlBar.y + _controlBar.height + metrics.bottom + 2;
+ }
+
+ private function handleOK(event:Event):void
+ {
+ // create some custom event where the detail value
+ // is the OK button flag. Do same for other event handlers
+ dispatchCloseEvent(Alert.OK);
+ }
+
+ private function handleCancel(event:Event):void
+ {
+ dispatchCloseEvent(Alert.CANCEL);
+ }
+
+ private function handleYes(event:Event):void
+ {
+ dispatchCloseEvent(Alert.YES);
+ }
+
+ private function handleNo(event:Event):void
+ {
+ dispatchCloseEvent(Alert.NO);
+ }
+
+ public function dispatchCloseEvent(buttonFlag:uint):void
+ {
+ // TO DO: buttonFlag should be part of the event
+ var newEvent:Event = new Event("close",true);
+ IEventDispatcher(_strand).dispatchEvent(newEvent);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/ComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/ComboBoxView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/ComboBoxView.as
new file mode 100644
index 0000000..6ace705
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/ComboBoxView.as
@@ -0,0 +1,176 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.dynamicControls.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.Sprite;
+
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.core.IComboBoxView;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.dynamicControls.Button;
+ import org.apache.flex.html.dynamicControls.TextInput;
+
+ public class ComboBoxView implements IBeadView, IComboBoxView
+ {
+ public function ComboBoxView()
+ {
+ }
+
+ private var textInput:TextInput;
+ private var button:Button;
+
+ public function get text():String
+ {
+ return textInput.text;
+ }
+ public function set text(value:String):void
+ {
+ textInput.text = value;
+ }
+
+ public function get html():String
+ {
+ return textInput.html;
+ }
+ public function set html(value:String):void
+ {
+ textInput.html = value;
+ }
+ private var _strand:IStrand;
+
+ public function get strand():IStrand
+ {
+ return _strand;
+ }
+
+ private var selectionModel:IComboBoxModel;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ selectionModel = value.getBeadByType(IComboBoxModel) as IComboBoxModel;
+ selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
+
+ textInput = new TextInput();
+ IParent(strand).addElement(textInput);
+ textInput.width = 100;
+ textInput.height = 18;
+
+ upSprite = new Sprite();
+ drawButton( upSprite, "up", 18, 18 );
+ overSprite = new Sprite();
+ drawButton( overSprite, "over", 18, 18 );
+ downSprite = new Sprite();
+ drawButton( downSprite, "down", 18, 18 );
+
+ button = new Button( upSprite, overSprite, downSprite );
+ DisplayObjectContainer(strand).addChild(button);
+ button.width = 18;
+ button.height = 18;
+ button.x = textInput.width;
+ button.y = textInput.y;
+
+ // listen for events on the text input and modify the list and selection
+ textInput.addEventListener("change", textChangeHandler,false,0,true);
+ }
+
+ private var upSprite:Sprite;
+ private var overSprite:Sprite;
+ private var downSprite:Sprite;
+
+ private function drawButton( sprite:Sprite, mode:String, width:Number, height:Number ) : void
+ {
+ sprite.graphics.clear();
+ sprite.graphics.lineStyle(1,0xFFFFFF);
+ sprite.graphics.drawRect(0, 0, width-1, height-1);
+ sprite.graphics.lineStyle(-1);
+
+ if( mode == "over" ) sprite.graphics.beginFill(0xCCCCCC);
+ else if( mode == "down" ) sprite.graphics.beginFill(0x888888);
+ sprite.graphics.drawRect(0, 0, width-1, height-1);
+ sprite.graphics.endFill();
+
+ sprite.graphics.beginFill(0x333333);
+ sprite.graphics.moveTo(4,4);
+ sprite.graphics.lineTo(width-4,4);
+ sprite.graphics.lineTo(int(width/2),height-4);
+ sprite.graphics.lineTo(4,4);
+ sprite.graphics.endFill();
+ }
+
+ private var _popUp:IStrand;
+ public function get popUp():IStrand
+ {
+ return _popUp;
+ }
+
+ private var _popUpVisible:Boolean;
+
+ public function get popUpVisible():Boolean
+ {
+ return _popUpVisible;
+ }
+
+ public function set popUpVisible(value:Boolean):void
+ {
+ if (value != _popUpVisible)
+ {
+ _popUpVisible = value;
+ if (value)
+ {
+ if (!_popUp)
+ {
+ var popUpClass:Class = ValuesManager.valuesImpl.getValue(_strand, "iPopUp") as Class;
+ _popUp = new popUpClass() as IStrand;
+ }
+ var root:Object = DisplayObject(_strand).root;
+ var host:DisplayObjectContainer = DisplayObject(_strand).parent;
+ while (host && !(host is IPopUpHost))
+ host = host.parent;
+ if (host)
+ IPopUpHost(host).addElement(popUp);
+ }
+ else
+ {
+ DisplayObject(_popUp).parent.removeChild(_popUp as DisplayObject);
+ }
+ }
+ }
+
+ private function selectionChangeHandler(event:Event):void
+ {
+ text = selectionModel.selectedItem.toString();
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ var newEvent:Event = new Event("change");
+ IEventDispatcher(strand).dispatchEvent(newEvent);
+ }
+ }
+}
\ No newline at end of file