Package com.google.collide.client.search.awesomebox.AwesomeBox

Examples of com.google.collide.client.search.awesomebox.AwesomeBox.SectionIterationCallback


    AwesomeBoxContext.DEFAULT.addSection(section1);
    AwesomeBoxContext.DEFAULT.addSection(section2);
    AwesomeBoxContext.DEFAULT.addSection(section3);

    // backward not quiting iteration
    model.iterateFrom(section3, false, new SectionIterationCallback() {
      @Override
      public boolean onIteration(AwesomeBoxSection section) {
        StubAwesomeBoxSection stub = (StubAwesomeBoxSection) section;
        stub.wasIterated();
        return true;
      }
    });
    assertEquals(1, section1.getAndResetWasIterated());
    assertEquals(1, section2.getAndResetWasIterated());
    assertEquals(0, section3.getAndResetWasIterated());
   
    // forward quiting the iteration
    model.iterateFrom(section1, true, new SectionIterationCallback() {
      @Override
      public boolean onIteration(AwesomeBoxSection section) {
        StubAwesomeBoxSection stub = (StubAwesomeBoxSection) section;
        stub.wasIterated();
        return false;
      }
    });
    assertEquals(0, section1.getAndResetWasIterated());
    assertEquals(1, section2.getAndResetWasIterated());
    assertEquals(0, section3.getAndResetWasIterated());

    // forward not-quiting the iteration
    model.iterateFrom(section1, true, new SectionIterationCallback() {
      @Override
      public boolean onIteration(AwesomeBoxSection section) {
        StubAwesomeBoxSection stub = (StubAwesomeBoxSection) section;
        stub.wasIterated();
        return true;
View Full Code Here

TOP

Related Classes of com.google.collide.client.search.awesomebox.AwesomeBox.SectionIterationCallback

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.