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.
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"/>
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>
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 @@
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 @@
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 @@
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 @@
{
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 @@
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 @@
{
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 @@
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 @@
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.staticControls.beads.TextButtonMeasurementBead");
+ 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.common.beads.TextButtonMeasurementBead");
}
TextFieldItemRenderer
@@ -283,9 +311,18 @@
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;
}
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>
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>
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 @@
*/
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 @@
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 @@
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;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as b/frameworks/as/src/org/apache/flex/core/IComboBoxView.as
similarity index 90%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as
rename to frameworks/as/src/org/apache/flex/core/IComboBoxView.as
index e3866fc..a4fb8d8 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as
+++ b/frameworks/as/src/org/apache/flex/core/IComboBoxView.as
@@ -16,10 +16,8 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.core
{
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
public interface IComboBoxView extends IBeadView
{
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 @@
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
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as b/frameworks/as/src/org/apache/flex/core/ITextFieldView.as
similarity index 91%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
rename to frameworks/as/src/org/apache/flex/core/ITextFieldView.as
index 67fa049..154c7dd 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
+++ b/frameworks/as/src/org/apache/flex/core/ITextFieldView.as
@@ -16,9 +16,8 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.core
{
- import org.apache.flex.core.CSSTextField;
public interface ITextFieldView
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as b/frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as
similarity index 93%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as
index 5886073..0eeb022 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/SingleLineBorderBead.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.html.common.beads
{
import flash.display.Graphics;
@@ -26,6 +26,8 @@
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
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as
similarity index 94%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as
index c6e3b6d..ed0b066 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/TextButtonMeasurementBead.as
@@ -16,10 +16,11 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+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
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as
similarity index 96%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as
index 01ba18a..30447c9 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/AlertController.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
+package org.apache.flex.html.common.beads.controllers
{
import flash.display.DisplayObject;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ComboBoxController.as b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as
similarity index 95%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ComboBoxController.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as
index ed2d228..4b7b4de 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ComboBoxController.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/ComboBoxController.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
+package org.apache.flex.html.common.beads.controllers
{
import flash.display.DisplayObject;
import flash.events.MouseEvent;
@@ -26,7 +26,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.staticControls.beads.IComboBoxView;
+ import org.apache.flex.core.IComboBoxView;
public class ComboBoxController implements IBeadController
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/EditableTextKeyboardController.as b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as
similarity index 93%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/EditableTextKeyboardController.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as
index e505217..a5e9583 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/EditableTextKeyboardController.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/controllers/EditableTextKeyboardController.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
+package org.apache.flex.html.common.beads.controllers
{
import org.apache.flex.core.CSSTextField;
import org.apache.flex.core.IBead;
@@ -24,7 +24,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.core.ITextModel;
import org.apache.flex.core.UIBase;
- import org.apache.flex.html.staticControls.beads.ITextFieldView;
+ import org.apache.flex.core.ITextFieldView;
public class EditableTextKeyboardController implements IBead, IBeadController
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as
similarity index 98%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as
index 12deea4..68b2528 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/AlertModel.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
+package org.apache.flex.html.common.beads.models
{
import org.apache.flex.core.IAlertModel;
import org.apache.flex.core.IBead;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as
similarity index 92%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as
index 91d2ce0..fbc5a61 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/ComboBoxModel.as
@@ -16,11 +16,12 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
+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
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SingleLineBorderModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as
similarity index 96%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SingleLineBorderModel.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as
index 39908e8..6c699f6 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SingleLineBorderModel.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/SingleLineBorderModel.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
+package org.apache.flex.html.common.beads.models
{
import flash.geom.Rectangle;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as b/frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as
similarity index 96%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as
rename to frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as
index 6a994b2..1cfacba 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as
+++ b/frameworks/as/src/org/apache/flex/html/common/beads/models/TextModel.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
+package org.apache.flex.html.common.beads.models
{
import org.apache.flex.core.IBead;
import org.apache.flex.core.IStrand;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/Border.as b/frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as
similarity index 94%
rename from frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/Border.as
rename to frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as
index 615e35c..15e95af 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/Border.as
+++ b/frameworks/as/src/org/apache/flex/html/common/supportClasses/Border.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.supportClasses
+package org.apache.flex.html.common.supportClasses
{
import org.apache.flex.core.UIBase;
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
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as
similarity index 66%
copy from frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
copy to frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as
index 8199b28..ff3858c 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/Button.as
@@ -16,31 +16,20 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.html.dynamicControls
{
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
+ import flash.display.DisplayObject;
- public class AlertMeasurementBead implements IMeasurementBead
+ 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 AlertMeasurementBead()
+ public function Button(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)
{
- }
-
- 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;
+ super(upState, overState, downState, hitTestState);
}
}
}
\ No newline at end of file
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
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as
similarity index 65%
copy from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as
copy to frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as
index 6a994b2..b0e1cda 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/Label.as
@@ -16,55 +16,48 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
+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.EventDispatcher;
-
- public class TextModel extends EventDispatcher implements IBead, ITextModel
+ import org.apache.flex.events.IEventDispatcher;
+
+ public class Label extends UIBase
{
- public function TextModel()
+ public function Label()
{
+ super();
}
- private var _strand:IStrand;
-
- public function set strand(value:IStrand):void
- {
- _strand = value;
- }
-
- private var _text:String;
public function get text():String
{
- return _text;
+ return ITextModel(model).text;
}
-
public function set text(value:String):void
{
- if (value != _text)
- {
- _text = value;
- dispatchEvent(new Event("textChange"));
- }
+ ITextModel(model).text = value;
}
- private var _html:String;
public function get html():String
{
- return _html;
+ return ITextModel(model).html;
}
-
public function set html(value:String):void
{
- if (value != _html)
- {
- _html = value;
- dispatchEvent(new Event("htmlChange"));
- }
+ 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
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as
similarity index 66%
copy from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
copy to frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as
index 91d2ce0..620aede 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextButton.as
@@ -16,46 +16,35 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
+package org.apache.flex.html.dynamicControls
{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IComboBoxModel;
- import org.apache.flex.events.Event;
-
- public class ComboBoxModel extends ArraySelectionModel implements IBead, IComboBoxModel
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.ITextModel;
+
+ public class TextButton extends Button
{
- public function ComboBoxModel()
+ public function TextButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)
{
+ super(upState, overState, downState, hitTestState);
}
-
- private var _text:String;
+
public function get text():String
{
- return _text;
+ return ITextModel(model).text;
}
-
public function set text(value:String):void
{
- if (value != _text)
- {
- _text = value;
- dispatchEvent(new Event("textChange"));
- }
+ ITextModel(model).text = value;
}
- private var _html:String;
public function get html():String
{
- return _html;
+ return ITextModel(model).html;
}
-
public function set html(value:String):void
{
- if (value != _html)
- {
- _html = value;
- dispatchEvent(new Event("htmlChange"));
- }
+ ITextModel(model).html = value;
}
}
}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as
similarity index 66%
copy from frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
copy to frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as
index 91d2ce0..fc87ba6 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/TextInput.as
@@ -16,46 +16,34 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
+package org.apache.flex.html.dynamicControls
{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IComboBoxModel;
- import org.apache.flex.events.Event;
-
- public class ComboBoxModel extends ArraySelectionModel implements IBead, IComboBoxModel
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+
+ public class TextInput extends UIBase
{
- public function ComboBoxModel()
+ public function TextInput()
{
+ super();
}
-
- private var _text:String;
+
public function get text():String
{
- return _text;
+ return ITextModel(model).text;
}
-
public function set text(value:String):void
{
- if (value != _text)
- {
- _text = value;
- dispatchEvent(new Event("textChange"));
- }
+ ITextModel(model).text = value;
}
- private var _html:String;
public function get html():String
{
- return _html;
+ return ITextModel(model).html;
}
-
public function set html(value:String):void
{
- if (value != _html)
- {
- _html = value;
- dispatchEvent(new Event("htmlChange"));
- }
+ ITextModel(model).html = value;
}
}
}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as
similarity index 96%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
rename to frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as
index 8199b28..ff91119 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertMeasurementBead.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.html.dynamicControls.beads
{
import org.apache.flex.core.IMeasurementBead;
import org.apache.flex.core.IStrand;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as
similarity index 96%
rename from frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertView.as
rename to frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as
index b02911a..b917e12 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertView.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/AlertView.as
@@ -16,7 +16,7 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.html.dynamicControls.beads
{
import org.apache.flex.core.IAlertModel;
import org.apache.flex.core.IBead;
@@ -30,11 +30,13 @@
import org.apache.flex.createjs.staticControls.Label;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.staticControls.Alert;
+ 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
{
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
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.as
similarity index 70%
copy from frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
copy to frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.as
index 8199b28..449f616 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.as
@@ -16,25 +16,30 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.html.dynamicControls.beads
{
import org.apache.flex.core.IMeasurementBead;
import org.apache.flex.core.IStrand;
+ import org.apache.flex.html.dynamicControls.beads.TextFieldView;
- public class AlertMeasurementBead implements IMeasurementBead
+ public class TextFieldLabelMeasurementBead implements IMeasurementBead
{
- public function AlertMeasurementBead()
+ public function TextFieldLabelMeasurementBead()
{
}
public function get measuredWidth():Number
{
- return 0;
+ var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
+ if( view ) return view.textField.textWidth;
+ else return 0;
}
public function get measuredHeight():Number
{
- return 0;
+ var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
+ if( view ) return view.textField.textHeight;
+ else return 0;
}
private var _strand:IStrand;
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldView.as
similarity index 76%
copy from frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
copy to frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldView.as
index 67fa049..9e2c956 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldView.as
@@ -16,12 +16,19 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
+package org.apache.flex.html.dynamicControls.beads
{
- import org.apache.flex.core.CSSTextField;
+ import flash.text.TextFieldType;
- public interface ITextFieldView
+ public class TextFieldView extends TextFieldViewBase
{
- function get textField():CSSTextField;
+ public function TextFieldView()
+ {
+ super();
+
+ textField.selectable = false;
+ textField.type = TextFieldType.DYNAMIC;
+ textField.mouseEnabled = false;
+ }
}
}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldViewBase.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldViewBase.as
new file mode 100644
index 0000000..79e6cdd
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldViewBase.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.ITextFieldView;
+ import org.apache.flex.events.Event;
+
+ public class TextFieldViewBase implements IBeadView, ITextFieldView
+ {
+ public function TextFieldViewBase()
+ {
+ _textField = new CSSTextField();
+ }
+
+ private var _textField:CSSTextField;
+
+ public function get textField() : CSSTextField
+ {
+ return _textField;
+ }
+
+ private var _textModel:ITextModel;
+
+ public function get textModel() : ITextModel
+ {
+ return _textModel;
+ }
+
+ private var _strand:IStrand;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ _textModel = value.getBeadByType(ITextModel) as ITextModel;
+ textModel.addEventListener("textChange", textChangeHandler);
+ textModel.addEventListener("htmlChange", htmlChangeHandler);
+ textModel.addEventListener("widthChanged", sizeChangeHandler);
+ textModel.addEventListener("heightChanged", sizeChangeHandler);
+ DisplayObjectContainer(value).addChild(_textField);
+ sizeChangeHandler(null);
+ if (textModel.text !== null)
+ text = textModel.text;
+ if (textModel.html !== null)
+ html = textModel.html;
+ }
+
+ public function get strand() : IStrand
+ {
+ return _strand;
+ }
+
+ public function get text():String
+ {
+ return _textField.text;
+ }
+ public function set text(value:String):void
+ {
+ if (value == null)
+ value = "";
+ _textField.text = value;
+ }
+
+ public function get html():String
+ {
+ return _textField.htmlText;
+ }
+
+ public function set html(value:String):void
+ {
+ _textField.htmlText = value;
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = textModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = textModel.html;
+ }
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ textField.width = DisplayObject(_strand).width;
+ textField.height = DisplayObject(_strand).height;
+ }
+ }
+}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputView.as
new file mode 100644
index 0000000..889751d
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputView.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.text.TextFieldType;
+
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ public class TextInputView extends TextFieldViewBase
+ {
+ public function TextInputView()
+ {
+ super();
+
+ textField.selectable = true;
+ textField.type = TextFieldType.INPUT;
+ textField.mouseEnabled = true;
+ textField.multiline = false;
+ textField.wordWrap = false;
+ }
+
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ // Default size
+ var ww:Number = DisplayObject(strand).width;
+ if( isNaN(ww) || ww == 0 ) DisplayObject(strand).width = 100;
+ var hh:Number = DisplayObject(strand).height;
+ if( isNaN(hh) || hh == 0 ) DisplayObject(strand).height = 18;
+
+ IEventDispatcher(strand).addEventListener("widthChanged", sizeChangedHandler);
+ IEventDispatcher(strand).addEventListener("heightChanged", sizeChangedHandler);
+ sizeChangedHandler(null);
+ }
+
+ private function sizeChangedHandler(event:Event):void
+ {
+ var ww:Number = DisplayObject(strand).width;
+ if( !isNaN(ww) && ww > 0 ) textField.width = ww;
+
+ var hh:Number = DisplayObject(strand).height;
+ if( !isNaN(hh) && hh > 0 ) textField.height = hh;
+ }
+ }
+}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputWithBorderView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputWithBorderView.as
new file mode 100644
index 0000000..87f9b55
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputWithBorderView.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.core.IParent;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.common.beads.SingleLineBorderBead;
+ import org.apache.flex.html.common.beads.models.SingleLineBorderModel;
+ import org.apache.flex.html.common.supportClasses.Border;
+
+ public class TextInputWithBorderView extends TextInputView
+ {
+ public function TextInputWithBorderView()
+ {
+ super();
+ }
+
+ private var _border:Border;
+
+ public function get border():Border
+ {
+ return _border;
+ }
+
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ // add a border to this
+ _border = new Border();
+ _border.model = new SingleLineBorderModel();
+ _border.addBead(new SingleLineBorderBead());
+ IParent(strand).addElement(border);
+
+ IEventDispatcher(strand).addEventListener("widthChanged", sizeChangedHandler);
+ IEventDispatcher(strand).addEventListener("heightChanged", sizeChangedHandler);
+ sizeChangedHandler(null);
+ }
+
+ private function sizeChangedHandler(event:Event):void
+ {
+ var ww:Number = DisplayObject(strand).width;
+ _border.width = ww;
+
+ var hh:Number = DisplayObject(strand).height;
+ _border.height = hh;
+ }
+ }
+}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as b/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
index b3cf5e2..0e06086 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
@@ -17,18 +17,16 @@
//
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.html.staticControls
-{
+{
import org.apache.flex.core.IAlertModel;
import org.apache.flex.core.IPopUp;
import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+
+ [Event(name="close", type="org.apache.flex.events.Event")]
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();
@@ -36,17 +34,22 @@
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
+ private function get message():String
{
- var alert:Alert = new Alert();
- alert.message = text;
- alert.title = title;
- alert.flags = flags;
-
- alert.show(parent);
+ return IAlertModel(model).message;
+ }
+ private function set message(value:String):void
+ {
+ IAlertModel(model).message = value;
+ }
+
+ private function get htmlMessage():String
+ {
+ return IAlertModel(model).htmlMessage;
+ }
+ private function set htmlMessage(value:String):void
+ {
+ IAlertModel(model).htmlMessage = value;
}
public function show(parent:Object) : void
@@ -54,31 +57,13 @@
parent.addElement(this);
}
- public function get title():String
+ static public function show(message:String, parent:Object):Alert
{
- 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;
+ var alert:Alert = new Alert();
+ alert.message = message;
+ alert.show(parent);
+
+ return alert;
}
}
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
deleted file mode 100644
index cf4cc8c..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
+++ /dev/null
@@ -1,70 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls
-{
- import org.apache.flex.core.IAlertModel;
- import org.apache.flex.core.IPopUp;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
-
- [Event(name="close", type="org.apache.flex.events.Event")]
-
- public class SimpleAlert extends UIBase implements IPopUp
- {
- public function SimpleAlert()
- {
- super();
-
- className = "SimpleAlert";
- }
-
- private function get message():String
- {
- return IAlertModel(model).message;
- }
- private function set message(value:String):void
- {
- IAlertModel(model).message = value;
- }
-
- private function get htmlMessage():String
- {
- return IAlertModel(model).htmlMessage;
- }
- private function set htmlMessage(value:String):void
- {
- IAlertModel(model).htmlMessage = value;
- }
-
- public function show(parent:Object) : void
- {
- parent.addElement(this);
- }
-
- static public function show(message:String, parent:Object):SimpleAlert
- {
- var alert:SimpleAlert = new SimpleAlert();
- alert.message = message;
- alert.show(parent);
-
- return alert;
- }
-
- }
-}
\ No newline at end of file
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/accessories/NumericOnlyTextInputBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/accessories/NumericOnlyTextInputBead.as
index b92a317..cf6a5e7 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/accessories/NumericOnlyTextInputBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/accessories/NumericOnlyTextInputBead.as
@@ -25,7 +25,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.staticControls.beads.ITextFieldView;
+ import org.apache.flex.core.ITextFieldView;
public class NumericOnlyTextInputBead implements IBead
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/accessories/PasswordInputBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/accessories/PasswordInputBead.as
index 9280317..5235edb 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/accessories/PasswordInputBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/accessories/PasswordInputBead.as
@@ -23,7 +23,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.staticControls.beads.ITextFieldView;
+ import org.apache.flex.core.ITextFieldView;
public class PasswordInputBead implements IBead
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxView.as
index d7a5bba..b241c54 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxView.as
@@ -24,16 +24,17 @@
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.core.IParent;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
import org.apache.flex.html.staticControls.Button;
import org.apache.flex.html.staticControls.TextInput;
- public class ComboBoxView implements IBeadView, IComboBoxView
+ public class ComboBoxView implements IBeadView, org.apache.flex.core.IComboBoxView
{
public function ComboBoxView()
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerView.as
index c0eb0b7..be9faf1 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerView.as
@@ -30,7 +30,7 @@
import org.apache.flex.core.ValuesManager;
import org.apache.flex.html.staticControls.Container;
import org.apache.flex.html.staticControls.ContainerContentArea;
- 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 class ContainerView implements IBeadView, ILayoutParent
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListView.as
index 8e74ff4..baff324 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IListView.as
@@ -20,7 +20,7 @@
{
import org.apache.flex.core.IItemRendererParent;
import org.apache.flex.core.IStrand;
- 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 IListView
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListView.as
index dbe9e36..2180c5c 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListView.as
@@ -33,10 +33,11 @@
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.html.staticControls.beads.models.ScrollBarModel;
- import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
- import org.apache.flex.html.staticControls.supportClasses.Border;
+ import org.apache.flex.html.common.beads.models.SingleLineBorderModel;
+ import org.apache.flex.html.common.supportClasses.Border;
import org.apache.flex.html.staticControls.supportClasses.NonVirtualDataGroup;
import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
+ import org.apache.flex.html.common.beads.SingleLineBorderBead;
public class ListView extends Strand implements IBeadView, IStrand, IListView, ILayoutParent
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
index 27308ef..523aa0c 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
@@ -33,7 +33,7 @@
import org.apache.flex.html.staticControls.Spinner;
import org.apache.flex.html.staticControls.TextInput;
import org.apache.flex.html.staticControls.beads.layouts.NonVirtualHorizontalLayout;
- 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 class NumericStepperView implements IBeadView, ILayoutParent
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextAreaView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextAreaView.as
index bea4cb5..7dd6d16 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextAreaView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextAreaView.as
@@ -28,9 +28,10 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.core.IParent;
import org.apache.flex.html.staticControls.beads.models.ScrollBarModel;
- import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
- import org.apache.flex.html.staticControls.supportClasses.Border;
+ import org.apache.flex.html.common.beads.models.SingleLineBorderModel;
+ import org.apache.flex.html.common.supportClasses.Border;
import org.apache.flex.html.staticControls.supportClasses.ScrollBar;
+ import org.apache.flex.html.common.beads.SingleLineBorderBead;
public class TextAreaView extends TextFieldViewBase implements IStrand
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldViewBase.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldViewBase.as
index 5f5ba8f..9c958b6 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldViewBase.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldViewBase.as
@@ -26,6 +26,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.core.ITextModel;
import org.apache.flex.events.Event;
+ import org.apache.flex.core.ITextFieldView;
public class TextFieldViewBase implements IBeadView, ITextFieldView
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputWithBorderView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputWithBorderView.as
index 8d5e405..f3746d3 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputWithBorderView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputWithBorderView.as
@@ -22,10 +22,11 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.core.IParent;
- import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
- import org.apache.flex.html.staticControls.supportClasses.Border;
+ import org.apache.flex.html.common.beads.models.SingleLineBorderModel;
+ import org.apache.flex.html.common.supportClasses.Border;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.common.beads.SingleLineBorderBead;
public class TextInputWithBorderView extends TextInputView
{
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalScrollingLayout.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalScrollingLayout.as
index 00dcfc1..5634b8d 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalScrollingLayout.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualHorizontalScrollingLayout.as
@@ -29,7 +29,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- 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 class NonVirtualHorizontalScrollingLayout implements IBeadLayout
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
index 0bc9dfd..1bbeb3a 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
@@ -29,7 +29,7 @@
import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- 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 class NonVirtualVerticalScrollingLayout implements IBeadLayout
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
index 04f88b4..0b1c6f8 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
@@ -15,6 +15,9 @@
goog.provide('org.apache.flex.html.staticControls.ComboBox');
goog.require('org.apache.flex.core.ListBase');
+goog.require('org.apache.flex.html.staticControls.beads.models.ArraySelectionModel');
+goog.require('org.apache.flex.html.staticControls.beads.TextItemRendererFactoryForArrayData');
+goog.require('org.apache.flex.html.staticControls.beads.ComboBoxView');
@@ -23,7 +26,13 @@
* @extends {org.apache.flex.core.ListBase}
*/
org.apache.flex.html.staticControls.ComboBox = function() {
+
+ this.model = new
+ org.apache.flex.html.staticControls.beads.models.ArraySelectionModel();
+ this.addBead(this.model);
+
goog.base(this);
+
};
goog.inherits(org.apache.flex.html.staticControls.ComboBox,
org.apache.flex.core.ListBase);
@@ -35,136 +44,12 @@
*/
org.apache.flex.html.staticControls.ComboBox.prototype.createElement =
function() {
- var button, input;
-
- this.element = document.createElement('div');
-
- input = document.createElement('input');
- input.style.position = 'absolute';
- input.style.width = '80px';
- this.element.appendChild(input);
-
- button = document.createElement('div');
- button.style.position = 'absolute';
- button.style.top = '0px';
- button.style.right = '0px';
- button.style.background = '#bbb';
- button.style.width = '16px';
- button.style.height = '20px';
- button.style.margin = '0';
- button.style.border = 'solid #609 1px';
- goog.events.listen(button, 'click', goog.bind(this.buttonClicked, this));
- this.element.appendChild(button);
-
- this.element.style.position = 'relative';
-
- this.positioner = this.element;
-
- // add a click handler so that a click outside of the combo box can
- // dismiss the pop-up should it be visible.
- goog.events.listen(document, 'click',
- goog.bind(this.dismissPopup, this));
-
- input.flexjs_wrapper = this;
-};
-
-
-/**
- * @expose
- * @this {org.apache.flex.html.staticControls.ComboBox}
- * @param {string} event The event.
- */
-org.apache.flex.html.staticControls.ComboBox.prototype.selectChanged =
- function(event) {
- var select;
-
- select = event.currentTarget;
-
- this.set_selectedItem(select.options[select.selectedIndex].value);
-
- this.popup.parentNode.removeChild(this.popup);
- this.popup = null;
-
- this.dispatchEvent(event);
-};
-
-
-/**
- * @expose
- * @this {org.apache.flex.html.staticControls.ComboBox}
- * @param {string} event The event.
- */
-org.apache.flex.html.staticControls.ComboBox.prototype.dismissPopup =
- function(event) {
- // remove the popup if it already exists
- if (this.popup) {
- this.popup.parentNode.removeChild(this.popup);
- this.popup = null;
- }
-};
-
-
-/**
- * @expose
- * @this {org.apache.flex.html.staticControls.ComboBox}
- * @param {string} event The event.
- */
-org.apache.flex.html.staticControls.ComboBox.prototype.buttonClicked =
- function(event) {
- var dp, i, input, left, n, opt, opts, pn, popup, select, si, top, width;
-
- event.stopPropagation();
-
- if (this.popup) {
- this.dismissPopup();
-
- return;
- }
-
- input = this.element.childNodes.item(0);
-
- pn = this.element;
- top = pn.offsetTop + input.offsetHeight;
- left = pn.offsetLeft;
- width = pn.offsetWidth;
-
- popup = document.createElement('div');
- popup.className = 'popup';
- popup.id = 'test';
- popup.style.position = 'absolute';
- popup.style.top = top.toString() + 'px';
- popup.style.left = left.toString() + 'px';
- popup.style.width = width.toString() + 'px';
- popup.style.margin = '0px auto';
- popup.style.padding = '0px';
- popup.style.zIndex = '10000';
-
- select = document.createElement('select');
- select.style.width = width.toString() + 'px';
- goog.events.listen(select, 'change', goog.bind(this.selectChanged, this));
- opts = select.options;
-
- dp = this.get_dataProvider();
- n = dp.length;
- for (i = 0; i < n; i++) {
- opt = document.createElement('option');
- opt.text = dp[i];
- opts.add(opt);
- }
-
- select.size = n;
-
- si = this.get_selectedIndex();
- if (si < 0) {
- select.value = null;
- } else {
- select.value = dp[si];
- }
-
- this.popup = popup;
-
- popup.appendChild(select);
- document.body.appendChild(popup);
+ goog.base(this,'createElement');
+
+ this.set_className('ComboBox');
+
+ this.viewBead = new org.apache.flex.html.staticControls.beads.ComboBoxView();
+ this.addBead(this.viewBead);
};
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ComboBoxView.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ComboBoxView.js
new file mode 100644
index 0000000..1829085
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ComboBoxView.js
@@ -0,0 +1,186 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.html.staticControls.beads.ComboBoxView');
+
+goog.require('org.apache.flex.core.IItemRendererParent');
+goog.require('org.apache.flex.html.staticControls.beads.TextItemRendererFactoryForArrayData');
+goog.require('org.apache.flex.html.staticControls.beads.models.ArraySelectionModel');
+goog.require('org.apache.flex.html.staticControls.supportClasses.NonVirtualDataGroup');
+
+/**
+ * @constructor
+ */
+org.apache.flex.html.staticControls.beads.ComboBoxView = function() {
+ this.lastSelectedIndex = -1;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.ComboBoxView}
+ * @param {Object} value The new host.
+ */
+org.apache.flex.html.staticControls.beads.ComboBoxView.prototype.set_strand =
+ function(value) {
+
+ this.strand_ = value;
+
+ this.model = value.getBeadByType(
+ org.apache.flex.html.staticControls.beads.models.ArraySelectionModel);
+ this.model.addEventListener('selectedIndexChanged',
+ goog.bind(this.selectionChangeHandler, this));
+
+ this.input = document.createElement('input');
+ this.input.style.position = 'relative';
+ this.input.style.width = '80px';
+ this.input.style.height = '21px';
+ this.strand_.element.appendChild(this.input);
+
+ this.button = document.createElement('div');
+ this.button.style.position = 'relative';
+ this.button.style.top = '0px';
+ this.button.style.left = '80px';
+ this.button.style.background = '#bbb';
+ this.button.style.width = '50px';
+ this.button.style.height = '21px';
+ this.button.style.margin = '0';
+ this.button.style.border = 'solid #609 1px';
+ goog.events.listen(this.button, 'click', goog.bind(this.buttonClicked, this));
+ this.strand_.element.appendChild(this.button);
+
+
+ // add a click handler so that a click outside of the combo box can
+ // dismiss the pop-up should it be visible.
+ goog.events.listen(document, 'click',
+ goog.bind(this.dismissPopup, this));
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.ComboBox}
+ * @param {string} event The event.
+ */
+org.apache.flex.html.staticControls.beads.ComboBoxView.prototype.dismissPopup =
+ function(event) {
+ // remove the popup if it already exists
+ if (this.popup) {
+ this.popup.parentNode.removeChild(this.popup);
+ this.popup = null;
+ }
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.ComboBox}
+ * @param {string} event The event.
+ */
+org.apache.flex.html.staticControls.beads.ComboBoxView.prototype.buttonClicked =
+ function(event) {
+ var dp, i, left, n, opt, opts, pn, popup, select, si, top, width;
+
+ event.stopPropagation();
+
+ if (this.popup) {
+ this.dismissPopup();
+
+ return;
+ }
+
+ pn = this.strand_.element;
+ top = pn.offsetTop + this.input.offsetHeight;
+ left = pn.offsetLeft;
+ width = pn.offsetWidth;
+
+ popup = document.createElement('div');
+ popup.className = 'popup';
+ popup.id = 'test';
+ popup.style.position = 'absolute';
+ popup.style.top = top.toString() + 'px';
+ popup.style.left = left.toString() + 'px';
+ popup.style.width = width.toString() + 'px';
+ popup.style.margin = '0px auto';
+ popup.style.padding = '0px';
+ popup.style.zIndex = '10000';
+
+ select = document.createElement('select');
+ select.style.width = width.toString() + 'px';
+ goog.events.listen(select, 'change', goog.bind(this.selectChanged, this));
+ opts = select.options;
+
+ dp = this.strand_.get_dataProvider();
+ n = dp.length;
+/* for (i = 0; i < n; i++) {
+ opt = document.createElement('option');
+ opt.text = dp[i];
+ opts.add(opt);
+ }
+
+ select.size = n;
+
+ si = this.get_selectedIndex();
+ if (si < 0) {
+ select.value = null;
+ } else {
+ select.value = dp[si];
+ }
+*/
+ this.popup = popup;
+
+ popup.appendChild(select);
+ document.body.appendChild(popup);
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.ComboBoxView}
+ * @param {string} event The event.
+ */
+org.apache.flex.html.staticControls.beads.ComboBoxView.prototype.selectChanged =
+ function(event) {
+ var select;
+
+ select = event.currentTarget;
+
+ this.set_selectedItem(select.options[select.selectedIndex].value);
+
+ this.popup.parentNode.removeChild(this.popup);
+ this.popup = null;
+
+ this.dispatchEvent(event);
+};
+
+
+/**
+ * @expose
+ * @this {org.apache.flex.html.staticControls.beads.ComboBoxView}
+ * @param {object} value The event that triggered the selection.
+ */
+org.apache.flex.html.staticControls.beads.ComboBoxView.prototype.
+selectionChangeHandler = function(value) {
+/*
+ if (this.lastSelectedIndex != -1) {
+ var ir = this.dataGroup_.getItemRendererForIndex(this.lastSelectedIndex);
+ if (ir) ir.set_selected(false);
+ }
+ if (this.model.get_selectedIndex() != -1) {
+ ir = this.dataGroup_.getItemRendererForIndex(
+ this.model.get_selectedIndex());
+ if (ir) ir.set_selected(true);
+ }
+ this.lastSelectedIndex = this.model.get_selectedIndex();
+*/
+};