Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.MarkupResourceStream


      try
      {
        // set a ContainerInfo to be able to use HtmlHeaderContainer so header contribution
        // still work. WICKET-3700
        ContainerInfo containerInfo = new ContainerInfo(page);
        MarkupResourceStream markupResourceStream = new MarkupResourceStream(
          new StringResourceStream(markup), containerInfo, page.getClass());

        MarkupParser markupParser = getApplication().getMarkupSettings()
          .getMarkupFactory()
          .newMarkupParser(markupResourceStream);
View Full Code Here


    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)
      {
        ContainerInfo ci = new ContainerInfo(containerClass, locale, style, null,
            markupType);
        markupResourceStream = new MarkupResourceStream(resourceStream, ci, containerClass);
        break;
      }

      // Walk up the class hierarchy one level, if markup has not
      // yet been found
      containerClass = containerClass.getSuperclass();
    }

    if (markupResourceStream == null)
    {
      throw new WicketRuntimeException("Could not find markup for component border `"
          + getClass().getName() + "`");
    }

    try
    {
      Markup markup = Application.get().getMarkupSettings().getMarkupParserFactory()
          .newMarkupParser().readAndParse(markupResourceStream);
      return new MarkupStream(markup);
    }
    catch (Exception e)
    {
      throw new WicketRuntimeException("Could not parse markup from markup resource stream: "
          + markupResourceStream.toString());
    }
  }
View Full Code Here

      try
      {
        // set a ContainerInfo to be able to use HtmlHeaderContainer so header contribution
        // still work. WICKET-3700
        ContainerInfo containerInfo = new ContainerInfo(page);
        MarkupResourceStream markupResourceStream = new MarkupResourceStream(
          new StringResourceStream(markup), containerInfo, page.getClass());

        MarkupParser markupParser = getApplication().getMarkupSettings()
          .getMarkupFactory()
          .newMarkupParser(markupResourceStream);
View Full Code Here

    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)
      {
        ContainerInfo ci = new ContainerInfo(containerClass, locale, style, null,
          markupType);
        markupResourceStream = new MarkupResourceStream(resourceStream, ci, containerClass);
        break;
      }

      // Walk up the class hierarchy one level, if markup has not
      // yet been found
      containerClass = containerClass.getSuperclass();
    }

    if (markupResourceStream == null)
    {
      throw new WicketRuntimeException("Could not find markup for component border `" +
        getClass().getName() + "`");
    }

    try
    {
      Markup markup = Application.get()
        .getMarkupSettings()
        .getMarkupParserFactory()
        .newMarkupParser(markupResourceStream)
        .parse();
      return new MarkupStream(markup);
    }
    catch (Exception e)
    {
      throw new WicketRuntimeException(
        "Could not parse markup from markup resource stream: " +
          markupResourceStream.toString());
    }
  }
View Full Code Here

      try
      {
        // set a ContainerInfo to be able to use HtmlHeaderContainer so header contribution
        // still work. WICKET-3700
        ContainerInfo containerInfo = new ContainerInfo(page);
        MarkupResourceStream markupResourceStream = new MarkupResourceStream(
          new StringResourceStream(markup), containerInfo, page.getClass());

        MarkupParser markupParser = getApplication().getMarkupSettings()
          .getMarkupFactory()
          .newMarkupParser(markupResourceStream);
View Full Code Here

    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)
      {
        ContainerInfo ci = new ContainerInfo(containerClass, locale, style, null,
            markupType);
        markupResourceStream = new MarkupResourceStream(resourceStream, ci, containerClass);
        break;
      }

      // Walk up the class hierarchy one level, if markup has not
      // yet been found
      containerClass = containerClass.getSuperclass();
    }

    if (markupResourceStream == null)
    {
      throw new WicketRuntimeException("Could not find markup for component border `"
          + getClass().getName() + "`");
    }

    try
    {
      Markup markup = Application.get().getMarkupSettings().getMarkupParserFactory()
          .newMarkupParser(markupResourceStream).parse();
      return new MarkupStream(markup);
    }
    catch (Exception e)
    {
      throw new WicketRuntimeException("Could not parse markup from markup resource stream: "
          + markupResourceStream.toString());
    }
  }
View Full Code Here

          Markup markup;
          try
          {
            MarkupParser parser = getApplication().getMarkupSettings()
                .getMarkupParserFactory().newMarkupParser(
                    new MarkupResourceStream(
                        new StringResourceStream(result)));
            markup = parser.parse();
          }
          catch (ResourceStreamNotFoundException e)
          {
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.MarkupResourceStream

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.