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


Java LinkerContext.getModuleName方法代码示例

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


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

示例1: getPageRelativeModulePath

import com.google.gwt.core.ext.LinkerContext; //导入方法依赖的package包/类
private static String getPageRelativeModulePath(LinkerContext context) {
    String moduleName = context.getModuleName();

    List<String> pathBindings = null;
    for (ConfigurationProperty property : context.getConfigurationProperties()) {
        if (PAGE_RELATIVE_MODULE_PATH.equals(property.getName())) {
            pathBindings = property.getValues();
        }
    }
    if (pathBindings == null) return moduleName;

    for (String binding : pathBindings) {
        String[] parts = binding.split("=");
        if (parts.length == 2 && moduleName.equals(parts[0])) {
            System.out.println("      Setting page-relative module path for module '" + moduleName + "' using gwt.xml config");
            return parts[1];
        }
    }

    return moduleName;
}
 
开发者ID:iSergio,项目名称:gwt-cs,代码行数:22,代码来源:CesiumScriptInjector.java

示例2: link

import com.google.gwt.core.ext.LinkerContext; //导入方法依赖的package包/类
@Override
public ArtifactSet link( TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation ) throws UnableToCompleteException
{
	MANIFEST = context.getModuleName() + ".appcache";

	ArtifactSet toReturn = new ArtifactSet( artifacts );

	if( onePermutation )
	{
		return toReturn;
	}

	if( toReturn.find( SelectionInformation.class ).isEmpty() )
	{
		logger.log( TreeLogger.INFO, "DevMode warning: Clobbering " + MANIFEST + " to allow debugging. Recompile before deploying your app!" + artifacts );
		// artifacts = null;
		return toReturn;
	}

	// Create the general cache-manifest resource for the landing page:
	toReturn.add( emitLandingPageCacheManifest( context, logger, artifacts ) );
	return toReturn;
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:24,代码来源:AppCacheLinker.java

示例3: link

import com.google.gwt.core.ext.LinkerContext; //导入方法依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean permutation) throws UnableToCompleteException {
    Float gwtVersion = Float.parseFloat(About.getGwtVersionNum().replaceFirst("([0-9]+\\.[0-9]+).*", "$1"));
    String moduleName = context.getModuleName();

    if (permutation) {
        return artifacts;
    }

    Artifact scriptLoader = emitString(logger, "", SCRIPT_LOADER);
    ArtifactSet result = new ArtifactSet(artifacts);
    result.add(scriptLoader);

    if (gwtVersion < 2.5f || !forceScriptLoad(logger, moduleName, gwtVersion)) {
        return result;
    }

    Set<ScriptReference> scripts = result.find(ScriptReference.class);
    if (scripts.size() == 0) {
        return result;
    }

    Set<EmittedArtifact> emittedArtifacts = artifacts.find(EmittedArtifact.class);
    for (EmittedArtifact emittedArtifact : emittedArtifacts) {
        String partialPath = emittedArtifact.getPartialPath();
        if (!partialPath.endsWith(moduleName + ".nocache.js")) continue;

        System.out.println("   Invoking Linker CesiumScriptInjector");

        String pageRelativeModulePath = getPageRelativeModulePath(context);

        System.out.println("      Creating " + SCRIPT_LOADER + " to manually load the following script tags:");

        result.remove(emittedArtifact);
        String nocacheJS = CesiumLinkerUtils.getContents(emittedArtifact, logger);
        nocacheJS += getScriptLoaderJS(pageRelativeModulePath);
        result.add(emitString(logger, nocacheJS, partialPath, context));

        result.remove(scriptLoader);
        String loadTags = getScriptLoadJS(scripts, pageRelativeModulePath);
        result.add(emitString(logger, loadTags, SCRIPT_LOADER, context));

        break;
    }

    return result;
}
 
开发者ID:iSergio,项目名称:gwt-cs,代码行数:48,代码来源:CesiumScriptInjector.java

示例4: link

import com.google.gwt.core.ext.LinkerContext; //导入方法依赖的package包/类
@Override
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean permutation) throws UnableToCompleteException {
    Float gwtVersion = Float.parseFloat(About.getGwtVersionNum().replaceFirst("([0-9]+\\.[0-9]+).*", "$1"));
    String moduleName = context.getModuleName();

    if (permutation) {
        return artifacts;
    }

    Artifact scriptLoader = emitString(logger, "", SCRIPT_LOADER);
    ArtifactSet result = new ArtifactSet(artifacts);
    result.add(scriptLoader);

    if (gwtVersion < 2.5f || !forceScriptLoad(logger, moduleName, gwtVersion)) {
        return result;
    }

    Set<ScriptReference> scripts = result.find(ScriptReference.class);
    if (scripts.size() == 0) {
        return result;
    }

    Set<EmittedArtifact> emittedArtifacts = artifacts.find(EmittedArtifact.class);
    for (EmittedArtifact emittedArtifact : emittedArtifacts) {
        String partialPath = emittedArtifact.getPartialPath();
        if (!partialPath.endsWith(moduleName + ".nocache.js")) continue;

        System.out.println("   Invoking Linker CesiumScriptInjector");

        String pageRelativeModulePath = getPageRelativeModulePath(context);

        System.out.println("      Creating " + SCRIPT_LOADER + " to manually load the following script tags:");

        result.remove(emittedArtifact);
        String nocacheJS = OLCesiumLinkerUtils.getContents(emittedArtifact, logger);
        nocacheJS += getScriptLoaderJS(pageRelativeModulePath);
        result.add(emitString(logger, nocacheJS, partialPath, context));

        result.remove(scriptLoader);
        String loadTags = getScriptLoadJS(scripts, pageRelativeModulePath);
        result.add(emitString(logger, loadTags, SCRIPT_LOADER, context));

        break;
    }

    return result;
}
 
开发者ID:iSergio,项目名称:gwt-olcs,代码行数:48,代码来源:OLCesiumScriptInjector.java


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