// check for @wbp.parser.entryPoint
{
MethodDeclaration method = ExecutionFlowUtils.getExecutionFlow_entryPoint(typeDeclaration);
if (method != null) {
List<MethodDeclaration> rootMethods = Lists.newArrayList(method);
return new ParseRootContext(null, new ExecutionFlowDescription(rootMethods));
}
}
// support for EntryPoint
if (AstNodeUtils.isSuccessorOf(typeBinding, "com.google.gwt.core.client.EntryPoint")) {
MethodDeclaration onModuleLoadMethod =
AstNodeUtils.getMethodBySignature(typeDeclaration, "onModuleLoad()");
if (onModuleLoadMethod != null) {
List<MethodDeclaration> rootMethods = Lists.newArrayList(onModuleLoadMethod);
return new ParseRootContext(null, new ExecutionFlowDescription(rootMethods));
}
}
// support for com.google.gwt.user.client.ui.UIObject
if (AstNodeUtils.isSuccessorOf(typeBinding, "com.google.gwt.user.client.ui.UIObject")) {
ITypeBinding typeBinding_super = typeBinding.getSuperclass();
// prepare class of component
Class<?> superClass = getSuperClass(editor, typeBinding_super);
// prepare creation
MethodDeclaration constructor = getConstructor(editor, typeDeclaration);
ThisCreationSupport creationSupport = new ThisCreationSupport(constructor);
// create JavaInfo
JavaInfo javaInfo = JavaInfoUtils.createJavaInfo(editor, superClass, creationSupport);
if (javaInfo != null) {
javaInfo.setVariableSupport(new ThisVariableSupport(javaInfo, constructor));
// prepare root context
List<MethodDeclaration> rootMethods = Lists.newArrayList();
rootMethods.add(constructor);
return new ParseRootContext(javaInfo, new ExecutionFlowDescription(rootMethods));
}
}
// no root found
return null;
}