Package org.apache.flex.compiler.internal.workspaces

Examples of org.apache.flex.compiler.internal.workspaces.Workspace


            // script tag with source attribute
            String sourcePath = MXMLNodeBase.resolveSourceAttributePath(null, sourceAttribute, null);
            Reader sourceFileReader = null;
            try
            {
                Workspace workspace = project.getWorkspace();
               
                IFileSpecification sourceFileSpec = fileSpecGetter.getFileSpecification(sourcePath);
                sourceFileReader = sourceFileSpec.createReader();
                //TODO what do we do about errors that are encountered in the attached file?
                //is this even the correct approach?
View Full Code Here


        {
            problems.add(new EmbedUnrecogniedFileTypeProblem(location, source));
            return false;
        }

        Workspace workspace = project.getWorkspace();
        switch (mimeType)
        {
            case JPEG:
            case JPG:
            case PNG:
View Full Code Here

                                           MXMLNodeInfo info)
    {
        super.initializeFromAttribute(builder, attribute, info);

        final FlexProject project = builder.getProject();
        final Workspace workspace = builder.getWorkspace();
        final Collection<ICompilerProblem> problems = builder.getProblems();

        setSourcePath(attribute.getParent().getParent().getFileSpecification().getPath());

        final int startOffsetLocal = attribute.getValueStart();
View Full Code Here

    }

    private IExpressionNode createExpressionNode(MXMLTreeBuilder builder,
                                                 IMXMLTagAttributeData attribute)
    {
        Workspace workspace = builder.getWorkspace();
        Collection<ICompilerProblem> problems = builder.getProblems();

        ISourceFragment[] fragments = attribute.getValueFragments(problems);

        // Adjust fragment offsets from local to absolute,
View Full Code Here

     * @return A new {@link Multiname} created from information in the specified
     * name
     */
    public static Multiname crackDottedQName(ICompilerProject project, String name, boolean includeInternal)
    {
        Workspace workspace = (Workspace)project.getWorkspace();
        final Set<INamespaceDefinition> namespaceSet = new HashSet<INamespaceDefinition>(includeInternal ? 2 : 1);
        if (name != null)
        {
            int lastIndexOfDot = name != null ? name.lastIndexOf('.') : -1;
            if (lastIndexOfDot != -1)
            {
                final String definitionName = name.substring(lastIndexOfDot + 1);
                final String packageName = name.substring(0, lastIndexOfDot);
                INamespaceDefinition publicPackageNS =
                    workspace.getPackageNamespaceDefinitionCache().get(packageName, false);
                namespaceSet.add(publicPackageNS);
                if (includeInternal)
                {
                    INamespaceDefinition internalPackageNS =
                        workspace.getPackageNamespaceDefinitionCache().get(packageName, true);
                    namespaceSet.add(internalPackageNS);           
                }
                return new Multiname(namespaceSet, definitionName);
            }
        }

        final INamespaceDefinition publicPackageNS = NamespaceDefinition.getPublicNamespaceDefinition();
        namespaceSet.add(publicPackageNS);
        if (includeInternal)
        {
            INamespaceDefinition internalPackageNS =
                workspace.getPackageNamespaceDefinitionCache().get("", true);
            namespaceSet.add(internalPackageNS);           
        }
        return new Multiname(namespaceSet, name);
    }
View Full Code Here

            packageName = target.substring(0, lastDotIndex);
            String afterLastDot = target.substring(lastDotIndex + 1);
            if (!afterLastDot.equals("*"))
                definitionName = afterLastDot;
        }
        Workspace workspace = (Workspace)w;
        NamespaceDefinition.ILanguageNamespaceDefinition packagePublicNamespace =
            workspace.getPackageNamespaceDefinitionCache().get(packageName, false);
        return new ASImportTarget(packagePublicNamespace, definitionName);
    }
View Full Code Here

     */
    public static IImportTarget buildImportFromPackageName(IWorkspace w, String packageName)
    {
        if (packageName == null || (packageName.length() == 1 && packageName.charAt(0) == '*') || packageName.length() == 0)
            packageName = "";
        Workspace workspace = (Workspace)w;
        NamespaceDefinition.ILanguageNamespaceDefinition packagePublicNamespace =
            workspace.getPackageNamespaceDefinitionCache().get(packageName, false);
        return new ASImportTarget(packagePublicNamespace, null);
    }
View Full Code Here

      e1.printStackTrace();
    }

    IFileSpecification fileSpec = new FileSpecification(tempMXMLFile.getPath());
   
    Workspace workspace = new Workspace();
    IMXMLDataManager mxmlDataManager = workspace.getMXMLDataManager();
    IMXMLData mxmlData = mxmlDataManager.get(fileSpec);
    return mxmlData;
  }
View Full Code Here

     * @param problems
     */
    private void printProblems(Collection<ICompilerProblem> problems)
    {
        CompilerProblemCategorizer categorizer = new CompilerProblemCategorizer();
        ProblemFormatter formatter = new WorkspaceProblemFormatter(new Workspace(),
                categorizer);
        ProblemPrinter printer = new ProblemPrinter(formatter, System.err);

        printer.printProblems(problems);
    }
View Full Code Here

            QualifiedNamespaceExpressionNode qNode = (QualifiedNamespaceExpressionNode)node;

            // TODO: this cast is kinda bad.  QualifiedNamespaceExpressionNode should have a getPackage() method
            IIdentifierNode prefix = (IIdentifierNode)qNode.getLeftOperandNode();
            Workspace w = (Workspace)scope.getWorkspace();
            INamespaceReference qualifedNamespace = w.getPackageNamespaceDefinitionCache().get(prefix.getName(), false);

            return qualifedNamespace;
        }
View Full Code Here

TOP

Related Classes of org.apache.flex.compiler.internal.workspaces.Workspace

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.