replace existing format bead if it exists

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

Branch: refs/heads/dual
Commit: 4842fa7a15a756026dcfa1ca4262039fded2db59
Parents: 23f3c5a
Author: Justin Mclean <[email protected]>
Authored: Mon Apr 17 14:22:32 2017 +1000
Committer: Justin Mclean <[email protected]>
Committed: Mon Apr 17 14:22:32 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/html/DateField.as | 22 ++++++++++++++++++++
 .../main/flex/org/apache/flex/html/DateField.as | 22 ++++++++++++++++++++
 2 files changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4842fa7a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/DateField.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/DateField.as 
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/DateField.as
index f46e453..ca142ba 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/DateField.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/DateField.as
@@ -20,6 +20,7 @@ package org.apache.flex.html
 {
        import org.apache.flex.core.IBead;
        import org.apache.flex.core.IDateChooserModel;
+       import org.apache.flex.core.IFormatBead;
        import org.apache.flex.core.UIBase;
        import org.apache.flex.core.ValuesManager;
        
@@ -74,6 +75,27 @@ package org.apache.flex.html
             
                        super.addedToParent();
                }
+
+               /**
+                *  Replace existing format bead if it exists.
+                *
+                *  @copy org.apache.flex.core.IStrand#addBead()
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion FlexJS 0.0
+                */
+               override public function addBead(bead:IBead):void
+               {
+                       if (bead is IFormatBead) {
+                               var formatBead:IBead = 
getBeadByType(IFormatBead);
+                               if (formatBead != null) {
+                                       removeBead(formatBead);
+                               }
+                       }
+                       super.addBead(bead);
+               }
                
                /**
                 *  The currently selected date (or null if no date has been 
selected).

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4842fa7a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as 
b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
index f33db9d..5b73db0 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
@@ -20,6 +20,7 @@ package org.apache.flex.html
 {
        import org.apache.flex.core.IBead;
        import org.apache.flex.core.IDateChooserModel;
+       import org.apache.flex.core.IFormatBead;
        import org.apache.flex.core.UIBase;
        import org.apache.flex.core.ValuesManager;
        
@@ -75,6 +76,27 @@ package org.apache.flex.html
             
                        super.addedToParent();
                }
+
+               /**
+                *  Replace existing format bead if it exists.
+                *
+                *  @copy org.apache.flex.core.IStrand#addBead()
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion FlexJS 0.0
+                */
+               override public function addBead(bead:IBead):void
+               {
+                       if (bead is IFormatBead) {
+                               var formatBead:IBead = 
getBeadByType(IFormatBead);
+                               if (formatBead != null) {
+                                       removeBead(formatBead);
+                               }
+                       }
+                       super.addBead(bead);
+               }
                
                /**
                 *  The currently selected date (or null if no date has been 
selected).

Reply via email to