////////////////////////////////////////////////////////////////////////////
@Override
protected CanvasInfo createLiveComponent() throws Exception {
m_utils.setLiveManager(true);
// prepare empty RootPanel
final CanvasInfo parentCanvas;
{
String[] sourceLines =
new String[]{
" com.google.gwt.user.client.ui.RootPanel __wbp_panel = com.google.gwt.user.client.ui.RootPanel.get();",
" com.smartgwt.client.widgets.Canvas __wbp_canvas = new com.smartgwt.client.widgets.Canvas();",
" __wbp_canvas.setTitle(\"__wbp_liveWidget\");",
" __wbp_panel.add(__wbp_canvas);",
" __wbp_panel.setPixelSize(800, 600);",};
RootPanelInfo panel = (RootPanelInfo) parse(sourceLines);
parentCanvas = (CanvasInfo) panel.getChildrenWidgets().get(0);
}
// prepare component
CanvasInfo canvas = createClone();
// add component on Canvas
parentCanvas.command_absolute_CREATE(canvas, null);
parentCanvas.command_BOUNDS(canvas, new Point(10, 10), null);
// check for forced size
{
String width = canvas.getDescription().getParameter("liveComponent.forcedSize.width");
String height = canvas.getDescription().getParameter("liveComponent.forcedSize.height");
if (!StringUtils.isEmpty(width) && !StringUtils.isEmpty(height)) {
m_shouldSetSize = true;
canvas.getSizeSupport().setSize(width, height);
}
}
// ready to get live values
return canvas;
}