当前位置: 首页>>代码示例>>Java>>正文


Java ArtifactSet.find方法代码示例

本文整理汇总了Java中com.google.gwt.core.ext.linker.ArtifactSet.find方法的典型用法代码示例。如果您正苦于以下问题:Java ArtifactSet.find方法的具体用法?Java ArtifactSet.find怎么用?Java ArtifactSet.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.core.ext.linker.ArtifactSet的用法示例。


在下文中一共展示了ArtifactSet.find方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: link

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts) throws UnableToCompleteException {
    ArtifactSet toReturn = new ArtifactSet(artifacts);

    Set<EmittedArtifact> emittedArtifacts = artifacts.find(EmittedArtifact.class);
    for (EmittedArtifact emittedArtifact : emittedArtifacts) {
        String partialPath = emittedArtifact.getPartialPath();
        // Add to Cesium.js file, path, where Cesium/Cesium.js stored.
        // It need for inject css files for example - Viewer
        if (partialPath.endsWith("/Cesium.js")) {
            String contents = CesiumLinkerUtils.getContents(emittedArtifact, logger);
            StringBuffer sb = new StringBuffer(contents);
            sb.insert(0, "window.CesiumPath = '" + context.getModuleName() + "/js/';\n");
            toReturn.remove(emittedArtifact);
            toReturn.add(emitString(logger, sb.toString(), partialPath));
        }
    }
    return toReturn;
}
 
开发者ID:iSergio,项目名称:gwt-cs,代码行数:20,代码来源:CesiumLinker.java

示例2: link

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts) throws UnableToCompleteException {
    ArtifactSet toReturn = new ArtifactSet(artifacts);

    Set<EmittedArtifact> emittedArtifacts = artifacts.find(EmittedArtifact.class);
    for (EmittedArtifact emittedArtifact : emittedArtifacts) {
        String partialPath = emittedArtifact.getPartialPath();
        // Add to Cesium.js file, path, where Cesium/Cesium.js stored.
        // It need for inject css files for example - Viewer
        if (partialPath.endsWith("/olcesium.js")) {
            String contents = OLCesiumLinkerUtils.getContents(emittedArtifact, logger);
            StringBuffer sb = new StringBuffer(contents);
            sb.insert(0, "window.OpenLayersPath = '" + context.getModuleName() + "/js/';\n");
            toReturn.remove(emittedArtifact);
            toReturn.add(emitString(logger, sb.toString(), partialPath));
        }
    }
    return toReturn;
}
 
开发者ID:iSergio,项目名称:gwt-olcs,代码行数:20,代码来源:OLCesiumLinker.java

示例3: link

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
public ArtifactSet link(
    TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation)
    throws UnableToCompleteException {
  ArtifactSet toReturn = new ArtifactSet(artifacts);
  ArtifactSet writableArtifacts = new ArtifactSet(artifacts);
  boolean export = getExportProperty(context);

  for (CompilationResult result : toReturn.find(CompilationResult.class)) {
    String[] js = result.getJavaScript();
    checkArgument(js.length == 1, "MinimalLinker doesn't support GWT.runAsync");

    String output = formatOutput(js[0], export);
    toReturn.add(emitString(logger, output, context.getModuleName() + ".js"));
  }

  for (SymbolMapsLinker.ScriptFragmentEditsArtifact ea :
      writableArtifacts.find(SymbolMapsLinker.ScriptFragmentEditsArtifact.class)) {
    toReturn.add(ea);
  }
  return toReturn;
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:23,代码来源:MinimalLinker.java

示例4: link

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context,
    ArtifactSet artifacts) throws UnableToCompleteException {
    ArtifactSet toLink = new ArtifactSet(artifacts);

    // Mask the stub manifest created by the generator
    for (EmittedArtifact res : toLink.find(EmittedArtifact.class)) {
        if (res.getPartialPath().endsWith(".gadget.xml")) {
            manifestArtifact = res;
            toLink.remove(res);

            break;
        }
    }

    if (manifestArtifact == null) {
        if (artifacts.find(CompilationResult.class).isEmpty()) {
            // Maybe hosted mode or junit, defer to XSLinker.
            return new XSLinker().link(logger, context, toLink);
        } else {
            // When compiling for web mode, enforce that the manifest is present.
            logger.log(TreeLogger.ERROR,
                "No gadget manifest found in ArtifactSet.");
            throw new UnableToCompleteException();
        }
    }

    return super.link(logger, context, toLink);
}
 
开发者ID:kebernet,项目名称:shortyz,代码行数:30,代码来源:GadgetLinker.java

