Package org.apache.flex.compiler.definitions.references

Examples of org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference


           
            String className = null;      // name of class to get reference for
           
            EmbedCompilationUnit splashScreenImageEmbedUnit = null;
            String functionName = getAtFunctionName(splashScreenImageValue);
            IResolvedQualifiersReference splashScreenImageReference = null;
            if ("Embed".equals(functionName))
            {
                splashScreenImageEmbedUnit = getEmbeddedCompilationUnit(ATTRIBUTE_SPLASH_SCREEN_IMAGE);
                className = splashScreenImageEmbedUnit.getName();
                assert className != null;
View Full Code Here


                //No need to create this class, so return from this method
                return;
            }

            String className = IMXMLTypeConstants._CompiledResourceBundleInfo;      
            IResolvedQualifiersReference mainClassRef = ReferenceFactory.packageQualifiedReference(
                     flexProject.getWorkspace(), className);

            ABCEmitter emitter = new ABCEmitter();
            emitter.visit(ABCConstants.VERSION_ABC_MAJOR_FP10, ABCConstants.VERSION_ABC_MINOR_FP10);

            ClassGeneratorHelper classGen = new ClassGeneratorHelper(flexProject, emitter,
                     mainClassRef.getMName(),
                     (ClassDefinition)flexProject.getBuiltinType(BuiltinType.OBJECT),
                     ClassGeneratorHelper.returnVoid());

            //Create method body for compiledLocales getter
            InstructionList localesInstructionList = new InstructionList();
View Full Code Here

                    IDefinition mxInternalDef = mxInternalReference.resolve(flexProject);
                    if (!(mxInternalDef instanceof NamespaceDefinition))
                        return false;
                   
                   
                    IResolvedQualifiersReference registerEffectTriggerRef =
                        ReferenceFactory.resolvedQualifierQualifiedReference(flexProject.getWorkspace(), (INamespaceDefinition)mxInternalDef,
                                "registerEffectTrigger");
                    Name registerEffectTriggerName = registerEffectTriggerRef.getMName();
                   
                    initMethod.addInstruction(ABCConstants.OP_getlex, effectManagerReference.getMName());
                   
                    for (Map.Entry<String, String> effectEntry : effectNameToTriggerMap.entrySet())
                    {
                        initMethod.addInstruction(ABCConstants.OP_dup)// copy the effectManager class closure
                        initMethod.addInstruction(ABCConstants.OP_pushstring, effectEntry.getKey());
                        initMethod.addInstruction(ABCConstants.OP_pushstring, effectEntry.getValue());
                        initMethod.addInstruction(ABCConstants.OP_callpropvoid, new Object[] { registerEffectTriggerName, 2 });
                    }
                    initMethod.addInstruction(ABCConstants.OP_pop);
                   
                }
               
                // Initialize AccessibilityClasses. Below is example code. Each
                // accessibility class found by the compiler will have its
                // enableAccessibility() method called.
                //
                // if (Capabilities.hasAccessibility) {
                //    spark.accessibility.TextBaseAccImpl.enableAccessibility();
                //    mx.accessibility.UIComponentAccProps.enableAccessibility();
                //    spark.accessibility.ButtonBaseAccImpl.enableAccessibility();
                // }
                if (targetSettings.isAccessible())
                {
                    Name capabilitiesSlotName = capabilitiesReference.getMName();
                    initMethod.addInstruction(ABCConstants.OP_findpropstrict, capabilitiesSlotName);
                    initMethod.addInstruction(ABCConstants.OP_getproperty, capabilitiesSlotName);
                    initMethod.addInstruction(ABCConstants.OP_getproperty, new Name("hasAccessibility"));
                    Label accessibilityEnd = new Label();
                    initMethod.addInstruction(ABCConstants.OP_iffalse, accessibilityEnd);
   
                    IResolvedQualifiersReference enableAccessibilityReference = ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(),
                            "enableAccessibility");           
                    Name enableAccessibilityName = enableAccessibilityReference.getMName();
                    Object[] enableAccessibilityCallPropOperands = new Object[] { enableAccessibilityName, 0 };
                    for (String accessibilityClassName : accessibleClassNames)
                    {
                        IResolvedQualifiersReference ref = ReferenceFactory.packageQualifiedReference(flexProject.getWorkspace(),
                                accessibilityClassName);
                        Name accName = ref.getMName();
                        initMethod.addInstruction(ABCConstants.OP_getlex, accName);
                        initMethod.addInstruction(ABCConstants.OP_callproperty, enableAccessibilityCallPropOperands);
                        initMethod.addInstruction(ABCConstants.OP_pop);
                    }
   
