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

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


   */
  protected 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)
    {
      if (pageInfo.getPageId() != null)
      {
        // WICKET-4594 - ignore the parsed parameters for stateful pages
        pageParameters = 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 = handler.getRenderCount();
      }

      PageInfo pageInfo = getPageInfo(handler);
      ComponentInfo componentInfo = new ComponentInfo(renderCount,
        requestListenerInterfaceToString(handler.getListenerInterface()),
        handler.getComponentPath(), handler.getBehaviorIndex());

      PageParameters parameters = getRecreateMountedPagesAfterExpiry() ? new PageParameters(
        handler.getPage().getPageParameters()).mergeWith(handler.getPageParameters())
View Full Code Here

        {
          renderCount = page.getRenderCount();
        }

        PageInfo pageInfo = getPageInfo(handler);
        ComponentInfo componentInfo = new ComponentInfo(renderCount,
          requestListenerInterfaceToString(listenerInterface), componentPath,
          handler.getBehaviorIndex());
        PageComponentInfo pageComponentInfo = new PageComponentInfo(pageInfo, componentInfo);
        PageParameters parameters = new PageParameters(page.getPageParameters());
        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
View Full Code Here

        {
          renderCount = page.getRenderCount();
        }

        PageInfo pageInfo = getPageInfo(handler);
        ComponentInfo componentInfo = new ComponentInfo(renderCount,
          requestListenerInterfaceToString(listenerInterface), componentPath,
          handler.getBehaviorIndex());
        PageComponentInfo pageComponentInfo = new PageComponentInfo(pageInfo, componentInfo);
        PageParameters parameters = new PageParameters(page.getPageParameters());
        UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
View Full Code Here

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

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

   *
   */
  public void test2()
  {
    String s = "-component-path";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals(null, info);
  }
View Full Code Here

   *
   */
  public void test3()
  {
    String s = "listener-";
    ComponentInfo info = ComponentInfo.parse(s);
    // empty component path is allowed - listener invoked on page
    assertEquals("listener", info.getListenerInterface());
    assertEquals("", info.getComponentPath());
  }
View Full Code Here

   *
   */
  public void test4()
  {
    String s = "-";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals(null, info);
  }
View Full Code Here

   *
   */
  public void test6()
  {
    String s = "listener-compo--nent-path";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals("listener", info.getListenerInterface());
    assertEquals("compo-nent:path", info.getComponentPath());
    assertNull(info.getBehaviorIndex());

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

   *
   */
  public void test7()
  {
    String s = "listener-co--mpo----nent-path";
    ComponentInfo info = ComponentInfo.parse(s);
    assertEquals("listener", info.getListenerInterface());
    assertEquals("co-mpo--nent:path", info.getComponentPath());
    assertNull(info.getBehaviorIndex());

    assertEquals(s, info.toString());
  }
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.