flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - allow a magic 'localId' property that works like the 'id' property but is not set on the component so doesn't get factored into CSS calculations.
Date Mon, 07 Aug 2017 04:03:14 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop aefb414b5 -> 42516a88d


allow a magic 'localId' property that works like the 'id' property but is not set on the component
so doesn't get factored into CSS calculations.


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/42516a88
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/42516a88
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/42516a88

Branch: refs/heads/develop
Commit: 42516a88dd925acef6263c0eaccc7dddfb36afc7
Parents: aefb414
Author: Alex Harui <aharui@apache.org>
Authored: Sun Aug 6 21:02:38 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Sun Aug 6 21:02:38 2017 -0700

----------------------------------------------------------------------
 .../internal/parsing/mxml/MXMLScopeBuilder.java |  7 +++++++
 .../internal/tree/mxml/MXMLInstanceNode.java    | 21 +++++++++++++++++++-
 .../compiler/mxml/IMXMLLanguageConstants.java   |  5 +++++
 .../compiler/tree/mxml/IMXMLInstanceNode.java   |  9 +++++++++
 4 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/42516a88/compiler/src/main/java/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
b/compiler/src/main/java/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
index bd778e7..63a02cd 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/parsing/mxml/MXMLScopeBuilder.java
@@ -422,6 +422,13 @@ public class MXMLScopeBuilder
         String id = tag.getRawAttributeValue("id");
         if (id != null)
             processID(tag, idAttribute);
+        else
+        {
+            idAttribute = tag.getTagAttributeData("localId");
+            id = tag.getRawAttributeValue("localId");
+            if (id != null)
+                processID(tag, idAttribute);        	
+        }
 
         if (recurse)
         {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/42516a88/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
index 4d5072b..6d721fa 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/mxml/MXMLInstanceNode.java
@@ -21,6 +21,7 @@ package org.apache.flex.compiler.internal.tree.mxml;
 
 import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.ATTRIBUTE_EXCLUDE_FROM;
 import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.ATTRIBUTE_ID;
+import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.ATTRIBUTE_LOCAL_ID;
 import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.ATTRIBUTE_INCLUDE_IN;
 import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.ATTRIBUTE_ITEM_CREATION_POLICY;
 import static org.apache.flex.compiler.mxml.IMXMLLanguageConstants.ATTRIBUTE_ITEM_DESTRUCTION_POLICY;
@@ -141,6 +142,14 @@ class MXMLInstanceNode extends MXMLClassReferenceNodeBase implements
IMXMLInstan
     private String id;
 
     /**
+     * The compile-time identifier for this instance. This is <code>null</code>
+     * if there is no compile-time <code>id</code> attribute on the tag that
+     * produced this instance.  A localId does not set the id property used
+     * by CSS.
+     */
+    private String localId;
+
+    /**
      * The states (or state groups) that include this instance. This is
      * <code>null</code> if there was no <code>includeIn</code> attribute
on the
      * tag that produced this instance node.
@@ -180,6 +189,9 @@ class MXMLInstanceNode extends MXMLClassReferenceNodeBase implements IMXMLInstan
         if (attribute.isSpecialAttribute(ATTRIBUTE_ID))
             id = processIDAttribute(builder, attribute);
 
+        else if (attribute.isSpecialAttribute(ATTRIBUTE_LOCAL_ID))
+            localId = processIDAttribute(builder, attribute);
+
         else if (attribute.isSpecialAttribute(ATTRIBUTE_INCLUDE_IN))
             includeIn = processIncludeInOrExcludeFromAttribute(builder, attribute);
 
@@ -329,9 +341,16 @@ class MXMLInstanceNode extends MXMLClassReferenceNodeBase implements
IMXMLInstan
     }
 
     @Override
+    public String getLocalID()
+    {
+        return localId;
+    }
+
+    @Override
     public String getEffectiveID()
     {
-        return id != null ? id : getClassDefinitionNode().getGeneratedID(this);
+        return id != null ? id : 
+        	localId != null ? localId : getClassDefinitionNode().getGeneratedID(this);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/42516a88/compiler/src/main/java/org/apache/flex/compiler/mxml/IMXMLLanguageConstants.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/mxml/IMXMLLanguageConstants.java
b/compiler/src/main/java/org/apache/flex/compiler/mxml/IMXMLLanguageConstants.java
index 4b0a127..f67c2c8 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/mxml/IMXMLLanguageConstants.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/mxml/IMXMLLanguageConstants.java
@@ -245,6 +245,11 @@ public interface IMXMLLanguageConstants
     static final String ATTRIBUTE_ID = "id";
 
     /**
+     * The short name of the special <code>localId</code> attribute.
+     */
+    static final String ATTRIBUTE_LOCAL_ID = "localId";
+
+    /**
      * The short name of the special <code>implements</code> attribute.
      */
     static final String ATTRIBUTE_IMPLEMENTS = "implements";

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/42516a88/compiler/src/main/java/org/apache/flex/compiler/tree/mxml/IMXMLInstanceNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/tree/mxml/IMXMLInstanceNode.java
b/compiler/src/main/java/org/apache/flex/compiler/tree/mxml/IMXMLInstanceNode.java
index 0660e0d..b3577d3 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/tree/mxml/IMXMLInstanceNode.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/tree/mxml/IMXMLInstanceNode.java
@@ -36,6 +36,14 @@ public interface IMXMLInstanceNode extends IMXMLClassReferenceNode
     String getID();
 
     /**
+     * The compile-time identifier specified for this instance.
+     * 
+     * @return The localId as a String, or <code>null</code> if no compile-time
+     * identifier was specified.
+     */
+	String getLocalID();
+	
+    /**
      * The compile-time identifier used by the compiler for this instance. If no
      * <code>id</code> is specified, then the compiler generates an identifier
      * if one is needed.
@@ -91,4 +99,5 @@ public interface IMXMLInstanceNode extends IMXMLClassReferenceNode
      * @return <code>true</code> if node has same line number.
      */
     boolean isEqual(IMXMLInstanceNode node);
+
 }


Mime
View raw message