Package org.apache.wicket.request.handler

Examples of org.apache.wicket.request.handler.ListenerInterfaceRequestHandler


  private String urlForBehavior(Behavior behaviorUnderTest)
  {
    final int index = page.container.getBehaviorId(behaviorUnderTest);
    final IPageAndComponentProvider provider = new PageAndComponentProvider(page,
      page.container);
    final IRequestHandler handler = new ListenerInterfaceRequestHandler(provider,
      IBehaviorListener.INTERFACE, index);

    return tester.urlFor(handler).toString();
  }
View Full Code Here


   */
  public void executeListener(final Component component, final RequestListenerInterface listener)
  {
    // there are two ways to do this. RequestCycle could be forced to call the handler
    // directly but constructing and parsing the URL increases the chance of triggering bugs
    IRequestHandler handler = new ListenerInterfaceRequestHandler(new PageAndComponentProvider(
      component.getPage(), component), listener);

    Url url = urlFor(handler);
    MockHttpServletRequest request = new MockHttpServletRequest(application, hsession,
      servletContext);
View Full Code Here

    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener, id);
    }
    else
    {
      handler = new ListenerInterfaceRequestHandler(provider, listener, id);
    }
    return getRequestCycle().urlFor(handler);
  }
View Full Code Here

    {
      handler = new BookmarkableListenerInterfaceRequestHandler(provider, listener);
    }
    else
    {
      handler = new ListenerInterfaceRequestHandler(provider, listener);
    }
    return getRequestCycle().urlFor(handler);
  }
View Full Code Here

      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())
View Full Code Here

  private String getRequestHandlerString(final IRequestHandler requestHandler)
  {
    AppendingStringBuffer sb = new AppendingStringBuffer(128);
    if (requestHandler instanceof ListenerInterfaceRequestHandler)
    {
      ListenerInterfaceRequestHandler listener = (ListenerInterfaceRequestHandler)requestHandler;
      sb.append("Interface[component: ");
      sb.append(Classes.simpleName(listener.getComponent().getClass()));
      sb.append("(");
      sb.append(listener.getComponent().getPageRelativePath());
      sb.append("), page: ");
      sb.append(listener.getPage().getClass().getName());
      sb.append("(");
      sb.append(listener.getPage().getId());
      sb.append("), interface: ");
      sb.append(listener.getListenerInterface().getName());
      sb.append(".");
      sb.append(listener.getListenerInterface().getMethod().getName());
      sb.append("]");
    }
    else if (requestHandler instanceof BookmarkablePageRequestHandler)
    {
      BookmarkablePageRequestHandler pageRequestHandler = (BookmarkablePageRequestHandler)requestHandler;
View Full Code Here

    Url url = Url.parse("some/mount/path?15-ILinkListener-foo-bar");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    checkPage(page, 15);

    assertEquals(ILinkListener.INTERFACE, h.getListenerInterface());
    assertEquals("foo:bar", h.getComponent().getPageRelativePath());
    assertNull(h.getBehaviorIndex());
  }
View Full Code Here

  {
    Url url = Url.parse("some/mount/path/i1/i2?15-ILinkListener-foo-bar&a=b&b=c");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);
    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    checkPage(page, 15);

    assertEquals(ILinkListener.INTERFACE, h.getListenerInterface());
    assertEquals("foo:bar", h.getComponent().getPageRelativePath());

    PageParameters p = page.getPageParameters();
    assertEquals(2, p.getIndexedCount());
    assertEquals("i1", p.get(0).toString());
    assertEquals("i2", p.get(1).toString());
View Full Code Here

    Url url = Url.parse("some/mount/path?param1=value1&15-ILinkListener.4-foo-bar");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    checkPage(page, 15);

    assertEquals(ILinkListener.INTERFACE, h.getListenerInterface());
    assertEquals("foo:bar", h.getComponent().getPageRelativePath());
    assertEquals((Object)4, h.getBehaviorIndex());
  }
View Full Code Here

    context.setNextPageRenderCount(5);
    IRequestHandler handler = encoder.mapRequest(getRequest(url));

    assertTrue(handler instanceof ListenerInterfaceRequestHandler);

    ListenerInterfaceRequestHandler h = (ListenerInterfaceRequestHandler)handler;

    IRequestablePage page = h.getPage();
    assertEquals(5, page.getRenderCount());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.handler.ListenerInterfaceRequestHandler

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.