本文整理汇总了Java中com.google.gwt.core.linker.CrossSiteIframeLinker类的典型用法代码示例。如果您正苦于以下问题:Java CrossSiteIframeLinker类的具体用法?Java CrossSiteIframeLinker怎么用?Java CrossSiteIframeLinker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CrossSiteIframeLinker类属于com.google.gwt.core.linker包,在下文中一共展示了CrossSiteIframeLinker类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: forceScriptLoad
import com.google.gwt.core.linker.CrossSiteIframeLinker; //导入依赖的package包/类
private boolean forceScriptLoad(TreeLogger logger, String moduleName, Float gwtVersion) {
try {
ModuleDef module;
Method getModuleDef;
if (gwtVersion < 2.6f) {
getModuleDef = ModuleDefLoader.class.getDeclaredMethod("loadFromClassPath", new Class[] {TreeLogger.class, String.class});
module = (ModuleDef)getModuleDef.invoke(null, logger, moduleName);
} else if (gwtVersion < 2.8f) {
Class compilerContextClass = Class.forName("com.google.gwt.dev.CompilerContext");
Object context = compilerContextClass.getDeclaredConstructor().newInstance();
getModuleDef = ModuleDefLoader.class.getDeclaredMethod("loadFromClassPath", new Class[] {TreeLogger.class, compilerContextClass, String.class});
module = (ModuleDef)getModuleDef.invoke(null, logger, compilerContextClass.cast(context), moduleName);
} else {
getModuleDef = ModuleDefLoader.class.getDeclaredMethod("loadFromClassPath", new Class[] {TreeLogger.class, String.class, boolean.class});
module = (ModuleDef)getModuleDef.invoke(null, logger, moduleName, false);
}
if (module != null) return CrossSiteIframeLinker.class.equals(module.getActivePrimaryLinker());
logger.log(TreeLogger.WARN, "Can't find module reference - not injecting scripts.");
} catch (Throwable t) {
logger.log(TreeLogger.ERROR, "Encountered an exception while trying to resolve the ModuleDef for " + moduleName, t);
}
return false;
}