royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [royale-asjs] branch develop updated: update hardcoded events to constants
Date Fri, 31 Aug 2018 19:29:17 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/develop by this push:
     new 534e06f  update hardcoded events to constants
534e06f is described below

commit 534e06f21daa9320247cb48da9a232c0d2340bf9
Author: Carlos Rovira <carlosrovira@apache.org>
AuthorDate: Fri Aug 31 21:29:13 2018 +0200

    update hardcoded events to constants
---
 .../Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as  |  2 +-
 .../src/main/royale/org/apache/royale/jewel/ToggleButton.as    |  6 +++---
 .../royale/jewel/beads/controllers/ComboBoxController.as       | 10 +++++-----
 .../jewel/beads/controllers/DateChooserMouseController.as      |  6 +++---
 .../royale/jewel/beads/controllers/DropDownListController.as   |  4 ++--
 .../beads/controllers/ListSingleSelectionMouseController.as    |  2 +-
 .../beads/controllers/TableCellSelectionMouseController.as     |  2 +-
 .../royale/org/apache/royale/jewel/beads/views/AlertView.as    |  8 ++++----
 .../royale/org/apache/royale/jewel/beads/views/ComboBoxView.as |  2 +-
 .../org/apache/royale/jewel/beads/views/DateChooserView.as     |  2 +-
 .../org/apache/royale/jewel/beads/views/DateFieldView.as       |  2 +-
 .../royale/org/apache/royale/jewel/beads/views/ListView.as     |  2 +-
 .../org/apache/royale/jewel/beads/views/NumericStepperView.as  |  2 +-
 13 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
index b6ca0ac..2380089 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
@@ -131,7 +131,7 @@ package org.apache.royale.jewel
 		private function internalMouseHandler(event:org.apache.royale.events.MouseEvent) : void
 		{
 			selected = !selected;
-			dispatchEvent(new Event("change"));
+			dispatchEvent(new Event(Event.CHANGE));
 		}
 	}
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
index 923a82e..2198ea8 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
@@ -120,7 +120,7 @@ package org.apache.royale.jewel
             {
                 IToggleButtonModel(model).selected = value;
                 internalSelected();
-                dispatchEvent(new Event("change"));
+                dispatchEvent(new Event(Event.CHANGE));
             }
             COMPILE::JS
             {
@@ -128,7 +128,7 @@ package org.apache.royale.jewel
                 {
                     _selected = value;
                     internalSelected();
-                    dispatchEvent(new Event("change"));
+                    dispatchEvent(new Event(Event.CHANGE));
                 }
             }
         }
@@ -137,7 +137,7 @@ package org.apache.royale.jewel
         override protected function createElement():WrappedHTMLElement
         {
             super.createElement();
-            element.addEventListener("click", clickHandler, false);
+            element.addEventListener(MouseEvent.CLICK, clickHandler, false);
             internalSelected();
             
             return element;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
index b3e3468..403ab2b 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
@@ -79,8 +79,8 @@ package org.apache.royale.jewel.beads.controllers
 		
 		protected function finishSetup(event:Event = null):void
 		{
-			IEventDispatcher(viewBead.button).addEventListener("click", handleButtonClick);
-            IEventDispatcher(viewBead.textinput).addEventListener("click", handleButtonClick);
+			IEventDispatcher(viewBead.button).addEventListener(MouseEvent.CLICK, handleButtonClick);
+            IEventDispatcher(viewBead.textinput).addEventListener(MouseEvent.CLICK, handleButtonClick);
 		}
 
 		protected function handleControlMouseDown(event:MouseEvent):void
@@ -115,7 +115,7 @@ package org.apache.royale.jewel.beads.controllers
 		{
 			if(viewBead.popup != null)
 			{
-				IEventDispatcher(viewBead.popup).removeEventListener("change", handleListChange);
+				IEventDispatcher(viewBead.popup).removeEventListener(Event.CHANGE, handleListChange);
 			}
 			viewBead.popUpVisible = !viewBead.popUpVisible;
 
@@ -129,7 +129,7 @@ package org.apache.royale.jewel.beads.controllers
 
 			if(viewBead.popup != null)
 			{
-				IEventDispatcher(viewBead.popup).addEventListener("change", handleListChange);
+				IEventDispatcher(viewBead.popup).addEventListener(Event.CHANGE, handleListChange);
 			}
 		}
 		
@@ -138,7 +138,7 @@ package org.apache.royale.jewel.beads.controllers
 			if(viewBead.popUpVisible)
 				viewBead.popUpVisible = false;
 			
-			IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+			IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE));
 		}
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DateChooserMouseController.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DateChooserMouseController.as
index 9edadaf..58d0ef1 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DateChooserMouseController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DateChooserMouseController.as
@@ -70,10 +70,10 @@ package org.apache.royale.jewel.beads.controllers
             model = _strand.getBeadByType(IBeadModel) as DateChooserModel;
 			                   
             var view:DateChooserView = value.getBeadByType(IBeadView) as DateChooserView;
-			view.prevMonthButton.addEventListener("click", prevMonthClickHandler);
-			view.nextMonthButton.addEventListener("click", nextMonthClickHandler);
+			view.prevMonthButton.addEventListener(MouseEvent.CLICK, prevMonthClickHandler);
+			view.nextMonthButton.addEventListener(MouseEvent.CLICK, nextMonthClickHandler);
 			
-            IEventDispatcher(view.daysTable).addEventListener("change", tableHandler);
+            IEventDispatcher(view.daysTable).addEventListener(Event.CHANGE, tableHandler);
 		}
 
 		private var model:DateChooserModel;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DropDownListController.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DropDownListController.as
