royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yish...@apache.org
Subject [royale-asjs] 04/04: Make ComboBoxView more reusable
Date Tue, 22 May 2018 08:37:05 GMT
This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch feature/revert-refactor
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit f770aa314d2ff107338b23578e45b0fe2ce7eed6
Author: DESKTOP-RH4S838\Yishay <yishayjobs@hotmail.com>
AuthorDate: Wed May 16 10:03:55 2018 +0300

    Make ComboBoxView more reusable
---
 .../org/apache/royale/html/beads/ComboBoxView.as   | 40 +++++++++++++++-------
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
index a0bfe3f..ccda141 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ComboBoxView.as
@@ -137,8 +137,8 @@ package org.apache.royale.html.beads
 			IEventDispatcher(_strand).addEventListener("sizeChanged", handleSizeChange);
 			
 			// set initial value and positions using default sizes
-			handleItemChange(null);
-			handleSizeChange(null);
+			itemChangeAction();
+			sizeChangeAction();
 		}
 		
 		/**
@@ -185,7 +185,32 @@ package org.apache.royale.html.beads
 		/**
 		 * @private
 		 */
-		private function handleSizeChange(event:Event):void
+		protected function handleSizeChange(event:Event):void
+		{
+			sizeChangeAction();
+		}
+		
+		/**
+		 * @private
+		 */
+		protected function handleItemChange(event:Event):void
+		{
+			itemChangeAction();
+		}
+		
+		/**
+		 * @private
+		 */
+		protected function itemChangeAction():void
+		{
+			var model:IComboBoxModel = _strand.getBeadByType(IComboBoxModel) as IComboBoxModel;
+			input.text = model.selectedItem as String;
+		}
+		
+		/**
+		 * @private
+		 */
+		protected function sizeChangeAction():void
 		{
 			var host:UIBase = UIBase(_strand);
 			
@@ -214,14 +239,5 @@ package org.apache.royale.html.beads
 				host.width = input.width + button.width;
 			}
 		}
-		
-		/**
-		 * @private
-		 */
-		private function handleItemChange(event:Event):void
-		{
-			var model:IComboBoxModel = _strand.getBeadByType(IComboBoxModel) as IComboBoxModel;
-			input.text = model.selectedItem as String;
-		}
 	}
 }

-- 
To stop receiving notification emails like this one, please contact
yishayw@apache.org.

Mime
View raw message