Examples of PackagedTextTemplate


Examples of org.apache.wicket.util.template.PackagedTextTemplate

  public void setSlot(YuiImage slot) {
    this.slot = slot;
  }

  protected String getDragDropSlotInitializationScript(String slotId) {
    PackagedTextTemplate template = new PackagedTextTemplate(
        DragDropTargetSlot.class, "dragdropSlot.js");
    Map<String, Object> variables = new HashMap<String, Object>(3);
    variables.put("javaScriptId", javaScriptId);
    variables.put("id", slotId);
    variables.put("dragableSlot", settings.getTargetSlotList().getId());
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

  public void updateModel() {
  }

  protected String getJavaScriptComponentInitializationScript() {
    PackagedTextTemplate template = new PackagedTextTemplate(
        Selection.class, "init.js");
    Map<String, Object> variables = new HashMap<String, Object>(9);
    variables.put("javaScriptId", javaScriptId);
    variables.put("attributeOn", yuiAttribute.getJsScript());
    variables.put("attributeOff", yuiAttribute.getReverseJsScript());
    variables.put("easing", easing);
    variables.put("duration", new Double(duration));
    variables.put("event", "'" + event + "'");
    variables.put("maxSelection", new Integer(maxSelection));
    variables.put("boxes", boxes);
    variables.put("counts", counts);
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

    template.interpolate(variables);
    return template.getString();
  }

  protected String getSelectionInitializationScript() {
    PackagedTextTemplate template = null;

    if (maxSelection == 1) {
      template = new PackagedTextTemplate(Selection.class, "single.js");
    } else if (maxSelection > 1) {
      template = new PackagedTextTemplate(Selection.class, "multiple.js");
    }

    Map<String, Object> variables = new HashMap<String, Object>(10);
    variables.put("javaScriptId", javaScriptId);
    variables.put("attributeOn", yuiAttribute.getJsScript());
    variables.put("attributeOff", yuiAttribute.getReverseJsScript());
    variables.put("easing", easing);
    variables.put("maxSelection", new Integer(maxSelection));
    variables.put("duration", new Double(duration));
    variables.put("event", "'" + event + "'");
    variables.put("boxes", boxes);
    variables.put("counts", counts);
    variables.put("message", message);
    template.interpolate(variables);
    return template.getString();

  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

   * Initialize the init.js which is shared among a group of options
   *
   * @return a String representation of the init.js
   */
  protected String getJavaScriptComponentInitializationScript() {
    PackagedTextTemplate template = new PackagedTextTemplate(
        AnimGroup.class, "init.js");
    Map<String, Object> variables = new HashMap<String, Object>(7);
    variables.put("javaScriptId", javaScriptId);
    variables.put("easing", "'" + easing + "'");
    variables.put("duration", new Double(duration));
    variables.put("maxSelection", new Integer(maxSelection));
    variables.put("noOfBoxes", new Integer(animOptionList.size()));
    variables.put("selectedValues", selectedValues);
    variables.put("valueId", "'" + valueId + "'");
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

  public void setSlot(YuiImage slot) {
    this.slot = slot;
  }

  protected String getDragDropSlotInitializationScript(String slotId) {
    PackagedTextTemplate template = new PackagedTextTemplate(
        DragDropDragableSlot.class, "dragdropSlot.js");
    Map<String, Object> variables = new HashMap<String, Object>(3);
    variables.put("javaScriptId", javaScriptId);
    variables.put("id", slotId);
    variables.put("dragableSlot", settings.getDragableSlotList().getId());
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

   * @param index -
   *            auto-generated through the listview
   * @return a String representation of the anim.js
   */
  protected String getAnimSelectInitializationScript(int index) {
    PackagedTextTemplate template = new PackagedTextTemplate(AnimBox.class,
        "anim.js");
    Map<String, Object> variables = new HashMap<String, Object>(7);
    variables.put("javaScriptId", javaScriptId);
    variables.put("boxId", new Integer(index));
    variables.put("easing", "YAHOO.util.Easing." + easing);
    variables.put("duration", new Double(duration));
    variables.put("maxSelection", new Integer(maxSelection));
    variables.put("noOfBoxes", new Integer(settings.getAnimOptionList()
        .size()));
    if (message == null || message.equals("")) {
      message = "Up to " + maxSelection + " selections allowed!";
    }
    variables.put("message", message);
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

    variables.put("javaScriptId", javaScriptId);
    variables.put("elementId", elementId);
    variables.put("navigationArrowLeft", leftImage);
    variables.put("navigationArrowRight", rightImage);

    PackagedTextTemplate template = new PackagedTextTemplate(Calendar.class, "init.js");
    template.interpolate(variables);

    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

   * @param boxId
   * @return
   */
  protected String getAnimSelectInitializationScript(int boxId)
  {
    PackagedTextTemplate template = new PackagedTextTemplate(AnimSelectOptionBox.class, "animselect.js");
    Map<String, Object> variables = new HashMap<String, Object>(7);
    variables.put("javaScriptId", javaScriptId);
    variables.put("boxId", new Integer(boxId));
    variables.put("easing", "YAHOO.util.Easing." + easing);
    variables.put("duration", new Double(duration));
    variables.put("maxSelection", new Integer(maxSelection));
    variables.put("noOfBoxes", new Integer(settings.getAnimSelectOptionList().size()));
    if (message == null || message.equals("")) {
      message = "Up to " + maxSelection + " selections allowed!";
    }
    variables.put("message", message);
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

  protected void onBeforeRender() {
    super.onBeforeRender();
    javaScriptId = getMarkupId();

    TextTemplate template = new PackagedTextTemplate(
            DragDropGroup.class, "init.js");
   
    add(TextTemplateHeaderContributor.forJavaScript(template, new AbstractReadOnlyModel(){

            @Override
View Full Code Here

Examples of org.apache.wicket.util.template.PackagedTextTemplate

   *
   * @return
   */
  protected String getJavaScriptComponentInitializationScript()
  {
    PackagedTextTemplate template = new PackagedTextTemplate(AnimSelectOptionGroup.class, "init.js");
    Map<String, Object> variables = new HashMap<String, Object>(6);
    variables.put("javaScriptId", javaScriptId);
    variables.put("easing", "YAHOO.util.Easing." + easing);
    variables.put("duration", new Double(duration));
    variables.put("maxSelection", new Integer(maxSelection));
    variables.put("noOfBoxes", new Integer(animSelectOptionList.size()));
    variables.put("selectedValues", selectedValues);
    template.interpolate(variables);
    return template.getString();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.