Examples of ICSSCodeGenResult


Examples of org.apache.flex.compiler.internal.css.codegen.ICSSCodeGenResult

       
        private boolean addGeneratedStylesClassToFrame(SWFFrame frame, Set<ICompilationUnit> emittedCompilationUnits) throws Exception
        {
            ABCEmitter emitter = new ABCEmitter();
            emitter.visit(ABCConstants.VERSION_ABC_MAJOR_FP10, ABCConstants.VERSION_ABC_MINOR_FP10);
            ICSSCodeGenResult cssCodeGenResult = cssCompilationSession.emitStyleDataClass(flexProject, emitter);

            Name stylesClassName = new Name(getStylesClassName());

            IDefinition objectDef = objectReference.resolve(flexProject);
            if ((objectDef == null) || (!(objectDef instanceof ClassDefinition)))
                return false;

            ClassDefinition objectClassDef = (ClassDefinition)objectDef;

            // Generates a Style's class
            // Generated class name will be of the form _MyApplication_Styles
            // Eg:
            // public class _MyApplication_Styles
            // {
            // }

            final InstructionList cinit = cssCodeGenResult.getClassInitializationInstructions();
            assert cinit.canFallThrough() : "CSSReducer should not append 'returnvoid' to the initialization instructions.";
            cinit.addInstruction(ABCConstants.OP_returnvoid);

            ClassGeneratorHelper classGenerator = new ClassGeneratorHelper(
                        flexProject,
                        emitter,
                        stylesClassName,
                        objectClassDef,
                        Collections.<Name> emptyList(),
                        Collections.<Name> emptyList(),
                        ClassGeneratorHelper.returnVoid(),
                        cinit,
                        false);
            cssCodeGenResult.visitClassTraits(classGenerator.getCTraitsVisitor());

            classGenerator.finishScript();

            DoABCTag tag = new DoABCTag();
            tag.setABCData(emitter.emit());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.