typeDeclaration.accept(new ASTVisitor() {
@Override
public void postVisit(ASTNode node) {
if (!isGWT[0] && node instanceof Expression) {
Expression expression = (Expression) node;
ITypeBinding expressionBinding = AstNodeUtils.getTypeBinding(expression);
if (AstNodeUtils.isSuccessorOf(
expressionBinding,
"com.google.gwt.user.client.ui.UIObject")) {
isGWT[0] = true;
}
}
}
});
// not a GWT, stop
if (!isGWT[0]) {
return null;
}
}
// special unsupported classes
{
ITypeBinding superClass = typeBinding.getSuperclass();
String superClassName = AstNodeUtils.getFullyQualifiedName(superClass, false);
if (superClassName.equals("com.google.gwt.user.client.ui.Widget")) {
throw new DesignerException(IExceptionConstants.NO_DESIGN_WIDGET);
}
}
// prepare class loader
initializeClassLoader(editor);
// 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);