}
private static void doRendererType(TreeLogger logger, JClassType type,
- ConnectorBundle bundle) {
+ ConnectorBundle bundle) throws UnableToCompleteException {
// The class in which createRenderer is implemented
JClassType createRendererClass = ConnectorBundle.findInheritedMethod(
type, "createRenderer").getEnclosingType();
JMethod getRenderer = ConnectorBundle.findInheritedMethod(type,
"getRenderer");
+ if (getRenderer.getEnclosingType().getQualifiedSourceName()
+ .equals(AbstractRendererConnector.class.getCanonicalName())) {
+ logger.log(Type.ERROR, type.getQualifiedSourceName()
+ + " must override either createRenderer or getRenderer");
+ throw new UnableToCompleteException();
+ }
JClassType rendererType = getRenderer.getReturnType().isClass();
bundle.setNeedsGwtConstructor(rendererType);
// Needs GWT constructor if createWidget is not overridden
if (createWidgetClass.getQualifiedSourceName().equals(
AbstractComponentConnector.class.getCanonicalName())) {
+ if (getWidget
+ .getEnclosingType()
+ .getQualifiedSourceName()
+ .equals(AbstractComponentConnector.class
+ .getCanonicalName())) {
+ logger.log(Type.ERROR, type.getQualifiedSourceName()
+ + " must override either createWidget or getWidget");
+ throw new UnableToCompleteException();
+ }
+
bundle.setNeedsGwtConstructor(widgetType);
// Also needs widget type to find the right GWT constructor