Package org.apache.wicket

Examples of org.apache.wicket.Page


   */
  public <C extends Page> Result isRenderedPage(Class<C> expectedRenderedPageClass)
  {
    Args.notNull(expectedRenderedPageClass, "expectedRenderedPageClass");

    Page page = getLastRenderedPage();
    if (page == null)
    {
      return Result.fail("page was null");
    }
    if (!expectedRenderedPageClass.isAssignableFrom(page.getClass()))
    {
      return Result.fail(String.format("classes not the same, expected '%s', current '%s'",
        expectedRenderedPageClass, page.getClass()));
    }
    return Result.pass();
  }
View Full Code Here


         */

        // make sure this page instance was just created so the page can be stateless
        if (page.isPageStateless())
        {
          Page p = (Page)page;
          p.internalInitialize();
          p.internalPrepareForRender(false);
          component = page.get(componentPath);
        }
      }
    }
    if (component == null)
View Full Code Here

    }

    @Override
    public PageRenderer get(RenderPageRequestHandler handler)
    {
      Page newPage = (Page)handler.getPageProvider().getPageInstance();
      if (componentInPage != null && lastPage != null &&
        lastPage.getPageClass() != newPage.getPageClass())
      {
        // WICKET-3913: reset startComponent if a new page type is rendered
        componentInPage = null;
      }
      lastRenderedPage = lastPage = newPage;
View Full Code Here

  public static PageParameters getCurrentPageParameters()
  {
    if (RequestCycle.get().getActiveRequestHandler() instanceof IPageRequestHandler)
    {
      Page page = getCurrentPage();
      if (page != null)
        return page.getPageParameters();
    }

    return null;
  }
View Full Code Here

    return (FormComponentPanel< ? >) page.get(page.getPanelComponentPath());
  }

  public RepeatingView getRepeatingView(String path)
  {
    Page renderedPage = getLastRenderedPage();
    assertComponent(path, RepeatingView.class);
    RepeatingView rv = (RepeatingView) renderedPage.get(path);
    return rv;
  }
View Full Code Here

    return rv;
  }

  public ListView< ? > getListView(String path)
  {
    Page renderedPage = getLastRenderedPage();
    assertComponent(path, ListView.class);
    ListView< ? > rv = (ListView< ? >) renderedPage.get(path);
    return rv;
  }
View Full Code Here

    return rv;
  }

  public List<IHeaderContributor> getHeaderContributors()
  {
    Page renderedPage = getLastRenderedPage();
    final List<IHeaderContributor> contributors = new ArrayList<IHeaderContributor>();

    renderedPage.visitChildren(new IVisitor<Component, Void>()
    {
      public void component(Component component, IVisit<Void> visit)
      {
        for (Behavior behavior : component.getBehaviors())
          if (behavior instanceof IHeaderContributor)
View Full Code Here

     */
    public void testBasicAnnotations()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(AnnotationTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaData beanMetaData = new BeanMetaData(AnnotationTestBean.class, null, page, null, false);
        // Check parameters, elements, element parameters, tabs, tab elements.
        assertFalse( beanMetaData.isViewOnly() );
        assertTrue( beanMetaData.isDisplayed() );
View Full Code Here

     */
    public void testContext()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(AnnotationTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        // Use the "view" context
        BeanMetaData beanMetaData = new BeanMetaData(AnnotationTestBean.class, "view", page, null, false);
        // Check parameters, elements, element parameters, tabs, tab elements.
        assertTrue( beanMetaData.isViewOnly() );
View Full Code Here

     */
    public void testBasicParsing()
    {
        WicketTester tester = new WicketTester();
        tester.startPage(BeanMetaDataTestPage.class);
        Page page = tester.getLastRenderedPage();
       
        BeanMetaDataTestBean bean = new BeanMetaDataTestBean();
        BeanMetaData beanMetaData = new BeanMetaData(BeanMetaDataTestBean.class, null, page, null, false);
        // Check parameters, elements, element parameters, tabs, tab elements.
        assertFalse( beanMetaData.isViewOnly() );
View Full Code Here

TOP

Related Classes of org.apache.wicket.Page

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.