You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2017/12/11 22:48:13 UTC

[royale-asjs] branch develop updated (26acf9c -> fe0d68a)

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

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


    from 26acf9c  more tuning of release artifacts
     new 5dfa96c  Override missing methods in MDL Table
     new fe0d68a  Update MDLDynamicTableExample and show add/remove

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../MDLDynamicTableExample/src/MainView.mxml       | 24 ++++--
 .../src/resources/mdl-styles.css                   |  3 +-
 .../src/main/royale/org/apache/royale/mdl/Table.as | 95 ++++++++++++++++++++--
 .../org/apache/royale/mdl/beads/views/ListView.as  | 10 ---
 .../org/apache/royale/mdl/beads/views/TableView.as |  8 --
 5 files changed, 107 insertions(+), 33 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <co...@royale.apache.org>'].

[royale-asjs] 01/02: Override missing methods in MDL Table

Posted by pi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5dfa96c8a44a692899a7b2c2e4911a4f3f0a5a7b
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Mon Dec 11 23:46:53 2017 +0100

    Override missing methods in MDL Table
    
    Override missing methods in MDL Table which allows to remove/add rows
---
 .../src/main/royale/org/apache/royale/mdl/Table.as | 95 ++++++++++++++++++++--
 .../org/apache/royale/mdl/beads/views/ListView.as  | 10 ---
 .../org/apache/royale/mdl/beads/views/TableView.as |  8 --
 3 files changed, 88 insertions(+), 25 deletions(-)

diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/Table.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/Table.as
index 1052437..9a70510 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/Table.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/Table.as
@@ -89,6 +89,28 @@ package org.apache.royale.mdl
 			}
         }
 
+        /**
+         *  @copy org.apache.royale.core.IParent#getElementAt()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+		override public function getElementAt(index:int):IChild
+		{
+			var element:IChild;
+
+			COMPILE::JS
+            {
+                if (_isTbodyAddedToParent)
+                {
+                    element = tbody.getElementAt(index);
+                }
+            }
+			
+			return element;
+		}
 
         /**
          *  @copy org.apache.royale.core.IParent#addElement()
@@ -97,7 +119,6 @@ package org.apache.royale.mdl
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.8
-         *  @royaleignorecoercion org.apache.royale.core.IUIBase
          */
 		override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
 		{
@@ -110,17 +131,50 @@ package org.apache.royale.mdl
             }
 		}
 
