org.apache.royale.compiler.tree.mxml.IMXMLDesignLayerNode Maven / Gradle / Ivy
Show all versions of compiler Show documentation
/*
*
* 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.royale.compiler.tree.mxml;
/**
* This AST node represents an MXML {@code } tag.
*
* - {@code
} is scoped to the 2009 language namespace.
* - Only {@code id}, {@code visible} and {@code alpha} are legal properties.
* - {@code visible} and {@code alpha} properties can have states.
* - These attributes are not supported: includeIn, excludeFrom,
* itemCreationPolicy, and itemDestructionPolicy.
* - A {@code DesignLayer} tag without any attribute is a "no-op". It will be
* skipped during code generation.
* - Layer children of optimized (stripped) layers will be hoisted up to
* parent layers if applicable.
*
*
* Although {@code } tag is a MXML 2009 Language tag, it does
* have a corresponding ActionScript class definition -
* {@code mx.core.DesignLayer}.
*
* The implementation of this AST node extends {@code IMXMLInstanceNode} so that
* it can take advantage of the property definitions in the backing ActionScript
* class. However, the generated code can not treat a {@code }
* tag as an instance of some sort of component container. Instead, all the
* children components under the {@code DesignLayer} tag will be hoisted to be
* the direct children of the {@code DesignLayer}'s closest non-DesignLayer
* parent.
*
* For example, given the MXML AST like the following:
*
*
* HGroup
* {
* Label l1
* DesignLayer
* {
* Button b1
* Button b2
* }
* Label l2
* }
*
*
* The MXML code generator will make Button "b1" and "b2" children of the
* HGroup, which means despite the AST shape, "b1" and "b2" will actually become
* siblings of "l1" and "l2" at runtime.
*
* @see
*/
public interface IMXMLDesignLayerNode extends IMXMLInstanceNode
{
/**
* Flatten {@code } tags by hoisting direct children of a
* "DesignLayer" tag. For example:
*
*
* Group
* Button #1
* DesignLayer #1
* Label #1
* Label #2
* Button #2
*
{@code DesignLayer #1}'s hoisted child count is 2.
*
*
*
* Group
* DesignLayer #1
* Label #1
* DesignLayer #2
* Label #2
* Label #3
* Label #4
* DesignLayer #3
* HGroup
* Label #5
*
*
* {@code DesignLayer #1}'s hoisted child count is 5. They are:
*
*
* Label #1
* Label #2
* Label #3
* Label #4
* HGroup
*
*
* Note that {@code Label #5} is a child of {@code HGroup}. It is not
* hoisted up to the {@code Group} level.
*
*/
int getHoistedChildCount();
/**
* If a {@code } tag has no attributes or property child
* nodes, it will be ignored during code generation.
*
* @return True if this {@code } node will be included in
* the code generation.
*/
boolean skipCodeGeneration();
}