Package org.apache.wicket.request.mapper.info

Examples of org.apache.wicket.request.mapper.info.ComponentInfo


   *
   */
  public void test8()
  {
    String s = "listener.12-component-path";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals("listener", info.getListenerInterface());
    assertEquals("component:path", info.getComponentPath());
    assertEquals((Object)12, info.getBehaviorIndex());

    assertEquals(s, info.toString());
  }
View Full Code Here


   *
   */
  public void test9()
  {
    String s = "4.listener-a-b";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals("listener", info.getListenerInterface());
    assertEquals((Integer)4, info.getRenderCount());

    assertEquals(s, info.toString());
  }
View Full Code Here

   *
   */
  public void test10()
  {
    String s = "4.listener.5-a-b";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals("listener", info.getListenerInterface());
    assertEquals((Integer)4, info.getRenderCount());
    assertEquals((Integer)5, info.getBehaviorIndex());

    assertEquals(s, info.toString());
  }
View Full Code Here

  private IRequestHandler processListener(PageComponentInfo pageComponentInfo,
    Class<? extends IRequestablePage> pageClass, PageParameters pageParameters)
  {
    PageInfo pageInfo = pageComponentInfo.getPageInfo();
    ComponentInfo componentInfo = pageComponentInfo.getComponentInfo();
    Integer renderCount = componentInfo != null ? componentInfo.getRenderCount() : null;

    RequestListenerInterface listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());

    if (listenerInterface != null)
    {
      PageAndComponentProvider provider = new PageAndComponentProvider(pageInfo.getPageId(),
        pageClass, pageParameters, renderCount, componentInfo.getComponentPath());

      provider.setPageSource(getContext());

      return new ListenerInterfaceRequestHandler(provider, listenerInterface,
        componentInfo.getBehaviorIndex());
    }
    else
    {
      if (logger.isWarnEnabled())
      {
        logger.warn("Unknown listener interface '" + componentInfo.getListenerInterface() +
          "'");
      }
      return null;
    }
  }
View Full Code Here

      {
        renderCount = page.getRenderCount();
      }

      PageInfo pageInfo = new PageInfo(page);
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(handler.getListenerInterface()),
        handler.getComponent().getPageRelativePath(), handler.getBehaviorIndex());

      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo, componentInfo),
        page.getClass(), handler.getPageParameters());
View Full Code Here

          // render page
          return new RenderPageRequestHandler(provider);
        }
        else
        {
          ComponentInfo componentInfo = info.getComponentInfo();

          PageAndComponentProvider provider = new PageAndComponentProvider(
            info.getPageInfo().getPageId(), renderCount,
            componentInfo.getComponentPath());

          provider.setPageSource(getContext());

          // listener interface
          RequestListenerInterface listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());

          return new ListenerInterfaceRequestHandler(provider, listenerInterface,
            componentInfo.getBehaviorIndex());
        }
      }
    }
    return null;
  }
View Full Code Here

      {
        renderCount = page.getRenderCount();
      }

      PageInfo pageInfo = new PageInfo(page);
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(listenerInterface), componentPath,
        handler.getBehaviorIndex());
      info = new PageComponentInfo(pageInfo, componentInfo);
    }
View Full Code Here

  private IRequestHandler processListener(PageComponentInfo pageComponentInfo,
    Class<? extends IRequestablePage> pageClass, PageParameters pageParameters)
  {
    PageInfo pageInfo = pageComponentInfo.getPageInfo();
    ComponentInfo componentInfo = pageComponentInfo.getComponentInfo();
    Integer renderCount = null;
    RequestListenerInterface listenerInterface = null;

    if (componentInfo != null)
    {
      renderCount = componentInfo.getRenderCount();
      listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());
    }

    if (listenerInterface != null)
    {
      PageAndComponentProvider provider = new PageAndComponentProvider(pageInfo.getPageId(),
        pageClass, pageParameters, renderCount, componentInfo.getComponentPath());

      provider.setPageSource(getContext());

      return new ListenerInterfaceRequestHandler(provider, listenerInterface,
        componentInfo.getBehaviorId());
    }
    else
    {
      if (logger.isWarnEnabled())
      {
        if (componentInfo != null)
        {
          logger.warn("Unknown listener interface '{}'",
            componentInfo.getListenerInterface());
        }
        else
        {
          logger.warn("Cannot extract the listener interface for PageComponentInfo: '{}'" +
            pageComponentInfo);
View Full Code Here

      {
        renderCount = page.getRenderCount();
      }

      PageInfo pageInfo = new PageInfo(page.getPageId());
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(handler.getListenerInterface()),
        handler.getComponent().getPageRelativePath(), handler.getBehaviorIndex());

      UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo, componentInfo),
        page.getClass(), handler.getPageParameters());
View Full Code Here

          // render page
          return new RenderPageRequestHandler(provider);
        }
        else
        {
          ComponentInfo componentInfo = info.getComponentInfo();

          PageAndComponentProvider provider = new PageAndComponentProvider(
            info.getPageInfo().getPageId(), renderCount,
            componentInfo.getComponentPath());

          provider.setPageSource(getContext());

          // listener interface
          RequestListenerInterface listenerInterface = requestListenerInterfaceFromString(componentInfo.getListenerInterface());

          return new ListenerInterfaceRequestHandler(provider, listenerInterface,
            componentInfo.getBehaviorId());
        }
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.mapper.info.ComponentInfo

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.