// Do nothing, if launcher content is not to be rendered.
if (!shouldRenderContents(protocol, attributes)) {
return;
}
LaunchAttributes attrs = (LaunchAttributes)attributes;
DOMOutputBuffer currentBuffer = getCurrentBuffer(protocol);
// store current launcher element
currentBuffer.saveInsertionPoint();
closeDivElement(currentBuffer);
String textToScript = "Widget.getInstance(" + createJavaScriptString(attrs.getWidgetId())
+ ").registerLauncher(" + createJavaScriptString(attrs.getId()) + ");";
try {
writeScriptElement(currentBuffer,textToScript);
} catch (IOException e) {
throw new ProtocolException();
}