flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [07/50] git commit: [flex-asjs] [refs/heads/feature/mdl] - Simplify Materialcon estructure to allow further changes
Date Mon, 19 Dec 2016 02:17:55 GMT
Simplify Materialcon estructure to allow further changes


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7ff78947
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7ff78947
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7ff78947

Branch: refs/heads/feature/mdl
Commit: 7ff7894768f1968a28b68c7e6fc72b470ba2adaa
Parents: bc10559
Author: Carlos Rovira <carlosrovira@apache.org>
Authored: Sun Dec 11 23:09:56 2016 +0100
Committer: Carlos Rovira <carlosrovira@apache.org>
Committed: Sun Dec 11 23:09:56 2016 +0100

----------------------------------------------------------------------
 .../mdl/beads/materialIcons/MaterialIconAdd.as  | 26 ++--------------
 .../beads/materialIcons/MaterialIconCancel.as   | 26 ++--------------
 .../beads/materialIcons/MaterialIconEvent.as    | 26 ++--------------
 .../beads/materialIcons/MaterialIconPerson.as   | 26 ++--------------
 .../beads/materialIcons/MaterialIconShare.as    | 26 ++--------------
 .../mdl/beads/materialIcons/MaterialIconStar.as | 26 ++--------------
 .../flex/mdl/supportClasses/MaterialIconBase.as | 32 +++++++++++++++++++-
 7 files changed, 49 insertions(+), 139 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
index 522e685..ed2d8e2 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
@@ -18,9 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.beads.materialIcons
 {
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
@@ -32,7 +29,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconAdd extends MaterialIconBase implements IBead
+    public class MaterialIconAdd extends MaterialIconBase
     {
         /**
          *  constructor.
@@ -47,26 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
             super();
         }
         
-        private var _strand:IStrand;
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        public function set strand(value:IStrand):void
+        override protected function get iconText():String
         {
-            _strand = value;
-
-            COMPILE::JS
-            {
-                var host:UIBase = value as UIBase;
-                var htmlElement:HTMLElement = host.element as HTMLElement;
-
-                materialIcon.text = MaterialIconsType.ADD;
-
-                htmlElement.appendChild(element);
-            }
+            return MaterialIconsType.ADD;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
index 9925e91..828f067 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
@@ -18,9 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.beads.materialIcons
 {
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
@@ -32,7 +29,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconCancel extends MaterialIconBase implements IBead
+    public class MaterialIconCancel extends MaterialIconBase
     {
         /**
          *  constructor.
@@ -47,26 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
             super();
         }
 
-        private var _strand:IStrand;
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        public function set strand(value:IStrand):void
+        override protected function get iconText():String
         {
-            _strand = value;
-
-            COMPILE::JS
-            {
-                var host:UIBase = value as UIBase;
-                var hostElement:HTMLElement = host.element as HTMLElement;
-
-                materialIcon.text = MaterialIconsType.CANCEL;
-
-                hostElement.appendChild(element);
-            }
+            return MaterialIconsType.CANCEL;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconEvent.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconEvent.as
index 34bf8fc..60e833b 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconEvent.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconEvent.as
@@ -18,9 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.beads.materialIcons
 {
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
@@ -32,7 +29,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconEvent extends MaterialIconBase implements IBead
+    public class MaterialIconEvent extends MaterialIconBase
     {
         /**
          *  constructor.
@@ -47,26 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
             super();
         }
         
-        private var _strand:IStrand;
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        public function set strand(value:IStrand):void
+        override protected function get iconText():String
         {
-            _strand = value;
-
-            COMPILE::JS
-            {
-                var host:UIBase = value as UIBase;
-                var htmlElement:HTMLElement = host.element as HTMLElement;
-
-                materialIcon.text = MaterialIconsType.EVENT;
-
-                htmlElement.appendChild(element);
-            }
+            return MaterialIconsType.EVENT;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
index 6e210c5..0881364 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconPerson.as
@@ -18,9 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.beads.materialIcons
 {
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
@@ -32,7 +29,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconPerson extends MaterialIconBase implements IBead
+    public class MaterialIconPerson extends MaterialIconBase
     {
         /**
          *  constructor.
@@ -47,26 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
             super();
         }
         
-        private var _strand:IStrand;
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        public function set strand(value:IStrand):void
+        override protected function get iconText():String
         {
-            _strand = value;
-
-            COMPILE::JS
-            {
-                var host:UIBase = value as UIBase;
-                var htmlElement:HTMLElement = host.element as HTMLElement;
-
-                materialIcon.text = MaterialIconsType.PERSON;
-
-                htmlElement.appendChild(element);
-            }
+            return MaterialIconsType.PERSON;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconShare.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconShare.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconShare.as
index 76b027a..cc751db 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconShare.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconShare.as
@@ -18,9 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.beads.materialIcons
 {
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
@@ -32,7 +29,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconShare extends MaterialIconBase implements IBead
+    public class MaterialIconShare extends MaterialIconBase
     {
         /**
          *  constructor.
@@ -47,26 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
             super();
         }
         
-        private var _strand:IStrand;
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        public function set strand(value:IStrand):void
+        override protected function get iconText():String
         {
-            _strand = value;
-
-            COMPILE::JS
-            {
-                var host:UIBase = value as UIBase;
-                var htmlElement:HTMLElement = host.element as HTMLElement;
-
-                materialIcon.text = MaterialIconsType.SHARE;
-
-                htmlElement.appendChild(element);
-            }
+            return MaterialIconsType.SHARE;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconStar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconStar.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconStar.as
index ae52548..6befded 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconStar.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconStar.as
@@ -18,9 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.beads.materialIcons
 {
-    import org.apache.flex.core.IBead;
-    import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
@@ -32,7 +29,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconStar extends MaterialIconBase implements IBead
+    public class MaterialIconStar extends MaterialIconBase
     {
         /**
          *  constructor.
@@ -47,26 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
             super();
         }
         
-        private var _strand:IStrand;
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        public function set strand(value:IStrand):void
+        override protected function get iconText():String
         {
-            _strand = value;
-
-            COMPILE::JS
-            {
-                var host:UIBase = value as UIBase;
-                var htmlElement:HTMLElement = host.element as HTMLElement;
-
-                materialIcon.text = MaterialIconsType.STAR;
-
-                htmlElement.appendChild(element);
-            }
+            return MaterialIconsType.STAR;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7ff78947/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
index 70e2092..da5b9d8 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
@@ -18,6 +18,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.supportClasses
 {
+    import org.apache.flex.core.IBead;
+    import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.UIBase;
     import org.apache.flex.html.I;
 
     /**
@@ -28,7 +31,7 @@ package org.apache.flex.mdl.supportClasses
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconBase
+    public class MaterialIconBase implements IBead
     {
         /**
          *  constructor.
@@ -49,6 +52,33 @@ package org.apache.flex.mdl.supportClasses
             }
         }
 
+        private var _strand:IStrand;
+
+        /**
+         * @flexjsignorecoercion HTMLElement
+         *
+         * @param value
+         */
+        public function set strand(value:IStrand):void
+        {
+            _strand = value;
+
+            COMPILE::JS
+            {
+                var host:UIBase = value as UIBase;
+                var htmlElement:HTMLElement = host.element as HTMLElement;
+
+                materialIcon.text = iconText;
+
+                htmlElement.appendChild(element);
+            }
+        }
+
+        protected function get iconText():String
+        {
+            return "";
+        }
+
         COMPILE::JS
         protected var materialIcon:I;
 


Mime
View raw message