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:51 UTC
[1/2] 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.
Updated Branches:
refs/heads/features/dynamicControls [created] 90dd38428
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.as
new file mode 100644
index 0000000..449f616
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldLabelMeasurementBead.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.dynamicControls.beads
+{
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.html.dynamicControls.beads.TextFieldView;
+
+ public class TextFieldLabelMeasurementBead implements IMeasurementBead
+ {
+ public function TextFieldLabelMeasurementBead()
+ {
+ }
+
+ public function get measuredWidth():Number
+ {
+ var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
+ if( view ) return view.textField.textWidth;
+ else return 0;
+ }
+
+ public function get measuredHeight():Number
+ {
+ var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
+ if( view ) return view.textField.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/dynamicControls/beads/TextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldView.as b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldView.as
new file mode 100644
index 0000000..9e2c956
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextFieldView.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.text.TextFieldType;
+
+ public class TextFieldView extends TextFieldViewBase
+ {
+ public function TextFieldView()
+ {
+ super();
+
+ textField.selectable = false;
+ textField.type = TextFieldType.DYNAMIC;
+ textField.mouseEnabled = false;
+ }
+ }
+}
\ 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/TextFieldViewBase.as
----------------------------------------------------------------------
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputView.as
----------------------------------------------------------------------
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/dynamicControls/beads/TextInputWithBorderView.as
----------------------------------------------------------------------
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
----------------------------------------------------------------------
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,49 +34,36 @@ package org.apache.flex.html.staticControls
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;
}
-
- public function show(parent:Object) : void
+ private function set message(value:String):void
{
- parent.addElement(this);
+ IAlertModel(model).message = value;
}
- public function get title():String
+ private function get htmlMessage():String
{
- return IAlertModel(model).title;
+ return IAlertModel(model).htmlMessage;
}
- public function set title(value:String):void
+ private function set htmlMessage(value:String):void
{
- IAlertModel(model).title = value;
+ IAlertModel(model).htmlMessage = value;
}
- public function get message():String
- {
- return IAlertModel(model).message;
- }
- public function set message(value:String):void
+ public function show(parent:Object) : void
{
- IAlertModel(model).message = value;
+ parent.addElement(this);
}
- public function get flags():uint
+ static public function show(message:String, parent:Object):Alert
{
- 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;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
----------------------------------------------------------------------
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/accessories/NumericOnlyTextInputBead.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.accessories
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
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/accessories/PasswordInputBead.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.accessories
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
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
deleted file mode 100644
index 8199b28..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertMeasurementBead.as
+++ /dev/null
@@ -1,46 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
-{
- 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/staticControls/beads/AlertView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertView.as
deleted file mode 100644
index b02911a..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertView.as
+++ /dev/null
@@ -1,178 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
-{
- 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.staticControls.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;
-
- 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/staticControls/beads/ComboBoxView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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()
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/ContainerView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as
deleted file mode 100644
index e3866fc..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/IComboBoxView.as
+++ /dev/null
@@ -1,37 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
-{
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
-
- 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/html/staticControls/beads/IListView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
{
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
deleted file mode 100644
index 67fa049..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ITextFieldView.as
+++ /dev/null
@@ -1,27 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
-{
- import org.apache.flex.core.CSSTextField;
-
- 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/staticControls/beads/ListView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
deleted file mode 100644
index 5886073..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SingleLineBorderBead.as
+++ /dev/null
@@ -1,73 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
-{
- 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;
-
- 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/staticControls/beads/TextAreaView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as
deleted file mode 100644
index c6e3b6d..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextButtonMeasurementBead.as
+++ /dev/null
@@ -1,50 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads
-{
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
-
- 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/staticControls/beads/TextFieldViewBase.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputWithBorderView.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads
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
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as
deleted file mode 100644
index 01ba18a..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/AlertController.as
+++ /dev/null
@@ -1,52 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
-{
- import flash.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/staticControls/beads/controllers/ComboBoxController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ComboBoxController.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ComboBoxController.as
deleted file mode 100644
index ed2d228..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/ComboBoxController.as
+++ /dev/null
@@ -1,71 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
-{
- import flash.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.html.staticControls.beads.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/staticControls/beads/controllers/EditableTextKeyboardController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/EditableTextKeyboardController.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/EditableTextKeyboardController.as
deleted file mode 100644
index e505217..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/EditableTextKeyboardController.as
+++ /dev/null
@@ -1,55 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.controllers
-{
- import 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.html.staticControls.beads.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/staticControls/beads/layouts/NonVirtualHorizontalScrollingLayout.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads.layouts
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/layouts/NonVirtualVerticalScrollingLayout.as
----------------------------------------------------------------------
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 @@ package org.apache.flex.html.staticControls.beads.layouts
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
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as
deleted file mode 100644
index 12deea4..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/AlertModel.as
+++ /dev/null
@@ -1,163 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.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/staticControls/beads/models/ComboBoxModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
deleted file mode 100644
index 91d2ce0..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
+++ /dev/null
@@ -1,61 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.models
-{
- 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
- {
- 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/staticControls/beads/models/SingleLineBorderModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SingleLineBorderModel.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SingleLineBorderModel.as
deleted file mode 100644
index 39908e8..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SingleLineBorderModel.as
+++ /dev/null
@@ -1,49 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.staticControls.beads.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/staticControls/beads/models/TextModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.as
deleted file mode 100644
index 6a994b2..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/TextModel.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.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/staticControls/supportClasses/Border.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/Border.as b/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/Border.as
deleted file mode 100644
index 615e35c..0000000
--- a/frameworks/as/src/org/apache/flex/html/staticControls/supportClasses/Border.as
+++ /dev/null
@@ -1,31 +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.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/js/FlexJS/src/org/apache/flex/html/staticControls/ComboBox.js
----------------------------------------------------------------------
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 @@ goog.require('org.apache.flex.core.ListBase');
* @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 @@ goog.inherits(org.apache.flex.html.staticControls.ComboBox,
*/
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);
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/90dd3842/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/ComboBoxView.js
----------------------------------------------------------------------
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();
+*/
+};
[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
Posted by pe...@apache.org.
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