Package flash.localization

Examples of flash.localization.LocalizationManager


        {
            // setup the path resolver
            CompilerAPI.usePathResolver();

            // set up for localizing messages
            LocalizationManager l10n = new LocalizationManager();
            l10n.addLocalizer( new XLRLocalizer() );
            l10n.addLocalizer( new ResourceBundleLocalizer() );
            ThreadLocalToolkit.setLocalizationManager( l10n );

            // setup a console-based logger...
            CompilerAPI.useConsoleLogger();
View Full Code Here


    }

    public static Benchmark compc( ConfigurationBuffer cfgbuf, CompcConfiguration configuration )
        throws Exception, ConfigurationException, CompilerException
    {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
        CompilerAPI.useConsoleLogger(true, true, configuration.getWarnings(), true);

        Benchmark benchmark = null;
        if (configuration.benchmark())
        {
            benchmark = CompilerAPI.runBenchmark();
            benchmark.startTime(Benchmark.PRECOMPILE);
        }
        else
        {
            CompilerAPI.disableBenchmark();
        }

        CompilerAPI.setupHeadless(configuration);

        String[] sourceMimeTypes = WebTierAPI.getSourcePathMimeTypes();
        CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();

        // create a SourcePath...
        SourcePath sourcePath = new SourcePath(sourceMimeTypes, compilerConfig.allowSourcePathOverlap());
        sourcePath.addPathElements( compilerConfig.getSourcePath() );

        List<VirtualFile>[] array = CompilerAPI.getVirtualFileList(configuration.getIncludeSources(),
                                                                   configuration.getStylesheets().values(),
                                                                   new HashSet<String>(Arrays.asList(sourceMimeTypes)),
                                                                   sourcePath.getPaths());

        // note: if Configuration is ever shared with other parts of the system, then this part will need
        // to change, since we're setting a compc-specific setting below
        compilerConfig.setMetadataExport(true);

        // create a FileSpec... can reuse based on appPath, debug settings, etc...
        FileSpec fileSpec = new FileSpec(array[0], WebTierAPI.getFileSpecMimeTypes(), false);

        // create a SourceList...
        SourceList sourceList = new SourceList(array[1], compilerConfig.getSourcePath(), null,
                                               WebTierAPI.getSourceListMimeTypes(), false);

        ResourceContainer resources = new ResourceContainer();
        ResourceBundlePath bundlePath = new ResourceBundlePath(configuration.getCompilerConfiguration(), null);

        Map<String, Source> classes = new HashMap<String, Source>();
        NameMappings mappings = CompilerAPI.getNameMappings(configuration);
        List<SwcComponent> nsComponents = SwcAPI.setupNamespaceComponents(configuration, mappings, sourcePath,
                                                                          sourceList, classes);
        SwcAPI.setupClasses(configuration, sourcePath, sourceList, classes);

        if (benchmark != null)
        {
            benchmark.benchmark(l10n.getLocalizedTextString(new Mxmlc.InitialSetup()));
        }

        // load SWCs
        CompilerSwcContext swcContext = new CompilerSwcContext();
        SwcCache cache = new SwcCache();
View Full Code Here

        return benchmark;
    }

    public static final void displayStartMessage()
    {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();

        ThreadLocalToolkit.logInfo(l10n.getLocalizedTextString(new StartMessage(VersionInfo.buildMessage())));
    }
View Full Code Here

            toolsConfiguration = (ToolsConfiguration)cls.newInstance();
            toolsConfiguration.setConfigPathResolver( configResolver );
        }
        catch (Exception e)
        {
            LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
            throw new ConfigurationException(l10n.getLocalizedTextString(new CouldNotInstantiate(toolsConfiguration)));
        }
        cfgbuf.commit( toolsConfiguration );

        // enterprise service config file has other config file dependencies. add them here...
        calculateServicesChecksum(toolsConfiguration, cfgbuf);
View Full Code Here

        }
    }

    private static String getStartMessage( String program )
    {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();

        return l10n.getLocalizedTextString(new StartMessage(program, VersionInfo.buildMessage()));
    }
