You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2016/12/19 02:18:13 UTC
[25/50] git commit: [flex-asjs] [refs/heads/feature/mdl] - TextNode
class
TextNode class
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a11bb25c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a11bb25c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a11bb25c
Branch: refs/heads/feature/mdl
Commit: a11bb25ce29482d9c53f1ab29cccd0b7c7c8e880
Parents: bc1937b
Author: Carlos Rovira <ca...@apache.org>
Authored: Wed Dec 14 19:33:24 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Wed Dec 14 19:33:24 2016 +0100
----------------------------------------------------------------------
.../main/flex/org/apache/flex/html/TextNode.as | 99 ++++++++++++++++++++
.../HTML/src/main/resources/basic-manifest.xml | 1 +
2 files changed, 100 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a11bb25c/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextNode.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextNode.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextNode.as
new file mode 100644
index 0000000..865e775
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextNode.as
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html
+{
+ import org.apache.flex.core.ContainerBase;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ [DefaultProperty("text")]
+
+ /**
+ * The TextNode class represents an HTML Text node element
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextNode extends ContainerBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextNode()
+ {
+ super();
+ }
+
+ private var _text:String = "";
+
+ /**
+ * The text of the heading
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return _text;
+ }
+
+ public function set text(value:String):void
+ {
+ _text = value;
+
+ COMPILE::JS
+ {
+ textNode.nodeValue = text;
+ }
+
+ }
+
+ COMPILE::JS
+ private var textNode:Text;
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ textNode = document.createTextNode('') as Text;
+
+ element = textNode as WrappedHTMLElement;
+
+ positioner = element;
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a11bb25c/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
index b7f3667..c283cb1 100644
--- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
@@ -155,5 +155,6 @@
<component id="Li" class="org.apache.flex.html.Li" />
<component id="InnerHTML" class="org.apache.flex.html.beads.InnerHTML" />
+ <component id="TextNode" class="org.apache.flex.html.TextNode" />
</componentPackage>