Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.UIConfiguration


  }

  @Test
  public void testShowsPageWithController() {
    Controller controller = mock( Controller.class );
    UIConfiguration configuration = mock( UIConfiguration.class );
    UIImpl ui = new UIImpl( display, controller, configuration );
    UIDescriptor contentHolder = new UIDescriptor();
    PageDescriptor page = mock( PageDescriptor.class );
    when( page.getId() ).thenReturn( "foo" );
    doReturn( Boolean.FALSE ).when( page ).isTopLevel();
    contentHolder.add( page );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( contentHolder );

    ui.markInitialized();
    ui.getPageOperator().openPage( "foo" );

    verify( controller ).show( eq( ui ), eq( page ), any( PageData.class ) );
View Full Code Here


  }

  @Test( expected = IllegalArgumentException.class )
  public void testShowsPageFailsWithNullPageData() {
    Controller controller = mock( Controller.class );
    UIConfiguration configuration = mock( UIConfiguration.class );
    UIImpl ui = new UIImpl( display, controller, configuration );
    UIDescriptor contentHolder = new UIDescriptor();
    PageDescriptor page = mock( PageDescriptor.class );
    when( page.getId() ).thenReturn( "foo" );
    doReturn( Boolean.FALSE ).when( page ).isTopLevel();
    contentHolder.add( page );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( contentHolder );
    ui.markInitialized();

    ui.getPageOperator().openPage( "foo", null );
  }
View Full Code Here

  }

  @Test
  public void testShowsPageWithControllerAndPageData() {
    Controller controller = mock( Controller.class );
    UIConfiguration configuration = mock( UIConfiguration.class );
    UIImpl ui = new UIImpl( display, controller, configuration );
    UIDescriptor contentHolder = new UIDescriptor();
    PageDescriptor page = mock( PageDescriptor.class );
    when( page.getId() ).thenReturn( "foo" );
    doReturn( Boolean.FALSE ).when( page ).isTopLevel();
    contentHolder.add( page );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( contentHolder );
    PageData data = mock( PageData.class );
    ui.markInitialized();

    ui.getPageOperator().openPage( "foo", data );
View Full Code Here

  public EntryPoint create() {
    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

  public EntryPoint create() {
    return new TabrisUIEntryPoint( createConfiguration() );
  }

  private UIConfiguration createConfiguration() {
    UIConfiguration configuration = new UIConfiguration();
    // configuration.setImage( getImage( IMAGE_BOOK_STORE_UI ) );
    createPages( configuration );
    createPageSettings( configuration );
    createGlobalActions( configuration );
    return configuration;
View Full Code Here

    // Add a Tabris UI application
    application.addEntryPoint( "/app", new TabrisUIEntrypointFactory( createUIConfiguration() ), null );
  }

  private UIConfiguration createUIConfiguration() {
    UIConfiguration uiConfiguration = new UIConfiguration();
   
    // Add a top level page
    PageConfiguration topLevelPage = new PageConfiguration( "topLevelPage", TopLevelPage.class );
    topLevelPage.setTopLevel( true );
    topLevelPage.setTitle( "Top Level Page" );
    uiConfiguration.addPageConfiguration( topLevelPage );
   
    // Add a normal page
    PageConfiguration page = new PageConfiguration( "page", Page.class );
    page.setTitle( "Page" );
   
    // Add a page action
    ActionConfiguration pageAction = new ActionConfiguration( "pageAction", PageAction.class );
    pageAction.setImage( Configuration.class.getResourceAsStream( "/share.png" ) );
    page.addActionConfiguration( pageAction );
    uiConfiguration.addPageConfiguration( page );
   
    // Add a global action
    ActionConfiguration globalAction = new ActionConfiguration( "globalAction", GlobalAction.class );
    globalAction.setImage( Configuration.class.getResourceAsStream( "/page.png" ) );
    uiConfiguration.addActionConfiguration( globalAction );
   
    return uiConfiguration;
  }
View Full Code Here

TOP

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

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.