View Full Code Here

            // setup the path resolver
          flex2.compiler.CompilerAPI.usePathResolver();

            // set up for localizing messages
            LocalizationManager l10n = new LocalizationManager();
            l10n.addLocalizer( new XLRLocalizer() );
            l10n.addLocalizer( new ResourceBundleLocalizer() );
            ThreadLocalToolkit.setLocalizationManager( l10n );

            // setup a console-based logger...
          flex2.compiler.CompilerAPI.useConsoleLogger();
View Full Code Here

        }
    }

  public static void displayStartMessage()
  {
    LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
    System.out.println(l10n.getLocalizedTextString(new StartMessage(VersionInfo.buildMessage())));
  }
View Full Code Here

    {
      return msg;
    }
    else
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      if (l10n == null)
      {
        return null;
      }
      else
      {
        return l10n.getLocalizedTextString(this);
      }
    }
  }
View Full Code Here

     */
    public static String SetOfVertexToString(Set<Vertex<String, SwcExternalScriptInfo>> vertexSet)
    {
      StringBuilder dependencyMessage = new StringBuilder();
      String lineSeparator = System.getProperty("line.separator");
      LocalizationManager i10n = ThreadLocalToolkit.getLocalizationManager();
     
      for (Vertex<String, SwcExternalScriptInfo> vertexEntry : vertexSet)
      {
          String message = i10n.getLocalizedTextString(new DependsOn(vertexEntry.getWeight()));
          dependencyMessage.append(message + lineSeparator);
          Set<Vertex<String, SwcExternalScriptInfo>> predSet = vertexEntry.getPredecessors();

          for (Vertex<String, SwcExternalScriptInfo> predEntry : predSet)
          {
View Full Code Here

      flex2.compiler.CompilerAPI.useAS3();
      flex2.compiler.CompilerAPI.usePathResolver();
      flex2.compiler.CompilerAPI.setupHeadless(configuration);

      // set up for localizing messages
      LocalizationManager l10n = new LocalizationManager();
      l10n.addLocalizer( new XLRLocalizer() );
      l10n.addLocalizer( new ResourceBundleLocalizer() );
      ThreadLocalToolkit.setLocalizationManager( l10n );

      checkSupportedTargetMimeType(targetFile);

      List<VirtualFile> virtualFileList = new ArrayList<VirtualFile>();
      virtualFileList.add(targetFile);

      CompilerConfiguration compilerConfig = configuration.getCompilerConfiguration();
      NameMappings mappings = flex2.compiler.CompilerAPI.getNameMappings(configuration);

      //  get standard bundle of compilers, transcoders
      flex2.compiler.Transcoder[] transcoders = getTranscoders(configuration);
      flex2.compiler.SubCompiler[] compilers = getCompilers(compilerConfig, mappings, transcoders);

      // create a FileSpec...
      target.fileSpec = new FileSpec(Collections.<VirtualFile>emptyList(), getFileSpecMimeTypes());

      VirtualFile[] asClasspath = compilerConfig.getSourcePath();

      // create a SourceList...
      target.sourceList = new SourceList(virtualFileList,
                         asClasspath,
                         targetFile,
                         getSourcePathMimeTypes());
      // create a SourcePath...
      target.sourcePath = new SourcePath(asClasspath,
                         targetFile,
                         getSourcePathMimeTypes(),
                         compilerConfig.allowSourcePathOverlap());

      // create a ResourceContainer
      target.resources = new ResourceContainer();

      target.bundlePath = new ResourceBundlePath(configuration.getCompilerConfiguration(), targetFile);

      if (ThreadLocalToolkit.getBenchmark() != null)
      {
        ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new Mxmlc.InitialSetup()));
      }

      // load SWCs
      CompilerSwcContext swcContext = new CompilerSwcContext();
      swcContext.load(compilerConfig.getLibraryPath(),
View Full Code Here

TOP

Related Classes of flash.localization.LocalizationManager

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.