+        /**
+         *  @copy org.apache.royale.core.IParent#addElementAt()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+		{
+            if (!_isTbodyAddedToParent) return;
+
+            COMPILE::JS
+            {
+				tbody.addElementAt(c, index, dispatchEvent);
+            }
+		}
+
+        /**
+         *  @copy org.apache.royale.core.IParent#removeElement()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
         override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
         {
+			if (!_isTbodyAddedToParent) return;
+
 			COMPILE::JS
             {
-                if (_isTbodyAddedToParent)
-                {
-                    tbody.removeElement(c);
-                }
+				tbody.removeElement(c, dispatchEvent);
             }
         }
 
+        /**
+         *  @copy org.apache.royale.core.IItemRendererParent#removeAllItemRenderers()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
         override public function removeAllItemRenderers():void
         {
 			if (!_isTbodyAddedToParent) return;
@@ -135,9 +189,36 @@ package org.apache.royale.mdl
             }
         }
 
+        /**
+         *  @copy org.apache.royale.core.IItemRendererParent#removeItemRenderer()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+		override public function removeItemRenderer(renderer:IItemRenderer):void
+		{
+            if (!_isTbodyAddedToParent) return;
+
+            COMPILE::JS
+            {
+                removeElement(renderer);
+            }
+		}
+
+        /**
+         *  @copy org.apache.royale.core.IItemRendererParent#getItemRendererForIndex()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
         override public function getItemRendererForIndex(index:int):IItemRenderer
         {
 			if (!_isTbodyAddedToParent) return null;
+			var itemRenderer:IItemRenderer;
 
             COMPILE::JS
             {
@@ -146,10 +227,10 @@ package org.apache.royale.mdl
 					return null;
                 }
 
-                return tbody.getElementAt(index) as IItemRenderer;
+                itemRenderer = tbody.getElementAt(index) as IItemRenderer;
             }
 
-			return null;
+			return itemRenderer;
         }
 
         COMPILE::JS
diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/ListView.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/ListView.as
index c077e1a..adb291a 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/ListView.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/ListView.as
@@ -18,18 +18,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.mdl.beads.views
 {
-	import org.apache.royale.core.BeadViewBase;
-	import org.apache.royale.core.IBeadLayout;
-	import org.apache.royale.core.IDataProviderItemRendererMapper;
-	import org.apache.royale.core.IItemRendererParent;
-	import org.apache.royale.core.IStrand;
-	import org.apache.royale.core.ISelectionModel;
-	import org.apache.royale.core.ValuesManager;
-	import org.apache.royale.html.beads.IListView;
 	import org.apache.royale.html.beads.ListView;
 
-	import org.apache.royale.events.Event;
-
 	/**
 	 *  ListView makes sure the itemRendererFactory and the layout beads are installed.
 	 * 
diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/TableView.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/TableView.as
index 994a002..66f021f 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/TableView.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/beads/views/TableView.as
@@ -18,14 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.mdl.beads.views
 {
-	import org.apache.royale.core.IBeadLayout;
-	import org.apache.royale.core.IDataProviderItemRendererMapper;
-	import org.apache.royale.core.IStrand;
-	import org.apache.royale.core.ISelectionModel;
-	import org.apache.royale.core.ValuesManager;
-	import org.apache.royale.events.Event;
-	import org.apache.royale.utils.loadBeadFromValuesManager;
-
 	/**
 	 *  TableView makes sure the itemRendererFactory and the layout beads are installed.
 	 * 

-- 
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.

[royale-asjs] 02/02: Update MDLDynamicTableExample and show add/remove

Posted by pi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fe0d68ab1e321e9bfc8c8cddef4cf405248454f7
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Mon Dec 11 23:48:04 2017 +0100

    Update MDLDynamicTableExample and show add/remove
---
 .../MDLDynamicTableExample/src/MainView.mxml       | 24 +++++++++++++++-------
 .../src/resources/mdl-styles.css                   |  3 ++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/examples/royale/MDLDynamicTableExample/src/MainView.mxml b/examples/royale/MDLDynamicTableExample/src/MainView.mxml
index 70ef5ae..e7234d8 100644
--- a/examples/royale/MDLDynamicTableExample/src/MainView.mxml
+++ b/examples/royale/MDLDynamicTableExample/src/MainView.mxml
@@ -29,6 +29,17 @@ limitations under the License.
 		{
 			usersListModel.users.addItem(new UserVO("piotrz", "Piotr", "Zarzycki", "piotrz@apache.org"));
 		}
+
+		private function onRemoveEmployeeClick(event:MouseEvent):void
+		{
+			usersListModel.users.removeItemAt(usersListModel.users.length - 1);
+		}		
+		
+		private function onTblChange(event:Event):void
+		{
+			var selIndex:int = tblUsers.selectedIndex;
+			var selItem:Object = tblUsers.selectedItem;
+		}
         ]]>
     </fx:Script>
 
@@ -42,7 +53,7 @@ limitations under the License.
 
 	<mdl:GridCell column="12">
 		<mdl:Table id="tblUsers" shadow="2"
-				   dataProvider="{usersListModel.users}" className="customTableStyle">
+				   dataProvider="{usersListModel.users}" className="customTableStyle" change="onTblChange(event)">
 			<mdl:columns>
 				<mdl:TableColumn headerText="Username" />
 				<mdl:TableColumn headerText="First Name"/>
@@ -50,16 +61,15 @@ limitations under the License.
 				<mdl:TableColumn headerText="Email"/>
 			</mdl:columns>
 			<mdl:beads>
-				<!--Bead for listening changes of collection source-->
-				<js:DataProviderCollectionChangeNotifier sourceID="usersListModel" propertyName="users"
-														 destinationPropertyName="dataProvider" changeEventName="dataProviderChanged"  />
-				<!--Bead for listening items events changes-->
-				<js:DataProviderItemsChangeNotifier sourceID="usersListModel" propertyName="users"
-													destinationPropertyName="dataProvider" changeEventName="dataProviderChanged"  />
+				<js:DynamicItemsRendererFactoryForArrayListData />
+				<js:DynamicRemoveItemRendererForArrayListData />
 			</mdl:beads>
 		</mdl:Table>
 	</mdl:GridCell>
 	<mdl:GridCell>
 		<mdl:Button text="Add Employee" width="100" click="onAddEmployeeClick(event)"/>
 	</mdl:GridCell>
+	<mdl:GridCell>
+		<mdl:Button text="Remove Last Employee" width="100" click="onRemoveEmployeeClick(event)"/>
+	</mdl:GridCell>
 </mdl:Grid>
diff --git a/examples/royale/MDLDynamicTableExample/src/resources/mdl-styles.css b/examples/royale/MDLDynamicTableExample/src/resources/mdl-styles.css
index 86406fa..b046aec 100644
--- a/examples/royale/MDLDynamicTableExample/src/resources/mdl-styles.css
+++ b/examples/royale/MDLDynamicTableExample/src/resources/mdl-styles.css
@@ -25,7 +25,8 @@
 
 .customTableStyle
 {
-	IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DynamicItemsRendererFactoryForArrayListData");
+	IDataProviderItemRendererMapper: ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayList");
     IItemRenderer: ClassReference("itemRenderers.CustomTableRowItemRenderer");
+    IBeadController: ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController");
 }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.