Package com.dragome.render.interfaces

Examples of com.dragome.render.interfaces.ComponentRenderer


    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!!"));
  }
View Full Code Here

TOP

Related Classes of com.dragome.render.interfaces.ComponentRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.