Package flex2.compiler.mxml.reflect

Examples of flex2.compiler.mxml.reflect.TypeTable$EventHelper


    /**
     * Create virtual file for given file and throw configuration exception if not possible
     */
    public static VirtualFile getVirtualFile(String path, boolean reportError) throws ConfigurationException
    {
        VirtualFile result = null;
        File file = new File(path);

        if (file != null && file.exists())
        {
            try
View Full Code Here


    {
            // No need to check to see if the appPath is supported again.
      if ((appPath != null && files[i].getName().equals(appPath.getName())) || isSupported(files[i]))
      {
        String name = files[i].getName();
        VirtualFile pathRoot = calculatePathRoot(files[i]);
        if (pathRoot != null)
        {
                    String relativePath = calculateRelativePath(name);
                    String namespaceURI = relativePath.replace('/', '.');
                    String localPart = calculateLocalPart(name);
View Full Code Here

        standardDefs.set(defs);
    }

    public static StandardDefs getStandardDefs()
    {
        StandardDefs defs = standardDefs.get();
        if (defs == null)
        {
            defs = StandardDefs.getStandardDefs("halo");
            setStandardDefs(defs);
        }
View Full Code Here

            String packageName = originalSource.getRelativePath().replace('/','.');

            // TypeTable will be used to determine if an text related FXG
            // attribute apply to a property or style of the associated
            // ActionScript API.
            TypeTable typeTable = new TypeTable(symbolTable, nameMappings, unit.getStandardDefs(),
                                                themeNames);

            // Transcode the FXG DOM to SWF graphics primitives
            FXGSymbolClass asset = transcodeFXG(unit, packageName, className, typeTable);
View Full Code Here

     */
    public void validate(SymbolTable symbolTable, NameMappings nameMappings,
                         StandardDefs standardDefs, Set<String> themeNames, Set<String> addedCSSFiles)
    {
        Set<String> classNames;
        TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(MxmlCompiler.TYPE_TABLE);

        if (typeTable == null)
        {
            typeTable = new TypeTable(symbolTable, nameMappings, standardDefs, themeNames);
        }

        if (qualifiedTypeSelectors)
        {
            classNames = symbolTable.getClassNames();
        }
        else
        {
            classNames = new HashSet<String>();

            for (String className : symbolTable.getClassNames())
            {
                if (qualifiedTypeSelectors)
                    classNames.add(NameFormatter.toDot(className));
                else
                    classNames.add(className.replaceFirst(".*:", ""));
            }
        }

        // Strip off the leading '[' and trailing ']'.
        String themeNamesString = themeNames.toString();
        themeNamesString = themeNamesString.substring(1, themeNamesString.length() - 1);

        for (Entry<String, StyleDef> entry : styleDefs.entrySet())
        {
            String styleName = entry.getKey();
            StyleDef styleDef = entry.getValue();
            String typeName = StyleDef.dehyphenize(styleName);

            Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();

            if (declarations != null)
            {
                for (StyleDeclaration styleDeclaration : declarations.values())
                {
                    Collection<StyleDeclarationBlock> blocks = styleDeclaration.getDeclarationBlocks();
                    for (StyleDeclarationBlock block : blocks)
                    {
                        Map<String, StyleProperty> styleProperties = block.getProperties();
   
                        if (addedCSSFiles == null || addedCSSFiles.contains(styleDeclaration.getPath()))
                        {
                            if (styleDef.isTypeSelector())
                            {
                                if (qualifiedTypeSelectors && mxmlConfiguration.showInvalidCssPropertyWarnings())
                                {
                                    Type type = typeTable.getType(NameFormatter.toColon(typeName));
   
                                    if (type != null)
                                    {
                                        validateTypeSelectorProperties(styleProperties, type, styleDef,
                                                                       typeName, themeNamesString);
                                    }
                                }
                            }
   
                            if (mxmlDocumentQName != null)
                            {
                                // Don't use getType(QName), because that
                                // tries to lookup the class name in the
                                // manifest.  Use getType(String) instead.
                                Type mxmlDocumentType = typeTable.getType(mxmlDocumentQName.toString());
                                assert mxmlDocumentType != null;
                                validatePropertyReferences(styleProperties, mxmlDocumentType);
                            }
                        }
                    }
View Full Code Here

  public CompilationUnit parse1(Source source, SymbolTable symbolTable)
  {
        CompilationUnit unit = source.getCompilationUnit();

      // use TypeTable to do the encapsulation - SymbolTable can be too low-level for MXML...
    TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(MxmlCompiler.TYPE_TABLE);
    if (typeTable == null)
    {
      typeTable = new TypeTable(symbolTable, nameMappings, unit.getStandardDefs(),
                                      mxmlConfiguration.getThemeNames());
      symbolTable.getContext().setAttribute(MxmlCompiler.TYPE_TABLE, typeTable);
    }

    /**
 
View Full Code Here

  protected String formatExpr(Type targetType, Object value)
  {
    assert targetType != null;
    assert value != null;

    TypeTable typeTable = getTypeTable();

    if (value instanceof BindingExpression)
    {
      if (targetType.equals(typeTable.booleanType) ||
        targetType.equals(typeTable.numberType) ||
View Full Code Here

                              boolean generateDocComments, Type targetType, Object value)
  {
    assert targetType != null;
    assert value != null;

    TypeTable typeTable = getTypeTable();

    if (value instanceof BindingExpression)
    {
      if (targetType.equals(typeTable.booleanType) ||
        targetType.equals(typeTable.numberType) ||
View Full Code Here

   *     rvalue must be a singleton, and rvalue type must be a subtype of lvalue type (ok)
   * </pre>
   */
  public static int check(Type lvalueType, Type lvalueElementType, Type rvalueType, boolean rvalueIsSingleton, StandardDefs standardDefs)
  {
    TypeTable typeTable = lvalueType.getTypeTable();
    //  assert typeTable == rvalueType.getTypeTable();

    if (typeTable.arrayType.equals(lvalueType))
    {
      if (rvalueIsSingleton)
View Full Code Here

     */
    public void validate(SymbolTable symbolTable, NameMappings nameMappings,
                         StandardDefs standardDefs, Set<String> themeNames, Set<String> addedCSSFiles)
    {
        Set<String> classNames;
        TypeTable typeTable = (TypeTable) symbolTable.getContext().getAttribute(MxmlCompiler.TYPE_TABLE);

        if (typeTable == null)
        {
            typeTable = new TypeTable(symbolTable, nameMappings, standardDefs, themeNames);
        }

        if (qualifiedTypeSelectors)
        {
            classNames = symbolTable.getClassNames();
        }
        else
        {
            classNames = new HashSet<String>();

            for (String className : symbolTable.getClassNames())
            {
                if (qualifiedTypeSelectors)
                    classNames.add(NameFormatter.toDot(className));
                else
                    classNames.add(className.replaceFirst(".*:", ""));
            }
        }

        // Strip off the leading '[' and trailing ']'.
        String themeNamesString = themeNames.toString();
        themeNamesString = themeNamesString.substring(1, themeNamesString.length() - 1);

        for (Entry<String, StyleDef> entry : styleDefs.entrySet())
        {
            String styleName = entry.getKey();
            StyleDef styleDef = entry.getValue();
            String typeName = StyleDef.dehyphenize(styleName);

            Map<String, StyleDeclaration> declarations = styleDef.getDeclarations();

            if (declarations != null)
            {
                for (StyleDeclaration styleDeclaration : declarations.values())
                {
                    Collection<StyleDeclarationBlock> blocks = styleDeclaration.getDeclarationBlocks();
                    for (StyleDeclarationBlock block : blocks)
                    {
                        Map<String, StyleProperty> styleProperties = block.getProperties();
   
                        if (addedCSSFiles == null || addedCSSFiles.contains(styleDeclaration.getPath()))
                        {
                            if (styleDef.isTypeSelector())
                            {
                                if (qualifiedTypeSelectors && mxmlConfiguration.showInvalidCssPropertyWarnings())
                                {
                                    Type type = typeTable.getType(NameFormatter.toColon(typeName));
   
                                    if (type != null)
                                    {
                                        validateTypeSelectorProperties(styleProperties, type, styleDef,
                                                                       typeName, themeNamesString);
                                    }
                                }
                            }
   
                            if (mxmlDocumentQName != null)
                            {
                                // Don't use getType(QName), because that
                                // tries to lookup the class name in the
                                // manifest.  Use getType(String) instead.
                                Type mxmlDocumentType = typeTable.getType(mxmlDocumentQName.toString());
                                assert mxmlDocumentType != null;
                                validatePropertyReferences(styleProperties, mxmlDocumentType);
                            }
                        }
                    }
View Full Code Here

TOP

Related Classes of flex2.compiler.mxml.reflect.TypeTable$EventHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.