You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2016/12/19 19:54:52 UTC

git commit: [flex-asjs] [refs/heads/develop] - Add IMaterialIcon interface - implement when material icon is needed in component

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 6c03ee3dd -> 5ce980fb1


Add IMaterialIcon interface - implement when material icon is needed in component


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

Branch: refs/heads/develop
Commit: 5ce980fb190b0cc8b41bebf44e6579ae54fe622a
Parents: 6c03ee3
Author: piotrz <pi...@apache.org>
Authored: Mon Dec 19 20:54:47 2016 +0100
Committer: piotrz <pi...@apache.org>
Committed: Mon Dec 19 20:54:47 2016 +0100

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/mdl/Button.as |  3 +-
 .../main/flex/org/apache/flex/mdl/ButtonChip.as |  2 --
 .../org/apache/flex/mdl/beads/DeletableChip.as  |  8 ++---
 .../apache/flex/mdl/beads/DeletableLinkChip.as  |  5 +--
 .../flex/mdl/materialIcons/IMaterialIcon.as     | 36 ++++++++++++++++++++
 5 files changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ce980fb/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 6935531..4ad120e 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
@@ -19,6 +19,7 @@
 package org.apache.flex.mdl
 {
     import org.apache.flex.html.TextButton;
+    import org.apache.flex.mdl.materialIcons.IMaterialIcon;
     import org.apache.flex.mdl.supportClasses.MaterialIconBase;    
     
     COMPILE::JS
@@ -35,7 +36,7 @@ package org.apache.flex.mdl
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class Button extends TextButton
+	public class Button extends TextButton implements IMaterialIcon
 	{
         /**
          *  Constructor.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ce980fb/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/ButtonChip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/ButtonChip.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/ButtonChip.as
index df0574b..8ef1ea2 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/ButtonChip.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/ButtonChip.as
@@ -18,8 +18,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.mdl
 {
-    import org.apache.flex.mdl.supportClasses.MaterialIconBase;
-
     COMPILE::JS
     {
         import org.apache.flex.core.WrappedHTMLElement;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ce980fb/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 5b153d6..d839e14 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,10 +22,8 @@ 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.MaterialIconBase;
-    import org.apache.flex.utils.StrandUtils;
-
-    //import org.apache.flex.mdl.Chip;
 
     /**
      *  The DeletableChip bead class is a specialty bead that can be used to add additional
@@ -94,8 +92,8 @@ package org.apache.flex.mdl.beads
         COMPILE::JS
         private function createDeleteButton():Button
         {
-            var materialIcon:MaterialIconBase = Button(_strand).materialIcon; //this could be Chip or ButtonChip, 
-                                                                    //maybe add an Interface for both since is not really a Button
+            var materialIcon:MaterialIconBase = IMaterialIcon(_strand).materialIcon;
+
             if (materialIcon == null)
             {
                 throw new Error("Missing material icon");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ce980fb/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 6f7d2fb..cbf79a7 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,6 +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.MaterialIconBase;
     import org.apache.flex.utils.StrandUtils;
 
@@ -101,8 +102,8 @@ package org.apache.flex.mdl.beads
         COMPILE::JS
         private function createLinkElement():NavigationLink
         {
-            var materialIcon:MaterialIconBase = Button(_strand).materialIcon; //this could be Chip or ButtonChip, 
-                                                                    //maybe add an Interface for both since is not really a Button
+            var materialIcon:MaterialIconBase = IMaterialIcon(_strand).materialIcon;
+
             if (materialIcon == null)
             {
                 throw new Error("Missing material icon");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ce980fb/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
new file mode 100644
index 0000000..71d689d
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/materialIcons/IMaterialIcon.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.materialIcons
+{
+    import org.apache.flex.mdl.supportClasses.MaterialIconBase;
+
+    /**
+     *  Implement if class will need ability to display Material icon
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public interface IMaterialIcon
+    {
+        function get materialIcon():MaterialIconBase;
+        function set materialIcon(value:MaterialIconBase):void;
+    }
+}