Package org.hdiv.state

Examples of org.hdiv.state.Page


  /**
   * DataComposer initialization with new stack to store all states of the page <code>page</code>.
   */
  public void init() {
    this.setPage(new Page());
    this.statesStack = new Stack<IState>();
  }
View Full Code Here


  /**
   * Obtains a new unique identifier for the page.
   */
  public void initPage() {
    this.page = new Page();
    int pageId = this.session.getPageId();
    this.page.setId(pageId);
  }
View Full Code Here

    assertTrue(pageId > 0);
  }

  public void testAddPage() {

    IPage page = new Page();
    page.setId(20);

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("name", "value", false, null, true);
    state.addParameter(param);
    page.addState(state);

    session.addPage("20", page);

  }
View Full Code Here

  }

  public void testGetState() {

    IPage page = new Page();
    page.setId(20);

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("name", "value", false, null, true);
    state.addParameter(param);
    page.addState(state);

    session.addPage("20", page);

    // Restore state
    IState restored = session.getState("20", 0);
View Full Code Here

    assertEquals(state, restored);
  }

  public void testGetPage() {

    IPage page = new Page();
    page.setId(20);

    IState state = new State(0);
    state.setAction("/action");
    IParameter param = new Parameter("name", "value", false, null, true);
    state.addParameter(param);
    page.addState(state);

    session.addPage("20", page);

    // Restore page
    IPage restored = session.getPage("20");
View Full Code Here

  public void testAddPage() {

    // cache's maximum size is defined using the Spring factory.
    IStateCache cache = this.getApplicationContext().getBean(IStateCache.class);

    IPage page1 = new Page();
    IPage page2 = new Page();
    IPage page3 = new Page();

    IState state1 = new State(0);
    IState state2 = new State(0);
    IState state3 = new State(0);

    page1.addState(state1);
    page1.setId(1);
    cache.addPage("1");

    page2.addState(state2);
    page2.setId(2);
    cache.addPage("2");

    page3.addState(state3);
    page3.setId(3);
    cache.addPage("3");

    log.info("cache:" + cache.toString());
  }
View Full Code Here

TOP

Related Classes of org.hdiv.state.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.