Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.PageConfiguration


  private UIImpl createUI( Class<? extends AbstractPage> pageType) {
    UIConfiguration configuration = new UIConfiguration();
    Shell shell = new Shell( new Display() );
    shell.setLayout( new ZIndexStackLayout() );
    ActionConfiguration actionConfiguration = new ActionConfiguration( "bar", TestAction.class );
    configuration.addPageConfiguration( new PageConfiguration( "fooRoot", TestPage.class ).setTopLevel( true ) );
    configuration.addPageConfiguration( new PageConfiguration( "foo", pageType )
      .addActionConfiguration( actionConfiguration ) );
    RemoteUI remoteUI = new RemoteUI( shell );
    Controller controller = new Controller( remoteUI, configuration.getAdapter( UIDescriptor.class ) );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    remoteUI.setController( controller );
View Full Code Here


    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );
    controller.showPage( ui, page, mock( PageData.class ) ).getPage();
    PageConfiguration configuration = mock( PageConfiguration.class );
    when( configuration.getAdapter( PageDescriptor.class ) ).thenReturn( page );

    controller.remove( configuration );
  }
View Full Code Here

    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );
    controller.showRoot( ui, rootPage, new PageData() );
    PageConfiguration configuration = mock( PageConfiguration.class );
    when( configuration.getAdapter( PageDescriptor.class ) ).thenReturn( rootPage );

    controller.remove( configuration );
  }
View Full Code Here

    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );
    controller.showRoot( ui, rootPage, new PageData() );
    PageConfiguration configuration = mock( PageConfiguration.class );
    when( configuration.getAdapter( PageDescriptor.class ) ).thenReturn( rootPage2 );

    controller.remove( configuration );

    verify( remoteObject ).destroy();
  }
View Full Code Here

    when( remoteUI.getPageParent() ).thenReturn( shell );
    when( remoteUI.getActionsParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );
    controller.showPage( ui, page, mock( PageData.class ) ).getPage();
    PageConfiguration configuration = mock( PageConfiguration.class );
    when( configuration.getAdapter( PageDescriptor.class ) ).thenReturn( page );

    controller.update( configuration );

    PageRenderer renderer = controller.getAllPages().get( 2 );
    verify( renderer ).update( page, factory, shell );
View Full Code Here

  }

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

    PageConfiguration actualConfiguration = controller.getPageConfiguration( controller.getAllPages().get( 0 ).getPage() );

    assertSame( pageConfiguration, actualConfiguration );
  }
View Full Code Here

  }

  @Test
  public void testCanGetPageConfigurationForPage() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    PageConfiguration pageConfiguration2 = new PageConfiguration( "foo2", TestPage.class );
    configuration.addPageConfiguration( pageConfiguration );
    configuration.addPageConfiguration( pageConfiguration2 );
    Controller controller = new Controller( new RemoteUI( shell ), configuration.getAdapter( UIDescriptor.class ) );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    controller.setUI( ui );
    controller.createRootPages( ui );
    PageRenderer page = controller.showPage( ui, pageConfiguration2.getAdapter( PageDescriptor.class ), new PageData() );

    PageConfiguration actualConfiguration = controller.getPageConfiguration( page.getPage() );

    assertSame( pageConfiguration2, actualConfiguration );
  }
View Full Code Here

  }

  @Test
  public void testCanGetActionConfigurationForGlobalAction() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    configuration.addPageConfiguration( pageConfiguration );
    ActionConfiguration actionConfiguration = new ActionConfiguration( "bar", TestAction.class );
    configuration.addActionConfiguration( actionConfiguration );
    UIDescriptor uiDescriptor = configuration.getAdapter( UIDescriptor.class );
    Controller controller = new Controller( new RemoteUI( shell ), uiDescriptor );
View Full Code Here

  }

  @Test
  public void testCanGetActionConfigurationForPageAction() {
    UIConfiguration configuration = new UIConfiguration();
    PageConfiguration pageConfiguration = new PageConfiguration( "foo", TestPage.class ).setTopLevel( true );
    PageConfiguration pageConfiguration2 = new PageConfiguration( "foo2", TestPage.class );
    configuration.addPageConfiguration( pageConfiguration );
    configuration.addPageConfiguration( pageConfiguration2 );
    ActionConfiguration actionConfiguration = new ActionConfiguration( "bar", TestAction.class );
    pageConfiguration2.addActionConfiguration( actionConfiguration );
    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 );
    PageRenderer page = controller.showPage( ui, pageConfiguration2.getAdapter( PageDescriptor.class ), new PageData() );
    Action action = page.getActionRenderers().get( 0 ).getDescriptor().getAction();

    ActionConfiguration actualConfiguration = controller.getActionConfiguration( action );

    assertSame( actionConfiguration, actualConfiguration );
View Full Code Here

  }

  @Test
  public void testGetActionConfigurationIsNullForNonExistentAction() {
    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 );
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.