.println("ctx.addToRootPanel(" + generateWithSingletonSemantics(type.getType()) + ");");
}
});
}
else {
throw new InjectionFailure("type declares @" + annotation.getClass().getSimpleName()
+ " but does not extend type Widget: " + type.getType().getFullyQualifiedName());
}
return true;
}
});
procFactory.registerHandler(CreatePanel.class, new JSR330AnnotationHandler<CreatePanel>() {
@Override
public boolean handle(final InjectableInstance type, final CreatePanel annotation,
final IOCProcessingContext context) {
if (widgetType.isAssignableFrom(type.getType())) {
addDeferred(new Runnable() {
@Override
public void run() {
context.getWriter().println(
"ctx.registerPanel(\"" + (annotation.value().equals("")
? type.getType().getName() : annotation.value()) + "\", " + generateInjectors(type.getType())
+ ");");
}
});
}
else {
throw new InjectionFailure("type declares @" + annotation.getClass().getSimpleName()
+ " but does not extend type Widget: " + type.getType().getFullyQualifiedName());
}
return true;
}
});
procFactory.registerHandler(ToPanel.class, new JSR330AnnotationHandler<ToPanel>() {
@Override
public boolean handle(final InjectableInstance type, final ToPanel annotation,
final IOCProcessingContext context) {
if (widgetType.isAssignableFrom(type.getType())) {
addDeferred(new Runnable() {
@Override
public void run() {
context.getWriter()
.println("ctx.widgetToPanel(" + generateWithSingletonSemantics(type.getType())
+ ", \"" + annotation.value() + "\");");
}
});
}
else {
throw new InjectionFailure("type declares @" + annotation.getClass().getSimpleName()
+ " but does not extend type Widget: " + type.getType().getFullyQualifiedName());
}
return true;
}
});