Package org.apache.wicket.util.template

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


   *
   * @return the JavaScript needed to "tagit" an input text field
   */
  protected TextTemplate getTagItConfig()
  {
    return new PackageTextTemplate(TagItAjaxBehavior.class, "res/tag-it.tmpl.js");
  }
View Full Code Here


        final Map<String, CharSequence> params = new HashMap<String, CharSequence>();
        params.put("callbackUrl", getCallbackUrl());
        params.put("componentId", vector.getJsId());
        params.put("dataLoaderId", getId());

        PackageTextTemplate template = new PackageTextTemplate(VectorFeatureDataLoadedListener.class,
                "VectorFeatureDataLoadedListener.js");
        response.render(OnDomReadyHeaderItem.forScript(template.asString(params)));
    }
View Full Code Here

        final Map<String, CharSequence> params = new HashMap<String, CharSequence>();
        params.put("callbackUrl", getCallbackUrl());
        params.put("componentId", vector.getJsId());
        params.put("dataLoaderId", getId());

        PackageTextTemplate template = new PackageTextTemplate(VectorFeatureDataLoadedListener.class,
                "VectorFeaturesLoadedListener.js");
        response.render(OnDomReadyHeaderItem.forScript(template.asString(params)));
    }
View Full Code Here

  }

  private CharSequence getHead(boolean rebind)
  {
    // load the css template we created form the res package
    PackageTextTemplate template = new PackageTextTemplate(DnDSortableBehavior.class,
      DnDSortableBehavior.class.getSimpleName() + (rebind ? "-rebind.tmpl" : "-head.tmpl"));

    // create a variable subsitution map
    CharSequence itemSelector = "." + options_.get("accept");
    CharSequence handleSelector = (CharSequence)options_.get("handle");
    if (handleSelector == null)
    {
      // only for CSS
      handleSelector = itemSelector;
    }
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("containerSelector", "." + getContainerCSSClass());
    params.put("helperclass", options_.get("helperclass", "").toString());
    params.put("handleSelector", handleSelector);
    params.put("itemSelector", itemSelector);
    params.put("options", options_.toString(true));
    params.put("callbackUrl", getCallbackUrl());
    params.put("dndHandlerStart", getJSFunctionName4Start());
    params.put("dndHandlerStop", getJSFunctionName4Stop());
    // params.put("startOnLoad", options_.get("startOnLoad", "true").toString());
    // perform subsitution and return the result
    return template.asString(params);
  }
View Full Code Here

  @Override
  public void renderHead(IHeaderResponse response)
  {
    super.renderHead(response);

    PackageTextTemplate template = new PackageTextTemplate(CroppableImage.class, "crop.css");
    String css = template.interpolate(vars).asString();

    response.render(CssHeaderItem.forCSS(css, "croppable-image." + getMarkupId()));


  }
View Full Code Here

            "resource.txt"), null);
        String href = getRequestCycle().getUrlRenderer().renderFullUrl(
            Url.parse(relativeUrl.toString()));
        variables.put("downloadLink", href);

        PackageTextTemplate template = new PackageTextTemplate(MailTemplate.class, "mail-template.tmpl");
        CharSequence templateHtml = template.asString(variables);
        updateResult(result, templateHtml, target);
        target.add(feedback);
      }

      @Override
View Full Code Here

  {
    super.renderHead(component, response);

    response.render(JavaScriptHeaderItem.forReference(WicketWebSocketJQueryResourceReference.get()));

    PackageTextTemplate webSocketSetupTemplate =
        new PackageTextTemplate(WicketWebSocketJQueryResourceReference.class,
            "res/js/wicket-websocket-setup.js.tmpl");

    Map<String, Object> variables = Generics.newHashMap();

    // set falsy JS values for the non-used parameter
    if (Strings.isEmpty(resourceName))
    {
      int pageId = component.getPage().getPageId();
      variables.put("pageId", pageId);
      variables.put("resourceName", "");
    }
    else
    {
      variables.put("resourceName", resourceName);
      variables.put("pageId", false);
    }

    Url baseUrl = component.getRequestCycle().getUrlRenderer().getBaseUrl();
    CharSequence ajaxBaseUrl = Strings.escapeMarkup(baseUrl.toString());
    variables.put("baseUrl", ajaxBaseUrl);

    String contextPath = component.getRequest().getContextPath();
    variables.put("contextPath", contextPath);

    // preserve the application name for JSR356 based impl
    variables.put("applicationName", component.getApplication().getName());

    String webSocketSetupScript = webSocketSetupTemplate.asString(variables);

    response.render(OnDomReadyHeaderItem.forScript(webSocketSetupScript));
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.template.PackageTextTemplate

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.