示例5: link

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts) throws UnableToCompleteException {
	ArtifactSet artifactset = new ArtifactSet(artifacts);

	StringBuilder builder = new StringBuilder("CACHE MANIFEST\n");
	builder.append("# Cache Version 10\n");
	builder.append("CACHE:\n");

	builder.append("../css/main.css\n");
	builder.append("../Yaph.html\n");
	for (EmittedArtifact emitted : artifacts.find(EmittedArtifact.class)) {
		if (emitted.getVisibility().equals(Visibility.Private)) {
			continue;
		}
		if (emitted.getPartialPath().endsWith(".symbolMap"))
			continue;
		if (emitted.getPartialPath().endsWith(".txt"))
			continue;
		builder.append("" + emitted.getPartialPath()).append("\n");
	}
	builder.append("yaph.nocache.js\n");
	builder.append("NETWORK:\n");
	builder.append("*\n");
	EmittedArtifact manifest = emitString(logger, builder.toString(), "offline.appcache");
	artifactset.add(manifest);
	return artifactset;
}
 
开发者ID:guiguib,项目名称:yaph,代码行数:28,代码来源:OfflineLinker.java

示例6: assertHasOneManifest

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
private void assertHasOneManifest(ArtifactSet artifacts) {
  int manifestCount = 0;
  for (SyntheticArtifact artifact : artifacts.find(SyntheticArtifact.class)) {
    if ("appcache.nocache.manifest".equals(artifact.getPartialPath())) {
      assertEquals("appcache.nocache.manifest", artifact.getPartialPath());
      manifestCount++;
    }
  }
  assertEquals(1, manifestCount);
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:11,代码来源:SimpleAppCacheLinkerTest.java

示例7: getManifest

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
private SyntheticArtifact getManifest(ArtifactSet artifacts) {
  for (SyntheticArtifact artifact : artifacts.find(SyntheticArtifact.class)) {
    if ("appcache.nocache.manifest".equals(artifact.getPartialPath())) {
      assertEquals("appcache.nocache.manifest", artifact.getPartialPath());
      return artifact;
    }
  }
  fail("Manifest not found");
  return null;
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:11,代码来源:SimpleAppCacheLinkerTest.java

示例8: getPermutationArtifacts

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
final ArrayList<PermutationArtifact> getPermutationArtifacts( final ArtifactSet artifacts )
{
  final ArrayList<PermutationArtifact> results = new ArrayList<PermutationArtifact>();
  for ( final PermutationArtifact permutationArtifact : artifacts.find( PermutationArtifact.class ) )
  {
    results.add( permutationArtifact );
  }
  return results;
}
 
开发者ID:realityforge,项目名称:gwt-appcache,代码行数:10,代码来源:AppcacheLinker.java

示例9: getArtifactsForCompilation

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
final Set<String> getArtifactsForCompilation( final LinkerContext context, final ArtifactSet artifacts )
{
  final Set<String> artifactNames = new HashSet<String>();
  for ( final EmittedArtifact artifact : artifacts.find( EmittedArtifact.class ) )
  {
    if ( Visibility.Public == artifact.getVisibility() && shouldAddToManifest( artifact.getPartialPath() ) )
    {
      artifactNames.add( context.getModuleName() + "/" + artifact.getPartialPath() );
    }
  }
  return artifactNames;
}
 
开发者ID:realityforge,项目名称:gwt-appcache,代码行数:13,代码来源:AppcacheLinker.java

示例10: emitSelectionScript

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
protected EmittedArtifact emitSelectionScript(TreeLogger logger,
    LinkerContext context, ArtifactSet artifacts)
    throws UnableToCompleteException {

  // Find the single Script result
  Set<Script> results = artifacts.find(Script.class);
  ensureSinglePermutation(logger, context, results);
  Script result = results.iterator().next();

  DefaultTextOutput out = new DefaultTextOutput(true);

  // Emit the selection script.
  String bootstrap = generateSelectionScript(logger, context, artifacts);
  bootstrap = context.optimizeJavaScript(logger, bootstrap);
  out.print(bootstrap);
  out.newlineOpt();

  // Emit the module's JS a closure.
  out.print("(function () {");
  out.newlineOpt();
  out.print("var $gwt_version = \"" + About.getGwtVersionNum() + "\";");
  out.newlineOpt();
  
  defineJsWndAndDoc(out);
  
  out.print("var $moduleName, $moduleBase;");
  out.newlineOpt();
  out.print("var $stats = $wnd.__gwtStatsEvent ? function(a) {$wnd.__gwtStatsEvent(a)} : null;");
  out.newlineOpt();

  out.print("var $strongName = '" + result.getStrongName() + "';");
  out.newlineOpt();

  out.print(result.getJavaScript());

  // Generate the call to tell the bootstrap code that we're ready to go.
  out.newlineOpt();
  out.print("if (" + context.getModuleFunctionName() + ") "
      + context.getModuleFunctionName() + ".onScriptLoad(gwtOnLoad);");
  out.newlineOpt();
  out.print("})();");
  out.newlineOpt();

  return emitString(logger, out.toString(), context.getModuleName()
      + getCompilationExtension(logger, context));
}
 
开发者ID:metteo,项目名称:gwt-worker,代码行数:48,代码来源:SingleScriptLinker.java

示例11: link

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
@Override
public ArtifactSet link( TreeLogger logger, LinkerContext context,
        ArtifactSet artifacts ) throws UnableToCompleteException {

    ArtifactSet toReturn = new ArtifactSet( artifacts );
    out = new DefaultTextOutput( true );
    long compilationTime = System.currentTimeMillis();
    out.print( "(function(){" );
    out.newline();

    // get compilation result
    Set<CompilationResult> results = artifacts
        .find( CompilationResult.class );
    if( results.size() == 0 ) {
        logger.log( TreeLogger.WARN, "Requested 0 permutations" );
        return toReturn;
    }

    CompilationResult result = results.iterator().next();

    // get the generated javascript
    String[] javaScript = result.getJavaScript();
    out.print( "var $wnd;var $doc;" );
    out.print( "var $moduleName, $moduleBase;" );
    out.newline();
    out.print( "if(typeof(window)!='undefined'){$wnd=window;$doc=$wnd.document;}" );
    out.newline();
    out.print( "if(typeof(navigator)=='undefined'){navigator={};navigator.userAgent='timobile';$doc={};$doc.documentMode=''; }" );
    out.newline();
    out.print( "var $gwt_version = \"" + About.getGwtVersionNum() + "\";" );
    out.newlineOpt();
    out.print( context.optimizeJavaScript( logger, javaScript[0] ) );
    out.newline();
    out.print( "var $stats = function(){};" );
    out.newline();
    out.print( "var $sessionId = function(){};" );
    out.newline();
    out.print( "$strongName = '" + result.getStrongName() + "';" );
    out.newline();
    out.print( "$ti4jCompilationDate = " + compilationTime + ";" );
    out.newline();
    out.print( "gwtOnLoad(null,'" + context.getModuleName() + "',null);" );
    out.newline();
    out.print( "})();" );
    out.newline();

    toReturn.add( emitString( logger, out.toString(), generateJavaScriptPath( context ) ) );

    // toReturn.add(emitString(logger, Long.toString(compilationTime),
    // APP_COMPILATION_FILE_NAME));

    return toReturn;
}
 
开发者ID:ahome-it,项目名称:ahome-core,代码行数:54,代码来源:BaseSingleScriptLinker.java

示例12: calculatePermutation

import com.google.gwt.core.ext.linker.ArtifactSet; //导入方法依赖的package包/类
/**
 * Return the permutation for a single link step.
 */
final Permutation calculatePermutation( final TreeLogger logger,
                                        final LinkerContext context,
                                        final ArtifactSet artifacts )
  throws UnableToCompleteException
{
  Permutation permutation = null;

  for ( final SelectionInformation result : artifacts.find( SelectionInformation.class ) )
  {
    final String strongName = result.getStrongName();
    if ( null != permutation && !permutation.getPermutationName().equals( strongName ) )
    {
      throw new UnableToCompleteException();
    }
    if ( null == permutation )
    {
      permutation = new Permutation( strongName );
      final Set<String> artifactsForCompilation = getArtifactsForCompilation( context, artifacts );
      permutation.getPermutationFiles().addAll( artifactsForCompilation );
    }
    final List<BindingProperty> list = new ArrayList<BindingProperty>();
    for ( final SelectionProperty property : context.getProperties() )
    {
      if ( !property.isDerived() )
      {
        final String name = property.getName();
        final String value = result.getPropMap().get( name );
        if ( null != value )
        {
          list.add( new BindingProperty( name, value ) );
        }
      }
    }
    final SelectionDescriptor selection = new SelectionDescriptor( strongName, list );
    final List<SelectionDescriptor> selectors = permutation.getSelectors();
    if ( !selectors.contains( selection ) )
    {
      selectors.add( selection );
    }
  }
  if ( null != permutation )
  {
    logger.log( Type.DEBUG, "Calculated Permutation: " + permutation.getPermutationName() +
                            " Selectors: " + permutation.getSelectors() );
  }
  return permutation;
}
 
开发者ID:realityforge,项目名称:gwt-appcache,代码行数:51,代码来源:AppcacheLinker.java


注:本文中的com.google.gwt.core.ext.linker.ArtifactSet.find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。