You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2018/05/16 07:05:36 UTC

[royale-asjs] 01/02: Make ComboBoxView more reusable

This is an automated email from the ASF dual-hosted git repository.

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

commit 60b858cef128ea59654138bf692a367432d862a8
Author: DESKTOP-RH4S838\Yishay <yi...@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.