Package com.eclipsesource.tabris.ui

Examples of com.eclipsesource.tabris.ui.UIConfiguration


    assertSame( display, ui.getDisplay() );
  }

  @Test
  public void testGetsUI() {
    UIConfiguration configuration = mock( UIConfiguration.class );
    UIImpl ui = new UIImpl( display, controller, configuration );

    assertSame( configuration, ui.getConfiguration() );
  }
View Full Code Here


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

  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 );
    remoteUI.setUi( ui );
    ui.markInitialized();
    controller.createGlobalActions( ui );
View Full Code Here

    mockUI();
    remoteObject = environment.getRemoteObject();
  }

  private void mockUI() {
    UIConfiguration configuration = mock( UIConfiguration.class );
    listener = mock( TransitionListener.class );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );
    uiDescriptor.addTransitionListener( listener );
    when( ui.getConfiguration() ).thenReturn( configuration );
  }
View Full Code Here

    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    when( remoteUI.getActionsParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );
    UIConfiguration configuration = mock( UIConfiguration.class );
    PageDescriptor descriptor2 = createRootPage( "fooBar" );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );

    controller.update( configuration );

    Map<PageDescriptor, PageRenderer> rootPages = controller.getRootPages();
    assertNotNull( rootPages.get( descriptor2 ) );
View Full Code Here

    RemoteUI remoteUI = mock( RemoteUI.class );
    when( remoteUI.getPageParent() ).thenReturn( shell );
    when( remoteUI.getActionsParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createRootPages( ui );
    UIConfiguration configuration = mock( UIConfiguration.class );
    createRootPage( "fooBar" );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );

    controller.update( configuration );

    assertEquals( 2, shell.getChildren().length );
  }
View Full Code Here

    controller.createGlobalActions( ui );
    ActionDescriptor descriptor2 = mock( ActionDescriptor.class );
    when( descriptor2.getTitle() ).thenReturn( "foo2" );
    when( descriptor2.getId() ).thenReturn( "foo2" );
    uiDescriptor.add( descriptor2 );
    UIConfiguration configuration = mock( UIConfiguration.class );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );

    controller.update( configuration );

    verify( remoteObject ).set( "title", "foo2" );
  }
View Full Code Here

    when( remoteUI.getPageParent() ).thenReturn( shell );
    when( remoteUI.getActionsParent() ).thenReturn( shell );
    Controller controller = new Controller( remoteUI, uiDescriptor );
    controller.createGlobalActions( ui );
    when( uiDescriptor.getGlobalActions() ).thenReturn( new ArrayList<ActionDescriptor>() );
    UIConfiguration configuration = mock( UIConfiguration.class );
    when( configuration.getAdapter( UIDescriptor.class ) ).thenReturn( uiDescriptor );

    controller.update( configuration );

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

    assertTrue( hasAction );
  }

  @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() );
View Full Code Here

    assertSame( pageConfiguration, actualConfiguration );
  }

  @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() );
View Full Code Here

    assertSame( pageConfiguration2, actualConfiguration );
  }

  @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 );
    UIImpl ui = new UIImpl( shell.getDisplay(), controller, configuration );
    controller.setUI( ui );
    controller.createRootPages( ui );
    controller.createGlobalActions( ui );
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.