if(!isWidgetSupported(protocol)) {
return;
}
// Render the Property Handler controller.
HandlerAttributes handlerAttributes = (HandlerAttributes) attributes;
EventReference eventReference = handlerAttributes.getEventReference();
ActionReference actionReference = handlerAttributes.getActionReference();
StringBuffer scriptBuffer = new StringBuffer();
if (attributes.getId() != null) {
scriptBuffer.append("Widget.register(")
.append(createJavaScriptString(attributes.getId()))
.append(",");
addCreatedWidgetId(attributes.getId());
}
scriptBuffer.append("new Widget.Handler(")
.append(createJavaScriptExpression(eventReference))
.append(",")
.append(createJavaScriptExpression(actionReference));
if (!handlerAttributes.isEnabled()) {
scriptBuffer.append(",{isEnabled:false}");
}
scriptBuffer.append(")");