addRenderFor(VisualLink.class, HTMLLinkRenderer.class);
}
public Canvas render(final VisualComponent visualComponent)
{
ComponentRenderer renderer= null;
if (visualComponent instanceof VisualComboBox)
renderer= new HTMLComboBoxRenderer();
else if (visualComponent instanceof VisualListBoxImpl)
renderer= new HTMLListRenderer();
else if (visualComponent instanceof VisualPanelImpl)
renderer= new HTMLPanelRenderer();
else if (visualComponent instanceof VisualCheckboxImpl)
renderer= new HTMLCheckboxRenderer();
else if (visualComponent instanceof VisualButtonImpl)
renderer= new HTMLButtonRenderer();
else if (visualComponent instanceof VisualLabelImpl)
renderer= new HTMLLabelRenderer();
else if (visualComponent instanceof VisualTextFieldImpl)
renderer= new HTMLTextFieldRenderer();
else if (visualComponent instanceof VisualTextArea)
renderer= new HTMLTextAreaRenderer();
else if (visualComponent instanceof VisualRadioButton)
renderer= new HTMLRadioButtonRenderer();
else if (visualComponent instanceof VisualProgressBar)
renderer= new HTMLProgressBarRenderer();
for (Entry<Class<? extends VisualComponent>, Class<? extends ComponentRenderer<Element, ? extends VisualComponent>>> entry : renderers.entrySet())
{
if (entry.getKey().isAssignableFrom(visualComponent.getClass()))
renderer= ServiceLocator.getInstance().getReflectionService().createClassInstance(entry.getValue());
}
if (renderer != null)
return renderer.render(visualComponent);
else
return new HTMLLabelRenderer().render(new VisualLabelImpl("l1", "no renderer!!"));
}