You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/03/08 19:56:40 UTC
[royale-asjs] 01/02: get Label to compile
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 7da4f9d2b49e73918e75f885a3a664acb10d5962
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 8 11:54:51 2018 -0800
get Label to compile
---
.../src/main/resources/mx-royale-manifest.xml | 3 +-
.../MXRoyale/src/main/royale/mx/controls/Label.as | 56 +++--------
.../src/main/royale/mx/core/IDataRenderer.as | 103 +++++++++++++++++++++
3 files changed, 120 insertions(+), 42 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index 257a9fe..3fccab1 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -21,6 +21,7 @@
<componentPackage>
- <component id="Application" class="mx.core.Application" />
+ <component id="Application" class="mx.core.Application" />
+ <component id="Label" class="mx.controls.Label" />
</componentPackage>
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as
index 8150d5f..3ad20ac 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Label.as
@@ -19,7 +19,10 @@
package mx.controls
{
+COMPILE::JS
+{
import goog.DEBUG;
+}
/*
import flash.display.DisplayObject;
@@ -32,17 +35,27 @@ import flash.text.TextLineMetrics;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.IDropInListItemRenderer;
import mx.controls.listClasses.IListItemRenderer;
+*/
import mx.core.IDataRenderer;
+/*
import mx.core.IFlexModuleFactory;
import mx.core.IFontContextComponent;
import mx.core.IUITextField;
+*/
import mx.core.UIComponent;
+import mx.events.FlexEvent;
+/*
import mx.core.UITextField;
import mx.core.mx_internal;
-import mx.events.FlexEvent;
use namespace mx_internal;
*/
+COMPILE::JS
+{
+ import org.apache.royale.html.util.addElementToWrapper;
+ import org.apache.royale.core.WrappedHTMLElement;
+}
+import org.apache.royale.core.ITextModel;
//--------------------------------------
// Events
@@ -66,30 +79,6 @@ use namespace mx_internal;
[Event(name="dataChange", type="mx.events.FlexEvent")]
/**
- * Dispatched when a user clicks a hyperlink in an
- * HTML-enabled text field, where the URL begins with <code>"event:"</code>.
- * The remainder of the URL after
- * <code>"event:"</code> is placed in the text property of the <code>link</code> event object.
- *
- * <p>When you handle the <code>link</code> event, the hyperlink is not automatically executed;
- * you need to execute the hyperlink from within your event handler.
- * You typically use the <code>navigateToURL()</code> method to execute the hyperlink.
- * This allows you to modify the hyperlink, or even prohibit it from occurring,
- * in your application. </p>
- *
- * <p>The Label control must have the <code>selectable</code> property set
- * to <code>true</code> to generate the <code>link</code> event.</p>
- *
- * @eventType flash.events.TextEvent.LINK
- *
- * @langversion 3.0
- * @playerversion Flash 9
- * @playerversion AIR 1.1
- * @productversion Flex 3
- */
-[Event(name="link", type="flash.events.TextEvent")]
-
-/**
* Dispatched when the user clicks on a Label.
*
* @langversion 3.0
@@ -108,8 +97,6 @@ use namespace mx_internal;
[DefaultBindingProperty(destination="text")]
-[Alternative(replacement="spark.components.Label", since="4.0")]
-
/**
* The Label control displays a single line of noneditable text.
* Use the Text control to create blocks of multiline
@@ -207,8 +194,7 @@ use namespace mx_internal;
* @productversion Flex 3
*/
public class Label extends UIComponent
- implements IDataRenderer, IDropInListItemRenderer,
- IListItemRenderer, IFontContextComponent
+ implements IDataRenderer
{
@@ -606,18 +592,6 @@ public class Label extends UIComponent
}
//----------------------------------
- // isHTML
- //----------------------------------
-
- /**
- * @private
- */
- private function get isHTML():Boolean
- {
- return explicitHTMLText != null;
- }
-
- //----------------------------------
// text
//----------------------------------
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDataRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDataRenderer.as
new file mode 100644
index 0000000..c3bfe10
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDataRenderer.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.core
+{
+
+/**
+ * The IDataRenderer interface defines the interface for components that have a <code>data</code> property.
+ *
+ * <p>Components that are used in an item renderer or item editor
+ * in a list control (such as the List, HorizontalList, TileList, DataGrid,
+ * and Tree controls), or as renderers in a chart are passed the data
+ * to render or edit by using the <code>data</code> property.
+ * The component must implement IDataRenderer so that the host components
+ * can pass this information.
+ * All Flex containers and many Flex components implement IDataRenderer and
+ * the <code>data</code> property.</p>
+ *
+ * <p>In a list control, Flex sets the <code>data</code> property
+ * of an item renderer or item editor to the element in the data provider
+ * that corresponds to the item being rendered or edited.
+ * For a DataGrid control, the <code>data</code> property
+ * contains the data provider element for the entire row of the DataGrid
+ * control, not just for the item.</p>
+ *
+ * <p>To implement this interface, you define a setter and getter method
+ * to implement the <code>data</code> property.
+ * Typically, the setter method writes the value of the <code>data</code>
+ * property to an internal variable and dispatches a <code>dataChange</code>
+ * event, and the getter method returns the current value of the internal
+ * variable, as the following example shows:</p>
+ *
+ * <pre>
+ * // Internal variable for the property value.
+ * private var _data:Object;
+ *
+ * // Make the data property bindable.
+ * [Bindable("dataChange")]
+ *
+ * // Define the getter method.
+ * public function get data():Object {
+ * return _data;
+ * }
+ *
+ * // Define the setter method, and dispatch an event when the property
+ * // changes to support data binding.
+ * public function set data(value:Object):void {
+ * _data = value;
+ *
+ * dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+ * }
+ * </pre>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IDataRenderer
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // data
+ //----------------------------------
+
+ /**
+ * The data to render or edit.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get data():Object;
+
+ /**
+ * @private
+ */
+ function set data(value:Object):void;
+}
+
+}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.