index 5b2fe69..9a75211 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DropDownListController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/DropDownListController.as
@@ -90,7 +90,7 @@ package org.apache.royale.jewel.beads.controllers
             pt = DisplayObject(_strand).parent.localToGlobal(pt);
 			DisplayObject(viewBead.popUp).x = pt.x;
 			DisplayObject(viewBead.popUp).y = pt.y;
-            IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
+            IEventDispatcher(viewBead.popUp).addEventListener(Event.CHANGE, changeHandler);
             IUIBase(_strand).topMostEventDispatcher.addEventListener(org.apache.royale.events.MouseEvent.CLICK,
dismissHandler);
         }
         
@@ -110,7 +110,7 @@ package org.apache.royale.jewel.beads.controllers
             var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as
ISelectionModel;
             var popUpModel:ISelectionModel = UIBase(viewBead.popUp).model as ISelectionModel;
             selectionModel.selectedIndex = popUpModel.selectedIndex;
-			IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+			IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE));
         }
 	
 	}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
index 4e3d170..c19ce5f 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ListSingleSelectionMouseController.as
@@ -136,7 +136,7 @@ package org.apache.royale.jewel.beads.controllers
         {
             listModel.selectedIndex = event.index;
 			listModel.selectedItem = event.data;
-            listView.host.dispatchEvent(new Event("change"));
+            listView.host.dispatchEvent(new Event(Event.CHANGE));
         }
 		
 		/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/TableCellSelectionMouseController.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/TableCellSelectionMouseController.as
index 8ba34ba..b8d6d56 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/TableCellSelectionMouseController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/TableCellSelectionMouseController.as
@@ -144,7 +144,7 @@ package org.apache.royale.jewel.beads.controllers
             (model as TableModel).selectedItemProperty = model.selectedItem[model.labelField];
             model.selectedIndex = (model as TableModel).getIndexForSelectedItemProperty();
 
-            view.host.dispatchEvent(new Event("change"));
+            view.host.dispatchEvent(new Event(Event.CHANGE));
         }
 		
 		/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
index 417a2f7..e58f6f5 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
@@ -208,7 +208,7 @@ package org.apache.royale.jewel.beads.views
 				okButton.width = 100;
 				okButton.emphasis = "primary";
                 okButton.text = alertModel.okLabel;
-                okButton.addEventListener("click", handleOK);
+                okButton.addEventListener(MouseEvent.CLICK, handleOK);
 
                 controlBar.addElement(okButton);
             }
@@ -218,7 +218,7 @@ package org.apache.royale.jewel.beads.views
                 cancelButton = new Button();
 				cancelButton.width = 100;
                 cancelButton.text = alertModel.cancelLabel;
-                cancelButton.addEventListener("click", handleCancel);
+                cancelButton.addEventListener(MouseEvent.CLICK, handleCancel);
 
                 controlBar.addElement(cancelButton);
             }
@@ -229,7 +229,7 @@ package org.apache.royale.jewel.beads.views
 				yesButton.width = 100;
 				yesButton.emphasis = "primary";
                 yesButton.text = alertModel.yesLabel;
-                yesButton.addEventListener("click", handleYes);
+                yesButton.addEventListener(MouseEvent.CLICK, handleYes);
 
                 controlBar.addElement(yesButton);
             }
@@ -239,7 +239,7 @@ package org.apache.royale.jewel.beads.views
                 noButton = new Button();
 				noButton.width = 100;
                 noButton.text = alertModel.noLabel;
-                noButton.addEventListener("click", handleNo);
+                noButton.addEventListener(MouseEvent.CLICK, handleNo);
 
                 controlBar.addElement(noButton);
             }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
index 15c59a8..3f02c9b 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ComboBoxView.as
@@ -189,7 +189,7 @@ package org.apache.royale.jewel.beads.views
 		{
 			itemChangeAction();
 
-			IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+			IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE));
 		}
 		
 		/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateChooserView.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateChooserView.as
index d953cd2..2f0eda8 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateChooserView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateChooserView.as
@@ -275,7 +275,7 @@ package org.apache.royale.jewel.beads.views
 			updateDisplay();
 
 			getHost().dispatchEvent(new Event("selectedDateChanged"));
-			getHost().dispatchEvent(new Event("change"));
+			getHost().dispatchEvent(new Event(Event.CHANGE));
 		}
 
 		/**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateFieldView.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateFieldView.as
index 156199a..1de0a09 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateFieldView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/DateFieldView.as
@@ -270,7 +270,7 @@ package org.apache.royale.jewel.beads.views
 		private function selectionChangeHandler(event:Event = null):void
 		{
 			getHost().dispatchEvent(new Event("selectedDateChanged"));
-			getHost().dispatchEvent(new Event("change"));
+			getHost().dispatchEvent(new Event(Event.CHANGE));
 		}
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
index a985bd0..de65dd0 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/ListView.as
@@ -78,7 +78,7 @@ package org.apache.royale.jewel.beads.views
 
 			lastSelectedIndex = listModel.selectedIndex;
 
-			IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+			IEventDispatcher(_strand).dispatchEvent(new Event(Event.CHANGE));
 		}
 
 		protected var lastRollOverIndex:int = -1;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/NumericStepperView.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/NumericStepperView.as
index fd0bccb..76f640c 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/NumericStepperView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/NumericStepperView.as
@@ -100,7 +100,7 @@ package org.apache.royale.jewel.beads.views
 			// value. ideally, we should either set the input to accept only
 			// numeric values or, barring that, reject non-numeric entries. we
 			// cannot do that right now however.
-			input.addEventListener("change",inputChangeHandler);
+			input.addEventListener(Event.CHANGE,inputChangeHandler);
 			
 			// listen for change events on the spinner so the value can be updated as
 			// as resizing the component


Mime
View raw message