Package org.apache.wicket.util.resource.locator

Examples of org.apache.wicket.util.resource.locator.IResourceStreamLocator


   * @see #getResourceStream()
   */
  public IResourceStream getCacheableResourceStream()
  {
    // get resource locator
    IResourceStreamLocator locator = ThreadContext.getApplication()
      .getResourceSettings()
      .getResourceStreamLocator();

    // determine current resource stream
    // taking client locale and style into account
    return locator.locate(getScope(), absolutePath, getCurrentStyle(), variation,
      getCurrentLocale(), null, false);
  }
View Full Code Here


    return internalGetResourceStream(style, locale);
  }

  private IResourceStream internalGetResourceStream(final String style, final Locale locale)
  {
    IResourceStreamLocator resourceStreamLocator = Application.get()
        .getResourceSettings()
        .getResourceStreamLocator();
    IResourceStream resourceStream = resourceStreamLocator.locate(getScope(), absolutePath, style, variation, locale, null, false);

    Class<?> realScope = getScope();
    String realPath = absolutePath;
    if (resourceStream instanceof IFixedLocationResourceStream)
    {
View Full Code Here

    // TODO we need to expose this functionality for any class not just for
    // markupcontainers in markupcache so we don't have to replicate this
    // logic here

    // Get locator to search for the resource
    final IResourceStreamLocator locator = Application.get()
      .getResourceSettings()
      .getResourceStreamLocator();

    final Session session = Session.get();
    final String style = session.getStyle();
    final Locale locale = session.getLocale();

    MarkupResourceStream markupResourceStream = null;
    Class< ? > containerClass = getClass();

    while (!(containerClass.equals(MarkupComponentBorder.class)))
    {
      String path = containerClass.getName().replace('.', '/');
      IResourceStream resourceStream = locator.locate(containerClass, path, style, locale,
        markupType);

      // Did we find it already?
      if (resourceStream != null)
      {
View Full Code Here

   */
  public IResourceStream getMarkupResourceStream(final MarkupContainer<?> container,
    Class<?> containerClass)
  {
    // Get locator to search for the resource
    final IResourceStreamLocator locator = Application.get()
      .getResourceSettings()
      .getResourceStreamLocator();

    String style = container.getStyle();
    Locale locale = container.getLocale();
    String ext = container.getMarkupType();

    // Markup is associated with the containers class. Walk up the class
    // hierarchy up to MarkupContainer to find the containers markup
    // resource.
    while (containerClass != MarkupContainer.class)
    {
      String path = containerClass.getName().replace('.', '/');
      IResourceStream resourceStream = locator.locate(container.getClass(), path, style,
        locale, ext);

      // Did we find it already?
      if (resourceStream != null)
      {
View Full Code Here

   * @see #getResourceStream()
   */
  public IResourceStream getCacheableResourceStream()
  {
    // get resource locator
    IResourceStreamLocator locator = ThreadContext.getApplication()
      .getResourceSettings()
      .getResourceStreamLocator();

    // determine current resource stream
    // taking client locale and style into account
    return locator.locate(getScope(), absolutePath,
                          getCurrentStyle(), variation, getCurrentLocale(),
                          null, false);
  }
View Full Code Here

    return internalGetResourceStream(style, locale);
  }

  private IResourceStream internalGetResourceStream(final String style, final Locale locale)
  {
    IResourceStreamLocator resourceStreamLocator = Application.get()
        .getResourceSettings()
        .getResourceStreamLocator();
    IResourceStream resourceStream = resourceStreamLocator.locate(getScope(), absolutePath, style, variation, locale, null, false);

    Class<?> realScope = getScope();
    String realPath = absolutePath;
    if (resourceStream instanceof IFixedLocationResourceStream)
    {
View Full Code Here

    // TODO we need to expose this functionality for any class not just for
    // markupcontainers in markupcache so we don't have to replicate this
    // logic here

    // Get locator to search for the resource
    final IResourceStreamLocator locator = Application.get()
      .getResourceSettings()
      .getResourceStreamLocator();

    final String style = owner.getStyle();
    final String variation = owner.getVariation();
    final Locale locale = owner.getLocale();

    MarkupResourceStream markupResourceStream = null;
    Class<?> containerClass = getClass();

    while (!(containerClass.equals(MarkupComponentBorder.class)))
    {
      String path = containerClass.getName().replace('.', '/');
      IResourceStream resourceStream = locator.locate(containerClass, path, style, variation,
        locale, markupType, false);

      // Did we find it already?
      if (resourceStream != null)
      {
View Full Code Here

      IOException
  {
    final MarkupParser parser = new MarkupParser(new XmlPullParser());
    parser.setWicketNamespace("wcn");

    IResourceStreamLocator locator = new ResourceStreamLocator();

    MarkupResourceStream resource = newMarkupResourceStream(locator, this.getClass(), "1",
        null, "html");

    Markup tokens = parser.readAndParse(resource);
View Full Code Here

     * Loads the given ResourceReference as an IResourceStream or returns
     * {@code null} if the resource could not be found.
     */
    private IResourceStream load(ResourceReference ref)
    {
        IResourceStreamLocator locator =
            Application.get().getResourceSettings().getResourceStreamLocator();
       
        Class<?> scope = ref.getScope();
        String path = Packages.absolutePath(scope, ref.getName());
       
        return locator.locate(scope, path);
    }
View Full Code Here

   * @see #getResourceStream()
   */
  public IResourceStream getCacheableResourceStream()
  {
    // get resource locator
    IResourceStreamLocator locator = ThreadContext.getApplication()
      .getResourceSettings()
      .getResourceStreamLocator();

    // determine current resource stream
    // taking client locale and style into account
    return locator.locate(getScope(), absolutePath, getCurrentStyle(), variation,
      getCurrentLocale(), null, false);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.resource.locator.IResourceStreamLocator

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.