Author: pent
Date: Wed Mar 13 21:03:05 2013
New Revision: 1456127
URL: http://svn.apache.org/r1456127
Log:
ComboxBox draft
Added:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxBead.as
(with props)
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxModel.as
(with props)
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/ComboBox.as
(with props)
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxBead.as
(with props)
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
(with props)
Modified:
flex/asjs/branches/develop/frameworks/as/basic-manifest.xml
flex/asjs/branches/develop/frameworks/as/defaults.css
flex/asjs/branches/develop/frameworks/as/src/FlexJSUIClasses.as
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
Modified: flex/asjs/branches/develop/frameworks/as/basic-manifest.xml
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/basic-manifest.xml?rev=1456127&r1=1456126&r2=1456127&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/basic-manifest.xml (original)
+++ flex/asjs/branches/develop/frameworks/as/basic-manifest.xml Wed Mar 13
21:03:05 2013
@@ -35,6 +35,7 @@
<component id="List" class="org.apache.flex.html.staticControls.List"/>
<component id="CheckBox"
class="org.apache.flex.html.staticControls.CheckBox"/>
<component id="RadioButton"
class="org.apache.flex.html.staticControls.RadioButton"/>
+ <component id="ComboBox"
class="org.apache.flex.html.staticControls.ComboBox"/>
<component id="HTTPService" class="org.apache.flex.net.HTTPService"/>
<component id="LazyCollection"
class="org.apache.flex.net.dataConverters.LazyCollection"/>
<component id="JSONInputParser"
class="org.apache.flex.net.JSONInputParser"/>
Modified: flex/asjs/branches/develop/frameworks/as/defaults.css
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/defaults.css?rev=1456127&r1=1456126&r2=1456127&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/defaults.css (original)
+++ flex/asjs/branches/develop/frameworks/as/defaults.css Wed Mar 13 21:03:05
2013
@@ -33,6 +33,12 @@ CheckBox
ICheckBoxBead:
ClassReference("org.apache.flex.html.staticControls.beads.CheckBoxBead");
}
+ComboBox
+{
+ IComboBoxBead:
ClassReference("org.apache.flex.html.staticControls.beads.ComboBoxBead");
+ IComboBoxModel:
ClassReference("org.apache.flex.html.staticControls.beads.models.ComboBoxModel");
+}
+
List
{
ISelectionModel:
ClassReference("org.apache.flex.html.staticControls.beads.models.ArraySelectionModel");
@@ -40,7 +46,7 @@ List
RadioButton
{
- IToggleButtonModel:
ClassReference("org.apache.flex.html.staticControls.beads.models.ToggleButtonModel");
+ IToggleButtonModel:
ClassReference("org.apache.flex.html.staticControls.beads.models.ValueToggleButtonModel");
IRadioButtonBead:
ClassReference("org.apache.flex.html.staticControls.beads.RadioButtonBead");
}
Modified: flex/asjs/branches/develop/frameworks/as/src/FlexJSUIClasses.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/FlexJSUIClasses.as?rev=1456127&r1=1456126&r2=1456127&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/FlexJSUIClasses.as (original)
+++ flex/asjs/branches/develop/frameworks/as/src/FlexJSUIClasses.as Wed Mar 13
21:03:05 2013
@@ -35,7 +35,9 @@ internal class FlexJSUIClasses
import org.apache.flex.html.staticControls.beads.TextAreaBead;
TextAreaBead;
import org.apache.flex.html.staticControls.beads.CheckBoxBead;
CheckBoxBead;
import org.apache.flex.html.staticControls.beads.RadioButtonBead;
RadioButtonBead;
+ import org.apache.flex.html.staticControls.beads.ComboBoxBead;
ComboBoxBead;
import org.apache.flex.html.staticControls.beads.models.TextModel;
TextModel;
+ import org.apache.flex.html.staticControls.beads.models.ComboBoxModel;
ComboBoxModel;
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.models.ArraySelectionModel;
ArraySelectionModel;
Added:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxBead.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxBead.as?rev=1456127&view=auto
==============================================================================
---
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxBead.as
(added)
+++
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxBead.as
Wed Mar 13 21:03:05 2013
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 IComboBoxBead extends IBead
+ {
+ function get text():String;
+ function set text(value:String):void;
+
+ function get html():String;
+ function set html(value:String):void;
+ }
+}
\ No newline at end of file
Propchange:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxBead.as
------------------------------------------------------------------------------
svn:eol-style = native
Added:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxModel.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxModel.as?rev=1456127&view=auto
==============================================================================
---
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxModel.as
(added)
+++
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxModel.as
Wed Mar 13 21:03:05 2013
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 IComboBoxModel
+ {
+ function get text():String;
+ function set text(value:String):void;
+
+ function get html():String;
+ function set html(value:String):void;
+
+ function get dataProvider():Object;
+ function set dataProvider(value:Object):void;
+
+ function get selectedIndex():int;
+ function set selectedIndex(value:int):void;
+
+ function get selectedItem():Object;
+ function set selectedItem(value:Object):void;
+ }
+}
\ No newline at end of file
Propchange:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/core/IComboBoxModel.as
------------------------------------------------------------------------------
svn:eol-style = native
Added:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/ComboBox.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/ComboBox.as?rev=1456127&view=auto
==============================================================================
---
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/ComboBox.as
(added)
+++
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/ComboBox.as
Wed Mar 13 21:03:05 2013
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IComboBoxBead;
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.core.IInitSkin;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+
+ public class ComboBox extends UIBase implements IInitSkin
+ {
+ 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;
+ }
+
+ override public function initModel():void
+ {
+ if (getBeadByType(IComboBoxModel) == null)
+ addBead(new
(ValuesManager.valuesImpl.getValue(this, "iComboBoxModel")) as IBead);
+ }
+
+ public function initSkin():void
+ {
+ if (getBeadByType(IComboBoxBead) == null) {
+ var cb:IComboBoxBead = new
(ValuesManager.valuesImpl.getValue(this, "iComboBoxBead")) as IComboBoxBead;
+ addBead(cb);
+ }
+ }
+ }
+}
\ No newline at end of file
Propchange:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/ComboBox.as
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as?rev=1456127&r1=1456126&r2=1456127&view=diff
==============================================================================
---
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
(original)
+++
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/RadioButton.as
Wed Mar 13 21:03:05 2013
@@ -112,7 +112,7 @@ package org.apache.flex.html.staticContr
public function initModel():void
{
if (getBeadByType(IValueToggleButtonModel) == null)
- addBead(new
(ValuesManager.valuesImpl.getValue(this, "iValueToggleButtonModel")) as IBead);
+ addBead(new
(ValuesManager.valuesImpl.getValue(this, "iToggleButtonModel")) as IBead);
}
public function initSkin():void
Added:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxBead.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxBead.as?rev=1456127&view=auto
==============================================================================
---
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxBead.as
(added)
+++
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxBead.as
Wed Mar 13 21:03:05 2013
@@ -0,0 +1,134 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.DisplayObjectContainer;
+ import flash.display.Sprite;
+ import flash.events.EventDispatcher;
+ import flash.events.IEventDispatcher;
+
+ import org.apache.flex.binding.ConstantBinding;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IComboBoxBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.html.staticControls.Button;
+ import org.apache.flex.html.staticControls.List;
+ import org.apache.flex.html.staticControls.TextInput;
+
+ public class ComboBoxBead implements IBead, IComboBoxBead
+ {
+ public function ComboBoxBead()
+ {
+ }
+
+ private var textInput:TextInput;
+ private var button:Button;
+ private var list:List;
+
+ 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;
+ }
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ textInput = new TextInput();
+ textInput.addToParent(DisplayObjectContainer(strand));
+ textInput.initModel();
+ textInput.width = 100;
+ textInput.height = 18;
+ textInput.initSkin();
+
+ 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.initModel();
+ button.width = 18;
+ button.height = 18;
+ button.x = textInput.width;
+ button.y = textInput.y;
+ button.initSkin();
+
+ list = new List();
+ list.addToParent(DisplayObjectContainer(strand));
+ list.initModel();
+ list.width = 118;
+ list.height = 100;
+ list.x = textInput.x;
+ list.y = textInput.y + textInput.height + 2;
+
+ if( value.getBeadByType(ConstantBinding) ) {
+ var cb:ConstantBinding =
value.getBeadByType(ConstantBinding) as ConstantBinding;
+ list.addBead(cb);
+ }
+ list.initSkin();
+ }
+
+ 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();
+ }
+ }
+}
\ No newline at end of file
Propchange:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/ComboBoxBead.as
------------------------------------------------------------------------------
svn:eol-style = native
Added:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
URL:
http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as?rev=1456127&view=auto
==============================================================================
---
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
(added)
+++
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
Wed Mar 13 21:03:05 2013
@@ -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.staticControls.beads.models
+{
+ import flash.events.Event;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IComboBoxModel;
+
+ 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
Propchange:
flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/ComboBoxModel.as
------------------------------------------------------------------------------
svn:eol-style = native