flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r1445314 - in /flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads: BaseTextFieldBead.as TextFieldBead.as TextFieldBeadBase.as TextInputBead.as
Date Tue, 12 Feb 2013 19:01:32 GMT
Author: pent
Date: Tue Feb 12 19:01:32 2013
New Revision: 1445314

URL: http://svn.apache.org/r1445314
Log:
Renamed BaseTextFieldBead to TextFieldBeadBase

Added:
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
  (with props)
Removed:
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/BaseTextFieldBead.as
Modified:
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBead.as
    flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as

Modified: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBead.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBead.as?rev=1445314&r1=1445313&r2=1445314&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBead.as
(original)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBead.as
Tue Feb 12 19:01:32 2013
@@ -20,7 +20,7 @@ package org.apache.flex.html.staticContr
 {
 	import flash.text.TextFieldType;
 	
-	public class TextFieldBead extends BaseTextFieldBead
+	public class TextFieldBead extends TextFieldBeadBase
 	{
 		public function TextFieldBead()
 		{

Added: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as?rev=1445314&view=auto
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
(added)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
Tue Feb 12 19:01:32 2013
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.events.Event;
+	import flash.text.TextField;
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.ITextBead;
+	import org.apache.flex.core.ITextModel;
+	
+	public class TextFieldBeadBase implements IBead, ITextBead
+	{
+		public function TextFieldBeadBase()
+		{
+			_textField = new TextField();
+		}
+		
+		private var _textField:TextField;
+		
+		protected function get textField() : TextField
+		{
+			return _textField;
+		}
+		
+		private var _textModel:ITextModel;
+		
+		public function get textModel() : ITextModel
+		{
+			return _textModel;
+		}
+		
+		private var _strand:IStrand;
+		
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			_textModel = value.getBeadByType(ITextModel) as ITextModel;
+			textModel.addEventListener("textChange", textChangeHandler);
+			textModel.addEventListener("htmlChange", htmlChangeHandler);
+			DisplayObjectContainer(value).addChild(_textField);
+			if (textModel.text !== null)
+				text = textModel.text;
+			if (textModel.html !== null)
+				html = textModel.html;
+		}
+		
+		public function get strand() : IStrand
+		{
+			return _strand;
+		}
+		
+		public function get text():String
+		{
+			return _textField.text;
+		}
+		public function set text(value:String):void
+		{
+			_textField.text = value;
+		}
+		
+		public function get html():String
+		{
+			return _textField.htmlText;
+		}
+		
+		public function set html(value:String):void
+		{
+			_textField.htmlText = value;
+		}
+		
+		private function textChangeHandler(event:Event):void
+		{
+			text = textModel.text;
+		}
+		
+		private function htmlChangeHandler(event:Event):void
+		{
+			html = textModel.html;
+		}
+	}
+}
\ No newline at end of file

Propchange: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextFieldBeadBase.as
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as
URL: http://svn.apache.org/viewvc/flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as?rev=1445314&r1=1445313&r2=1445314&view=diff
==============================================================================
--- flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as
(original)
+++ flex/asjs/branches/develop/frameworks/as/src/org/apache/flex/html/staticControls/beads/TextInputBead.as
Tue Feb 12 19:01:32 2013
@@ -24,7 +24,7 @@ package org.apache.flex.html.staticContr
 	
 	import org.apache.flex.core.IStrand;
 	
-	public class TextInputBead extends BaseTextFieldBead
+	public class TextInputBead extends TextFieldBeadBase
 	{
 		public function TextInputBead()
 		{



Mime
View raw message