View Full Code Here

    }

    private Name getMNameForQName(String qname)
    {
        Workspace workspace = getWorkspace();
        IResolvedQualifiersReference reference =
            ReferenceFactory.packageQualifiedReference(workspace, qname);
        return reference.getMName();
    }
View Full Code Here

    {
        final Iterable<ICompilerProblem> fatalProblemsFromSuper = super.computeFatalProblems();
        if (!Iterables.isEmpty(fatalProblemsFromSuper))
            return fatalProblemsFromSuper;
       
        IResolvedQualifiersReference rootClassRef = getRootClassReference();
        if (rootClassRef == null)
            return ImmutableList.<ICompilerProblem>of(new ImproperlyConfiguredTargetProblem());
       
        String rootClassFileName = targetSettings.getRootSourceFileName();
        if (rootClassFileName == null)
            return ImmutableList.<ICompilerProblem>of(new ImproperlyConfiguredTargetProblem());
       
        Collection<ICompilationUnit> rootClassCompilationUnits = project.getCompilationUnits(rootClassFileName);
        assert rootClassCompilationUnits.isEmpty() || rootClassCompilationUnits.size() == 1;
        if (rootClassCompilationUnits.isEmpty())
            return ImmutableList.<ICompilerProblem>of(new FileNotFoundProblem(rootClassFileName));
       
        assert Iterables.getOnlyElement(rootClassCompilationUnits) != null : "The build should have been aborted before this point if there is no root class compilation unit.";
       
        IDefinition rootClassDefinition = rootClassRef.resolve(project);
        if (rootClassDefinition == null)
            return ImmutableList.<ICompilerProblem>of(new UnableToFindRootClassDefinitionProblem(targetSettings.getRootClassName()));
       
        return ImmutableList.<ICompilerProblem>of();
    }
View Full Code Here

            List<String> classes = frameInfo.getFrameClasses();
            List<ClassDefinition> resolvedClasses = new ArrayList<ClassDefinition>(classes.size());
            Set<ICompilationUnit> frameCompilationUnits = new HashSet<ICompilationUnit>(classes.size());
            for (String frameClass : classes)
            {
                IResolvedQualifiersReference ref = ReferenceFactory.packageQualifiedReference(project.getWorkspace(), frameClass);
                IDefinition def = ref.resolve(project);
                if (def instanceof ClassDefinition)
                {
                    resolvedClasses.add((ClassDefinition)def);
                   
                    ICompilationUnit defCU = project.getScope().getCompilationUnitForDefinition(def);
View Full Code Here

     * @return A {@link ClassDefinition} of the root class of this target if there
     * is one, null otherwise.
     */
    private ClassDefinition computeRootClassDefinition()
    {
        IResolvedQualifiersReference rootClassRef = getRootClassReference();
        if (rootClassRef == null)
            return null;

        IDefinition rootClassDef = rootClassRef.resolve(project);
        if (!(rootClassDef instanceof ClassDefinition))
            return null;

        return (ClassDefinition)rootClassDef;
    }
View Full Code Here

    {
        Workspace workspace = project.getWorkspace();
        Set<IResolvedQualifiersReference> includesReferences = new HashSet<IResolvedQualifiersReference>();
        for (String className : targetSettings.getIncludes())
        {
            IResolvedQualifiersReference ref = ReferenceFactory.packageQualifiedReference(workspace, className);
            includesReferences.add(ref);
        }

        return project.getScope().getCompilationUnitsForReferences(includesReferences);
    }
View Full Code Here

            {
                for (ISWCScript script : library.getScripts())
                {
                    for (String def : script.getDefinitions())
                    {
                        IResolvedQualifiersReference definitionRef =
                                ReferenceFactory.packageQualifiedReference(w, def);
                        includeLibrariesReferences.add(definitionRef);
                    }
                }
            }
View Full Code Here

        // base name, so we need to make sure that the definition we find
        // also has the correct package, namely "__AS3__.vec".
       
        INamespaceDefinition vectorImplPackage = ((CompilerProject)project).getWorkspace().getPackageNamespaceDefinitionCache().get(IASLanguageConstants.Vector_impl_package, true);
       
        IResolvedQualifiersReference vectorReference = ReferenceFactory.resolvedQualifierQualifiedReference(project.getWorkspace(), vectorImplPackage, baseName);
        IDefinition vectorIDefinition = vectorReference.resolve(project);
        assert vectorIDefinition instanceof IClassDefinition :
            "Unable to find: " + vectorReference.getDisplayString();
        return (IClassDefinition) vectorIDefinition;
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference

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.