You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/04/21 16:35:54 UTC
[30/43] git commit: [flex-asjs] [refs/heads/dual] - replace existing
format bead if it exists
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 <jm...@apache.org>
Authored: Mon Apr 17 14:22:32 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
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).