flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject [1/2] git commit: [flex-asjs] [refs/heads/develop] - - Change IMaterialIcon to abstraction which provides user easies way to implement his own custom MaterialIcon class - IMaterialIcon was transformed to IMaterialIconProvider - class which implement prov
Date Tue, 07 Mar 2017 00:09:57 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 6436eff40 -> 86ecc8acf


- Change IMaterialIcon to abstraction which provides user easies way to implement his own
custom MaterialIcon class
- IMaterialIcon was transformed to IMaterialIconProvider - class which implement provides
"materialIcon" property for use in mxml


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

Branch: refs/heads/develop
Commit: 2a172a0bdb33753c9b67efe55e1dd5c356cd25ca
Parents: 6436eff
Author: piotrz <piotrz@apache.org>
Authored: Tue Mar 7 00:52:58 2017 +0100
Committer: piotrz <piotrz@apache.org>
Committed: Tue Mar 7 00:52:58 2017 +0100

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/mdl/Button.as | 12 +++----
 .../main/flex/org/apache/flex/mdl/IconToggle.as | 16 ++++++---
 .../org/apache/flex/mdl/beads/DeletableChip.as  |  4 +--
 .../apache/flex/mdl/beads/DeletableLinkChip.as  |  4 +--
 .../flex/mdl/materialIcons/IMaterialIcon.as     |  9 +++--
 .../mdl/supportClasses/IMaterialIconProvider.as | 36 ++++++++++++++++++++
 .../flex/mdl/supportClasses/MaterialIconBase.as |  3 +-
 7 files changed, 63 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
