http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as deleted file mode 100644 index fa91fec..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as +++ /dev/null @@ -1,277 +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 -{ - import org.apache.flex.core.IComboBoxModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.events.Event; - - COMPILE::JS - { - import goog.events; - import org.apache.flex.core.WrappedHTMLElement; - } - - [Event(name="change", type="org.apache.flex.events.Event")] - - /** - * The ComboBox class is a component that displays an input field and - * pop-up List with selections. Selecting an item from the pop-up List - * places that item into the input field of the ComboBox. The ComboBox - * uses the following bead types: - * - * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and - * so forth. - * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the component. - * org.apache.flex.core.IBeadController: the bead that handles input and output. - * org.apache.flex.core.IPopUp: the bead responsible for displaying the selection list. - * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders. - * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the component. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ComboBox extends UIBase - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ComboBox() - { - super(); - } - - /** - * The data for display by the ComboBox. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get dataProvider():Object - { - return IComboBoxModel(model).dataProvider; - } - public function set dataProvider(value:Object):void - { - IComboBoxModel(model).dataProvider = value; - } - - /** - * The index of the currently selected item. Changing this item changes - * the selectedItem value. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedIndex():int - { - return IComboBoxModel(model).selectedIndex; - } - public function set selectedIndex(value:int):void - { - IComboBoxModel(model).selectedIndex = value; - } - - /** - * The item that is currently selected. Changing this item changes - * the selectedIndex. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedItem():Object - { - return IComboBoxModel(model).selectedItem; - } - public function set selectedItem(value:Object):void - { - IComboBoxModel(model).selectedItem = value; - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - var button:WrappedHTMLElement; - var input:WrappedHTMLElement; - - element = document.createElement('div') as WrappedHTMLElement; - - input = document.createElement('input') as WrappedHTMLElement; - input.style.position = 'absolute'; - input.style.width = '80px'; - element.appendChild(input); - - button = document.createElement('div') as WrappedHTMLElement; - 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', buttonClicked); - element.appendChild(button); - - positioner = element; - positioner.style.position = 'relative'; - - // 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', - dismissPopup); - - input.flexjs_wrapper = this; - - return element; - } - - COMPILE::JS - private var popup:HTMLElement; - - /** - * @param event The event. - * @flexjsignorecoercion HTMLSelectElement - */ - COMPILE::JS - private function selectChanged(event:Event):void - { - var select:HTMLSelectElement; - - select = event.currentTarget as HTMLSelectElement; - - selectedItem = select.options[select.selectedIndex].value; - - popup.parentNode.removeChild(popup); - popup = null; - - dispatchEvent(event); - } - - - /** - * @param event The event. - */ - COMPILE::JS - private function dismissPopup(event:Event):void - { - // remove the popup if it already exists - if (popup) { - popup.parentNode.removeChild(popup); - popup = null; - } - } - - - /** - * @export - * @param {Object} event The event. - * @flexjsignorecoercion HTMLInputElement - * @flexjsignorecoercion HTMLElement - * @flexjsignorecoercion HTMLSelectElement - * @flexjsignorecoercion HTMLOptionElement - * @flexjsignorecoercion Array - */ - COMPILE::JS - private function buttonClicked(event:Event):void - { - var dp:Array; - var i:int; - var input:HTMLInputElement; - var left:Number; - var n:int; - var opt:HTMLOptionElement; - var pn:HTMLElement; - var popup:HTMLElement; - var select:HTMLSelectElement; - var si:int; - var top:Number; - var width:Number; - - event.stopPropagation(); - - if (popup) { - dismissPopup(null); - - return; - } - - input = element.childNodes.item(0) as HTMLInputElement; - - pn = element; - top = pn.offsetTop + input.offsetHeight; - left = pn.offsetLeft; - width = pn.offsetWidth; - - popup = document.createElement('div') as HTMLElement; - 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') as HTMLSelectElement; - select.style.width = width.toString() + 'px'; - goog.events.listen(select, 'change', selectChanged); - - dp = dataProvider as Array; - n = dp.length; - for (i = 0; i < n; i++) { - opt = document.createElement('option') as HTMLOptionElement; - opt.text = dp[i]; - select.add(opt, null); - } - - select.size = n; - - si = selectedIndex; - if (si < 0) { - select.value = null; - } else { - select.value = dp[si]; - } - - this.popup = popup; - - popup.appendChild(select); - document.body.appendChild(popup); - } - - } -}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as deleted file mode 100644 index ee30b7f..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as +++ /dev/null @@ -1,108 +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 -{ - import org.apache.flex.core.ContainerBase; - import org.apache.flex.core.IChrome; - import org.apache.flex.core.IContainer; - import org.apache.flex.core.IUIBase; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - import org.apache.flex.events.Event; - - [DefaultProperty("mxmlContent")] - - /** - * The Container class implements a basic container for - * other controls and containers. The position and size - * of the children are determined by a layout while the size of - * a Container can either be determined by its children or by - * specifying an exact size in pixels or as a percentage of the - * parent element. - * - * This Container does not have a built-in scroll bar or clipping of - * its content should the content exceed the Container's boundaries. To - * have scroll bars and clipping, add the ScrollingView bead. - * - * While the container is relatively lightweight, it should - * generally not be used as the base class for other controls, - * even if those controls are composed of children. That's - * because the fundamental API of Container is to support - * an arbitrary set of children, and most controls only - * support a specific set of children. - * - * And that's one of the advantages of beads: that functionality - * used in a Container can also be used in a Control as long - * as that bead doesn't assume that its strand is a Container. - * - * For example, even though you can use a Panel to create the - * equivalent of an Alert control, the Alert is a - * control and not a Container because the Alert does not - * support an arbitrary set of children. - * - * @see org.apache.flex.html.beads.layout - * @see org.apache.flex.html.supportClasses.ScrollingViewport - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class Container extends ContainerBase - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function Container() - { - super(); - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('div') as WrappedHTMLElement; - - positioner = element; - - // absolute positioned children need a non-null - // position value in the parent. It might - // get set to 'absolute' if the container is - // also absolutely positioned - positioner.style.position = 'relative'; - element.flexjs_wrapper = this; - - /*addEventListener('childrenAdded', - runLayoutHandler); - addEventListener('elementRemoved', - runLayoutHandler);*/ - - return element; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as deleted file mode 100644 index da65539..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as +++ /dev/null @@ -1,99 +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 -{ - - import org.apache.flex.core.IBeadLayout; - import org.apache.flex.core.IChrome; - import org.apache.flex.core.IContainer; - import org.apache.flex.core.ValuesManager; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /** - * The ControlBar class is used within a Panel as a place to position - * additional controls. The ControlBar appears at the bottom of the - * org.apache.flex.html.Panel - * and is not part of the Panel's scrollable content area. The ControlBar - * is a Container and implements the org.apache.flex.core.IChrome interface, indicating that is - * outside of the Container's content area. The ControlBar uses the following - * beads: - * - * org.apache.flex.core.IBeadModel: the data model for the component. - * org.apache.flex.core.IMeasurementBead: helps determine the overlay size of the ControlBar for layout. - * org.apache.flex.core.IBorderBead: if present, displays a border around the component. - * org.apache.flex.core.IBackgroundBead: if present, displays a solid background below the ControlBar. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ControlBar extends Container implements IContainer, IChrome - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ControlBar() - { - super(); - - className = "ControlBar"; - } - - /** - * @private - */ - override public function addedToParent():void - { - super.addedToParent(); - - if( getBeadByType(IBeadLayout) == null ) { - var layout:IBeadLayout = new (ValuesManager.valuesImpl.getValue(this, "iBeadLayout")) as IBeadLayout; - addBead(layout); - } - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('div') as WrappedHTMLElement; - element.className = 'ControlBar'; - element.style.display = 'inline'; - typeNames = 'ControlBar'; - - positioner = element; - positioner.style.position = 'relative'; - element.flexjs_wrapper = this; - - return element; - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as deleted file mode 100644 index 8cba078..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as +++ /dev/null @@ -1,164 +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 -{ - import org.apache.flex.core.IBead; - import org.apache.flex.core.IDataGridModel; - import org.apache.flex.core.IDataGridPresentationModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.html.beads.models.DataGridPresentationModel; - - [Event(name="change", type="org.apache.flex.events.Event")] - - /** - * The DataGrid class displays a collection of data using columns and rows. Each - * column represents a specific field in the data set; each row represents a specific - * datum. The DataGrid is a composite component built with a org.apache.flex.html.ButtonBar - * for the column headers and a org.apache.flex.html.List for each column. The DataGrid's - * view bead (usually org.apache.flex.html.beads.DataGridView) constructs these parts while - * itemRenderer factories contruct the elements to display the data in each cell. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class DataGrid extends UIBase - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function DataGrid() - { - super(); - } - - /** - * The array of org.apache.flex.html.supportClasses.DataGridColumns used to - * describe each column. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get columns():Array - { - return IDataGridModel(model).columns; - } - public function set columns(value:Array):void - { - IDataGridModel(model).columns = value; - } - - /** - * The object used to provide data to the org.apache.flex.html.DataGrid. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get dataProvider():Object - { - return IDataGridModel(model).dataProvider; - } - public function set dataProvider(value:Object):void - { - IDataGridModel(model).dataProvider = value; - } - - /** - * The currently selected row. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedIndex():int - { - return IDataGridModel(model).selectedIndex; - } - - /** - * The DataGrid's presentation model - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get presentationModel():IDataGridPresentationModel - { - var beadMod:IBead = getBeadByType(IDataGridPresentationModel); - var presModel:IDataGridPresentationModel; - - if (beadMod == null) { - presModel = new DataGridPresentationModel(); - addBead(presModel); - } else { - presModel = beadMod as IDataGridPresentationModel; - } - return presModel; - } - - /** - * The default height of each cell in every column - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get rowHeight():Number - { - return presentationModel.rowHeight; - } - public function set rowHeight(value:Number):void - { - presentationModel.rowHeight = value; - } - - /** - * @private - * The DataGrid needs to know whenever its size is being changed so the columns can be - * be aligned properly, so the noEvent value must always be false. - */ - override public function setWidth(value:Number, noEvent:Boolean=false):void - { - super.setWidth(value,false); - } - - /** - * @private - * The DataGrid needs to know whenever its size is being changed so the columns can be - * be aligned properly, so the noEvent value must always be false. - */ - override public function setHeight(value:Number, noEvent:Boolean=false):void - { - super.setHeight(value,false); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as deleted file mode 100644 index 33615ea..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as +++ /dev/null @@ -1,74 +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 -{ - import org.apache.flex.core.IDateChooserModel; - import org.apache.flex.core.UIBase; - - /** - * The change event is dispatched when the selectedDate is changed. - */ - [Event(name="change", type="org.apache.flex.events.Event")] - - /** - * The DateChooser class is a component that displays a calendar. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class DateChooser extends UIBase - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function DateChooser() - { - super(); - className = "DateChooser"; - - // fix the DateChooser's size -// width = 280; -// height = 240; - } - - /** - * The currently selected date (or null if no date has been selected). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedDate():Date - { - return IDateChooserModel(model).selectedDate; - } - public function set selectedDate(value:Date):void - { - IDateChooserModel(model).selectedDate = value; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as deleted file mode 100644 index f46e453..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as +++ /dev/null @@ -1,95 +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 -{ - import org.apache.flex.core.IBead; - import org.apache.flex.core.IDateChooserModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.core.ValuesManager; - - /** - * The change event is dispatched when the selectedDate is changed. - */ - [Event(name="change", type="org.apache.flex.events.Event")] - - /** - * The DateField class provides an input field where a date can be entered - * and a pop-up calendar control for picking a date as an alternative to - * the text field. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class DateField extends UIBase - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function DateField() - { - super(); - - className = "DateField"; - } - - /** - * The method called when added to a parent. The DateField class uses - * this opportunity to install additional beads. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - override public function addedToParent():void - { - var klass:* = ValuesManager.valuesImpl.getValue(this,"iFormatBead"); - var bead:IBead = new klass() as IBead; - if (bead) { - addBead(bead); - } - - super.addedToParent(); - } - - /** - * The currently selected date (or null if no date has been selected). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedDate():Date - { - return IDateChooserModel(model).selectedDate; - } - public function set selectedDate(value:Date):void - { - IDateChooserModel(model).selectedDate = value; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as deleted file mode 100644 index dd069b2..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as +++ /dev/null @@ -1,235 +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 -{ - import org.apache.flex.core.ISelectionModel; - - COMPILE::JS - { - import goog.events; - import org.apache.flex.core.WrappedHTMLElement; - import org.apache.flex.html.beads.models.ArraySelectionModel; - } - - //-------------------------------------- - // Events - //-------------------------------------- - - /** - * Dispatched when the user selects an item. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - [Event(name="change", type="org.apache.flex.events.Event")] - - /** - * The DropDownList class implements the basic equivalent of - * the <code><select></code> tag in HTML. - * The default implementation only lets the user see and - * choose from an array of strings. More complex controls - * would display icons as well as strings, or colors instead - * of strings or just about anything. - * - * The default behavior only lets the user choose one and - * only one item. More complex controls would allow - * mutiple selection by not dismissing the dropdown as soon - * as a selection is made. - * - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class DropDownList extends Button - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function DropDownList() - { - COMPILE::JS - { - model = new ArraySelectionModel(); - } - } - - /** - * The data set to be displayed. Usually a simple - * array of strings. A more complex component - * would allow more complex data and data sets. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get dataProvider():Object - { - return ISelectionModel(model).dataProvider; - } - - /** - * @private - * @flexjsignorecoercion HTMLOptionElement - * @flexjsignorecoercion HTMLSelectElement - */ - public function set dataProvider(value:Object):void - { - ISelectionModel(model).dataProvider = value; - COMPILE::JS - { - var dp:HTMLOptionsCollection; - var i:int; - var n:int; - var opt:HTMLOptionElement; - var dd:HTMLSelectElement = element as HTMLSelectElement; - - model.dataProvider = value; - dp = dd.options; - n = dp.length; - for (i = 0; i < n; i++) { - dd.remove(0); - } - - var lf:String = labelField; - n = value.length; - for (i = 0; i < n; i++) { - opt = document.createElement('option') as HTMLOptionElement; - if (lf) - opt.text = value[i][lf]; - else - opt.text = value[i]; - dd.add(opt, null); - } - - } - } - - [Bindable("change")] - /** - * @copy org.apache.flex.core.ISelectionModel#selectedIndex - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedIndex():int - { - return ISelectionModel(model).selectedIndex; - } - - /** - * @private - * @flexjsignorecoercion HTMLSelectElement - */ - public function set selectedIndex(value:int):void - { - ISelectionModel(model).selectedIndex = value; - COMPILE::JS - { - (element as HTMLSelectElement).selectedIndex = ISelectionModel(model).selectedIndex; - } - } - - - [Bindable("change")] - /** - * @copy org.apache.flex.core.ISelectionModel#selectedItem - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedItem():Object - { - return ISelectionModel(model).selectedItem; - } - - /** - * @private - * @flexjsignorecoercion HTMLSelectElement - */ - public function set selectedItem(value:Object):void - { - ISelectionModel(model).selectedItem = value; - COMPILE::JS - { - (element as HTMLSelectElement).selectedIndex = ISelectionModel(model).selectedIndex; - } - } - - /** - * The name of field within the data used for display. Each item of the - * data should have a property with this name. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get labelField():String - { - return ISelectionModel(model).labelField; - } - public function set labelField(value:String):void - { - ISelectionModel(model).labelField = value; - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - * @flexjsignorecoercion HTMLSelectElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('select') as WrappedHTMLElement; - (element as HTMLSelectElement).size = 1; - goog.events.listen(element, 'change', - changeHandler); - - positioner = element; - positioner.style.position = 'relative'; - - element.flexjs_wrapper = this; - - return element; - } - - /** - * @flexjsignorecoercion HTMLSelectElement - */ - COMPILE::JS - protected function changeHandler(event:Event):void - { - model.selectedIndex = (element as HTMLSelectElement).selectedIndex; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as deleted file mode 100644 index 9f38883..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.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 -{ - import org.apache.flex.core.ContainerBase; - import org.apache.flex.core.IChrome; - import org.apache.flex.core.IContainer; - import org.apache.flex.core.IUIBase; - import org.apache.flex.events.Event; - - [DefaultProperty("mxmlContent")] - - /** - * A Container that has a HorizontalLayout. - * - * This is effectively the same as the pattern - * <code> - * <basic:Container xmlns:basic="library://ns.apache.org/flexjs/basic"> - * <basic:layout> - * <basic:HorizontalLayout /> - * </basic:layout> - * </basic:Container> - * </code> - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class HContainer extends Container implements IContainer - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function HContainer() - { - super(); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as deleted file mode 100644 index 7c2fb2f..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as +++ /dev/null @@ -1,63 +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 -{ - import org.apache.flex.core.UIBase; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /** - * The HRule class displays a horizontal line - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class HRule extends UIBase - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function HRule() - { - super(); - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('hr') as WrappedHTMLElement; - positioner = element; - positioner.style.position = 'relative'; - element.flexjs_wrapper = this; - return element; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as deleted file mode 100644 index ae81c18..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as +++ /dev/null @@ -1,99 +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 -{ - import org.apache.flex.core.IImageModel; - import org.apache.flex.core.UIBase; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - import org.apache.flex.html.beads.models.ImageModel; - import org.apache.flex.html.beads.ImageView; - } - - /** - * The Image class is a component that displays a bitmap. The Image uses - * the following beads: - * - * org.apache.flex.core.IBeadModel: the data model for the Image, including the source property. - * org.apache.flex.core.IBeadView: constructs the visual elements of the component. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class Image extends UIBase - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function Image() - { - super(); - } - - /** - * The location of the bitmap, usually a URL. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.IImageModel - */ - public function get source():String - { - return (model as IImageModel).source; - } - public function set source(value:String):void - { - (model as IImageModel).source = value; - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('img') as WrappedHTMLElement; - element.className = 'Image'; - typeNames = 'Image'; - - positioner = element; - positioner.style.position = 'relative'; - element.flexjs_wrapper = this; - - model = new - ImageModel(); - - addBead(new - ImageView()); - - return element; - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as deleted file mode 100644 index 8bdcc6a..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as +++ /dev/null @@ -1,128 +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 -{ - import org.apache.flex.events.Event; - import org.apache.flex.html.beads.models.ImageAndTextModel; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /** - * The ImageTextButton class implements a basic button that - * displays and image and text. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ImageAndTextButton extends TextButton - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ImageAndTextButton() - { - super(); - } - - /** - * @private - */ - COMPILE::JS - override public function get text():String - { - return ImageAndTextModel(model).text; - } - - /** - * @private - */ - COMPILE::JS - override public function set text(value:String):void - { - ImageAndTextModel(model).text = value; - COMPILE::JS - { - setInnerHTML(); - } - } - - /** - * The URL of an icon to use in the button - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get image():String - { - return ImageAndTextModel(model).image; - } - - /** - * @private - */ - public function set image(value:String):void - { - ImageAndTextModel(model).image = value; - COMPILE::JS - { - setInnerHTML(); - } - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('button') as WrappedHTMLElement; - element.setAttribute('type', 'button'); - - positioner = element; - positioner.style.position = 'relative'; - element.flexjs_wrapper = this; - - return element; - } - - /** - */ - COMPILE::JS - protected function setInnerHTML():void - { - var inner:String = ''; - if (image != null) - inner += "<img src='" + image + "'/>"; - inner += ' '; - inner += text; - element.innerHTML = inner; - }; - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as deleted file mode 100644 index de563a1..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as +++ /dev/null @@ -1,89 +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 -{ - import org.apache.flex.core.SimpleCSSStyles; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /** - * The ImageButton class presents an image as a button. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ImageButton extends Button - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ImageButton() - { - super(); - typeNames = "ImageButton"; - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement("input") as WrappedHTMLElement; - positioner = element; - element.flexjs_wrapper = this; - - var inputElement:HTMLInputElement = element as HTMLInputElement; - inputElement.type = "image"; - - return element; - } - - /** - * Sets the image for the button. This is a URL. - * TODO: figure out how to set the source in the style, rather than using - * backgroundImage behind the scenes. - */ - public function get source():String - { - return style.backgroundImage; - } - - public function set source(url:String):void - { - if (!style) - style = new SimpleCSSStyles(); - style.backgroundImage = url; - - COMPILE::JS { - var inputElement:HTMLInputElement = element as HTMLInputElement; - inputElement.src = url; - } - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as deleted file mode 100644 index 392dcca..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.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 -{ - import org.apache.flex.core.ITextModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.core.ValuesManager; - import org.apache.flex.events.Event; - import org.apache.flex.events.IEventDispatcher; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /* - * Label probably should extend TextField directly, - * but the player's APIs for TextLine do not allow - * direct instantiation, and we might want to allow - * Labels to be declared and have their actual - * view be swapped out. - */ - - /** - * The Label class implements the basic control for labeling - * other controls. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class Label extends UIBase - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function Label() - { - super(); - } - - [Bindable("textChange")] - /** - * The text to display in the label. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get text():String - { - COMPILE::AS3 - { - return ITextModel(model).text; - } - COMPILE::JS - { - return element.innerHTML; - } - } - - /** - * @private - */ - public function set text(value:String):void - { - COMPILE::AS3 - { - ITextModel(model).text = value; - } - COMPILE::JS - { - this.element.innerHTML = value; - this.dispatchEvent('textChange'); - } - - } - - [Bindable("htmlChange")] - /** - * The html-formatted text to display in the label. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get html():String - { - COMPILE::AS3 - { - return ITextModel(model).html; - } - COMPILE::JS - { - return element.innerHTML; - } - } - - /** - * @private - */ - public function set html(value:String):void - { - COMPILE::AS3 - { - ITextModel(model).html = value; - } - COMPILE::JS - { - this.element.innerHTML = value; - this.dispatchEvent('textChange'); - } - } - - - /** - * @private - */ - COMPILE::AS3 - override public function addedToParent():void - { - super.addedToParent(); - model.addEventListener("textChange", repeaterListener); - model.addEventListener("htmlChange", repeaterListener); - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('span') as WrappedHTMLElement; - positioner = element; - element.flexjs_wrapper = this; - return element; - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as deleted file mode 100644 index 63bcf02..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as +++ /dev/null @@ -1,311 +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 -{ - import org.apache.flex.core.ContainerBaseStrandChildren; - import org.apache.flex.core.IContentViewHost; - import org.apache.flex.core.IDataProviderItemRendererMapper; - import org.apache.flex.core.IFactory; - import org.apache.flex.core.IItemRendererClassFactory; - import org.apache.flex.core.IItemRendererProvider; - import org.apache.flex.core.IListPresentationModel; - import org.apache.flex.core.IRollOverModel; - import org.apache.flex.core.ISelectionModel; - import org.apache.flex.core.ListBase; - import org.apache.flex.core.UIBase; - import org.apache.flex.core.ValuesManager; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - import org.apache.flex.html.beads.ListView; - import org.apache.flex.html.supportClasses.DataGroup; - } - import org.apache.flex.events.Event; - import org.apache.flex.events.IEventDispatcher; - import org.apache.flex.html.beads.models.ListPresentationModel; - - /** - * Indicates that the initialization of the list is complete. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - [Event(name="initComplete", type="org.apache.flex.events.Event")] - - /** - * The change event is dispatched whenever the list's selection changes. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - [Event(name="change", type="org.apache.flex.events.Event")] - - /** - * The List class is a component that displays multiple data items. The List uses - * the following bead types: - * - * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and - * so forth. - * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the list. - * org.apache.flex.core.IBeadController: the bead that handles input and output. - * org.apache.flex.core.IBeadLayout: the bead responsible for the size and position of the itemRenderers. - * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders. - * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the list. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class List extends ListBase implements IItemRendererProvider - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function List() - { - super(); - } - - /** - * The name of field within the data used for display. Each item of the - * data should have a property with this name. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get labelField():String - { - return ISelectionModel(model).labelField; - } - public function set labelField(value:String):void - { - ISelectionModel(model).labelField = value; - } - - /** - * The data being display by the List. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get dataProvider():Object - { - return ISelectionModel(model).dataProvider; - } - public function set dataProvider(value:Object):void - { - ISelectionModel(model).dataProvider = value; - } - - /** - * The index of the currently selected item. Changing this value - * also changes the selectedItem property. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedIndex():int - { - return ISelectionModel(model).selectedIndex; - } - public function set selectedIndex(value:int):void - { - ISelectionModel(model).selectedIndex = value; - } - - /** - * The index of the item currently below the pointer. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get rollOverIndex():int - { - return IRollOverModel(model).rollOverIndex; - } - public function set rollOverIndex(value:int):void - { - IRollOverModel(model).rollOverIndex = value; - } - - /** - * The presentation model for the list. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get presentationModel():IListPresentationModel - { - var presModel:IListPresentationModel = getBeadByType(IListPresentationModel) as IListPresentationModel; - if (presModel == null) { - presModel = new ListPresentationModel(); - addBead(presModel); - } - return presModel; - } - - /** - * The default height of each cell in every column - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get rowHeight():Number - { - return presentationModel.rowHeight; - } - public function set rowHeight(value:Number):void - { - presentationModel.rowHeight = value; - } - - /** - * The item currently selected. Changing this value also - * changes the selectedIndex property. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedItem():Object - { - return ISelectionModel(model).selectedItem; - } - public function set selectedItem(value:Object):void - { - ISelectionModel(model).selectedItem = value; - } - - private var _itemRenderer:IFactory; - - /** - * The class or factory used to display each item. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get itemRenderer():IFactory - { - return _itemRenderer; - } - public function set itemRenderer(value:IFactory):void - { - _itemRenderer = value; - } - - /** - * Returns whether or not the itemRenderer property has been set. - * - * @see org.apache.flex.core.IItemRendererProvider - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get hasItemRenderer():Boolean - { - var result:Boolean = false; - - COMPILE::AS3 { - result = _itemRenderer != null; - } - - COMPILE::JS { - var test:* = _itemRenderer; - result = _itemRenderer !== null && test !== undefined; - } - - return result; - } - - - /** - * @private - */ - override public function addedToParent():void - { - super.addedToParent(); - - if (getBeadByType(IDataProviderItemRendererMapper) == null) - { - var mapper:IDataProviderItemRendererMapper = new (ValuesManager.valuesImpl.getValue(this, "iDataProviderItemRendererMapper")) as IDataProviderItemRendererMapper; - addBead(mapper); - } - var itemRendererFactory:IItemRendererClassFactory = getBeadByType(IItemRendererClassFactory) as IItemRendererClassFactory; - if (!itemRendererFactory) - { - itemRendererFactory = new (ValuesManager.valuesImpl.getValue(this, "iItemRendererClassFactory")) as IItemRendererClassFactory; - addBead(itemRendererFactory); - } - - dispatchEvent(new Event("initComplete")); - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - super.createElement(); - className = 'List'; - - return element; - } - - /** - * @flexjsignorecoercion org.apache.flex.html.beads.ListView - * @flexjsignorecoercion org.apache.flex.html.supportClasses.DataGroup - */ - COMPILE::JS - override public function internalChildren():Array - { - var listView:ListView = getBeadByType(ListView) as ListView; - var dg:DataGroup = listView.dataGroup as DataGroup; - var renderers:Array = dg.internalChildren(); - return renderers; - }; - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as deleted file mode 100644 index 301e430..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as +++ /dev/null @@ -1,317 +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 -{ - import org.apache.flex.states.State; - - import org.apache.flex.core.IBead; - import org.apache.flex.core.ILayoutHost; - import org.apache.flex.core.IParent; - import org.apache.flex.core.IParentIUIBase; - import org.apache.flex.core.IStrand; - import org.apache.flex.core.IStatesImpl; - import org.apache.flex.core.ValuesManager; - import org.apache.flex.html.beads.ContainerView; - import org.apache.flex.events.Event; - import org.apache.flex.events.ValueChangeEvent; - import org.apache.flex.utils.MXMLDataInterpreter; - - [DefaultProperty("mxmlContent")] - - /** - * The MXMLBeadViewBase class extends BeadViewBase - * and adds support for databinding and specification - * of children in MXML. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class MXMLBeadViewBase extends ContainerView implements IStrand, ILayoutHost - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function MXMLBeadViewBase() - { - super(); - } - - [Bindable("strandChanged")] - /** - * An MXMLBeadViewBase doesn't create its children until it is added to - * the strand. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - override public function set strand(value:IStrand):void - { - super.strand = value; - // each MXML file can also have styles in fx:Style block - ValuesManager.valuesImpl.init(this); - - dispatchEvent(new Event("strandChanged")); - - for each (var bead:IBead in beads) - addBead(bead); - - dispatchEvent(new org.apache.flex.events.Event("beadsAdded")); - - MXMLDataInterpreter.generateMXMLInstances(this, IParent(value), MXMLDescriptor); - - dispatchEvent(new Event("initBindings")) - dispatchEvent(new Event("initComplete")) - dispatchEvent(new Event("childrenAdded")); - } - - [Bindable("__NoChangeEvent__")] - /** - * The model object. - */ - public function get model():Object - { - return _strand["model"]; - } - - /** - * @copy org.apache.flex.core.Application#MXMLDescriptor - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get MXMLDescriptor():Array - { - return null; - } - - /** - * @copy org.apache.flex.core.Application#generateMXMLAttributes() - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function generateMXMLAttributes(data:Array):void - { - MXMLDataInterpreter.generateMXMLProperties(this, data); - } - - /** - * @copy org.apache.flex.core.ItemRendererClassFactory#mxmlContent - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public var mxmlContent:Array; - - private var _states:Array; - - /** - * The array of view states. These should - * be instances of org.apache.flex.states.State. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get states():Array - { - return _states; - } - - /** - * @private - */ - public function set states(value:Array):void - { - _states = value; - _currentState = _states[0].name; - - try{ - if (getBeadByType(IStatesImpl) == null) - addBead(new (ValuesManager.valuesImpl.getValue(this, "iStatesImpl")) as IBead); - } - //TODO: Need to handle this case more gracefully - catch(e:Error) - { - COMPILE::AS3 - { - trace(e.message); - } - } - - } - - /** - * <code>true</code> if the array of states - * contains a state with this name. - * - * @param state The state namem. - * @return True if state in state array - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function hasState(state:String):Boolean - { - for each (var s:State in _states) - { - if (s.name == state) - return true; - } - return false; - } - - private var _currentState:String; - - [Bindable("currentStateChange")] - /** - * The name of the current state. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get currentState():String - { - return _currentState; - } - - /** - * @private - */ - public function set currentState(value:String):void - { - var event:ValueChangeEvent = new ValueChangeEvent("currentStateChange", false, false, _currentState, value) - _currentState = value; - dispatchEvent(event); - } - - private var _transitions:Array; - - /** - * The array of transitions. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get transitions():Array - { - return _transitions; - } - - /** - * @private - */ - public function set transitions(value:Array):void - { - _transitions = value; - } - - /** - * @copy org.apache.flex.core.Application#beads - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public var beads:Array; - - private var _beads:Array; - - /** - * @copy org.apache.flex.core.IStrand#addBead() - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function addBead(bead:IBead):void - { - if (!_beads) - _beads = []; - _beads.push(bead); - bead.strand = this; - } - - /** - * @copy org.apache.flex.core.IStrand#getBeadByType() - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function getBeadByType(classOrInterface:Class):IBead - { - for each (var bead:IBead in _beads) - { - if (bead is classOrInterface) - return bead; - } - return null; - } - - /** - * @copy org.apache.flex.core.IStrand#removeBead() - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function removeBead(value:IBead):IBead - { - var n:int = _beads.length; - for (var i:int = 0; i < n; i++) - { - var bead:IBead = _beads[i]; - if (bead == value) - { - _beads.splice(i, 1); - return bead; - } - } - return null; - } - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as deleted file mode 100644 index 5149237..0000000 --- a/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as +++ /dev/null @@ -1,76 +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 -{ - import org.apache.flex.core.ITextModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.core.ValuesManager; - import org.apache.flex.events.Event; - import org.apache.flex.events.IEventDispatcher; - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /* - * Label probably should extend TextField directly, - * but the player's APIs for TextLine do not allow - * direct instantiation, and we might want to allow - * Labels to be declared and have their actual - * view be swapped out. - */ - - /** - * The Label class implements the basic control for labeling - * other controls. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class MultilineLabel extends Label - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function MultilineLabel() - { - super(); - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - element = document.createElement('div') as WrappedHTMLElement; - positioner = element; - element.flexjs_wrapper = this; - return element; - } - - } -}