本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}