royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs] branch develop updated: Fixed TreeGrid selectors
Date Sun, 03 Jun 2018 09:39:42 GMT
This is an automated email from the ASF dual-hosted git repository.

harbs 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 3415078  Fixed TreeGrid selectors
3415078 is described below

commit 3415078ae839835501877642958c4ab4444e94dd
Author: Harbs <harbs@in-tools.com>
AuthorDate: Sun Jun 3 12:39:20 2018 +0300

    Fixed TreeGrid selectors
---
 .../projects/Basic/src/main/resources/defaults.css |  4 --
 .../org/apache/royale/html/beads/TreeGridView.as   | 50 +++++++++++-----------
 .../royale/html/supportClasses/DataGridColumn.as   |  3 +-
 3 files changed, 26 insertions(+), 31 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css b/frameworks/projects/Basic/src/main/resources/defaults.css
index cbd29c9..5576a31 100644
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@ -516,10 +516,6 @@ TreeGrid
 	border: 1px solid #222222;
 }
 
-TreeGrid .TreeGridColumn {
-	border: none
-}
-
 TreeGridListArea {
 	background-color: #FFFFFF;
 	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.BasicLayout");
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TreeGridView.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TreeGridView.as
index 89ea5ad..803c60a 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TreeGridView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TreeGridView.as
@@ -18,17 +18,17 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.html.beads
 {
-	import org.apache.royale.core.beads.GroupView;
 	import org.apache.royale.core.IBeadLayout;
 	import org.apache.royale.core.IBeadModel;
 	import org.apache.royale.core.IBeadView;
 	import org.apache.royale.core.IDataGridModel;
 	import org.apache.royale.core.IDataGridPresentationModel;
-	import org.apache.royale.core.ISelectionModel;
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.core.IUIBase;
 	import org.apache.royale.core.UIBase;
 	import org.apache.royale.core.ValuesManager;
+	import org.apache.royale.core.beads.GroupView;
+	import org.apache.royale.core.supportClasses.Viewport;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.events.IEventDispatcher;
 	import org.apache.royale.html.Container;
@@ -41,10 +41,7 @@ package org.apache.royale.html.beads
 	import org.apache.royale.html.beads.layouts.TreeGridLayout;
 	import org.apache.royale.html.beads.models.ButtonBarModel;
 	import org.apache.royale.html.beads.models.SingleSelectionCollectionViewModel;
-	import org.apache.royale.html.supportClasses.DataGridColumn;
 	import org.apache.royale.html.supportClasses.IDataGridColumn;
-	import org.apache.royale.html.supportClasses.TreeGridColumn;
-	import org.apache.royale.core.supportClasses.Viewport;
 	
 	/**
 	 * The TreeGridView class is responsible for creating the sub-components of the TreeGrid:
@@ -110,6 +107,9 @@ package org.apache.royale.html.beads
 		 *  @playerversion Flash 10.2
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
+		 *  @royaleignorecoercion Class
+		 *  @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+		 *  @royaleignorecoercion org.apache.royale.core.IBeadLayout
 		 */
 		override public function set strand(value:IStrand):void
 		{
@@ -137,6 +137,11 @@ package org.apache.royale.html.beads
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion org.apache.royale.core.IBeadModel
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
+		 * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumn
+		 * @royaleignorecoercion org.apache.royale.html.TreeGrid
 		 */
 		protected function finishSetup(event:Event):void
 		{
@@ -168,7 +173,7 @@ package org.apache.royale.html.beads
 			}
 				
 			for(var i:int=0; i < sharedModel.columns.length; i++) {
-				var dgc:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
+				var dgc:IDataGridColumn = sharedModel.columns[i] as IDataGridColumn;
 				var colWidth:Number = dgc.columnWidth - marginBorderOffset;
 				buttonWidths.push(colWidth);
 				
@@ -215,6 +220,7 @@ package org.apache.royale.html.beads
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
 		 */
 		private function handleSelectedIndexChanged(event:Event):void
 		{
@@ -230,6 +236,7 @@ package org.apache.royale.html.beads
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
 		 */
 		private function handleColumnListChange(event:Event):void
 		{
@@ -248,17 +255,14 @@ package org.apache.royale.html.beads
 		
 		/**
 		 * @private
+		 * @royaleignorecoercion Class
+		 * @royaleignorecoercion org.apache.royale.core.IDataGridModel
+		 * @royaleignorecoercion org.apache.royale.html.supportClasses.IDataGridColumn
 		 */
 		private function createColumns():void
 		{
 			var host:TreeGrid = _strand as TreeGrid;
-			
-			// get the name of the class to use for the columns
-			var columnClassName:String = ValuesManager.valuesImpl.getValue(host, "columnClassName")
as String;
-			if (columnClassName == null) {
-				columnClassName = "TreeGridColumn";
-			}
-			
+						
 			var presentationModel:IDataGridPresentationModel = host.presentationModel;
 			var sharedModel:IDataGridModel = host.model as IDataGridModel;
 			
@@ -266,23 +270,19 @@ package org.apache.royale.html.beads
 			
 			for (var i:int=0; i < sharedModel.columns.length; i++) {
 				var columnDef:IDataGridColumn = sharedModel.columns[i] as IDataGridColumn;
-				var useClassName:String = columnClassName;
-				if (columnDef.className != null) useClassName = columnDef.className;
+				var columnClassName:String = columnDef.className;
+				var useClassName:String = columnClassName ? " " + columnClassName : "";
 				
 				var column:List = columnDef.createColumn() as List;
 				
 				if (i == 0)
-				{
-					column.className = "first "+useClassName;
-				}
+					column.className = "first" + useClassName;
+
 				else if (i == sharedModel.columns.length-1)
-				{
-					column.className = "last "+useClassName;
-				}
+					column.className = "last" + useClassName;
+
 				else
-				{
-					column.className = "middle "+useClassName;
-				}
+					column.className = "middle" + useClassName;
 				
 				// For the TreeGrid, the List columns must use this
 				// model and itemRenderer factory to be compatible 
@@ -291,7 +291,7 @@ package org.apache.royale.html.beads
 					column.model = new SingleSelectionCollectionViewModel();
 					column.addBead(new DataItemRendererFactoryForCollectionView());
 				}
-				
+
 				column.id = "treeGridColumn" + String(i);
 				column.dataProvider = sharedModel.dataProvider;
 				column.labelField = columnDef.dataField;
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DataGridColumn.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DataGridColumn.as
index 904a539..cc58aff 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DataGridColumn.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DataGridColumn.as
@@ -59,8 +59,7 @@ package org.apache.royale.html.supportClasses
 		 */
 		public function createColumn():IUIBase
 		{
-			var list:List = new List();
-			return list;
+			return new List();
 		}
 		
 		private var _itemRenderer:IFactory;

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

Mime
View raw message