index 40abaea..aeb2a6f 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Button.as
@@ -20,9 +20,9 @@ package org.apache.flex.mdl
 {
     import org.apache.flex.html.TextButton;
     import org.apache.flex.mdl.beads.UpgradeElement;
+    import org.apache.flex.mdl.supportClasses.IMaterialIconProvider;
     import org.apache.flex.mdl.materialIcons.IMaterialIcon;
-    import org.apache.flex.mdl.supportClasses.MaterialIconBase;    
-    
+   
     COMPILE::JS
     {
         import org.apache.flex.core.WrappedHTMLElement;
@@ -37,7 +37,7 @@ package org.apache.flex.mdl
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.8
      */
-	public class Button extends TextButton implements IMaterialIcon
+	public class Button extends TextButton implements IMaterialIconProvider
 	{
         /**
          *  Constructor.
@@ -78,7 +78,7 @@ package org.apache.flex.mdl
             return element;
 		}
 
-        private var _materialIcon:MaterialIconBase;
+        private var _materialIcon:IMaterialIcon;
         /**
 		 *  A material icon to use with the button.
          *  Optional
@@ -88,11 +88,11 @@ package org.apache.flex.mdl
 		 *  @playerversion AIR 2.6
 		 *  @productversion FlexJS 0.8
 		 */
-        public function get materialIcon():MaterialIconBase
+        public function get materialIcon():IMaterialIcon
         {
             return _materialIcon;
         }
-        public function set materialIcon(value:MaterialIconBase):void
+        public function set materialIcon(value:IMaterialIcon):void
         {
             _materialIcon = value;
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/IconToggle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/IconToggle.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/IconToggle.as
index a18af96..fcb4309 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/IconToggle.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/IconToggle.as
@@ -18,6 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl
 {
+    import org.apache.flex.mdl.supportClasses.IMaterialIconProvider;
     import org.apache.flex.mdl.materialIcons.IMaterialIcon;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;
     import org.apache.flex.core.IToggleButtonModel;
@@ -76,7 +77,7 @@ package org.apache.flex.mdl
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.8
      */    
-    public class IconToggle extends TextButton implements IStrand, IEventDispatcher, IUIBase,
IMaterialIcon
+    public class IconToggle extends TextButton implements IStrand, IEventDispatcher, IUIBase,
IMaterialIconProvider
     {
         /**
          *  constructor.
@@ -178,7 +179,7 @@ package org.apache.flex.mdl
             }
         }
 
-        private var _materialIcon:MaterialIconBase;
+        private var _materialIcon:IMaterialIcon;
         /**
          *  A material icon.
          *
@@ -187,17 +188,22 @@ package org.apache.flex.mdl
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.8
          */
-        public function get materialIcon():MaterialIconBase
+        public function get materialIcon():IMaterialIcon
         {
             return _materialIcon;
         }
-        public function set materialIcon(value:MaterialIconBase):void
+        public function set materialIcon(value:IMaterialIcon):void
         {
             _materialIcon = value;
 
             COMPILE::JS
             {
-                _materialIcon.iconToggleLabel = true;
+                var icon:MaterialIconBase = (value as MaterialIconBase);
+                if (icon)
+                {
+                    icon.iconToggleLabel = true;
+                }
+                
                 addElement(_materialIcon);
             }
         }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableChip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableChip.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableChip.as
index 3eab336..939ff38 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableChip.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableChip.as
@@ -22,7 +22,7 @@ package org.apache.flex.mdl.beads
     import org.apache.flex.core.IStrand;
     import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.Button;
-    import org.apache.flex.mdl.materialIcons.IMaterialIcon;
+    import org.apache.flex.mdl.supportClasses.IMaterialIconProvider;
 
     /**
      *  The DeletableChip bead class is a specialty bead that can be used to add additional
@@ -92,7 +92,7 @@ package org.apache.flex.mdl.beads
         COMPILE::JS
         private function createDeleteButton():Button
         {
-            var materialIcon:IMaterialIcon = _strand as IMaterialIcon;
+            var materialIcon:IMaterialIconProvider = _strand as IMaterialIconProvider;
 
             if (materialIcon == null)
             {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableLinkChip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableLinkChip.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableLinkChip.as
index 2148ca7..f405a0a 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableLinkChip.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/DeletableLinkChip.as
@@ -22,7 +22,7 @@ package org.apache.flex.mdl.beads
     import org.apache.flex.core.IStrand;
     import org.apache.flex.core.UIBase;
     import org.apache.flex.mdl.NavigationLink;
-    import org.apache.flex.mdl.materialIcons.IMaterialIcon;
+    import org.apache.flex.mdl.supportClasses.IMaterialIconProvider;
 
     /**
      *  The DeletableLinkChip bead class is a specialty bead that can be used to add additional
@@ -119,7 +119,7 @@ package org.apache.flex.mdl.beads
         COMPILE::JS
         private function createLinkElement():NavigationLink
         {
-            var materialIcon:IMaterialIcon = _strand as IMaterialIcon;
+            var materialIcon:IMaterialIconProvider = _strand as IMaterialIconProvider;
 
             if (materialIcon == null)
             {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/materialIcons/IMaterialIcon.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/materialIcons/IMaterialIcon.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/materialIcons/IMaterialIcon.as
index 1d3af37..b49e605 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/materialIcons/IMaterialIcon.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/materialIcons/IMaterialIcon.as
@@ -18,19 +18,18 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl.materialIcons
 {
-    import org.apache.flex.mdl.supportClasses.MaterialIconBase;
+    import org.apache.flex.core.IUIBase;
 
     /**
-     *  Implement if a class will need ability to display Material icon
+     *  IMaterialIcon interface provides abstraction for easiest way to implements custom
MaterialIcon class
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.8
      */
-    public interface IMaterialIcon
+    public interface IMaterialIcon extends IUIBase
     {
-        function get materialIcon():MaterialIconBase;
-        function set materialIcon(value:MaterialIconBase):void;
+
     }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/IMaterialIconProvider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/IMaterialIconProvider.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/IMaterialIconProvider.as
new file mode 100644
index 0000000..e08313d
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/IMaterialIconProvider.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.mdl.supportClasses
+{
+    import org.apache.flex.mdl.materialIcons.IMaterialIcon;
+
+    /**
+     *  Implement if a class will need ability to display Material icon
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.8
+     */
+    public interface IMaterialIconProvider
+    {
+        function get materialIcon():org.apache.flex.mdl.materialIcons.IMaterialIcon;
+        function set materialIcon(value:org.apache.flex.mdl.materialIcons.IMaterialIcon):void;
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2a172a0b/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 cfa11d2..88f41f8 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
@@ -19,6 +19,7 @@
 package org.apache.flex.mdl.supportClasses
 {
     import org.apache.flex.core.UIBase;
+    import org.apache.flex.mdl.materialIcons.IMaterialIcon;
 
     COMPILE::JS
     {
@@ -37,7 +38,7 @@ package org.apache.flex.mdl.supportClasses
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.8
      */
-    public class MaterialIconBase extends UIBase
+    public class MaterialIconBase extends UIBase implements org.apache.flex.mdl.materialIcons.IMaterialIcon
     {
         /**
          *  constructor.


Mime
View raw message