Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.PageConfiguration


  }

  @Test
  public void testGetPageConfigurationIsNullForNonExistentPage() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    configuration.addPageConfiguration( pageConfiguration );
    UIDescriptor uiDescriptor = configuration.getAdapter( UIDescriptor.class );
    Controller controller = new Controller( new RemoteUI( shell ), uiDescriptor );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    controller.setUI( ui );
    controller.createRootPages( ui );
    controller.createGlobalActions( ui );

    PageConfiguration actualConfiguration = controller.getPageConfiguration( mock( Page.class ) );

    assertNull( actualConfiguration );
  }
View Full Code Here


  @Test
  public void testDispatchesPageTransition() {
    EventDispatcher dispatcher = mock( EventDispatcher.class );
    Tracking tracking = new Tracking( dispatcher, new ArrayList<Tracker>() );
    PageConfiguration pageConfiguration = mock( PageConfiguration.class );
    UIConfiguration configuration = mock( UIConfiguration.class );

    tracking.attach( configuration );
    fakePageTransition( configuration, pageConfiguration );
View Full Code Here

  @Test
  public void testNotifiesUpdaterAboutPageChange() {
    UIUpdater updater = mock( UIUpdater.class );
    UpdateUtil.registerUpdater( updater );
    PageConfiguration configuration = mock( PageConfiguration.class );

    UpdateUtil.firePageUpdate( configuration );

    verify( updater ).update( configuration );
  }
View Full Code Here

  @Test
  public void testNotifiesUpdaterAboutPageremove() {
    UIUpdater updater = mock( UIUpdater.class );
    UpdateUtil.registerUpdater( updater );
    PageConfiguration configuration = mock( PageConfiguration.class );

    UpdateUtil.firePageRemove( configuration );

    verify( updater ).remove( configuration );
  }
View Full Code Here

    return new TabrisUIEntryPoint( createConfig() );
  }

  private UIConfiguration createConfig() {
    UIConfiguration configuration = new UIConfiguration();
    configuration.addPageConfiguration( new PageConfiguration( "root", DynamicPage.class )
                                          .setTopLevel( true )
                                          .setTitle( "Dynamic UI Start" ) );
    return configuration;
  }
View Full Code Here

    createReadBookPage( configuration );
    createSearchResultsPage( configuration );
  }

  private void createAllBooksPage( UIConfiguration configuration ) {
    PageConfiguration page = new PageConfiguration( AllBooksPage.class.getName(),
                                                    AllBooksPage.class );
    page.setTitle( "All Books" );
    page.setImage( getImage( IMAGE_PAGE_ALL_BOOKS ) );
    page.setTopLevel( true );
    configuration.addPageConfiguration( page );
  }
View Full Code Here

    page.setTopLevel( true );
    configuration.addPageConfiguration( page );
  }

  private void createPopularBooksPage( UIConfiguration configuration ) {
    PageConfiguration page = new PageConfiguration( PopularBooksPage.class.getName(),
                                                    PopularBooksPage.class );
    page.setTitle( "Popular" );
    page.setImage( getImage( IMAGE_PAGE_POPULAR_BOOKS ) );
    page.setTopLevel( true );
    configuration.addPageConfiguration( page );
  }
View Full Code Here

    page.setTopLevel( true );
    configuration.addPageConfiguration( page );
  }

  private void createFavoriteBooksPage( UIConfiguration configuration ) {
    PageConfiguration page = new PageConfiguration( FavoriteBooksPage.class.getName(),
                                                    FavoriteBooksPage.class );
    page.setTitle( "Favorite" );
    page.setImage( getImage( IMAGE_PAGE_FAVORITE_BOOKS ) );
    page.setTopLevel( true );
    configuration.addPageConfiguration( page );
  }
View Full Code Here

    page.setTopLevel( true );
    configuration.addPageConfiguration( page );
  }

  private void createBookDetailsPage( UIConfiguration configuration ) {
    PageConfiguration page = new PageConfiguration( BookDetailsPage.class.getName(),
                                                    BookDetailsPage.class );
    page.setTitle( "Book" );
    ActionConfiguration action = new ActionConfiguration( ShareAction.class.getName(),
                                                          ShareAction.class );
    action.setImage( getImage( IMAGE_ACTION_SHARE ) );
    action.setTitle( "Share" );
    page.addActionConfiguration( action );
    configuration.addPageConfiguration( page );
  }
View Full Code Here

    page.addActionConfiguration( action );
    configuration.addPageConfiguration( page );
  }

  private void createReadBookPage( UIConfiguration configuration ) {
    PageConfiguration page = new PageConfiguration( ReadBookPage.class.getName(),
                                                    ReadBookPage.class );
    page.setTitle( "Book" );
    ActionConfiguration action = new ActionConfiguration( ChangeThemeAction.class.getName(),
                                                          ChangeThemeAction.class );
    action.setImage( getImage( IMAGE_ACTION_THEME ) );
    action.setTitle( "Change Theme" );
    page.addActionConfiguration( action );
    configuration.addPageConfiguration( page );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.ui.PageConfiguration

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.