Package com.dragome.templates.interfaces

Examples of com.dragome.templates.interfaces.Template


    String aTemplateName= "loaded-template-" + templateNumber++;
    childElement.setAttribute("data-template", aTemplateName);
    childElement.setAttribute("id", aTemplateName);

    Template createTemplate= ServiceLocator.getInstance().getTemplateManager().createTemplate(aTemplateName);
    //  Template createTemplate= new HTMLTemplateFactory().createTemplate(element, aTemplateName);
    return createTemplate;
    }
View Full Code Here


    {
      if (key != null)
        result+= ",";

      key= entry.getKey();
      Template value= entry.getValue();

      Attr id= ((Content<Element>) value.getContent()).getValue().getAttributeNode("id");
      String value2= id.getValue();
      document.getElementById(value2).setAttribute("id", System.identityHashCode(template) + "_" + value2);
    }
  }
View Full Code Here

    Element cloneNode= (Element) node.cloneNode(true);
    cloneNode.setAttribute("data-template-cloning", "true");
    node.getParentNode().appendChild(cloneNode);

    String path= "[data-template-cloning=\"true\"]  ";
    Template clonedTemplate= cloneChildren(template, path, cloneNode);

    cloneNode.removeAttribute("data-template-cloning");
    node.getParentNode().removeChild(cloneNode);

    return clonedTemplate;
View Full Code Here

  }

  private Template cloneChildren(Template template, String aSelector, Element cloneNode)
  {
    cloneNode.removeAttribute("data-debug-id");
    Template clonedTemplate= HTMLTemplateFactory.createTemplate(template.getName());
    clonedTemplate.setFiringEvents(false);
    clonedTemplate.setContent(new ContentImpl<Element>(cloneNode));

    for (Template child : template.getChildrenMap().values())
    {
      String childName= child.getName();
      String selector= aSelector + " " + createSelector(childName);
      Element clonedElement= ServiceLocator.getInstance().getDomHandler().getElementBySelector(selector);
      Template clonedChild= cloneChildren(child, selector, clonedElement);
      clonedTemplate.addChild(clonedChild);
    }

    clonedTemplate.setFiringEvents(true);
View Full Code Here

  {
  }

  public Canvas<Element> render(VisualPanel visualPanel)
  {
    Template template= ((TemplateLayout) visualPanel.getLayout()).getTemplate();

    if (template != null)
    {
      Element element= ((Content<Element>) template.getContent()).getValue();

      addListeners(visualPanel, element);
//      if (visualPanel.hasListener(ClickListener.class))
//      {
//        element.setAttribute("onclick", "_ed.onEvent(event)");
View Full Code Here

TOP

Related Classes of com.dragome.templates.interfaces.Template

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.